query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
POST /bugreports POST /bugreports.json
def create @bugreport = Bugreport.new(bugreport_params) @bugreport.reporter = current_user respond_to do |format| if @bugreport.save format.html { redirect_to root_url, notice: 'Bugreport was successfully created.' } format.json { render action: 'show', status: :created, location: @bugreport } else format.html { render action: 'new' } format.json { render json: @bugreport.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @bug = Bug.new(bug_params)\n @bug.project_id = session[:project_id]\n @bug.user_id = current_user.id\n @bug.clean_summary\n @bug.clean_description\n @bug.status = 0 #New\n @bug.resolution = 0 #Open\n\n respond_to do |format|\n if @bug.save\n BugHistoric.create(bug_id: @bug.id, ref: BugHistoric.CREATED, user_id: current_user.id)\n format.html { redirect_to @bug, notice: 'Bug was successfully created.' }\n format.json { render :show, status: :created, location: @bug }\n else\n format.html { render :new }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bug = @project.bugs.new(bug_params.merge!(user_status: current_user))\n respond_to do |format|\n if @bug.save\n send_slack_notification ( {create: true} )\n format.html { redirect_to [@project, @bug], notice: 'Bug was successfully created.' }\n format.json { render :show, status: :created, location: @bug }\n else\n format.html { render :new }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bug = Bug.new(params[:bug])\n\n respond_to do |format|\n if @bug.save\n format.html { redirect_to @bug, notice: 'Bug was successfully created.' }\n format.json { render json: @bug, status: :created, location: @bug }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bug = Bug.new(params[:bug])\n\n respond_to do |format|\n if @bug.save\n format.html { redirect_to @bug, notice: 'Bug was successfully created.' }\n format.json { render json: @bug, status: :created, location: @bug }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_report dep_name, user, vars, log\n require 'net/http'\n require 'uri'\n\n returning(Net::HTTP.post_form(\n URI.parse('http://gist.github.com/api/v1/xml/new'),\n {\n \"files[from]\" => user,\n \"files[vars.yml]\" => vars,\n \"files[#{dep_name}.log]\" => log.decolorize\n }\n )) do |response|\n report_report_result dep_name, response\n end.is_a? Net::HTTPSuccess\n end", "def index \n render :json => Project.find(11).bug_tracker.bugs\n end", "def create\n @client_bug = ClientBug.new(client_bug_params)\n\n respond_to do |format|\n if @client_bug.save\n format.html { redirect_to @client_bug, notice: 'Client bug was successfully created.' }\n format.json { render json: @client_bug, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @client_bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def bug\n bug = Bug.where(id: params[:bugId])\n render :json => bug.to_json\n end", "def create\n @bug = Bug.new(bug_params)\n @bug.user_id = current_user.id\n respond_to do |format|\n if @bug.save\n activity = @bug.create_activity :create, owner: current_user, recipient: Project.find(@bug.story.project_id)\n @notif = Notification.new\n @notif.notifs_create(@bug, activity.id) \n format.html { redirect_to :back, notice: 'Bug was successfully created.' }\n format.json { render :show, status: :created, location: @bug }\n else\n format.html { render :new }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bug = Bug.new(bug_params)\n @project = Project.find(params[:project_id])\n @bug.project_id = @project.id\n\n respond_to do |format|\n if @bug.save\n # Notificar a criação do bug no Slack\n message = \"#{current_user.username} adicionou o bug \\\"#{@bug.title}\\\" ao projeto \\\"#{@project.name}\\\"\"\n @notifier.ping message\n\n format.html { redirect_to user_project_url(current_user.id, params[:project_id]), notice: 'Bug was successfully created.' }\n format.json { render :show, status: :created, location: @bug }\n else\n format.html { render :new }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bugreports = Bugreport.all\n end", "def create\n \n if params[:bug][:bugtitle].empty? or params[:bug][:bugdescription].empty? or params[:bug][:assignedto_user_id].empty?\n @bug = Bug.new(params[:bug])\n @bug.errors[:base] << \"Please Enter all the mandatory fields \"\n @users = Bug.get_users_project(get_project_id)\n get_count_of_issue\n render :action=>\"new\"\n else\n @bug = Bug.new(params[:bug])\n Bug.save_file(params,@bug) if !params[:fileuploadpath].nil?\n @bug.project_id = get_project_id\n @bug.assignedby_user_id = session[:user_id]\n @bug.status= \"Open\"\n respond_to do |format|\n if @bug.save\n format.html { redirect_to bugs_url , notice: 'Bug was successfully created.' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n authorize Bug\n @bug = Bug.new(bug_params)\n\n respond_to do |format|\n if @bug.save\n format.html { redirect_to @bug, notice: 'Bug was successfully created.' }\n format.json { render :show, status: :created, location: @bug }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bug = Bug.new(params[:bug])\n \n respond_to do |format|\n if @bug.save\n flash[:notice] = 'Bug was successfully created.'\n format.html { redirect_to(bugs_path) }\n format.xml { render :xml => @bug, :status => :created, :location => @bug }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bug.errors, :status => :unprocessable_entity }\n end\n end\n end", "def report\n @report = Report.create(reports_params)\n if @report.valid?\n render json: {}, status: :created\n else\n render json: { error: 'failed to create report' }, status: :internal_server_error\n end\n end", "def bugreport_params\n params.require(:bugreport).permit(:subject, :description, :userid, :employeeid)\n end", "def create\n @abuse_report = AbuseReport.new(params[:abuse_report])\n respond_to do |format|\n if @abuse_report.save\n require 'rest_client'\n # Send bug to 16bugs\n if ArchiveConfig.PERFORM_DELIVERIES == true && Rails.env.production?\n site = RestClient::Resource.new(ArchiveConfig.BUGS_SITE, :user => ArchiveConfig.BUGS_USER, :password => ArchiveConfig.BUGS_PASSWORD)\n site['/projects/4603/bugs'].post build_post_info(@abuse_report), :content_type => 'application/xml', :accept => 'application/xml'\n end\n # Email bug to feedback email address\n AdminMailer.abuse_report(@abuse_report.id).deliver\n if params[:cc_me]\n # If user requests, and supplies email address, email them a copy of their message\n if !@abuse_report.email.blank?\n UserMailer.abuse_report(@abuse_report.id).deliver\n else\n setflash; flash[:error] = t('no_email', :default => \"Sorry, we can only send you a copy of your abuse report if you enter a valid email address.\")\n format.html { render :action => \"new\" }\n end\n end\n setflash; flash[:notice] = t('successfully_sent', :default => 'Your abuse report was sent to the Abuse team.')\n format.html { redirect_to '' }\n else\n setflash; flash[:error] = t('failure_send', :default => 'Sorry, your abuse report could not be sent - please try again!')\n format.html { render :action => \"new\" }\n end\n end\n end", "def submit_report(json, cookbookname)\n data = File.read(json)\n uri = URI.parse($SPEC_ENDPOINT)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == \"https\"\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(\"/api/reports\")\n request.add_field('Content-Type', 'application/json')\n request.body = {\n :spec_result => data,\n :hostname => `hostname`.chomp,\n :cookbook_name => cookbookname\n }.to_json\n response = http.request(request)\n end", "def report_test\n report_data = params.require(:api).permit(:code,:stdout,:project,:suite,:section)\n report = api_user.test_reports.create(report_data)\n if report.valid?\n render text: \"ok\"\n else\n raise \"Invalid report\"\n end\n end", "def new\n @bug = Bug.new\n @users =Bug.get_users_project(get_project_id)\n get_count_of_issue\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bug }\n end\n end", "def create\n @project = Project.find(params[:project_id])\n @[email protected]_bugs.create(project_bug_params)\n if @project_bug.errors.full_messages[0].present?\n redirect_to request.referer,flash: {error: @project_bug.errors.full_messages[0]}\n else\n redirect_to @project_bug\n end\n # p1=ProjectBug.find_by(id: params[:project_bug_id])\n # @project_bug = current_user.project_bugs.create(p1)\n # respond_to do |format|\n # format.html { redirect_to @project_bug, notice: \"Project bug was successfully created.\" }\n # format.json { render :show, status: :created, location: @project_bug }\n # end\n end", "def create\n @bug = Bug.new(bug_params)\n @project_id = @bug.project_id\n @project = Project.find_by(id: @project_id)\n respond_to do |format|\n if @bug.due_date < Date.current\n format.html { redirect_to project_url(@project_id), notice: 'Due Date cannot be less than current Date' }\n elsif @bug.save\n format.html { redirect_to @bug, notice: 'Bug was successfully created.' }\n format.json { render :show, status: :created, location: @bug }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n rescue\n redirect_to project_url(:id => @project_id), notice: 'Error: Some constraints are not matching.'\n end", "def create\n # if report is valid, save it and set flag (no need to run it b/c it will be redirected)\n @report.just_created = true if @report.errors.empty?\n \n # return data in json format\n render(:json => {:report => @report}.to_json)\n end", "def bug_params\n params.require(:bug).permit(:title, :deadline, :issue_type, :status, :bug_image)\n end", "def create\n @bugtype = Bugtype.new(bugtype_params)\n\n respond_to do |format|\n if @bugtype.save\n format.html { redirect_to bugtypes_path, notice: 'Bugtype was successfully created.' }\n format.json { render :index, status: :created, location: @bugtype }\n else\n format.html { render :new }\n format.json { render json: @bugtype.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @bugreport.destroy\n respond_to do |format|\n format.html { redirect_to bugreports_url }\n format.json { head :no_content }\n end\n end", "def bug_params\n params.require(:bug).permit(:project_id, :description, :status)\n end", "def create\n @bug_comment = BugComment.new(params[:bug_comment])\n\n respond_to do |format|\n if @bug_comment.save\n format.html { redirect_to project_bug_list_bug_post_path(params[:project_id], params[:bug_list_id], params[:bug_post_id]), notice: 'Bug comment was successfully created.' }\n format.json { render json: @bug_comment, status: :created, location: @bug_comment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bug_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def report\n begin\n build_info = params.require(:build_info)\n issue_info = params.require(:issue_info)\n rescue ActionController::ParameterMissing\n return invalid_params('Missing parameter')\n end\n # Get the build for this issue. If it doesn't exist, create it\n build = Build.find_or_create_by(:product => build_info[:product], \n :branch => build_info[:branch], \n :name => build_info[:name])\n\n # Check if an issue with this signature and type exists for this build. If not, create one\n # This will result in some duplicate issues when found across different builds.\n # Those duplicates can be merged later when the issue is triaged.\n created = false\n issue = build.issues.where(:issue_type => issue_info[:issue_type], \n :signature => issue_info[:signature]).first_or_create do |obj|\n # If the issue gets created, the instance merging the issue and build will also get created\n created = true\n end\n\n # Create an instance that points to this build and issue\n if !created\n instance = issue.instances.create(:build => build)\n else\n instance = issue.instances.where(:build => build).first\n end\n\n # Return the created instance\n render json: instance\n end", "def bug_params\n params.require(:bug).permit(:name, :bug_type, :description, :project_id)\n end", "def create\n @custom_report = CustomReport.new(params[:custom_report])\n\n if @custom_report.save\n render json: @custom_report, status: :created, location: @custom_report\n else\n render json: @custom_report.errors, status: :unprocessable_entity\n end\n end", "def create\n @project = Project.find_by_permalink(params[:project_id])\n @bug = Bug.new(params[:bug])\n @bug.project = @project\n @bug.creator = get_current_user\n\n respond_to do |format|\n if @bug.save\n @bug.generate_state_comment(@bug.creator, nil, @bug.state)\n format.html { redirect_to(project_bug_url(@project, @bug),\n :notice => 'Bug was successfully created.') }\n format.xml { render :xml => @bug, :status => :created, :location => @bug }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bug.errors, :status => :unprocessable_entity }\n end\n end\n end", "def bug_params\n params.require(:bug).permit(:assigned_to, :reported_by, :project_id, :priority, :severity, :status, :resolution, :version_planned, :version_solved, :summary, :description)\n end", "def bug_params\n params.require(:bug).permit(:title, :deadline, :type, :project_id, :bug_type, :image, :Description)\n end", "def project_bug_params\n params.require(:project_bug).permit(:title, :deadline, :project_id, :description, :status, :bug_type, :screenshot)\n end", "def bug_params\n params.require(:bug).permit(:title, :description, :due_date, :bugtype, :status, :user_id, :project_id, :image)\n end", "def create\n @jira = Jira.new(jira_params)\n\n\n respond_to do |format|\n if @jira.save\n format.html { redirect_to @jira, notice: 'Jira was successfully created.' }\n format.json { render :show, status: :created, location: @jira }\n else\n format.html { render :new }\n format.json { render json: @jira.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n \n @report.test_suite.test_cases.each do |test_case|\n @report.results.create({ status: 'Queued', report_id: @report, test_case_id: test_case.id})\n end\n \n format.html { redirect_to [:admin, @report], notice: 'Report was successfully created.' }\n format.json { render action: 'show', status: :created, location: @report }\n else\n format.html { render action: 'new' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def bug_params\n params.require(:bug).permit(:title, :deadline, :kind, :screenshot, :status,:description)\n end", "def bug_params\n params.require(:bug).permit(:user_id,:title, :bug_type, :status, :deadline, :description)\n end", "def index\n @notice = \"ALL Issues\"\n @@selected_label=nil\n @@found_by=false\n @@assigned_to=false\n get_bugs\n get_count_of_issue\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bugs }\n end\n end", "def create\n @bug_list = BugList.new(params[:bug_list])\n\t\t@bug_list.user_id = session[:user_id]\n respond_to do |format|\n if @bug_list.save\n format.html { redirect_to @bug_list.project, notice: 'Bug list was successfully created.' }\n format.json { render json: @bug_list, status: :created, location: @bug_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bug_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_report_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ReportApi.create_report ...'\n end\n # resource path\n local_var_path = '/api/3/reports'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'report'])\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CreatedReferenceintLink')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ReportApi#create_report\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @failure_report = FailureReport.new(failure_report_params)\n @failure_report.author = current_user\n\n respond_to do |format|\n if @failure_report.save\n format.html { redirect_to @failure_report, notice: 'Failure report was successfully created.' }\n format.json { render action: 'show', status: :created, location: @failure_report }\n else\n format.html { render action: 'new' }\n format.json { render json: @failure_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def markBug\n projectId = params[:projectId]\n bugId = to_number( params[:bugId] )\n userId = current_user.id\n id = params[:id]\n if id != projectId\n render json: { code: false, reason: \"Invalid request.\" }\n elsif bugId < 0\n render json: { code: false, reason: \"Invalid request.\" }\n elsif ProjectUser.where(project_id: projectId, user_id: userId).exists?\n bug = Bug.find(bugId)\n if(bug.project_id == to_number(projectId) && bug.developer_id == current_user.id)\n if(bug.status == 0)\n bug.status = 1\n elsif bug.status == 1\n bug.status = 2\n end\n bug.save\n if bug.valid?\n render json: { code: true, reason: \"Bug marked successfully.\" }\n else\n render json: { code: false, reason: \"Something went wrong. Please try again.\" }\n end\n else\n render json: { code: false, reason: \"Invalid request.\" }\n end\n else\n render json: { code: false, reason: \"Invalid request.\" }\n end\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'El Reporte fue creado Exitosamente.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @report = Report.new(params[:report])\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @report = Report.new(params[:report])\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @post_spam_report = PostSpamReport.new(params[:post_spam_report])\n\n if @post_spam_report.save\n render json: @post_spam_report, status: :created, location: @post_spam_report\n else\n render json: @post_spam_report.errors, status: :unprocessable_entity\n end\n end", "def new\n @bug = Bug.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bug }\n end\n end", "def new\n @bug = Bug.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bug }\n end\n end", "def new\n @bug_list = BugList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bug_list }\n end\n end", "def index\n @client_bugs = ClientBug.all.paginate(:page => params[:page], :per_page => 30).order('id DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_bugs }\n end\n end", "def create\n @menu = \"report\"\n @page_title = \"Report a UFO\"\n @page_description = \"Have you seen a UFO? Report your experience filling in the report form\"\n\n @tmp = report_params\n\n @tmp[\"links\"] = params[:report][:links] unless params[:report][:links].blank?\n @tmp[\"image_cloudinary\"] = params[:report][:image_cloudinary]\n\n unless @tmp[\"image_cloudinary\"].blank?\n @tmp[\"image_cloudinary\"] = @tmp[\"image_cloudinary\"].values\n end\n @tmp[\"status\"] = 0\n # Remove image_id\n @tmp.except! :image_id\n\n if @tmp[\"coord\"].blank?\n @tmp[\"coord\"] = [0,0]\n else\n @tmp[\"coord\"] = @tmp[\"coord\"].split(\",\").map { |s| s.to_f }\n end\n\n @tmp[\"source\"] = \"ufo-hunters.com\"\n @tmp[\"sighted_at\"] = Date.strptime(@tmp[\"sighted_at\"], '%m/%d/%Y').strftime('%Y%m%d')\n @tmp[\"reported_at\"] = Date.strptime(@tmp[\"reported_at\"], '%m/%d/%Y').strftime('%Y%m%d')\n\n @report = Report.new(@tmp)\n\n if verify_recaptcha(model: @report)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Ufo model was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n\n else\n @report[\"sighted_at\"] = \"\"\n @report[\"reported_at\"] = \"\"\n @report[\"links\"] = []\n respond_to do |format|\n @notice = 'You must enter the text of the image'\n format.html { render action: \"new\", notice: 'You must enter the text of the image'}\n format.json { render json: @report.errors, status: :unprocessable_entity, notice: 'You must enter the text of the image' }\n end\n\n end\n\n # Invalidate cache for sightings/latest, reports/latest and so on\n #Rails.cache.delete_matched /latest/\n #Rails.cache.delete \"common/num_reports\"\n expire_fragment \"common/header\"\n\n end", "def create\n @bug = Project.find(params[:project_id]).bugs.new(bug_params)\n @bug.user_id = current_user.id\n @bug.status = \"new\"\n authorize @bug\n if @bug.save\n redirect_to project_path(@bug.project.id), notice: I18n.t('flash.actions.bug.create.notice')\n else\n render 'new'\n end\n end", "def create\n @bug = Bug.new(params[:bug])\n @bug.user_id = session[:user_id]\n\n respond_to do |format|\n if @bug.save\n flash[:notice] = 'Bug was successfully created.'\n format.html { redirect_to(@bug) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def create_new_bug(bug={})\n return call('Bug.create', bug)\n end", "def post(summary, description, assignee, product=\"TestProduct\", component=\"\")\n @log.debug \"Attempting to file a new bug\"\n url = \"#{@url}/enter_bug.cgi?product=#{product}&assigned_to=#{assignee}&component=#{component}\"\n @log.debug url\n page = @agent.get(url)\n form_name = 'Create'\n form = page.form_with(:name => form_name)\n if form\n form['short_desc']=summary\n form['comment']=description\n form['assignee']=assignee\n form['component']=component if not component.empty?\n page = @agent.submit form if not @dummy\n @log.info page.search(\".//td[@id='title']\")[0].content.strip\n # Read the bug number from the page\n return page.search(\".//a[@title='NEW - #{summary}']\")[0].content.match(/Bug ([0-9]+)/)[1] \n else\n @log.error \"Unable to find form with name #{form_name}\"\n end\n end", "def create\n @hotel = Hotel.find_by(params[:hotel_id])\n @report = @hotel.reports.new(report_params)\n\n respond_to do |format|\n if @report.save\n flash[:success] = \"Report created successfuly.\"\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n flash[:alert] = \"Errors where found.\"\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_bug_reports(bugs, build_number)\n puts \"Updating bug reports...\"\n # update bugzilla reports\n bugs.each do |bug|\n bug_data = find_bug_by_id(bug[:task_num])\n if (bug_data)\n # bug was found, update comments and status\n update_bug(bug_data, bug, build_number)\n # set bug title in task object\n bug[:task_name] = bug_data['internals']['short_desc']\n else\n # unknown bug, notify author of commit\n @email_reporter.notify_bug_id_not_found(bug)\n end\n end\n end", "def assignBug\n projectId = params[:projectId]\n bugId = to_number( params[:bugId] )\n userId = current_user.id\n id = params[:id]\n if id != projectId\n render json: { code: false, reason: \"Invalid request.\" }\n elsif bugId < 0\n render json: { code: false, reason: \"Invalid request.\" }\n elsif ProjectUser.where(project_id: projectId, user_id: userId).exists?\n bug = Bug.find(bugId)\n if bug.project_id == to_number(projectId) && bug.developer_id.nil?\n bug.developer_id = current_user.id\n bug.save\n if bug.valid?\n render json: { code: true, reason: \"Bug assigned successfully.\" }\n else\n render json: { code: false, reason: \"Something went wrong. Please try again.\" }\n end\n else\n render json: { code: false, reason: \"This bug is already assigned to a developer.\" }\n end\n else\n render json: { code: false, reason: \"Invalid request.\" }\n end\n end", "def json_report(test_report)\n test_report.to_json\n end", "def create\n @bug_ticket = BugTicket.new(bug_ticket_params)\n @bug_ticket.owner = current_user.email\n @users_support = User.all.select { |u| u.role != 'user' }\n if current_user.role != 'user'\n params[:users][:id].each do |user|\n @bug_ticket.bug_ticket_users.build(user_id: user) unless user.empty?\n end\n end\n \n respond_to do |format|\n if @bug_ticket.save\n format.html { redirect_to bug_tickets_path, notice: 'Bug ticket was successfully created.' }\n format.json { render :show, status: :created, location: @bug_ticket }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bug_ticket.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @jira_issue = JiraIssue.new(jira_issue_params)\n\n respond_to do |format|\n if @jira_issue.save\n format.html { redirect_to @jira_issue, notice: 'Jira issue was successfully created.' }\n format.json { render :show, status: :created, location: @jira_issue }\n else\n format.html { render :new }\n format.json { render json: @jira_issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @project_report = ProjectReport.new(project_report_params)\n\n respond_to do |format|\n if @project_report.save\n format.html { redirect_to @project_report, notice: 'Project report was successfully created.' }\n format.json { render :show, status: :created, location: @project_report }\n else\n format.html { render :new }\n format.json { render json: @project_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def report\n # generate_report()\n ReportWorker.perform_async(\"07-01-2018\", \"08-01-2018\")\n render \\\n json: {status: 'SUCCESS', message:'REQUEST TO GENERATE A REPORT ADDED TO THE QUEUE'},\n status: :ok\n end", "def index\n @bugs = Project.find(params[:project_id]).bugs.all\n end", "def bug_ticket_params\n params.require(:bug_ticket).permit(:bug_behavior, :environment, :status, :priority, :owner, :comment, :category, :main_image, :project_id)\n end", "def show\n render :json => Project.find(params[:project_id]).bug_tracker.bugs.find(params[:id])\n end", "def create_ticket\n jiraPair = @defect.getJiraList\n mapping = jiraAPIMapping\n payload = {\n :fields =>\n {:project =>\n {:key => \"#{jiraPair['Project']}\"},\n :summary => jiraPair['Summary'] + \" (#{@defect.get_story})\",\n :description => Sanitize.clean(jiraPair['Description']),\n mapping['Release Milestone'] => {:value => jiraPair['Release Milestone']},\n :customfield_10143 => [{:value => jiraPair['Environment'],}],\n :issuetype => {:name => jiraPair['issuetype']},\n mapping['Functional Group'] => {:value => jiraPair['Functional Group']},\n mapping['Project Manager'] => {:value => jiraPair['Project Manager']},\n :versions => [{:name => \"#{jiraPair['Release']}\",}],\n },\n }\n\n response = self.class.post('/rest/api/latest/issue/',\n :body => payload.to_json,\n :headers => {'Content-Type' => 'application/json' },\n :verify => false)\n\n url = \"\"\n if response['key']\n url = $JIRA['base_uri'] + \"/browse/\" + response['key']\n @defect.setJiraLink(url)\n else\n errormsg = \"Error (#{@defect.get_story}): #{response}\"\n p errormsg\n @defect.setDefectError(errormsg)\n end\n\n return url\n end", "def create\n @error_report = ErrorReport.new(error_report_params)\n\n respond_to do |format|\n if @error_report.save\n format.html { redirect_to @error_report, notice: 'Error report was successfully created.' }\n format.json { render :show, status: :created, location: @error_report }\n else\n format.html { render :new }\n format.json { render json: @error_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # Build a ticket associated with the current user and fill with strong parameters\n @ticket = current_user.help_requests.build(ticket_params)\n # New Hash\n add_info = {}\n # New Nested Array\n add_info[:tagged_users] = []\n # Scan for tagged users in the report:\n @ticket.desc.scan(USER_TAG_REGEX) do |name|\n # Find a tagged user in the database\n user = User.find_by_name(name)\n # Add the tagged user to the hash of tagged users\n add_info[:tagged_users] << user.name unless user == nil\n end\n # Save a JSON representation of the add_info hash to the record\n @ticket.addinfo = JSON.generate(add_info)\n # Save the new record in the database\n @ticket.save\n # Send the user to their homepage\n redirect_to me_path\n end", "def reporting_data\r\n\r\n report_sid = params[:report].blank? ? \"\" : params[:report]\r\n render(:nothing => true) and return if report_sid.blank?\r\n opts = (params[:report_options] || {}).reject{|k,v| v.blank?}\r\n opts[:format] ||= params[:format]\r\n r = DevFeedbackReport.make_report(report_sid, opts)\r\n r[:title][:style] = r[:title][:style].tr(',', ';').gsub('colour', 'color') if r && r[:title] && r[:title][:style]\r\n @report = r\r\n respond_to do |format|\r\n format.json { render :json => @report }\r\n format.html { render :text => @report }\r\n end\r\n end", "def create\n @bug_category = BugCategory.new(params[:bug_category])\n\n respond_to do |format|\n if @bug_category.save\n format.html { redirect_to @bug_category, notice: 'Bug category was successfully created.' }\n format.json { render json: @bug_category, status: :created, location: @bug_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bug_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n retval = @survey.create_report_mockup(params[:report_mockup])\n render_json_auto retval and return\n end", "def create\n @report = current_user.reports.new(params[:report])\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: @report, status: :created, location: @report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_bugreport\n @bugreport = Bugreport.find(params[:id])\n end", "def create\n @reportabus = Reportabuse.new(reportabus_params)\n @reportabus.reporter_id = current_user.id\n respond_to do |format|\n if @reportabus.save\n format.html { redirect_to '/reportabuses/', notice: 'Reportabuse was successfully created.' }\n format.json { render :show, status: :created, location: @reportabus }\n else\n format.html { render :new }\n format.json { render json: @reportabus.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bugs = @project.bugs\n end", "def create\n raise \"Disabled\"\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render :show, status: :created, location: @report }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @report = current_user.reports.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to @report, notice: 'Report was successfully created.' }\n format.json { render json: { message: 'Report was successfully created.'}, status: :created }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @action_report = ActionReport.new(action_report_params)\n\n respond_to do |format|\n if @action_report.save\n format.html { redirect_to @action_report, notice: 'Action report was successfully created.' }\n format.json { render :show, status: :created, location: @action_report }\n else\n format.html { render :new }\n format.json { render json: @action_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if current_user.company.reports.any?\n if [\"Queued\", \"Running\"].include? current_user.company.reports.last.status\n redirect_to dashboard_path, notice: \"Looks like you already have a report queued. We'll get to it asap, promise!\"\n return\n end\n end\n \n @report = Report.new(report_params) \n\n respond_to do |format|\n if @report.save\n \n @report.test_suite.test_cases.order('id ASC').each do |test_case|\n @report.results.create({ status: 'Queued', report_id: @report, test_case_id: test_case.id})\n end\n \n ReportMailer.admin_requested_report_triggered_email(@report).deliver\n #ReportMailer.requested_report_triggered_email(@report).deliver\n \n format.html { redirect_to dashboard_path }\n format.json { render action: 'show', status: :created, location: @report }\n else\n format.html { render action: 'new' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def products\n project = Project.find(params[:id])\n bt = project.bug_tracker\n render :json => {error: \"Project has no bug tracker!\", status: :bad_request} unless bt\n products = project.bug_products\n \n render :json => {:data => products.map(&:to_data)}\n end", "def new\n @bug_comment = BugComment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bug_comment }\n end\n end", "def create\n @journal_doc_report = JournalDocReport.new(journal_doc_report_params)\n\n respond_to do |format|\n if @journal_doc_report.save\n format.html { redirect_to @journal_doc_report, notice: 'Journal doc report was successfully created.' }\n format.json { render :show, status: :created, location: @journal_doc_report }\n else\n format.html { render :new }\n format.json { render json: @journal_doc_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @aggregation_dimensions = Occurrence::AGGREGATING_FIELDS.\n map { |field| [Occurrence.human_attribute_name(field), field.to_s] }.\n unshift(['', nil])\n\n # We use `duplicate_of_number` on the view and `duplicate_of_id` in the\n # backend, so we need to copy between those values.\n @bug.duplicate_of_number = @bug.duplicate_of.try!(:number)\n\n @new_issue_url = Service::JIRA.new_issue_link(summary: t('controllers.bugs.show.jira_link.summary',\n class_name: @bug.class_name,\n file_name: File.basename(@bug.file),\n line: @bug.special_file? ? t('controllers.bugs.show.jira_link.not_applicable') : @bug.line,\n locale: @bug.environment.project.locale),\n environment: @environment.name,\n description: t('controllers.bugs.show.jira_link.description',\n class_name: @bug.class_name,\n file: File.basename(@bug.file),\n line: @bug.special_file? ? t('controllers.bugs.show.jira_link.not_applicable') : @bug.line,\n message: @bug.message_template,\n revision: @bug.revision,\n url: project_environment_bug_url(@project, @environment, @bug),\n locale: @bug.environment.project.locale),\n issuetype: 1)\n\n respond_with @project, @environment, @bug.as_json.merge(watched: current_user.watches?(@bug))\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n format.html { redirect_to admin_reports_path, notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { render :show, status: :created, location: @report }\n else\n set_date\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bugs = @project.bugs.all\n end", "def create\n @user_report = UserReport.new(:reported_user => params[:reported_id], :user_id=>current_user.id, :description => params[:description])\n\n respond_to do |format|\n if @user_report.save\n format.html { redirect_to request.referer, notice: 'User report was successfully created.' }\n format.json { render json: @user_report, status: :created, location: @user_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n authorize :report, :create?\n @report = Report.new(report_params)\n @report.user_id = current_user.id\n @report.resquest_criminal = @resquest_criminal\n @report.resquest_criminal.status = 1\n @report.resquest_criminal.save\n respond_to do |format|\n if @report.save\n format.html { redirect_to [@resquest_criminal,@report], notice: 'Report was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_bug_params\n params.require(:bug).permit(:title, :deadline, :issue_type, :status, :bug_image).merge(creator_id: current_user.id , status: 0 , project_id: params[:id])\n end", "def create\n #@team_report = TeamReport.new(params[:team_report])\n @team_report.status = 'submitted'\n respond_to do |format|\n if @team_report.save\n format.html { redirect_to team_team_report_path(@team,@team_report), notice: 'Team report was successfully created.' }\n format.json { render json: @team_report, status: :created, location: @team_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # We use `duplicate_of_number` on the view and `duplicate_of_id` in the\n # backend, so we need to copy between those values.\n add_error = false\n if (number = params[:bug].delete('duplicate_of_number')).present?\n original_bug = @environment.bugs.where(number: number).first\n if original_bug\n @bug.duplicate_of_id = original_bug.id\n else\n add_error = true\n end\n else\n @bug.duplicate_of_id = nil\n end\n\n # hacky fix for the JIRA status dropdown\n params[:bug][:jira_status_id] = params[:bug][:jira_status_id].presence\n\n if !add_error && @bug.update_attributes(bug_params)\n if params[:comment].kind_of?(Hash) && params[:comment][:body].present?\n @comment = @bug.comments.build(comment_params)\n @comment.user = current_user\n @comment.save\n end\n if params[:notification_threshold]\n if params[:notification_threshold][:threshold].blank? && params[:notification_threshold][:period].blank?\n current_user.notification_thresholds.where(bug_id: @bug.id).delete_all\n else\n @notification_threshold = current_user.notification_thresholds.where(bug_id: @bug.id).create_or_update(notification_threshold_params)\n end\n end\n else\n @bug.errors.add :duplicate_of_id, :not_found if add_error\n @bug.errors[:duplicate_of_id].each { |error| @bug.errors.add :duplicate_of_number, error }\n end\n\n respond_with @project, @environment, @bug.reload # reload to grab the new cached counter values\n end", "def create\n @bug_status = BugStatus.new(params[:bug_status])\n\n respond_to do |format|\n if @bug_status.save\n flash[:notice] = 'BugStatus was successfully created.'\n \tformat.html { redirect_to(bug_statuses_url) }\n format.xml { render :xml => @bug_status, :status => :created, :location => @bug_status }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bug_status.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n #@feedback = Feedback.find(params[:feedback_id])\n #@issue.feedback_id = @feedback.id\n @issue = Issue.new(params[:issue])\n @tester = Tester.find(current_tester)\n @issue.tester_id = @tester.id\n @issue.approvalstatus = \"Waiting for Approval\"\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to projects_tester_path(@issue), notice: 'Issue was successfully created.' }\n format.json { render json: @issue, status: :created, location: @issue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @bugs = Bug.where(project_id: params[:project_id])\n @project = params[:project_id]\n end" ]
[ "0.6781488", "0.65825206", "0.6582034", "0.6582034", "0.64818656", "0.64270556", "0.6361853", "0.63279647", "0.6293628", "0.62586296", "0.62543607", "0.6249598", "0.6227144", "0.62130576", "0.6190422", "0.6161469", "0.6136166", "0.6122411", "0.611669", "0.61154073", "0.59497595", "0.5941449", "0.5905685", "0.5883731", "0.5880334", "0.58613074", "0.58526367", "0.5833123", "0.5832171", "0.58155245", "0.58136684", "0.58068615", "0.5798845", "0.57776964", "0.57767475", "0.57766026", "0.57643676", "0.57613254", "0.57484084", "0.5740005", "0.57384855", "0.57267696", "0.5726251", "0.5715521", "0.5715521", "0.5715521", "0.5714708", "0.5712138", "0.5710426", "0.57018703", "0.57018703", "0.5697051", "0.56949854", "0.56949854", "0.56929904", "0.569281", "0.56894594", "0.56797314", "0.567848", "0.56474024", "0.56444323", "0.5643007", "0.56417334", "0.56401575", "0.56400865", "0.5631003", "0.56281036", "0.5622923", "0.5616613", "0.5613795", "0.5604935", "0.560409", "0.5600349", "0.55953264", "0.5594734", "0.55926913", "0.5591792", "0.55829424", "0.55804276", "0.55797136", "0.55792403", "0.5574789", "0.55725205", "0.5564469", "0.5553902", "0.5545687", "0.5545298", "0.5540303", "0.5539924", "0.553815", "0.5526597", "0.55153465", "0.55141044", "0.5512018", "0.55013025", "0.5498976", "0.5495187", "0.5493884", "0.54915816", "0.54847187" ]
0.69298863
0
PATCH/PUT /bugreports/1 PATCH/PUT /bugreports/1.json
def update respond_to do |format| if @bugreport.update(bugreport_params) format.html { redirect_to @bugreport, notice: 'Bugreport was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @bugreport.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @bug.update(bug_params)\n BugHistoric.create(bug_id: @bug.id, ref: BugHistoric.MODIFIED, user_id: current_user.id)\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # We use `duplicate_of_number` on the view and `duplicate_of_id` in the\n # backend, so we need to copy between those values.\n add_error = false\n if (number = params[:bug].delete('duplicate_of_number')).present?\n original_bug = @environment.bugs.where(number: number).first\n if original_bug\n @bug.duplicate_of_id = original_bug.id\n else\n add_error = true\n end\n else\n @bug.duplicate_of_id = nil\n end\n\n # hacky fix for the JIRA status dropdown\n params[:bug][:jira_status_id] = params[:bug][:jira_status_id].presence\n\n if !add_error && @bug.update_attributes(bug_params)\n if params[:comment].kind_of?(Hash) && params[:comment][:body].present?\n @comment = @bug.comments.build(comment_params)\n @comment.user = current_user\n @comment.save\n end\n if params[:notification_threshold]\n if params[:notification_threshold][:threshold].blank? && params[:notification_threshold][:period].blank?\n current_user.notification_thresholds.where(bug_id: @bug.id).delete_all\n else\n @notification_threshold = current_user.notification_thresholds.where(bug_id: @bug.id).create_or_update(notification_threshold_params)\n end\n end\n else\n @bug.errors.add :duplicate_of_id, :not_found if add_error\n @bug.errors[:duplicate_of_id].each { |error| @bug.errors.add :duplicate_of_number, error }\n end\n\n respond_with @project, @environment, @bug.reload # reload to grab the new cached counter values\n end", "def update\n respond_to do |format|\n if @bug.update(bug_params.merge!(user_status: current_user))\n send_slack_notification ( {update: true} )\n format.html { redirect_to [@project, @bug], notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n\n if project_bug_params[:status] ==\"started\"\n @project_bug.assigned_id = current_user.id\n\n end\n if @project_bug.update(project_bug_params)\n format.html { redirect_to @project_bug, notice: \"Project bug was successfully updated.\" }\n format.json { render :show, status: :ok, location: @project_bug }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @project_bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n\n respond_to do |format|\n if @bug.update_attributes(params[:bug])\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n\n respond_to do |format|\n if @bug.update_attributes(params[:bug])\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client_bug.update(client_bug_params)\n format.html { redirect_to @client_bug, notice: 'Client bug was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @client_bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n @project = Project.find(params[:project_id])\n \n old_status = @bug.is_fixed\n\n respond_to do |format|\n if @bug.update(bug_params)\n # Checar se o status do bug mudou\n if @bug.is_fixed != old_status\n status = { true => \"Corrigido\", false => \"Não corrigido\"}\n # Caso tenha mudado, notificar no Slack\n message = \"#{current_user.username} alterou o status do bug \\\"#{@bug.title}\\\" (#{@project.name}) para #{status[@bug.is_fixed]}\"\n @notifier.ping message\n end\n\n format.html { redirect_to user_project_path(current_user.id, params[:project_id]), notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n @bug.jobtests.each{ |jt| jt.valid? }\n\n respond_to do |format|\n if @bug.update_attributes(params[:bug])\n flash[:notice] = 'Bug was successfully updated.'\n format.html { redirect_to(@bug) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bug.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n authorize Bug\n respond_to do |format|\n if @bug.update(bug_params)\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n respond_to do |format|\n if @jira.update(jira_params)\n format.html { redirect_to @jira, notice: 'Jira was successfully updated.' }\n format.json { render :show, status: :ok, location: @jira }\n else\n format.html { render :edit }\n format.json { render json: @jira.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n\n \n respond_to do |format|\n if @bug.update_attributes(params[:bug])\n notice = \"Bug marked as solved\" if params[:bug][:solved] == \"1\"\n format.html { redirect_to_index :controller => \"admin\", :notice => notice }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bug.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n @success = @bug.update_attributes(params[:bug])\n\n if (request.xhr?) then\n render :release_asssigned, :layout => false\n else\n respond_to do |format|\n if @success\n flash[:notice] = 'Bug was successfully updated.'\n format.html { render :action => \"edit\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bug.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @jira_issue.update(jira_issue_params)\n format.html { redirect_to @jira_issue, notice: 'Jira issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @jira_issue }\n else\n format.html { render :edit }\n format.json { render json: @jira_issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @failure_report.update(failure_report_params)\n format.html { redirect_to @failure_report, notice: 'Failure report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @failure_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def refresh\n to_sync = params['_json']\n\n unless to_sync.kind_of?(Array)\n return redirect_to_error!('request body must contain a valid JSON array of bug numbers or aliases', :bad_request)\n end\n\n updated = Bug.batch_update_from_rpc(to_sync, :permissive => true)\n # Get all the bug ids and aliases we found so we can check if\n # there was anything requested that we _didn't_ find. Note the\n # special handling of aliases, because we store them in the DB as\n # a comma-separated string :(\n updated_ids_and_aliases = updated.\n map{|b| [b.id, b.alias.split(/,\\s*/)]}.\n flatten.map(&:to_s).uniq\n not_updated = to_sync.map(&:to_s) - updated_ids_and_aliases\n\n if not_updated.any?\n return redirect_to_error!(\n \"#{n_thing_or_things(not_updated.length, 'bug')} not found: #{display_list_with_and(not_updated, :elide_after => 4)}\", :not_found)\n end\n\n render :nothing => true, :status => 204\n end", "def update\n logger.info { \"PARAMS: #{params.inspect}\" }\n project_id, id = params[:id].split('-')\n ticket = Lighthouse::Ticket.find(id, :params => {:project_id => project_id})\n \n # insanely hacky. can't nest json, so don't want to do a willy-nilly merge.\n # move mergeable params to the [:ticket] hash to follow usual rails conventions\n # before merging\n params[:ticket] = {}\n %w(assigned_user_id state milestone_id).each do |field|\n params[:ticket].merge!( field => params.delete(field) ) if params[field]\n end\n logger.info { \"TICKET ATTRS TO UPDATE: #{params[:ticket].inspect}\"}\n \n ticket.attributes.merge!( params[:ticket] )\n ticket.save\n\n respond_to do |format|\n # if @ticket.update_attributes(params[:ticket])\n # flash[:notice] = 'Ticket was successfully updated.'\n # format.html { redirect_to(@ticket) }\n # format.xml { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n # end\n end\n end", "def markBug\n projectId = params[:projectId]\n bugId = to_number( params[:bugId] )\n userId = current_user.id\n id = params[:id]\n if id != projectId\n render json: { code: false, reason: \"Invalid request.\" }\n elsif bugId < 0\n render json: { code: false, reason: \"Invalid request.\" }\n elsif ProjectUser.where(project_id: projectId, user_id: userId).exists?\n bug = Bug.find(bugId)\n if(bug.project_id == to_number(projectId) && bug.developer_id == current_user.id)\n if(bug.status == 0)\n bug.status = 1\n elsif bug.status == 1\n bug.status = 2\n end\n bug.save\n if bug.valid?\n render json: { code: true, reason: \"Bug marked successfully.\" }\n else\n render json: { code: false, reason: \"Something went wrong. Please try again.\" }\n end\n else\n render json: { code: false, reason: \"Invalid request.\" }\n end\n else\n render json: { code: false, reason: \"Invalid request.\" }\n end\n end", "def update\n @bug_list = BugList.find(params[:id])\n\t\t@bug_list.user_id = session[:user_id]\n respond_to do |format|\n if @bug_list.update_attributes(params[:bug_list])\n format.html { redirect_to @bug_list.project, notice: 'Bug list was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bug_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update!(**args)\n @bug_id = args[:bug_id] if args.key?(:bug_id)\n end", "def update\n respond_to do |format|\n if @project_issue.update(project_issue_params)\n format.html { redirect_to @project_issue, notice: 'Project issue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @project_issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, **args); end", "def update\n @bug_comment = BugComment.find(params[:id])\n\n respond_to do |format|\n if @bug_comment.update_attributes(params[:bug_comment])\n format.html { redirect_to project_bug_list_bug_post_path(params[:project_id], params[:bug_list_id], params[:bug_post_id]), notice: 'Bug comment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bug_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bugtype.update(bugtype_params)\n format.html { redirect_to @bugtype, notice: 'Bugtype was successfully updated.' }\n format.json { render :index, status: :ok, location: @bugtype }\n else\n format.html { render :edit }\n format.json { render json: @bugtype.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if issue.save\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", "def update\n @project = Project.find_by_permalink(params[:project_id])\n @bug = Bug.find(params[:id])\n @user = get_current_user\n\n if params[:bug][:watcher_id]\n @watcher = @project.users.find_by_id(params[:bug][:watcher_id])\n params[:bug].delete :watcher_id\n\n if @bug.watchers.include?(@watcher)\n @bug.watchers.delete(@watcher)\n else\n @bug.watchers << @watcher unless @watcher.nil?\n end\n end\n\n if params[:bug][:comment]\n @comment = Comment.new()\n @comment.user = @user\n @comment.content = RedCloth.new(params[:bug][:comment][:content]).to_html\n @bug.comments << @comment\n params[:bug].delete :comment\n end\n\n if params[:bug][:state]\n if @bug.state != params[:bug][:state]\n render :action => \"show\"\n return\n else\n params[:bug].delete :state\n end\n end\n\n if params[:bug][:next_event]\n next_event = @bug.verify_next_event(params[:bug][:next_event], @user)\n if next_event.nil?\n render :action => \"show\"\n return\n end\n params[:bug].delete :next_event\n end\n\n if @bug.update_attributes(params[:bug])\n if next_event\n transition = @bug.state_transitions.find { |t| t if t.event == next_event }\n @bug.fire_events(next_event)\n @bug.generate_state_comment(@user, transition.from, transition.to)\n end\n\n redirect_to(project_bug_url(@project, @bug),\n :notice => 'Bug was successfully updated.')\n else\n render :action => \"edit\"\n end\n end", "def update_bug(bug_data, bug_task, build_number)\n bug_id = bug_data['id']\n bugproxy = @server.proxy('Bug')\n comments_result = bugproxy.comments({:ids => bug_id})\n #puts comments_result\n comments = comments_result['bugs'][\"#{bug_id}\"]['comments']\n last_comment = comments.last\n\n if last_comment\n if !last_comment['text'].start_with? FIXED_COMMENT_PREFIX\n\n # only add a comment if the state isn't already VERIFIED, REVERIFIED or CLOSED\n status = bug_data['status']\n txt = String.new(FIXED_COMMENT_PREFIX) # comment should always begin with this\n txt << \"Fixed in Git and deployed with build #{build_number}\"\n\n if !(status == 'RESOLVED' || verified_or_closed?(status))\n txt << \"\\n\\nNOTE: it appears that this bug has not been marked resolved yet... please verify and update status if necessary\"\n end\n\n if (!verified_or_closed?(status) && !@dry_run)\n add_comment_response = bugproxy.add_comment({'id' => bug_id, 'comment' => txt})\n\n #puts \"adding comment to bug id #{bug_id}\\n #{txt}\"\n # TODO: add delivered in build field\n # unfortunately it doesn't look like the API gives us a way to update custom fields\n # http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html#fields\n end\n end\n end\n #puts \"Last comment:\\n#{last_comment}\"\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @custom_report = CustomReport.find(params[:id])\n\n if @custom_report.update(params[:custom_report])\n head :no_content\n else\n render json: @custom_report.errors, status: :unprocessable_entity\n end\n end", "def update\n if @bug.update(bug_params)\n redirect_to projects_path, notice: I18n.t('flash.actions.bug.update.notice')\n else\n render :edit \n end\n end", "def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n # format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @report = Report.find(params[:id])\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_bug_reports(bugs, build_number)\n puts \"Updating bug reports...\"\n # update bugzilla reports\n bugs.each do |bug|\n bug_data = find_bug_by_id(bug[:task_num])\n if (bug_data)\n # bug was found, update comments and status\n update_bug(bug_data, bug, build_number)\n # set bug title in task object\n bug[:task_name] = bug_data['internals']['short_desc']\n else\n # unknown bug, notify author of commit\n @email_reporter.notify_bug_id_not_found(bug)\n end\n end\n end", "def update\n @reports_part = ReportsPart.find(params[:id])\n\n if @reports_part.update(params[:reports_part])\n head :no_content\n else\n render json: @reports_part.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @project_report.update(project_report_params)\n format.html { redirect_to @project_report, notice: 'Project report was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_report }\n else\n format.html { render :edit }\n format.json { render json: @project_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug_status = BugStatus.find(params[:id])\n\n respond_to do |format|\n if @bug_status.update_attributes(params[:bug_status])\n flash[:notice] = 'BugStatus was successfully updated.'\n \tformat.html { redirect_to(bug_statuses_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bug_status.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @issue.update(issue_params)\n render :show, status: :ok, location: @issue\n else\n render json: @issue.errors, status: :unprocessable_entity\n end\n end", "def update\n @ticket = @project.tickets.find_by_scoped_id!(params[:id])\n\n respond_to do |format|\n if @ticket.update_attributes(params[:ticket])\n format.html { redirect_to([@project, @ticket], :notice => 'Ticket was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @report = current_user.reports.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n end", "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", "def update\n @report = Report.find(params[:id])\n\n respond_to do |format|\n if @report.update_attributes(params[:report])\n #format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.html { redirect_to action: \"index\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to reports_path, notice: 'Report was successfully updated.' }\n format.json { render :index, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bug = Bug.find(params[:id])\n Bug.save_file(params,@bug) if params[:keepold].nil? or params[:keepold].empty?\n updateparams = params\n updateparams[:bug][:fileuploadpath] = @bug.fileuploadpath\n respond_to do |format|\n if @bug.update_attributes(updateparams[:bug])\n format.html { redirect_to bugs_path, notice: 'Bug was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @issue.update(issue_params)\n show\n else\n render json: @issue.errors, status: :unprocessable_entity\n end\n end", "def update\n feedback.is_bug_fix = params[:commit][:is_bug_fix]\n\n respond_to do |format|\n if feedback.save\n format.html { redirect_to(@commit.repository, :notice => 'Commit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"show\" }\n format.xml { render :xml => @commit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to reports_url, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bug.update(bug_params)\n if params.key?(:image)\n @bug.image.purge_later\n @bug.image.attach(params[:bug][:image])\n end\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @backlog.update(backlog_params)\n format.html { redirect_to project_backlogs_path(@backlog.project.id), notice: 'Backlog atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @backlog.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to report_path(@report.id), notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: report_path(@report.id) }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to [:admin, @report], notice: 'Report was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "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", "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", "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @issue = Issue.find(params[:id])\n @feedback = Feedback.find(params[:issue][:feedback_id])\n\n respond_to do |format|\n if @issue.update_attributes(params[:issue])\n format.html { redirect_to feedback_issue_path(@feedback.id), 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", "def update #only patch owned reports, do not edit client/user since their ids are in the routing\n @report = Report.find_by(id: params[:id])\n if current_user == @report.user\n #reset bool values that have n/a option\n @report.positive = nil\n @report.appointment = nil\n @report.payment = nil\n @report.update(report_params)\n @report.client_id = report_params[:client_id] if report_params[:client_id]\n redirect_to user_report_path(current_user, @report), notice: \"Report updated\"\n else\n redirect_to user_reports_path(current_user), alert: \"That's not your report\"\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @journal_doc_report.update(journal_doc_report_params)\n format.html { redirect_to @journal_doc_report, notice: 'Journal doc report was successfully updated.' }\n format.json { render :show, status: :ok, location: @journal_doc_report }\n else\n format.html { render :edit }\n format.json { render json: @journal_doc_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end", "def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end", "def update\n @report_file = ReportFile.find(params[:id])\n\n respond_to do |format|\n if @report_file.update_attributes(params[:report_file])\n format.html { redirect_to @report_file, notice: 'Report file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @report_file.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: \"Report was successfully updated.\" }\n format.json { render :show, status: :ok, location: @report }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to issues_url, notice: 'Issue was successfully updated.' }\n format.json { render json: {'success' => true} }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def assignBug\n projectId = params[:projectId]\n bugId = to_number( params[:bugId] )\n userId = current_user.id\n id = params[:id]\n if id != projectId\n render json: { code: false, reason: \"Invalid request.\" }\n elsif bugId < 0\n render json: { code: false, reason: \"Invalid request.\" }\n elsif ProjectUser.where(project_id: projectId, user_id: userId).exists?\n bug = Bug.find(bugId)\n if bug.project_id == to_number(projectId) && bug.developer_id.nil?\n bug.developer_id = current_user.id\n bug.save\n if bug.valid?\n render json: { code: true, reason: \"Bug assigned successfully.\" }\n else\n render json: { code: false, reason: \"Something went wrong. Please try again.\" }\n end\n else\n render json: { code: false, reason: \"This bug is already assigned to a developer.\" }\n end\n else\n render json: { code: false, reason: \"Invalid request.\" }\n end\n end", "def bug\n bug = Bug.where(id: params[:bugId])\n render :json => bug.to_json\n end", "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", "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", "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", "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", "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", "def update\n respond_to do |format|\n if @report.update(report_params)\n format.html { redirect_to @report, notice: 'Report was successfully updated.' }\n format.json { render json: { message: 'Report was successfully updated.'}, status: :created }\n else\n format.html { render :edit }\n format.json { render json: @report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @crunch_report.update(crunch_report_params)\n format.html { redirect_to @crunch_report, notice: 'Crunch report was successfully updated.' }\n format.json { render :show, status: :ok, location: @crunch_report }\n else\n format.html { render :edit }\n format.json { render json: @crunch_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @appissue.update(appissue_params)\n format.html { redirect_to @appissue, notice: 'Appissue was successfully updated.' }\n format.json { render :show, status: :ok, location: @appissue }\n else\n format.html { render :edit }\n format.json { render json: @appissue.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_bugreport\n @bugreport = Bugreport.find(params[:id])\n end", "def update\n @gotcha = Gotcha.find(params[:id])\n\n respond_to do |format|\n if @gotcha.update_attributes(params[:gotcha])\n format.html { redirect_to @gotcha, notice: 'Gotcha was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gotcha.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ticket.update(ticket_params)\n @ticket.update_responsible(:status, 'Waiting for Staff Response')\n format.html { redirect_to @ticket, notice: 'Ticket 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", "def update\n respond_to do |format|\n if @issue.update(issue_params)\n format.html { redirect_to issues_path, 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", "def update\n @report = Report.find(params[:report_id])\n @work_item = WorkItem.find(params[:id])\n\n respond_to do |format|\n if @work_item.update_attributes(params[:work_item])\n format.html { redirect_to @report, notice: 'Work item was successfully updated.' }\n format.json { render json: @work_item, status: :ok, location: [@report, @work_item] }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @working_change.update(working_change_params)\n format.html { redirect_to @working_change, notice: 'Working change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @working_change.debugs, status: :unprocessable_entity }\n end\n end\n end", "def update\n if current_user.id == @ticket.user_id || ProjectUser.verify_role(current_user.id, @project, 'developer')\n if params[:ticket][:status] == 'closed'\n # Unless doesn't work, but if! does for some reason?\n if !ProjectUser.verify_role(current_user.id, @project, 'owner')\n render json: { error: 'You must be the ticket author, or project owner to edit this' }, status: :unauthorized\n return\n end\n end\n if @ticket.update(ticket_params)\n render json: @ticket, status: 200\n else\n render json: @ticket.errors, status: :unprocessable_entity\n end\n else\n render json: { error: 'You must be the entry author, or on the admin team to edit this' }, status: :unauthorized\n end\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end" ]
[ "0.7086432", "0.6667938", "0.66447854", "0.6626886", "0.66071826", "0.66071826", "0.65955746", "0.6494753", "0.6492648", "0.6436245", "0.62485963", "0.6247278", "0.62275034", "0.6176275", "0.6114004", "0.60641396", "0.6059335", "0.6047012", "0.6046641", "0.6044141", "0.60397446", "0.60358304", "0.6026721", "0.60200953", "0.60076714", "0.5985987", "0.5985297", "0.59684783", "0.5960029", "0.59580326", "0.5948816", "0.59450305", "0.5944562", "0.5944562", "0.5943111", "0.59421945", "0.59184307", "0.59089655", "0.5897361", "0.5897361", "0.5897053", "0.58832943", "0.5876323", "0.58708274", "0.5844783", "0.58442616", "0.583892", "0.5837828", "0.5834256", "0.5831685", "0.58206284", "0.58199584", "0.5816222", "0.580263", "0.5799335", "0.5797523", "0.5795435", "0.57944113", "0.57877666", "0.5782349", "0.57784075", "0.577521", "0.57748884", "0.57703656", "0.57692933", "0.5756403", "0.57493764", "0.57493764", "0.57493764", "0.57493764", "0.57493764", "0.57493764", "0.57493764", "0.57493764", "0.57493764", "0.57434046", "0.57404846", "0.57404846", "0.57388455", "0.57302904", "0.5729279", "0.5726995", "0.57263905", "0.5723598", "0.5723598", "0.5723598", "0.5723598", "0.5723598", "0.572166", "0.57202303", "0.5719069", "0.56904507", "0.5687881", "0.5684134", "0.5673534", "0.5671282", "0.5669356", "0.56668234", "0.5660119", "0.5660119" ]
0.70894927
0
DELETE /bugreports/1 DELETE /bugreports/1.json
def destroy @bugreport.destroy respond_to do |format| format.html { redirect_to bugreports_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @report.destroy!\n render json: {status: :ok}\n end", "def destroy\n @client_bug.destroy\n respond_to do |format|\n format.html { redirect_to client_bugs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug.destroy\n respond_to do |format|\n format.html { redirect_to user_project_path(params[:project_id]), notice: 'Bug was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug = Project.find(params[:project_id]).bug_tracker.bugs.find(params[:id])\n \n if @bug.destroy\n render :json => {:status => :ok}\n else\n render :json => {:error => @bug.errors.full_messages, :status => :bad_request}\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug.destroy\n\n respond_to do |format|\n format.html { redirect_to project_environment_bugs_url(@project, @environment), flash: {success: t('controllers.bugs.destroy.deleted', number: number_with_delimiter(@bug.number))} }\n end\n end", "def destroy\n @failure_report.destroy\n respond_to do |format|\n format.html { redirect_to failure_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug = Bug.find(params[:id])\n @bug.destroy\n\n respond_to do |format|\n format.html { redirect_to bugs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug = Bug.find(params[:id])\n @bug.destroy\n\n respond_to do |format|\n format.html { redirect_to bugs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug_status = BugStatus.find(params[:id])\n @bug_status.destroy\n\n respond_to do |format|\n format.html { redirect_to(bug_statuses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n #format.json { head :ok }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n project_id = @bug.project_id\n @bug.image.purge\n @bug.destroy\n respond_to do |format|\n format.html { redirect_to bugs_url(id: project_id), notice: 'Bug was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug = Bug.find(params[:id])\n @bug.destroy\n\n respond_to do |format|\n format.html { redirect_to(bugs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @project_report.destroy\n respond_to do |format|\n format.html { redirect_to project_reports_url, notice: 'Project report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Bug was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @project_bug.destroy\n respond_to do |format|\n format.html { redirect_to project_bugs_url(project_id: @project_bug.project.id), notice: \"Project bug was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @report_content.destroy\n respond_to do |format|\n format.html { redirect_to report_contents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report = current_user.reports.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @project = Project.find_by_permalink(params[:project_id])\n @bug = Bug.find_by_id(params[:id])\n\n respond_to do |format|\n if @project and @bug and @project.bugs.exists?(@bug)\n @bug.destroy\n format.html { redirect_to(project_url(@project)) }\n format.xml { head :ok }\n else\n format.html { redirect_to(projects_url, :notice => 'Specified bug does not exist') }\n end\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_find_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @statusreport = current_user.organization.statusreports.find(params[:id])\n @statusreport.destroy\n respond_to do |format|\n format.html { redirect_to statusreports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pod_report.destroy\n respond_to do |format|\n format.html { redirect_to pod_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @survey_report = SurveyReport.find(params[:id])\n @survey_report.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_reports_url }\n format.json { head :no_content }\n end\n end", "def report_delete(id)\r\n\t\tpost= { \"token\" => @token, \"report\" => id } \r\n\t\tdocxml=nessus_request('report/delete', post)\r\n\t\treturn docxml\r\n\tend", "def destroy\n @bug_ticket.destroy\n respond_to do |format|\n format.html { redirect_to bug_tickets_url, notice: 'Bug ticket was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @crunch_report.destroy\n respond_to do |format|\n format.html { redirect_to crunch_reports_url, notice: 'Crunch report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bug_category = BugCategory.find(params[:id])\n @bug_category.destroy\n\n respond_to do |format|\n format.html { redirect_to bug_categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @bug_list = BugList.find(params[:id])\n @bug_list.destroy\n\n respond_to do |format|\n format.html { redirect_to project_bug_lists_url }\n format.json { head :ok }\n end\n end", "def destroy\n @report_file = ReportFile.find(params[:id])\n @report_file.destroy\n\n respond_to do |format|\n format.html { redirect_to report_files_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to user_reports_url, notice: I18n.t('controllers.reports.successfully_updated') }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: \"Report was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: \"Report was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @journal_doc_report.destroy\n respond_to do |format|\n format.html { redirect_to journal_doc_reports_url, notice: 'Journal doc report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'El Reporte fue Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @report = Report.find(params[:report_id])\n @work_item = WorkItem.find(params[:id])\n @work_item.destroy\n\n respond_to do |format|\n format.html { redirect_to @report }\n format.json { head :ok }\n end\n end", "def destroy\n @reporte = Reporte.find(params[:id])\n @reporte.destroy\n\n respond_to do |format|\n format.html { redirect_to reportes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report_narrative = ReportNarrative.find(params[:id])\n @report_narrative.destroy\n\n respond_to do |format|\n format.html { redirect_to report_narratives_url }\n format.json { head :ok }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @report = Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(reports_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @crash_test = CrashTest.find(params[:id])\n @crash_test.destroy\n\n respond_to do |format|\n format.html { redirect_to crash_tests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url, notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.report', count: 1)) }\n format.json { head :no_content }\n end\n end", "def destroy\n #@team_report = TeamReport.find(params[:id])\n @team_report.destroy\n\n respond_to do |format|\n format.html { redirect_to action: :index }\n format.json { head :no_content }\n end\n end", "def destroy\n @error_report.destroy\n respond_to do |format|\n format.html { redirect_to error_reports_url, notice: 'Error report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @time_report = TimeReport.find(params[:id])\n @time_report.destroy\n\n respond_to do |format|\n format.html { redirect_to time_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @fix_issue = FixIssue.find(params[:id])\n @fix_issue.destroy\n\n respond_to do |format|\n format.html { redirect_to fix_issues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reportabus.destroy\n respond_to do |format|\n format.html { redirect_to reportabuses_url, notice: 'Reportabuse was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @custom_report = CustomReport.find(params[:id])\n @custom_report.destroy\n\n head :no_content\n end", "def destroy\n @report = current_user.reports.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user), notice: \"Report was deleted!\" }\n format.json { head :no_content }\n end\n end", "def deleteBuglog(projectId, bugId, logId)\r\n\t\t\t\turl = getBaseURL+\"projects/\"+String(projectId)+\"/bugs/\"+String(bugId)+\"/logs/\"+String(logId)+\"/\"\t\t\t\t\r\n\t\t\t\tresponse = ZohoHTTPClient.delete(url, getQueryMap)\t\t\r\n\t\t\t\treturn $timesheetParser.getResult(response)\r\n\t\t\tend", "def destroy\n @question_report.destroy\n respond_to do |format|\n format.html { redirect_to question_reports_url, notice: 'El reporte ha sido eliminado!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report = Mg::Report.find(params[:id])\n @report.destroy\n\n respond_to do |format|\n format.html { redirect_to(mg_reports_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @client_report.destroy\n respond_to do |format|\n format.html { redirect_to client_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @debug.destroy\n respond_to do |format|\n format.html { redirect_to debugs_url, notice: 'Debug was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @backlogentry = Backlogentry.find(params[:id])\n @project = @backlogentry.project\n @backlogentry.destroy\n\n respond_to do |format|\n format.html { redirect_to project_backlogentries_url @project}\n format.json { head :ok }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to posts_path(code: Code.first.code) }\n format.json { head :no_content }\n end\n end", "def report_delete(id)\n\t\t\tpost= { \"token\" => @token, \"report\" => id }\n\t\t\tdocxml = nil\n\t\t\tdocxml=nessus_request('report/delete', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\treturn docxml\n\t\tend", "def destroy\n @admin_report.destroy\n respond_to do |format|\n format.html { redirect_to admin_reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @project_issue.destroy\n respond_to do |format|\n format.html { redirect_to project_issues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report_question = ReportQuestion.find(params[:id])\n @report_question.destroy\n\n respond_to do |format|\n format.html { redirect_to report_questions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@report = Report.find(params[:id])\n\t\[email protected]\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to reports_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n\t\t@report = Report.find(params[:id])\n\t\[email protected]\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to reports_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n @hivdrugreport = Hivdrugreport.find(params[:id])\n @hivdrugreport.destroy\n\n respond_to do |format|\n format.html { redirect_to hivdrugreports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @inventory_report = InventoryReport.find(params[:id])\n @inventory_report.destroy\n\n respond_to do |format|\n format.html { redirect_to inventory_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @fin_report = FinReport.find(params[:id])\n @fin_report.destroy\n\n respond_to do |format|\n format.html { redirect_to fin_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @villagesummaryreport.destroy\n respond_to do |format|\n format.html { redirect_to villagesummaryreports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @post_report.destroy\n respond_to do |format|\n format.html { redirect_to post_reports_url, notice: 'Post report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize :report, :destroy?\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url, notice: 'Report was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @annual_summary_report.destroy\n respond_to do |format|\n format.html { redirect_to annual_summary_reports_url}\n format.json { head :no_content }\n end\n end", "def destroy\n @et_report.destroy\n respond_to do |format|\n format.html { redirect_to et_reports_url, notice: '削除が完了しました。' }\n format.json { head :no_content }\n end\n end", "def destroy\n @report_comment = ReportComment.find(params[:id])\n @report_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to(report_comments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @theft_report.destroy\n respond_to do |format|\n format.html { redirect_to theft_reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tbdotreport = Tbdotreport.find(params[:id])\n @tbdotreport.destroy\n\n respond_to do |format|\n format.html { redirect_to tbdotreports_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.71863943", "0.7172071", "0.7099058", "0.70983267", "0.7091251", "0.70906377", "0.70906377", "0.70906377", "0.7082701", "0.70794785", "0.7059974", "0.7059974", "0.70548797", "0.70184135", "0.70184135", "0.70184135", "0.70184135", "0.6989349", "0.6981774", "0.69305503", "0.69263595", "0.69229555", "0.6906391", "0.68926466", "0.6886422", "0.68710905", "0.6858288", "0.684485", "0.6843979", "0.6838565", "0.68300104", "0.6820299", "0.68103236", "0.6809167", "0.6809043", "0.68085504", "0.6800393", "0.67924416", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.6785244", "0.67823327", "0.67823327", "0.67796963", "0.6769765", "0.6756619", "0.6756619", "0.6742258", "0.67250097", "0.6716593", "0.67043936", "0.66800773", "0.6678745", "0.6678745", "0.6678735", "0.6677413", "0.6667563", "0.66657317", "0.66529435", "0.6652133", "0.6648546", "0.6645528", "0.6644684", "0.6643019", "0.6638609", "0.66294456", "0.6628176", "0.66228485", "0.6620698", "0.66191584", "0.66166514", "0.661632", "0.66135716", "0.6610404", "0.66020757", "0.66020757", "0.6600421", "0.6594195", "0.65937525", "0.65926164", "0.6589198", "0.65845895", "0.65841174", "0.6583946", "0.6582381", "0.65819144", "0.65736324" ]
0.7836252
0
Use callbacks to share common setup or constraints between actions.
def set_bugreport @bugreport = Bugreport.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def bugreport_params params.require(:bugreport).permit(:subject, :description, :userid, :employeeid) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
2. Metoda display_details() afiseaza numele si prenumele
def display_details() puts "Numele persoanei: #@nume" puts "Prenumele persoanei: #@prenume" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_details\n return @selected.details\n end", "def details\n end", "def details\n\n end", "def info_page_will_display_details\n if info_page_can_display_details && link.details_text_markup.to_s != ''\n true\n end\n end", "def details; end", "def show_details\n @selected.details\n end", "def display_details()\n puts \"Customer id is #{@id} \"\n puts \"Customer name is #{@name} \"\n puts \"Customer address is #{@address} \"\n end", "def show_detail(detail, no_html=false, options={})\n multiple = false\n show_diff = false\n no_details = false\n\n case detail.property\n when 'attr'\n field = detail.prop_key.to_s.gsub(/\\_id$/, \"\")\n label = l((\"field_\" + field).to_sym)\n case detail.prop_key\n when 'due_date', 'start_date'\n value = format_date(detail.value.to_date) if detail.value\n old_value = format_date(detail.old_value.to_date) if detail.old_value\n\n when 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',\n 'priority_id', 'category_id', 'fixed_version_id'\n value = find_name_by_reflection(field, detail.value)\n old_value = find_name_by_reflection(field, detail.old_value)\n\n when 'estimated_hours'\n value = l_hours_short(detail.value.to_f) unless detail.value.blank?\n old_value = l_hours_short(detail.old_value.to_f) unless detail.old_value.blank?\n\n when 'parent_id'\n label = l(:field_parent_issue)\n value = \"##{detail.value}\" unless detail.value.blank?\n old_value = \"##{detail.old_value}\" unless detail.old_value.blank?\n\n when 'is_private'\n value = l(detail.value == \"0\" ? :general_text_No : :general_text_Yes) unless detail.value.blank?\n old_value = l(detail.old_value == \"0\" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?\n\n when 'description'\n show_diff = true\n end\n when 'cf'\n custom_field = detail.custom_field\n if custom_field\n label = custom_field.name\n if custom_field.format.class.change_no_details\n no_details = true\n elsif custom_field.format.class.change_as_diff\n show_diff = true\n else\n multiple = custom_field.multiple?\n value = format_value(detail.value, custom_field) if detail.value\n old_value = format_value(detail.old_value, custom_field) if detail.old_value\n end\n end\n when 'attachment'\n label = l(:label_attachment)\n when 'relation'\n if detail.value && !detail.old_value\n rel_issue = Issue.visible.find_by_id(detail.value)\n value =\n if rel_issue.nil?\n \"#{l(:label_issue)} ##{detail.value}\"\n else\n (no_html ? rel_issue : link_to_issue(rel_issue, :only_path => options[:only_path]))\n end\n elsif detail.old_value && !detail.value\n rel_issue = Issue.visible.find_by_id(detail.old_value)\n old_value =\n if rel_issue.nil?\n \"#{l(:label_issue)} ##{detail.old_value}\"\n else\n (no_html ? rel_issue : link_to_issue(rel_issue, :only_path => options[:only_path]))\n end\n end\n relation_type = IssueRelation::TYPES[detail.prop_key]\n label = l(relation_type[:name]) if relation_type\n end\n call_hook(:helper_issues_show_detail_after_setting,\n {:detail => detail, :label => label, :value => value, :old_value => old_value })\n\n label ||= detail.prop_key\n value ||= detail.value\n old_value ||= detail.old_value\n\n unless no_html\n label = content_tag('strong', label)\n old_value = content_tag(\"i\", h(old_value)) if detail.old_value\n if detail.old_value && detail.value.blank? && detail.property != 'relation'\n old_value = content_tag(\"del\", old_value)\n end\n if detail.property == 'attachment' && value.present? &&\n atta = detail.journal.journalized.attachments.detect {|a| a.id == detail.prop_key.to_i}\n # Link to the attachment if it has not been removed\n value = link_to_attachment(atta, only_path: options[:only_path])\n if options[:only_path] != false\n value += ' '\n value += link_to_attachment atta, class: 'icon-only icon-download', title: l(:button_download), download: true\n end\n else\n value = content_tag(\"i\", h(value)) if value\n end\n end\n\n if no_details\n s = l(:text_journal_changed_no_detail, :label => label).html_safe\n elsif show_diff\n s = l(:text_journal_changed_no_detail, :label => label)\n unless no_html\n diff_link =\n link_to(\n 'diff',\n diff_journal_url(detail.journal_id, :detail_id => detail.id,\n :only_path => options[:only_path]),\n :title => l(:label_view_diff))\n s << \" (#{diff_link})\"\n end\n s.html_safe\n elsif detail.value.present?\n case detail.property\n when 'attr', 'cf'\n if detail.old_value.present?\n l(:text_journal_changed, :label => label, :old => old_value, :new => value).html_safe\n elsif multiple\n l(:text_journal_added, :label => label, :value => value).html_safe\n else\n l(:text_journal_set_to, :label => label, :value => value).html_safe\n end\n when 'attachment', 'relation'\n l(:text_journal_added, :label => label, :value => value).html_safe\n end\n else\n l(:text_journal_deleted, :label => label, :old => old_value).html_safe\n end\n end", "def display_details()\r\n\t\tprintf(\"\\n**************************************************\")\r\n\t\tprintf(\"\\n***** MONTHLY PAY SLIP DETAILS *****\")\r\n\t\tprintf(\"\\n**************************************************\")\r\n\t\tprintf(\"\\nEmployee Name : %s\",@name)\r\n\t\t# Amounts are depicted with 2 decimal places.\r\n\t\tprintf(\"\\nGross Monthly Salary : $ %.2f\",@grossMonthlyIncome)\r\n\t\tprintf(\"\\nMonthly Tax : $ %.2f\",@monthlyIncomeTax)\r\n\t\tprintf(\"\\nNet Monthly Salary : $ %.2f\",@netMonthlyIncome)\r\n\t\tprintf(\"\\n**************************************************\")\r\n end", "def details_for(**options)\n\t\t\t\t\toptions[:details]\n\t\t\t\tend", "def display_details()\n puts \"Customer id #@cust_id\"\n puts \"Customer name #@cust_name\"\n puts \"Customer address #@cust_addr\"\n end", "def display_details()\n puts \"Customer name: #@cust_name\"\n puts \"Customer ID: #@cust_id\"\n puts \"Customer address: #@cust_addr\"\n end", "def show_details\n print @name.upcase + \": #{@name} has #{@moons} moons and a diameter of #{@diameter} miles.\"\n print \"It is #{@color} in color and associated with the #{@zodiac} zodiac sign.\"\n puts \"#{@name} is #{@distance} miles from the sun and has a solar rotation of #{@rotation} earth days!\"\n end", "def display_details()\n\t\tputs \"------------------------------\"\n\t\tputs \"User Details\"\n\t\tputs \"#{@first_name} #{@surname} aged '#{@age}'\"\n\t\tputs \"------------------------------\"\n\tend", "def detail_for record, &block\n concat(render_default_css, block.binding) unless @_showhide_css_done\n div_for(record, 'detail_for', :style => 'display: none;', :class => 'detail', &block)\n @_showhide_css_done = true # prevents to print the CSS multiple times\n nil\n end", "def additional_details\n\n end", "def list_details\n puts \"Name: \" + @name\n puts \"Description: \" + @details\n puts \"Exercise Time: \" + @duration\n end", "def show\n @details = current_custom.details\n end", "def details=(_); end", "def print_details()\n\t$details.each {|k, v| puts \"#{k}: #{v}\"}\nend", "def details(*args); end", "def heading\n\t\t\"Details\"\n\tend", "def include_details?\n false\n end", "def set_show_detail\n @show_detail = true\n end", "def details\n @details ||= fetch_details\n end", "def details_on(show_state, field)\n answer = self.send(field.to_s) ? 'Yes' : 'No'\n if self.send(field.to_s) and show_state\n \"#{self.send(field.to_s + \"_details\")}\"\n elsif ! self.send(field.to_s) and ! show_state\n \"#{self.send(field.to_s + \"_details\")}\"\n else\n ''\n end\n end", "def details\n data()\n end", "def details\n data.details\n end", "def display\n puts \"Personal Details\"\n puts \" Name : #{self.name}\"\n puts \" Date of Birth : #{self.dob}\"\n puts \" Marital Status : #{self.marital_status}\"\n puts \" Mobile Number : #{self.mobile_number}\"\n puts \" Email : #{self.email}\"\n end", "def inspect_details\n ''\n end", "def display_info_detailed(locations,products)\n puts \"\\n=======STORE INFO===========\"\n puts \"Store ID: #{@id}\"\n puts \"Store Name: #{@name}\"\n puts \"Description: #{@description}\"\n puts \"Location List: #{@location_list}\"\n #Detailed Breakdown\n show_store_inventory(locations,products)\n end", "def show\n #debugger\n @photos = @listing.photos.order(\"order_priority ASC\")\n @main_photo = Photo.where(listing_id: @listing.id, main_photo: true).first\n if @main_photo \n @main_photo = @main_photo.image_url\n end\n\n @title = \"\"\n @title = \"#{@listing.street_number} \" if @listing.show_street_number\n @title = @title + \"#{@listing.address}, \"\n @title = @title + \"Unit #{@listing.unit_number}, \" unless @listing.unit_number.blank? || [email protected]_unit_number\n @title = @title + \"#{@listing.city_province}\"\n\n end", "def show_details(id_to_show_details_from_db)\n @db.query(\"SELECT * FROM products WHERE id = '#{id_to_show_details_from_db}'\", :symbolize_keys => true).first\n end", "def print_details\n puts \"\"\n puts \"#{@fullname}\"\n puts \"---------\" ' '\n puts \"Date of Birth:#{@dob}\"\n \n puts \"\"\n puts \"Email addresses:\"\n @emails.each do |e|\n puts \"- \" + e.to_s\n end \n \n puts \"\"\n puts \"Phone Numbers:\"\n @phone_numbers.each do |n|\n puts \"- \" + n.to_s\n end\n end", "def show_detail(n)\n puts \"Here's the detail for contact ID #{n}\"\n puts \"================================\"\n puts \"Name: #{Contact.find(n).name}\"\n puts \"Email: #{Contact.find(n).email}\"\n puts Contact.find(n).phone_hash.to_yaml\n puts \"================================\"\n end", "def details\n\n return @description + \"; \" + @firstname + \"; \" + @lastname + \": \" + @dob + \": \"+ @address + \": \"+ @phone + \": \" + \"#{@infection}\"\n\n end", "def show_info()\n\t\tputs \"ID: #{@@id}\"\n\t\tputs \"Name: #{@car_name}\"\n\t\tputs \"Make: #{@@make}\"\n\t\tputs \"Cost: #{calc_total_cost} INR\"\n\t\tputs\n\t\tputs \"Review: #{@review}\"\n\t\tputs \"Rating: #{@rating} stars\"\n\tend", "def display\n # Don't no why i thought i would need that. or if i need this.\n end", "def print_details\n puts \"#{self.reader.name} subscribed to #{self.magazine.title} for $#{self.price}\"\n end", "def get_infos\n #detail = Info.find_by_status(true).detail\n #if detail \n # return detail\n #else\n # return \"wating for updatting.....\"\n #end\n info = Info.random_to_show_info\n return info.detail\n\n end", "def details\n\t\t\"#{self.title} - #{self.due_date} - #{self.is_completed}\"\n\tend", "def record_display\n string = \"#{id}. Title: #{title}\\n Author: #{author}\\n ISBN: #{isbn}\\n\"\n if library.nil?\n string += \" Library: None\\n\"\n else\n string += \" Library: #{library.branch_name}\\n\"\n end\n if patron.nil?\n string += \" Checked Out: Available\"\n else\n string += \" Checked Out: #{patron.name}\"\n end\n string\n end", "def details\n\n return @description + \": \" + \"#{@infection}\" + \". \" + @patient.details\n\n end", "def details\n p '===== details ====='\n p \"Main TABLE: #{@main_t}\"\n p \"MAX_FREQUENCY_METRIX\"\n p @cache_mfx_table\n '===== details ====='\n end", "def displayed?; end", "def display_personal_info_and_disclaimer\n display_personal_information()\n display_disclaimer()\n end", "def print_details\n puts \"#{self.reader.name} subscribed to #{self.magazine.title} for $#{self.price}\"\n end", "def display\r\n end", "def details\n format_description(@description) + \"site name: \" + format_name\n end", "def render_details\n {data: self.data}\n end", "def current_details\n if approved_details\n approved_details\n elsif submitted_details\n submitted_details\n elsif quoted_details\n quoted_details\n else\n nil\n end\n end", "def details\n return \" #{@description}, #{@lastname}, #{@date}. #{@start}, #{@hours}, #{@players}, #{@zone}. #{@cost}\"\n end", "def show \r\n end", "def show\n details = get_details(params[:id])\n render_with_protection details\n end", "def details_uncached\n return description unless description.blank?\n unless undescribable?\n return \"#{I18n.t('admin.medium.local_info.no_title')}.ID#{id}\"\n end\n ''\n end", "def details\n return @description + \"; \" + @doctorname + \"; \" + @medicine + \": \" + \"#{@cost}\"\n end", "def summary_detail\n Classifieds::Listing.format_cols([@title, @mileage, @price], SUMMARY_COL_FORMATS)\n end", "def details=(value)\n @details = value\n end", "def details=(value)\n @details = value\n end", "def details=(value)\n @details = value\n end", "def details\n\n @design = Design.find(params['id'])\n\n render :partial => 'details'\n end", "def details\r\n return @description + \": \" + \". \" + @basic_profile.details\r\n end", "def show\n\t\t#no need b/c we just show all at once\n\tend", "def details str = nil\n return @details if str.nil?\n @details = str\n end", "def details\n\t\"#{assigned_to} - #{status} - #{start_date} - #{description} - #{location} - #{Client.find(client_id).name}\"\nend", "def fetch_details\n\t\tself.send(\"fetch_details_from_#{self.provider.downcase}\")\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def detail\n attributes.fetch(:detail)\n end", "def detail\n attributes.fetch(:detail)\n end", "def details\n find_customer\n render_mobile(:mobile_layout => \"mobile\")\n end", "def details\n return @details\n end", "def details\n return @details\n end", "def details\n return @details\n end", "def post_detail( post, field )\n d = \"data-field='details[#{field}]'\"\n k = \"<p>#{field.to_s.humanize}:</p>\"\n\n if post.new_record?\n value = \"Edit this\"\n else\n value = post.details.send :[], field\n end\n v = \"<p #{d} class='post-field input'>#{value}</p>\"\n\n \"<div class='detail'>#{k} #{v}</div>\".html_safe\n end", "def show\t\t\t\t\n\t\t\tend", "def display\n\t\t\"\"\n\tend", "def details(reload = false)\n return @details unless reload\n\n reload_details\n end", "def full_details\n @account = Account.find(params[:account_id])\n @subscription = @account.subscriptions.find(params[:id])\n @order = Order.find(@subscription.order_id)\n\n if @order.user_id\n @user = User.find(@order.user_id)\n end\n\n if @order.by_agent\n @agent = User.find(@order.by_agent)\n end\n\n if @order.price_plan_id\n @price_plan = Country.where(:\"price_plans._id\" => @order.price_plan_id).first.price_plans.find(@order.price_plan_id)\n end\n\n respond_to do |format|\n format.html {render(layout: 'management')}\n end\n end", "def details\n return @description + \"; \" + @firm + \"; \" + @age + \": \" + \"#{@cost}\"\n end", "def render_details\n {:path => url_helpers.frontend_screen_field_content_path(self.screen, self.field, self)}\n end", "def details\r\n return @description + \"; \" + @firm + \": \" + \"#{@cost}\"\r\n end", "def details\n #\"#{title} #{active} x: #{ x },q: #{ q },z: #{ z },r: #{ r },y: #{ y }\"\n \"#{title} #{active} , q: #{ q },z: #{ z },r: #{ r } \"\n end", "def show\n @summary = {}\n # cash flow info\n @summary[\"cash_flow_domestic\"] = domestic_cash_flow_info\n # sell info\n @summary[\"domestic\"] = domestic_sold_info\n @summary[\"offshore\"] = offshore_sold_info\n # by date\n @summary[\"auction\"] = auction_info\n @summary[\"custom\"] = custom_info\n @summary[\"shipment\"] = shipment_info\n # undeal\n @summary[\"undeal_product\"] = undeal_product_info\n @summary[\"undeal_auction\"] = undeal_auction_info\n @summary[\"undeal_custom\"] = undeal_custom_info\n @summary[\"shipment_status\"] = shipment_status_info\n render 'dashboard'\n end", "def details\n return \"#{@description} : #{@extra_cost}, #{@basic_booking.details}\"\n end", "def show\n #@detail = Detail.find(params[:id])\n @plan = Plan.find(params[:plan_id])\n @detail = @plan.details.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detail }\n end\n end", "def show\n @detail = @listing.details.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @detail }\n end\n end", "def listinfo\n puts \"排名:#{@no}\"\n puts \"月份:#{@month}\" if @month\n puts \"标签: #{@subtag}\" if @subtag\n puts \"标题:#{@title}\"\n puts \"集数:#{@episode}\" if @episode\n puts \"链接:#{@link}\"\n puts \"<bilibili独家哟!>\" if @bilibilionly_flag\n puts \"--------------------\"\n end", "def show\n render_response(\"detail\") do find_detail end\n end", "def damage_record_details\n render layout: nil\n end", "def html_details(summary, *content, id: nil, title: nil, **opt, &block)\n title ||= 'Click to show details' # TODO: I18n\n summary = html_tag(:summary, summary, id: id, title: title)\n content = html_div(*content, class: 'content', &block)\n html_tag(:details, opt) do\n summary << content\n end\n end", "def get_item_detail_info(detail_page)\n item_detail_info = {}\n \n #get detail info by approciate syn_fieldsetItem\n item_detail_info[:applicant] = get_applicant(detail_page)\n item_detail_info[:decision] = get_decision(detail_page)\n item_detail_info[:date] = get_date(detail_page)\n \n return item_detail_info\nend", "def get_item_detail_info(detail_page)\n item_detail_info = {}\n \n #get detail info by approciate syn_fieldsetItem\n item_detail_info[:applicant] = get_applicant(detail_page)\n item_detail_info[:decision] = get_decision(detail_page)\n item_detail_info[:date] = get_date(detail_page)\n \n return item_detail_info\nend", "def details\n @attributes[:details]\n end", "def handle_display(aff_id)\n @data.affiliate = Affiliate.with_id(aff_id)\n @data.list = list = @data.affiliate.paks_with_no_regions\n\n if list.empty?\n standard_page(\"Assign TeamPaks to Regions\", {}, NO_WORK_TO_DO)\n return\n end\n\n common_display(list, true)\n end", "def get_item_detail_info(detail_page)\n\n item_detail_info = {}\n #get detail info by approciate syn_fieldsetItem\n item_detail_info[:info_group] = get_info_group(detail_page)\n item_detail_info[:people] = get_people(detail_page)\n item_detail_info[:property] = get_property(detail_page)\n item_detail_info[:fee] = get_fee(detail_page)\n item_detail_info[:decision] = get_decision(detail_page)\n return item_detail_info\n\nend", "def get_item_detail_info(detail_page)\n\n item_detail_info = {}\n #get detail info by approciate syn_fieldsetItem\n item_detail_info[:info_group] = get_info_group(detail_page)\n item_detail_info[:people] = get_people(detail_page)\n item_detail_info[:property] = get_property(detail_page)\n item_detail_info[:fee] = get_fee(detail_page)\n item_detail_info[:decision] = get_decision(detail_page)\n return item_detail_info\n\nend" ]
[ "0.7489983", "0.74136686", "0.7353853", "0.7159857", "0.7116823", "0.7020158", "0.7009326", "0.697416", "0.6950837", "0.6901627", "0.68921447", "0.6859523", "0.68557215", "0.68552256", "0.67985594", "0.67267156", "0.6706501", "0.67044353", "0.6667234", "0.66666734", "0.66616154", "0.6638753", "0.66246617", "0.6622704", "0.660833", "0.66033477", "0.6528791", "0.6509353", "0.6478125", "0.6444217", "0.64345664", "0.64009243", "0.63793755", "0.63710296", "0.63669133", "0.635133", "0.6345642", "0.6339778", "0.63167346", "0.62743366", "0.6271191", "0.6269992", "0.62695897", "0.6266788", "0.6266678", "0.6241079", "0.62361616", "0.6228676", "0.6224864", "0.62232363", "0.62206614", "0.62180066", "0.62117255", "0.62016326", "0.6175701", "0.61542165", "0.6149738", "0.6141568", "0.6141568", "0.6141568", "0.61346996", "0.61322355", "0.6129267", "0.612406", "0.6119959", "0.61059994", "0.60989606", "0.60989606", "0.60989606", "0.60989606", "0.60896534", "0.60896534", "0.6085568", "0.60848826", "0.60848826", "0.60848826", "0.6076311", "0.6071089", "0.60690564", "0.60627747", "0.6061098", "0.6057041", "0.6054625", "0.6053939", "0.60521823", "0.6039686", "0.6037568", "0.60336876", "0.60301507", "0.602505", "0.60218847", "0.60214704", "0.6021338", "0.60191387", "0.60191387", "0.60118735", "0.6008619", "0.6008403", "0.6008403" ]
0.7535434
1
DELETE LIST NOT WORKING
def destroy @list = current_user.lists.find(list_params) @list.destroy flash[:success] = "List deleted" redirect_to current_user end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove list\n list_action list, \"remove\"\n end", "def delete_list(id)\n query(\"DELETE FROM todos WHERE list_id = $1\", id)\n query(\"DELETE FROM lists WHERE id = $1\", id)\n end", "def delete_list(list)\n @lists[list.title].delete(list.title)\n end", "def delete_list(params={})\n @obj.delete('delete', @auth.merge(params))\n end", "def delete_item(rmstr,list)\n list.delete(rmstr)\n list\nend", "def destroy_multiple\n\t @list.delete(params[:id])\n\t redirect_to '/tasks'\n\tend", "def delete_item(list_item)\n @list.delete(list_item)\n @list\n end", "def delete(v)\n\n\tif List.all[v.to_i - 1] == nil\n\n\n\t# id = List.all[v.to_i - 1][:id]\n\n # list_of_ids = []\n\n # List.all.each do |idv|\n\t # list_of_ids << idv.id\n # end\n\n # if (list_of_ids.include?id) == false \n\n # target_id = List.where(id: id)\n\n # if target_id.count == 0\n\n\n clear_screen\n 20.times do blank_line \n end \n \tputs \"Sorry man, there is no such id/person! Did you remember correctly? Please try again..\".center(180)\n blank_line\n puts \"Your list still looks like this! Woohoo!\".center(180)\n sleep(3)\n clear_screen\n normal_list\n blank_line\n else\n id = List.all[v.to_i - 1][:id]\n\n target_person = List.find(id)\n\ttarget_person.destroy\n\n \t# list_of_people = List.where(id: id)\n \t# target = list_of_people[0]\n \t# target.destroy\n \n clear_screen\n 20.times do blank_line \n end \n \tputs \"Muahahhahaahha!! AHHAHA! We've found that person and BLOWN that person up!\".center(180)\n \tblank_line\n \tputs \"THIS IS YOUR UPDATED CONTACT LIST WITH THAT PERSON DEAD! MUAHAHAHHAHA!\".center(180)\n \tsleep(3)\n \tclear_screen\n \tnormal_list\n \tblank_line\n end \nend", "def delete_list(user, list)\n delete(\"/#{user}/lists/#{list}.json\")\n end", "def remove_item(name, list)\n list.delete(name)\n p list\n return list\nend", "def delete(list_id)\n Iterable.request(conf, \"/lists/#{list_id}\").delete\n end", "def destroy\n authorize @list\n @list.destroy\n head :no_content\n end", "def remove(list, item_name)\r\n\tlist.delete(item_name)\r\n\tp list\r\nend", "def delete_item_from_list(list, food)\n list.delete(food)\n list\nend", "def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end", "def delete(item, list)\n\tlist.delete(item)\nend", "def list_remover(list,item) #takes 2 arguments, 1 list and name of an item\n\tlist.delete(item)\t\n\t\nend", "def delete_item(list, item)\n del_list = list.delete(item)\nend", "def remove_from_list_resource\n manage_list_resource(:remove)\n end", "def remove(list,item)\r\n\tlist.delete(item)\r\n\tlist\r\nend", "def remove_from_list(list, item)\n list.delete(item)\n p list\nend", "def delete_item(list,item)\n list.delete(item)\n list\nend", "def delete_item(list,item)\n list.delete(item)\n list\nend", "def remove_item(item, list)\r\n list.delete(item)\r\n p list\r\n list\r\nend", "def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end", "def destroy\n @list_id = @item.list.id\n @item.destroy\n @items = List.find(@list_id).items.order(\"id ASC\")\n end", "def remove(list, item)\r\n list.delete(item)\r\n list\r\nend", "def delete_item(list, item)\n\tdel_list = list.delete(item)\nend", "def delete_item(list, item)\n\tlist.delete(item)\n\tlist\nend", "def delete_list(name)\n output \"You sure you want to delete everything in #{yellow(name)}? (y/n):\"\n if $stdin.gets.chomp == 'y'\n List.delete(name)\n output \"#{cyan(\"Boom!\")} Deleted all your #{yellow(name)}.\"\n save\n else\n output \"Just kidding then.\"\n end\n end", "def remove(list, food_item)\n\tlist.delete(food_item)\n\tlist\nend", "def destroy\n @list_item.destroy\n\n head :no_content\n end", "def delete_item(list, item)\n list.delete(item)\n list\nend", "def delete_item(list, item)\n list.delete(item)\n list\nend", "def destroy\n @list = List.find(params[:id])\n if current_list? @list\n set_current_list nil\n end\n @list.destroy\n flash[:notice] = 'Lista removida com sucesso!'\n redirect_to(new_list_path)\n end", "def delete_item(list,item)\n list.delete(item)\n return list\nend", "def remove_item(list, item_name)\r\n list.delete(item_name)\r\n list\r\nend", "def deletelist\n if @head == nil\n puts \"List deleted\"\n end\n\n tmp = @head\n while(@head != nil)\n tmp = tmp.next\n @head.next = nil\n @head = tmp\n end\n end", "def remove_item (item,list)\nlist.delete(item)\nlist\nend", "def delete_todo_from_list(list_id, todo_id)\n sql = \"DELETE FROM todos WHERE id = $1 AND list_id = $2\"\n query(sql, todo_id, list_id)\n end", "def remove_item(list, item)\r\n list.delete(item)\r\n p list\r\nend", "def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend", "def delete_item(current_list, item)\n current_list.delete(item)\n current_list\nend", "def remove_item(list,item)\r\n\r\n list.delete(item)\r\n list\r\nend", "def delete_list\n logger.debug(params[:deleteIdList])\n\n if params[:deleteIdList].present?\n # 一括削除実行\n Kokyaku.update_all(\"\\\"delFlg\\\"=1, \\\"koshinshaId\\\"=\" + params[:koshinshaId], \"\\\"kokyakuId\\\" IN (\" + params[:deleteIdList] + \")\")\n end\n\n respond_to do |format|\n format.html { redirect_to action: \"index\", notice: 'Kokyaku was successfully bulk logical deleted.', reload: 'on' }\n format.json { head :no_content }\n end\n end", "def rem_list(item_name, item_list)\n item_list.delete(item_name)\n puts \"You just removed #{item_name} from the list.\"\nend", "def remove_item(list,item)\n list.delete(item)\n p list\nend", "def remove_from_list(item,list)\n list.delete(item)\nend", "def delete_list(nonce_list)\n _resetCount()\n runMbxTransaction(@hpk, 'delete list') do\n nonce_list.each do |nonce|\n rds.del msg_tag nonce\n rds.hdel hpk_tag, nonce\n logger.info \"#{INFO} deleting #{dumpHex b64dec nonce} in mbx #{dumpHex b64dec @hpk}\"\n end\n end\n end", "def remove_item_from_list(list,item)\r\n list.delete(item)\r\n print_list(list)\r\nend", "def destroy\n @list.destroy\n redirect_via_turbolinks_to lists_path\n end", "def del_item(list, item_to_del)\n list.delete(item_to_del)\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def delete_item(list,item)\n list.delete(item)\nend", "def delete_item(list,item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(list, item_name)\n list.delete(item_name)\n list\nend", "def delete_item(list,item)\n\tlist.delete(item)\nend", "def destroy\n begin\n @task_list = @active_project.task_lists.find(params[:id])\n rescue\n return error_status(true, :invalid_task_list)\n end\n \n authorize! :delete, @task_list\n\n @on_page = (params[:on_page] || '').to_i == 1\n @removed_id = @task_list.id\n @task_list.updated_by = @logged_user\n @task_list.destroy\n\n respond_to do |format|\n format.html {\n error_status(false, :success_deleted_task_list)\n redirect_to(task_lists_url)\n }\n format.js { index_lists(@logged_user.member_of_owner?) }\n format.xml { head :ok }\n end\n end", "def remove_item(list_item,user_list)\n user_list.delete(list_item)\n user_list\nend", "def delete_item(list, item)\n\tlist.delete(item)\n\treturn list\nend", "def remove(list, item_name)\n\tlist.delete(item_name)\nend", "def delete\n DB.exec(\"DELETE FROM stylists WHERE id = #{self.id};\")\n end", "def remove(list, item)\n\tlist.delete(item)\n\tlist\nend", "def destroy\n list = List.find(params[:list_id])\n list.destroy\n \n redirect_to '/liverpool/index'\n end", "def delete\n \n end", "def destroy\n listentries = List.find(:all,:conditions => \"list_cat_id = #{params[:id]}\")\n for listentry in listentries \n listentry.destroy\n end\n @list_cat = ListCat.find(params[:id])\n @list_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => 'lists') }\n format.xml { head :ok }\n end\n end", "def remove_item(item)\n $grocery_list.delete(item)\n # puts \"List with #{item} deleted\"\n $grocery_list\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tp list\nend", "def items_list_deletion(tasks_to_delete_list,log_file)\n tasks_to_delete_list.each do |task|\n copy_to_log_file(log_file,\"Task deletion\",to_do_list:to_do_list,id:task)\n remove_an_item(task)\n print_out_all_items\n end\n end", "def remove_item(list, name)\n list.delete(normalize_string(name))\n return list\nend", "def delete_list\n logger.debug(params[:deleteIdList])\n\n if params[:deleteIdList].present?\n # 一括削除実行\n KonyuRireki.update_all(\"\\\"delFlg\\\"=1, \\\"koshinshaId\\\"=\" + params[:koshinshaId], \"\\\"id\\\" IN (\" + params[:deleteIdList] + \")\")\n end\n\n respond_to do |format|\n format.html { redirect_to action: \"index\", notice: 'KonyuRireki was successfully bulk logical deleted.', reload: 'on' }\n format.json { head :no_content }\n end\n end", "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n # Obtain selected saved list\n @saved_list = SavedList.find(params[:id])\n @saved_list_users = SavedListUser.where(\"saved_list_id = ?\", @saved_list.id)\n\n # Destroy user saved list entries for all users in list\n @saved_list_users.each do |saved_list_user|\n saved_list_user.destroy\n end\n\n # Destroy saved list\n @saved_list.destroy\n\n respond_to do |format|\n format.html {\n redirect_to :action => 'index'\n flash[:notice] ='Saved list was successfully deleted.'\n }\n format.json { head :no_content }\n end\n end", "def destroy\n\n # Obtain selected saved list\n @saved_list = SavedList.find(params[:id])\n @saved_list_users = SavedListUser.where(\"saved_list_id = ?\", @saved_list.id)\n\n # Destroy user saved list entries for all users in list\n @saved_list_users.each do |saved_list_user|\n saved_list_user.destroy\n end\n\n # Destroy saved list\n @saved_list.destroy\n\n respond_to do |format|\n format.html {\n redirect_to :action => 'index'\n flash[:notice] ='Saved list was successfully deleted.'\n }\n format.json { head :no_content }\n end\n end", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(new_list, item_name)\r\n new_list.delete(item_name)\r\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove(grocery_list, food)\n\tgrocery_list.delete(food)\nend", "def destroy\n @task_list.destroy\n\n head :no_content\n end", "def delete_item(list_name,name)\n if storage.list_exists?(list_name)\n list = List.find(list_name)\n if list.delete_item(name)\n output \"#{cyan(\"Boom!\")} #{yellow(name)} is gone forever.\"\n save\n else\n output \"#{yellow(name)} #{red(\"not found in\")} #{yellow(list_name)}\"\n end\n else\n output \"We couldn't find that list.\"\n end\n end", "def destroy\n @bulk_insert_list.destroy\n respond_to do |format|\n format.html { redirect_to bulk_insert_lists_url, notice: 'Bulk insert list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_item(list, item)\n list.delete(item)\nend", "def remove_item(list,item)\n\tlist.delete(item)\n\tp list\nend", "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end", "def remove list\n remove = @watch.objects.find { |obj| obj.name == \"remove\" }\n\n obix = OBIX::Builder.new do |obix|\n obix.obj is: \"obix:WatchIn\" do |obix|\n obix.list name: \"hrefs\" do |obix|\n list.each do |item|\n obix.uri val: item\n end\n end\n end\n end\n\n remove.invoke obix.object\n end", "def delete_movie_from_list(arg)\n puts \"You've removed #{arg.title} from your list.\"\n arg.destroy\n main_menu_options\n end", "def remove (list, item)\n\tlist.delete(item)\nend", "def del\n delete\n end" ]
[ "0.77334905", "0.76464516", "0.75257987", "0.74470896", "0.726799", "0.7262673", "0.7243866", "0.7214567", "0.7209067", "0.7171147", "0.7165363", "0.71645653", "0.7159874", "0.7130478", "0.7130099", "0.7126456", "0.71031576", "0.7101522", "0.7094816", "0.7075567", "0.707212", "0.70547205", "0.70547205", "0.7048482", "0.7029842", "0.70100385", "0.700881", "0.7008338", "0.7008107", "0.6999841", "0.6997496", "0.6995556", "0.699445", "0.699445", "0.69935477", "0.6966958", "0.6963418", "0.6960528", "0.69310856", "0.69296384", "0.69263196", "0.692221", "0.69148594", "0.6908382", "0.6901644", "0.6884734", "0.68664485", "0.68542105", "0.68321455", "0.6830612", "0.68244916", "0.68216187", "0.68210125", "0.682096", "0.682096", "0.6819818", "0.6819818", "0.6818959", "0.68184465", "0.68139195", "0.6808383", "0.6799512", "0.6799398", "0.67956424", "0.6785305", "0.6778713", "0.67659146", "0.6765317", "0.67652786", "0.67534274", "0.6750078", "0.6750078", "0.6750078", "0.67500305", "0.6746243", "0.67456096", "0.6744272", "0.6739411", "0.6739411", "0.6739411", "0.6730587", "0.6730587", "0.67274725", "0.67259115", "0.6725063", "0.6725063", "0.67239857", "0.67233145", "0.67088604", "0.6707318", "0.67022765", "0.66821146", "0.66811913", "0.66811913", "0.66811913", "0.66793084", "0.6678061", "0.6676125", "0.6675719", "0.6672943" ]
0.6701252
91
Initilizes an instance of the class with default settings Loads defaults from Yolo::Config::Settings
def initialize self.server = Yolo::Config::Settings.instance.mail_host self.from = Yolo::Config::Settings.instance.mail_from self.port = Yolo::Config::Settings.instance.mail_port self.account = Yolo::Config::Settings.instance.mail_account self.password = Yolo::Config::Settings.instance.mail_password @error_formatter = Yolo::Formatters::ErrorFormatter.new @progress_formatter = Yolo::Formatters::ProgressFormatter.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(settings = {})\n settings = self.class.defaults.merge(settings)\n settings.each do |key, value|\n set key, value\n end\n end", "def initialize settings\n self.settings = settings\n end", "def initialize\n @main = {}\n @config_directory = File.expand_path \"~/.config/next_background\"\n @file = \"#{@config_directory}/config.yaml\"\n self.load\n end", "def initialize\n set_config\n end", "def init_settings\n s = Biopsy::Settings.instance\n s.set_defaults\n libdir = File.dirname(__FILE__)\n s.target_dir = [File.join(libdir, 'assemblotron/assemblers/')]\n s.objectives_dir = [File.join(libdir, 'assemblotron/objectives/')]\n @log.debug \"initialised Biopsy settings\"\n end", "def initialize\n set_defaults\n end", "def initialize\n set_defaults\n end", "def initialize\n create_config unless File.exists?(config_file)\n load_settings\n set_domain\n end", "def initialize\n configure_via_yaml\n configure_via_env\n end", "def initialize settings\n self.settings = settings\n end", "def initialize(defaults = {}, config = {}, options = {})\n setup!(defaults, config, options)\n end", "def initialize\n\t\tpath = Pathname.new(File.dirname(__FILE__) + \"/../Preferences.yml\")\n\t\tdata = YAML.load_file(path)\n\t\t@menuAssets = MenuAssets.getInstance()\n\t\t@language = data[\"language\"]\n\t\t@resolution = data[\"resolution\"]\n\t\t@color = data[\"color\"]\n\t\t@clueHighlightColor = data[\"clueHighlightColor\"]\n\t\t@helpColor = data[\"helpColor\"]\n\tend", "def initialize(settings)\n @settings = settings\n end", "def initialize settings\n super\n end", "def set_defaults!\n __load_config( DEFAULTS )\n end", "def initialize\n define_os\n define_path\n read_settings\n end", "def setup(settings = {})\n @config = defaults.merge(settings)\n end", "def initialize(options = { })\n @options = DEFAULT_OPTIONS.merge(options)\n \n load_config\n end", "def initialize( settings={} )\n\t\tsuper()\n\n\t\t@settings = settings\n\t\t@overridden_settings = {}\n\tend", "def load()\n\n # Get the project root directory\n @root_dir = locate_root\n\n if File.file? File.join(@root_dir, SETTINGS_FILE)\n settings = YAML.load_file File.join(@root_dir, SETTINGS_FILE)\n @targets = settings[:targets]\n @src = settings[:src]\n @notify = settings[:notify]\n else\n puts \"No settings file found, creating one now\"\n # Settings file doesn't exist\n # Create it\n @targets = {}\n @active_target = nil\n @src = './src'\n @notify = true\n\n dump_settings\n end\n\n # Set the default target\n @targets.values.each do |target|\n # Check if this one is active\n if target.active == true\n # Set it if there is no default target set yet\n if @active_target == nil\n @active_target = target\n else\n puts \"Two active targets set. Using #{@active_target.print}\"\n end\n end\n end\n end", "def load()\n\n # Get the project root directory\n @root_dir = locate_root\n\n if File.file? File.join(@root_dir, SETTINGS_FILE)\n settings = YAML.load_file File.join(@root_dir, SETTINGS_FILE)\n @targets = settings[:targets]\n @src = settings[:src]\n @notify = settings[:notify]\n else\n puts \"No settings file found, creating one now\"\n # Settings file doesn't exist\n # Create it\n @targets = {}\n @active_target = nil\n @src = './src'\n @notify = true\n\n dump_settings\n end\n\n # Set the default target\n @targets.values.each do |target|\n # Check if this one is active\n if target.active == true\n # Set it if there is no default target set yet\n if @active_target == nil\n @active_target = target\n else\n puts \"Two active targets set. Using #{@active_target.print}\"\n end\n end\n end\n end", "def initialize\n @mutex = Mutex.new\n @config_hash = {}\n set_defaults\n end", "def initialize()\n @config = YAML.load_file('config.yaml')\n @puppetdb = @config['puppetdb']\n @servicenow = @config['servicenoe']\n @syslog = @config['syslog']\n end", "def init\n Config.load_yaml\n Log.init\n reset\n end", "def initialize\n @config = config_from_file || empty_config\n end", "def initialize(options = {})\n @settings = options\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize\n @settings = Hash.new\n end", "def initialize(config = nil)\n self.config = config || Cartage::Config.load(:default)\n end", "def initialize\n super\n Souffle::Config.merge!(config)\n end", "def initialize\n self.url = Yolo::Config::Settings.instance.deploy_url\n end", "def load_settings\n yamloptions = {}\n prop_options = {}\n #p @settings_filename\n yamloptions = YAML::load_file(@settings_filename) if File.exist?( @settings_filename )\n prop_options = yamloptions if yamloptions.class == Hash\n @settings_default.each do |k,v|\n if prop_options[k] != nil\n # use settings from yaml\n @app_settings[k] = prop_options[k]\n else\n # use default settings\n @app_settings[k] = v\n end\n end\n #p self.app_settings\n @playfor_classment = @app_settings[:playfor_classment]\n @login_name = @app_settings[:login]\n @server_ip = @app_settings[:server_ip]\n @server_port = @app_settings[:server_port]\n @password_login_md5 = Base64::encode64(@app_settings[:password])\n #select_engine(@app_settings[:engine])\n @supported_games = []\n supp_games = @app_settings[:engine]\n supp_games.each{|e| add_support_engine(e)}\n end", "def initialize(*args)\n @options = Hash.new\n @config = Hash.new\n \n # Set the banner\n @banner = self.class.banner\n \n # Dupe the class options for this instance\n klass_options = self.class.options\n klass_options.keys.inject(@options) { |memo, key| memo[key] = klass_options[key].dup; memo }\n \n # Set the default configuration values for this instance\n @options.each do |config_key, config_opts|\n config_opts[:on] ||= :on\n config_opts[:boolean] ||= false\n config_opts[:required] ||= false\n config_opts[:proc] ||= nil\n config_opts[:show_options] ||= false\n config_opts[:exit] ||= nil\n \n if config_opts.has_key?(:default)\n @config[config_key] = config_opts[:default]\n end\n end\n \n super(*args)\n end", "def initialize settings = {}\n @settings = DEFAULT_SETTINGS.merge settings\n @scale = @settings.get :scale\n @rotation = @settings.get :rotation\n @has_solids_manager = [email protected](:has_solids_manager)\n @solids_manager = SolidsManager.new if (has_solids_manager?)\n super @settings #.get.reject { |key,val| next key == :assign_to }\n end", "def initialize\n @data = default_data!(load_yml_data)\n # Order is important. @browserstack relies on @proxy being set\n @proxy = ::Quke::ProxyConfiguration.new(@data[\"proxy\"] || {})\n @browserstack = ::Quke::BrowserstackConfiguration.new(self)\n end", "def initialize\n config.base_uri = Config::BASE_URI\n config.user_agent = Config::USER_AGENT\n config.extend(Config)\n end", "def initialize(settings={})\n\t\tdefaults = {\n\t\t\t:location => \"localhost\",\n\t\t\t:port => nil,\n\t\t\t:instance_name => nil,\n\t\t\t:database => nil,\n\t\t\t:domain => nil,\n\t\t\t:user => nil,\n\t\t\t:pass => nil,\n\t\t}\n\t\tsettings = defaults.merge(settings)\n\t\t@location = settings[:location]\n\t\t@port = settings[:port]\n\t\t@instance_name = settings[:instance_name]\n\t\t@database = settings[:database]\n\t\t@domain = settings[:domain]\n\t\t@user = settings[:user]\n\t\t@pass = settings[:pass]\n\tend", "def initialize\n @config = DEFAULT_CONFIG.deep_dup\n end", "def initialize(config_yml=\"\")\n yml = YAML.load config_yml rescue nil\n @config = yml || {}\n @default_ttl = @config[\"default_ttl\"] ? convert_time(@config[\"default_ttl\"]) : 60\n @config.delete \"default_ttl\"\n setup_action_caching\n end", "def initialize(options)\n @config = Config.new(options)\n end", "def initialize(config=nil)\n super()\n read_config(config) if !config.nil?\n end", "def initialize(config=nil)\n super()\n read_config(config) if !config.nil?\n end", "def initialize settings = {}\n @settings = DEFAULT_SETTINGS.merge settings\n @z_index = @settings.get :z_index\n @image_options = get_image_options_from @settings\n @image = get_image_from @settings.get(:file) unless (@settings.get(:dont_create_image))\n super @settings\n end", "def initialize(*args)\n super\n @game = Game.new\n\n @changelog = self.load_changelog\n\n @mods = config[:mods]\n @channel_name = config[:channel]\n @settings_file = config[:settings]\n @games_dir = config[:games_dir]\n\n @idle_timer_length = config[:allowed_idle]\n @invite_timer_length = config[:invite_reset]\n\n @idle_timer = self.start_idle_timer\n\n @game_timer_minutes = nil\n @game_timer = nil\n end", "def initialize(config_yaml = File.join(File.expand_path(\"~\"), \".rest_connection\", \"rest_api_config.yaml\"))\n @@logger = nil\n etc_config = File.join(\"#{File::SEPARATOR}etc\", \"rest_connection\", \"rest_api_config.yaml\")\n if File.exists?(config_yaml)\n @settings = YAML::load(IO.read(config_yaml))\n elsif File.exists?(etc_config)\n @settings = YAML::load(IO.read(etc_config))\n else\n logger(\"\\nWARNING: you must setup config file rest_api_config.yaml in #{config_yaml} or #{etc_config}\")\n logger(\"WARNING: see GEM_HOME/rest_connection/config/rest_api_config.yaml for example config\")\n @settings = {}\n end\n @settings[:extension] = \".js\"\n @settings[:api_href] = @settings[:api_url] unless @settings[:api_href]\n end", "def init!\n @defaults = {\n :@refresh_token => ShakeTheCounter::Config.refresh_token,\n :@id => ShakeTheCounter::Config.client_id,\n :@secret => ShakeTheCounter::Config.client_secret,\n :@language_code => ShakeTheCounter::Config.language_code,\n }\n end", "def initialize\n @options = defaults\n end", "def initialize\n @options = defaults\n end", "def initialize(settings)\n\n @settings = settings\n return if @settings.wikipedia_host.empty?\n\n # Client configuration\n Wikipedia.Configure {\n domain settings.wikipedia_host\n path 'w/api.php'\n }\n\n end", "def new(**settings)\n __new_without_defaults__(\n **default_settings.merge(settings)\n )\n end", "def initialize(config = nil)\n @config = config\n setup\n end", "def initialize\n configure_trello\n end", "def initialize(config = {})\n super\n original_initialize(config)\n end", "def initialize(config)\n\t\tend", "def initialize(*args)\n initialize_config unless instance_variable_defined?(:@config)\n super\n end", "def init_default_settings!\n self.class.default_settings.dup.each do |var, vals|\n setting_objects.detect { |s| s.var == var.to_s } || setting_objects.create(var: var.to_s, value: vals, target: self)\n end\n end", "def init\n # Guard against doing this more than once.\n unless @config.nil?\n return\n end\n\n if Config.config_files.nil?\n raise \"No configuration file provided, set LapisLazuli::WorldModule::Config.config_files\"\n end\n\n load_config(Config.config_files)\n # In case there was no config file found an empty @config needs to be set to prevent infinite looping.\n if @config.nil?\n warn 'Unable to find a configuration file, defaulting to empty config.yml.'\n @config = {}\n end\n\n @metadata = Runtime.instance.set_if(self, :metadata) do\n log.debug \"Creating metadata storage\"\n Storage.new(\"metadata\")\n end\n end", "def initialize\n self.reset\n\n if File.exist? SETTING_FILE\n\n # Sometimes on the _development_ environment\n # the settings file gets corrupted...\n # Well, that's a shame!\n begin\n @values = YAML::load_file SETTING_FILE\n rescue\n self.reset\n end\n\n # Strange error that sometimes appear\n # (@values becomes `false`)\n if not @values.class == Hash\n self.reset\n end\n end\n self.save\n end", "def initialize()\n @config_file=\"projects.yml\"\n @config = YAML.load_file(@config_file)\n end", "def initialize(&block)\n load_defaults!\n\n instance_eval(&block)\n end", "def initialize(opts = {})\n\n # Defaults\n path = File.expand_path(\".\").to_s\n nick = opts[:nick] || config[:nick] || \"kirby-dev\"\n\n @config ||= {\n :svns => \"#{path}/#{nick}.svns\",\n :atoms => \"#{path}/#{nick}.atoms\",\n :pidfile => \"#{path}/#{nick}.pid\",\n :nick => nick,\n :channel => 'kirby-dev',\n :server => \"irc.freenode.org\",\n :delicious_user => nil,\n :delicious_pass => nil,\n :silent => false,\n :log => false,\n :logfile => \"#{path}/#{nick}.log\",\n :time_format => '%Y/%m/%d %H:%M:%S',\n :debug => false\n }\n \n # Nicely merge current options\n opts.each do |key, value|\n config[key] = value if value\n end\n end", "def initialize(...)\n super()\n configure(...)\n end", "def initialize(config = {})\n super\n @config = config\n end", "def load_defaults\n @main[:link_file] = File.expand_path \"~/Pictures/single\"\n @main[:directory] = File.expand_path \"~/Pictures\"\n @main[:mask] = \"**/*\"\n @main[:cache_dir] = File.expand_path \"~/.cache/\"\n @main[:cache_file] = File.expand_path \"~/.cache/next_background/cache.yaml\"\n @main[:timeout] = 10\n self.save\n end", "def initialize(config = {})\n super config\n end", "def initialize(config = {})\n @config = config\n end", "def load_settings\n @settings ||= Course::LeaderboardSettings.new(current_course.settings(:leaderboard))\n end", "def initialize(file = nil)\n @file_name = file ? file : File.join(Dir.home, '.dodona.yml')\n @config = if !File.exist? file_name\n {}\n else\n YAML.load_file file_name\n end\n @config = DEFAULTS.merge(@config)\n end", "def load_default_config\n self[:disable_html] ||= true\n self[:url_target] ||= \"_BLANK\"\n self[:image_alt] ||= \"Posted Image\"\n self[:table_width] ||= \"100%\"\n self[:syntax_highlighter] ||= :raw\n self[:coderay_options] ||= {}\n end", "def initializeDefaultParams()\n @fcName = nil # Flowcell name\n @baseCallsDir = nil # BaseCalls dir of the flowcell\n @useBasesMask = nil # Custom value to provide to BCL->FastQ convertor\n @sampleSheet = nil # Path to SampleSheet.csv\n\n yamlConfigFile = PathInfo::CONFIG_DIR + \"/config_params.yml\" \n @configReader = YAML.load_file(yamlConfigFile)\n @queue = SchedulerInfo::CASAVA_QUEUE # The processing queue on the cluster\n end", "def initialize\n set_root_path!\n \n self.frameworks = default_frameworks\n self.autoload_paths = default_autoload_paths\n self.autoload_once_paths = default_autoload_once_paths\n self.dependency_loading = default_dependency_loading\n self.eager_load_paths = default_eager_load_paths\n self.log_path = default_log_path\n self.log_level = default_log_level\n self.binder_paths = default_binder_paths\n self.marshal_path = default_marshal_path\n self.cache_classes = default_cache_classes\n self.whiny_nils = default_whiny_nils\n self.database_configuration_file = default_database_configuration_file\n self.app_config_file = default_app_config_file\n self.plugin_glob = default_plugin_glob\n self.helper_glob = default_helper_glob\n self.initializer_glob = default_initalizer_glob\n self.first_run_glob = default_first_run_glob\n self.publisher = default_publisher\n self.copyright = default_copyright\n \n for framework in default_frameworks\n self.send(\"#{framework}=\", Bowline::OrderedOptions.new)\n end\n end", "def initialize(defaults,cmd_opts)\n @fields = defaults\n if !cmd_opts[:config_file].nil?\n path = cmd_opts[:config_file]\n else\n path = defaults[:config_file]\n end\n data = YAML.load_file(path)\n # Now combine data:\n # defaults, config file, command line (low->high priority)\n data.each do |k,v|\n if EXPECTED.include? k.to_sym\n @fields[k.to_sym] = v\n else\n STDERR.puts \"Warning: unknown section '#{k}' in config file\"\n end\n end\n cmd_opts.each do |k,v|\n @fields[k] = v\n end\n end", "def initialize(config)\n end", "def initialize(config)\n end", "def load_config!\n if options[:config]\n config_inst = Config.new(options[:config])\n elsif self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES)\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = Config.new(path) if path\n end\n if config_inst\n options.delete(:config)\n defaults_inst = Smash[\n config_class.new(\n defaults.to_smash\n ).to_smash.find_all do |key, value|\n defaults.key?(key)\n end\n ]\n config_data = config_inst.data\n config_inst = Smash[\n config_inst.to_smash.find_all do |key, value|\n config_data.key?(key)\n end\n ]\n options_inst = Smash[\n config_class.new(\n options.to_smash\n ).to_smash.find_all do |key, value|\n options.key?(key)\n end\n ]\n @options = config_class.new(\n defaults_inst.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options_inst.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def initialize(settings={})\n settings.each do |k,v|\n __send__(\"#{k}=\", v)\n end\n end", "def initialize(config={})\n @config = config\n end", "def set_defaults\n self.main_image ||= Placeholder.image_generator(height: 600, width: 400) # go to concern folder\n self.thumb_image ||= Placeholder.image_generator(height: 350, width: 200) # go to concern folder\n end", "def initialize(file = DEFAULTS['cfg'])\n @everything = YAML.load(ERB.new(IO.read(file)).result)\n raise \"malformed yarb config\" unless @everything.is_a?(Hash)\n @config = DEFAULTS.merge(@everything[RAILS_ENV] || {})\n rescue\n puts \"error reading config file: #{$!}, using defaults\"\n @config = DEFAULTS\n end", "def initialize(config = nil)\n @config = config\n end", "def initialize\n @formatter = Yolo::Formatters::ProgressFormatter.new\n @error = Yolo::Formatters::ErrorFormatter.new\n check_config\n update_config\n end", "def initialize\n @options = {}\n # Populate the @options hash, if and only if\n # hadooken started directly by its own command.\n # The reason is, ARGV can be populated by puma\n # or rspec configuration options and this options\n # can be unrecognized by Hadooken and will lead\n # an exception in OptionParser.\n parser.parse! if Kernel.const_defined?(:HADOOKEN)\n @options[:config_file] ||= DEFAULT_CONFIG_FILE if File.exist?(DEFAULT_CONFIG_FILE)\n parse_config_file if @options[:config_file]\n end", "def initializeDefaultParams()\n @fcName = nil # Flowcell name\n @baseCallsDir = nil # BaseCalls dir of the flowcell\n @useBasesMask = nil # Custom value to provide to BCL->FastQ convertor\n @sampleSheet = nil # Path to SampleSheet.csv\n yamlConfigFile = File.dirname(File.expand_path(File.dirname(__FILE__))) +\n \"/config/config_params.yml\" \n @configReader = YAML.load_file(yamlConfigFile)\n @queue = \"high\" # The processing queue on the cluster\n end", "def load_config!\n if(options[:config])\n config_inst = config_class.new(options[:config])\n elsif(self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES))\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = config_class.new(path) if path\n end\n if(config_inst)\n options.delete(:config)\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def initialize(conf = {})\n super(conf) ;\n setup() ;\n end", "def initialize\n\n # Set some defaults\n self.auth_location = 'usa'\n self.use_service_net = 'false'\n self.retention_days = 7\n\n config_file = find_config_file\n raise \"Unable to find configuration file\" if config_file.nil?\n\n File.open(config_file, 'r') do |file|\n while (line = file.gets)\n key, value = line.strip.split('=', 2)\n send(:\"#{key}=\", value)\n end\n end\n\n end", "def initialize(arg=nil)\n set_from_config!(arg) if arg\n end", "def initialize()\n # Load the site from the config.\n parser = ParseConfig.new(CONFIG_FILE)\n @site = parser['site']\n \n # Prepare the object with nil values.\n @user = nil\n @password = nil\n @error = nil\n @logged_in = false\n @is_admin = false\n\n User.site = @site\n User.logger = LOGGER\n\n Broadcast.site = @site\n Broadcast.logger = LOGGER\n end", "def load\n if File.exists? @file\n @main = YAML::load_file @file\n else\n self.load_defaults\n end\n end", "def initialize\n yield self\n Config.apply(self)\n end", "def initialize(config = nil)\n load_or_create_config(config)\n load_assets()\n end", "def initialize\n super(MUSIC_CONFIG)\n end", "def initialize(conf = nil)\n @conf = conf || default_config\n end", "def initialize( settings={} )\n\t\tsuper()\n\n\t\t@log_hosts = settings.delete( :log_hosts )\n\t\t@settings = settings\n\t\t@overridden_settings = nil\n\tend", "def initialize\n @configuration = Configuration.new\n end", "def init_default_config\n configuration.project_id ||= (Cloud.configure.project_id || ErrorReporting::Project.default_project_id)\n configuration.credentials ||= Cloud.configure.credentials\n configuration.service_name ||= ErrorReporting::Project.default_service_name\n configuration.service_version ||= ErrorReporting::Project.default_service_version\n configuration.ignore_classes = Array(configuration.ignore_classes)\n end", "def initialize(config, default=Config::BasicAuth)\n check_init(config)\n @config = default.dup.update(config)\n end", "def initialize opts = {}\n opts = Comufy.symbolize_keys(opts)\n\n begin\n yaml_location = opts.delete(:yaml)\n yaml = YAML.load_file(yaml_location)\n yaml = Comufy.symbolize_keys(yaml)\n rescue\n yaml = Hash.new()\n end\n\n @user = yaml.delete(:user) || opts.delete(:user) || ENV.fetch('COMUFY_USER', nil)\n @password = yaml.delete(:password) || opts.delete(:password) || ENV.fetch('COMUFY_PASSWORD', nil)\n @access_token = yaml.delete(:token) || opts.delete(:token) || ENV.fetch('COMUFY_TOKEN', nil)\n @expiry_time = yaml.delete(:time) || opts.delete(:time) || ENV.fetch('COMUFY_EXPIRY_TIME', nil)\n @base_api_url = yaml.delete(:url) || opts.delete(:url) || ENV.fetch('COMUFY_URL', 'http://www.sociableapi.com/xcoreweb/client')\n end", "def defaults\n return @config if @config\n\n @config = Configatron::Store.new\n file_path = File.expand_path('../../../config/xpaths.yml', __FILE__)\n hash_config = YAML::load_file(file_path)\n\n @config.configure_from_hash(hash_config)\n @config.lock!\n @config\n end" ]
[ "0.70534503", "0.69655895", "0.6902988", "0.6889849", "0.68412465", "0.6831291", "0.6831291", "0.682119", "0.68199843", "0.6772664", "0.67419064", "0.6729439", "0.672668", "0.6719839", "0.67121196", "0.66933143", "0.6688689", "0.6677705", "0.6656091", "0.6614732", "0.66145307", "0.65845263", "0.6573934", "0.6536155", "0.6518751", "0.6503237", "0.6502091", "0.6502091", "0.6502091", "0.64902997", "0.64843994", "0.64734423", "0.6435537", "0.6421572", "0.64193743", "0.6408753", "0.6408586", "0.64017445", "0.64011276", "0.6399008", "0.63885576", "0.63854223", "0.63840514", "0.63840514", "0.63815457", "0.63702935", "0.63668257", "0.6366771", "0.6336714", "0.6336714", "0.6314976", "0.631301", "0.6309569", "0.63066554", "0.6305567", "0.6301318", "0.629694", "0.62923723", "0.6285934", "0.6281697", "0.6272444", "0.62688434", "0.6264138", "0.6252587", "0.6251612", "0.6250507", "0.62458676", "0.6241909", "0.62341225", "0.623073", "0.6227977", "0.62136143", "0.62132853", "0.62100375", "0.6206094", "0.6206094", "0.620335", "0.61984634", "0.6198242", "0.6189812", "0.6188641", "0.61865366", "0.6182141", "0.61631715", "0.6158028", "0.615327", "0.6151576", "0.6144448", "0.61420816", "0.61354667", "0.61242795", "0.612318", "0.61216223", "0.61161697", "0.61070323", "0.61064154", "0.61056083", "0.6084379", "0.6073222", "0.6066249", "0.6065729" ]
0.0
-1
Sends a nofification email using SMTP
def send(opts={}) opts[:server] ||= self.server opts[:from] ||= self.from opts[:subject] ||= "New Build!" opts[:title] ||= "New Build!" opts[:body] ||= body(opts) opts[:password] ||= self.password opts[:account] ||= self.account opts[:port] ||= self.port opts[:to] ||= self.to msg = opts[:body] if opts[:account] and opts[:password] and opts[:port] and opts[:to] @progress_formatter.sending_email smtp = Net::SMTP.new opts[:server], opts[:port] smtp.enable_starttls smtp.start(opts[:server], opts[:account], opts[:password], :login) do smtp.send_message(msg, opts[:from], opts[:to]) @progress_formatter.email_sent(opts[:to]) end elsif opts[:server] and opts[:to] @progress_formatter.sending_email Net::SMTP.start(opts[:server]) do |smtp| smtp.send_message(msg, opts[:from], opts[:to]) @progress_formatter.email_sent(opts[:to]) end else @error_formatter.missing_email_details end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendemail(subject,content,to=nil) \n from = \"[email protected]\" \n to = [\"[email protected]\"] if to.nil? \n sendmessage = \"Subject: \"+subject +\"\\n\\n\"+content \n smtp = Net::SMTP.start(\"mail.xj.cninfo.net\",25,\"mail.xj.cninfo.net\",'saq','wei720503',:login) \n smtp.send_message sendmessage,from,to \n smtp.finish \n end", "def send_mail(email,subject,body)\n Pony.mail(:to => email,\n :from => t.email.adress,\n :subject => subject,\n :body => body,\n :content_type => 'text/html',\n :charset => 'utf-8',\n :via => :smtp, :smtp => {\n :host => 'smtp.kunigo.com.br',\n :port => '587',\n :user => '[email protected]',\n :password => 'PASSWORD',\n :auth => :plain,\n :domain => \"localhost.localdomain\"\n })\n end", "def send_email(from, from_alias, to, to_alias, subject, message) #Sending emails!\n\tmsg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nReply-to: [email protected]\nSubject: #{subject}\n\t\n#{message}\nEND_OF_MESSAGE\n\t\n\tNet::SMTP.start('127.0.0.1') do |smtp|\n\t\tsmtp.send_message msg, from, to\n\tend\nend", "def send_email(from, from_alias, to, to_alias, subject, message)\n\tmsg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nMIME-Version: 1.0\nContent-type: text/plain\nSubject: #{subject}\n\n#{message}\nEND_OF_MESSAGE\n\n\tNet::SMTP.start('mr1.ufz.de',\n 25,\n 'localhost.localdomain',\n 'bilke', $password) do |smtp|\n\t\tputs \"Sending email to #{to_alias} <#{to}>...\"\n smtp.send_message(msg, from, to)\n\tend\nend", "def send_by_email\n Notifier.new_comment(self).deliver\n end", "def send_email\n mail = {\n :to => TO_ADDRESS,\n :from => from_email,\n :body => body,\n :subject => \"Comment on Docket 09-51 from #{@comment[:name]}\"\n }\n Pony.mail(mail)\n end", "def sendEmail(from, to, subject, message)\n toMail = \"\"\n to.each { |x| toMail= toMail + \",#{x}\" }\n\nmsg = <<END_OF_MESSAGE\nFrom: <#{from}>\nTo: <#{toMail}>\nSubject: #{subject}\n\n#{message}\nEND_OF_MESSAGE\n\n Net::SMTP.start('smtp.bcm.tmc.edu') do |smtp|\n smtp.send_message msg, from, to\n end\n end", "def send_email(from, from_alias, to, to_alias, subject, message)\n \tmsg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nMIME-Version: 1.0\nContent-type: text/plain\nSubject: #{subject}\n\n#{message}\nEND_OF_MESSAGE\n\n \tNet::SMTP.start('imap.leipzig.ufz.de',\n 25,\n 'localhost.localdomain',\n 'bilke', $password, :plain) do |smtp|\n \t\tputs \"Sending email to #{to_alias} <#{to}>...\"\n smtp.send_message(msg, from, to)\n \tend\n end", "def net_smtp\n Net::SMTP.start(self.class.config[:host], self.class.config[:port].to_i, self.class.config[:domain], \n self.class.config[:user], self.class.config[:pass], (self.class.config[:auth].to_sym||:plain)) { |smtp|\n smtp.send_message(@mail.to_s, @mail.from.first, @mail.to)\n }\n end", "def send_message\n Pony.mail({\n :from => params[:email], \n :to => '[email protected]',\n :subject => params[:email] + \" has contacted you - Phone: \" + params[:phone], \n :body => params[:email] + params[:message],\n :via => :smtp,\n :via_options => {\n :address => 'smtp.gmail.com', \n :port => '587', \n :enable_starttls_auto => true,\n :user_name => 'info_the_lodge',\n :password => 'secret',\n :authentication => :plain,\n :domain => 'localhost.localdomain'\n }}) \n end", "def send_message\n error_check\n if @message_config[:debug]\n puts \"\\n\\n<=> Debug Mode <=>\"\n puts \"Via: #{@message_config[:via]}\"\n puts \"From: #{@message_config[:from]}\"\n puts \"To: #{@message_config[:to]}\"\n puts \"Cc: #{@message_config[:cc]}\" unless @message_config[:cc].nil?\n puts \"Bcc: #{@message_config[:bcc]}\" unless @message_config[:bcc].nil?\n puts \"Subject: #{@message_config[:subject]}\\n\\n\"\n puts @message_config[:body]\n else\n Pony.mail(\n to: @message_config[:to],\n from: @message_config[:from],\n subject: @message_config[:subject],\n body: @message_config[:body],\n cc: @message_config[:cc],\n bcc: @message_config[:bcc],\n via: @message_config[:via],\n headers: { \"mailer\" => \"nikkyMail\" }\n )\n sleep @message_config[:sleep]\n end\n end", "def send_mail(msg,tomailaddr)\n fromaddr = '<frommailaddress>'\n Net::SMTP.start('localhost', 25, '<fromdomain>') do |smtp|\n emailmessage = <<END\nFrom: <From Mail address>\nTo: #{tomailaddr.join('; ')}\nMIME-Version: 1.0\nContent-type: text/html\nSubject: Instance Report\n#{msg}\nEND\n smtp.send_message emailmessage, fromaddr, tomailaddr\n end\nend", "def send_email\n return true unless RunLevel.is_normal?\n\n log_msg = \"SEND #{flavor} \" \\\n \"from=#{user&.login || \"nil\"} \" \\\n \"to=#{to_user&.login || \"nil\"} \" +\n queued_email_integers.map { |x|\n \"#{x.key}=#{x.value}\"\n }.join(\" \") +\n queued_email_strings.map do |x|\n \"#{x.key}=\\\"#{x.value}\\\"\"\n end.join(\" \")\n self.class.debug_log(log_msg)\n current_locale = I18n.locale\n result = false\n if user.present? && user == to_user\n unless Rails.env.test?\n raise(\"Skipping email with same sender and recipient: #{user.email}\\n\")\n end\n else\n result = deliver_email\n end\n I18n.locale = current_locale\n result\n rescue StandardError => e\n warn(\"ERROR CREATING EMAIL\")\n warn(log_msg)\n warn(e)\n warn(e.backtrace)\n I18n.locale = current_locale\n false\n end", "def email(defn, participant, assignment)\n defn[:body][:type] = \"Teammate Review\"\n participant = AssignmentParticipant.find(reviewee_id)\n topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)\n defn[:body][:obj_name] = assignment.name\n user = User.find(participant.user_id)\n defn[:body][:first_name] = user.fullname\n defn[:to] = user.email\n Mailer.sync_message(defn).deliver\n end", "def send_email_alert(sender_email, sender_pass, recipients, subject, body)\n log \"Sending e-mail alert.\"\n recipients.each do |r|\n Pony.mail(:to => r, :via => :smtp, :via_options => {\n :address => 'smtp.gmail.com',\n :port => '587',\n :enable_starttls_auto => true,\n :user_name => sender_email,\n :password => sender_pass,\n :authentication => :plain,\n :domain => \"HELO\",\n }, :subject => subject, :body => body)\n end\nend", "def show_notfication\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def notifyRecipients (statusMsgAddress, statusMsgPassword, recipientList, downTitle, downMessage)\n recipientList.length.times do |i|\n msg = \"Subject: #{downTitle}\\n\\n#{downMessage}\"\n smtp = Net::SMTP.new 'smtp.gmail.com', 587\n smtp.enable_starttls\n smtp.start(\"gmail\", statusMsgAddress, statusMsgPassword, :login) do\n smtp.send_message(msg, statusMsgAddress, recipientList[i])\n end\n end\nend", "def send_email(santa, recipient)\n require 'tlsmail' \n require 'time' \n \ncontent = <<EOF \nFrom: #{@username}\nTo: #{santa.email}\nSubject: Hey #{santa.fname}! Secret Santa info inside. \nDate: #{Time.now.rfc2822} \n \nYou are #{recipient.fname} #{recipient.lname}'s Secret Santa.\nEOF\n \n Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) \n Net::SMTP.start('smtp.gmail.com', 587, 'gmail.com', @username, @password, :login) do |smtp| \n smtp.send_message(content, @username, santa.email) \n end\nend", "def send_order_email\n\t mail( :to => '[email protected]',\n\t :subject => 'Order' )\n\t end", "def notify_email2(fuel_limit)\n @fuel_limit=fuel_limit\n mail(to: @fuel_limit.emails, subject: 'Notification Email')\n end", "def deliver_email\n#puts \"**** deliver_email: emails=#{emails}\"\n emails = @contact_info.map {|c| c[:email]}.compact.uniq\n self.subject ||= 'Message from SIM Nigeria'\n id_for_reply = self.following_up || id # a follow-up message uses id of the original msg\n#puts \"**** Messages#deliver_email response_time_limit=#{response_time_limit}\"\n outgoing = Notifier.send_group_message(:recipients=>emails, :content=>self.body, \n :subject => subject, :id => id_for_reply , :response_time_limit => response_time_limit, \n :bcc => true, :following_up => following_up) # send using bcc:, not to:\nraise \"send_email with nil email produced\" if outgoing.nil?\n outgoing.deliver\n # Mark all as being sent, but only if they have an email address\n # This is terribly inefficient ... need to find a way to use a single SQL statement\n sent_messages.each do |sm| \n sm.update_attributes(:msg_status => MsgSentToGateway) if sm.member.primary_email\n end\n end", "def mail_message(subject, content)\n message = ''\n message << \"From: Do Not Reply <[email protected]>\\n\"\n message << \"To: #{EMAIL_TO}\\n\"\n message << \"Subject: #{subject}\\n\"\n message << \"\\n\"\n message << content\n\n Net::SMTP.start('localhost') do |smtp|\n smtp.send_message message, '[email protected]', EMAIL_TO\n end\nend", "def konsalt_mail params\n build_params params\n send_email t('emails.konsalta_mail.subject')\n end", "def order_send(order)\n @greeting = \"Hi\"\np 1111111111\np order\n @orde_email = order.email\n\n mail(:to => order.email, :subject => \"Your Order\")\n end", "def smtp_send(to,from,subject,message)\n msgstr = message.join(\"\\n\")\n from_smtp = \"#{from.gsub(\" \",\".\")}@#{SMTPDOMAIN}\"\n msg = [ \"From: #{from_smtp}\\n\",\"To: #{to}\\n\",\"Subject: #{subject}\\n\", \"\\n\", \"#{msgstr}\" ]\n Net::SMTP.start(SMTPSERVER, 25) do |smtp|\n smtp.send_message msg, from_smtp, to\n end\n end", "def funded_email_to_creator\n Pony.mail(:to => self.email, :from => '[email protected]', :subject => 'the gift you created is now funded!', :body => 'yay! some people owe you money.')\n end", "def send(mail)\n Net::SMTP.start(\n smtp_data[:server], \n smtp_data[:port], \n smtp_data[:domain], \n smtp_data[:user_name], \n smtp_data[:password]\n ) do |smtp|\n begin\n # puts \"Message à déliver : <<<<<<<\\n#{mail.content}\\n>>>>>>>>>>>\\n\\n\"\n smtp.send_message( mail.content, mail.from, mail.to)\n rescue Net::SMTPSyntaxError => e\n puts \"ERREUR DE SYNTAXE : #{e.message}\"\n end\n end\nend", "def send_email(to, subject, body)\n # Run this asynchronously using EventMachine since it takes a couple of seconds.\n EM.defer do\n Pony.mail(:from => \"Cheesy Parts <#{CheesyCommon::Config.gmail_user}>\", :to => to,\n :subject => subject, :body => body, :via => :smtp,\n :via_options => { :address => \"smtp.gmail.com\", :port => \"587\",\n :enable_starttls_auto => true,\n :user_name => CheesyCommon::Config.gmail_user.split(\"@\").first,\n :password => CheesyCommon::Config.gmail_password,\n :authentication => :plain, :domain => \"localhost.localdomain\" })\n end\n end", "def send_email(final_location,user_email)\n\n#This variable is used to store the email headers\nmessage =<<EOF\nFrom: LUCNHINATOR! <[email protected]>\nTo: RECEIVER <[email protected]>\nSubject: Your Lunch Location!\nThe following are information regarding your lunch location\nEOF\n\n\n #Using Block\n smtp = Net::SMTP.new('smtp.gmail.com', 587 ) #intialise the SMTP gmail protocol to be used\n smtp.enable_starttls #To start the TTL\n smtp.start('gmail.com', '[email protected]', 'lunchinator2019', :login) do |smtp| #After logging in,it would start to create the email and send it\n smtp.send_message (message + \"\\n Location Name: \" + final_location.name + \"\\n Location Address: \" + final_location.address + \"\\n Cuisine Type: \" + final_location.cuisine + \"\\n Healthy option?: \" + final_location.healthy + \"\\n Halal or Non-Halal: \" + final_location.halal + + \"\\n Price Range: \" + final_location.price ) ,'[email protected]', user_email\n #The line above is used to send the email using the given message structure.\n #The sender email and user_email is defined as the last 2 values in the line.\n #[email protected] is the sender email and the user_email is the recipient\n\n\n smtp.finish #end the process\n end\nend", "def do_reply(subject, msg)\n full_msg=<<END_OF_MESSAGE\nFrom: #{@test_data['user_name']}\nTo: #{@test_data['reply_email']}\nSubject: #{subject}\nDate: #{Time.now}\n\n#{msg}\nEND_OF_MESSAGE\n Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)\n Net::SMTP.start(@test_data['smtp_host'], @test_data['smtp_port'], @test_data['mail_domain'], @test_data['user_name'], @test_data['user_passwd'], :login) { |smtp|\n smtp.send_message(full_msg, @test_data['user_name'], @test_data['reply_email'])\n }\nend", "def email_for_no_pto(full_name, pto, pto_type) \n Mail.defaults do\n delivery_method :smtp,\n address: \"email-smtp.us-east-1.amazonaws.com\",\n port: 587,\n :user_name => ENV['a3smtpuser'],\n :password => ENV['a3smtppass'],\n :enable_ssl => true\n end\n email_body = \"#{full_name[0]} #{full_name[1]} tried to request #{pto_type}and they have #{pto}PTO days left to request.<a href= 'https://wv-timesheet-clock.herokuapp.com/'> To Reply Click Here . </a>\"\n mail = Mail.new do\n from ENV['from']\n to '[email protected]'\n subject \"PTO Request with no days to request\"\n \n html_part do\n content_type 'text/html'\n body email_body\n end\n end\n mail.deliver!\nend", "def send_email(from, from_alias, to, to_alias, subject, message)\n hostname = Socket.gethostname\n msg = <<END_OF_MESSAGE\nFrom: #{from_alias} <#{from}>\nTo: #{to_alias} <#{to}>\nSubject: #{hostname} - #{subject}\n \n#{message}\nEND_OF_MESSAGE\n\n $log.info \"[#{from}] #{hostname} - #{subject}\"\n\n Net::SMTP.start('localhost', 25) do |smtp|\n smtp.send_message(msg, from, to)\n end\nend", "def notify(bodystr, subject=nil, *to_addrs)\n from = '\"VAUtil\" <vautil@' + `/bin/hostname`.chomp + '>'\n to = to_addrs.map { |a| '<' + a + '>' }.join(', ')\n message = <<HERE\nFrom: #{from}\nTo: #{to}\nSubject: #{subject.nil? ? \"VAUtil Notification\" : subject }\nDate: #{Time.now}\nMessage-Id: <#{(0...20).map{ (('0'..'9').to_a + ('a'..'z').to_a).to_a[rand(36)] }.join}@coredial.com>\n\n#{bodystr}\nHERE\n Net::SMTP.start(VAUtil.config['mail_host'], 25, 'coredial.com') do |smtp|\n smtp.send_message(message, from, to_addrs)\n end\n end", "def send_email(options = {})\n options = { server: 'remotesmtp.freescale.net',\n port: 25,\n from: '',\n from_alias: '',\n subject: '',\n body: '',\n to: ''\n }.merge(options)\n\n # Force to an array\n to = options[:to].respond_to?('each') ? options[:to] : [options[:to]]\n\n # Convert any user objects to an email\n to = to.map { |obj| obj.respond_to?('email') ? obj.email : obj }\n\n to.uniq.each do |addr|\n msg = <<END_OF_MESSAGE\nFrom: #{options[:from_alias]} <#{options[:from]}>\nTo: #{addr}\nSubject: #{options[:subject]}\n\n#{options[:body]}\n\nEND_OF_MESSAGE\n\n begin\n # Exceptions raised here will be caught by rescue clause\n Net::SMTP.start(options[:server], options[:port]) do |smtp|\n smtp.send_message msg, options[:from], addr\n end\n rescue\n warn \"Email not able to be sent to address '#{addr}'\"\n end\n end\n end", "def food_mail(email)\n\n @url = 'http://foodcircles.net/?app=mobile_email'\n mail(:to => email, :reply_to => '[email protected]', :subject => \"Your hunger is powerful.\")\n end", "def notice_post\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_order_email_to_sender(email, consignment_number)\n @email = email\n @consignment_number = consignment_number\n mail( :to => @email,\n :subject => 'Thanks for send order email to sender' )\n end", "def send_email( options={} )\n mail_opts = {\n :to => self.config[\"email\"][\"to\"],\n :from => self.config[\"email\"][\"from\"],\n :subject => \"A Message from MartSearch...\",\n :body => \"You have been sent this message from your MartSearch portal.\"\n }.merge!(options)\n \n mail = Mail.new do\n from mail_opts[:from]\n to mail_opts[:to]\n subject mail_opts[:subject]\n body mail_opts[:body]\n end\n \n if self.config[\"email\"][\"smtp\"]\n smtp_opts = { :host => \"127.0.0.1\", :port => \"25\" }\n \n [:host, :port, :user, :pass].each do |opt|\n if self.config[\"email\"][\"smtp\"][opt.to_s]\n smtp_opts[opt] = self.config[\"email\"][\"smtp\"][opt.to_s]\n end\n end\n \n Mail.defaults do\n smtp smtp_opts[:host], smtp_opts[:port]\n if smtp_opts[:user] then user smtp_opts[:user] end\n if smtp_opts[:pass] then pass smtp_opts[:pass] end\n end\n \n mail.deliver!\n else\n # Send via sendmail\n sendmail = `which sendmail`.chomp\n if sendmail.empty? then sendmail = \"/usr/sbin/sendmail\" end\n \n IO.popen('-', 'w+') do |pipe|\n if pipe\n pipe.write(mail.to_s)\n else\n exec(sendmail, \"-t\")\n end\n end\n end\n end", "def normal_email(user, status)\n @user = user\n @status = status\n mail to: @user.email, subject: 'CastleBridge Normal Email'\n end", "def send_email\n InquiryMailer.inquiry_created_email(self).deliver\n end", "def event_mail\n NoticePlannerMailer.delay.notice_planner_email('[email protected]', 'test', 'cron-test', 'https://yahoo.co.jp')\n end", "def notify\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def sent(order)\n @order = order\n mail :to => \"[email protected]\", :subject => \"注文を受けました\"\n end", "def sending_email\n puts\n email = \"Sending notification email\"\n puts bold(email)\n puts email.length.times.map {\"=\"}.join\n puts\n end", "def email(body)\n message = <<EOM\nFrom: #{FROM}\nTo: #{TO}\nDate: #{NOW.rfc822}\nMessage-Id: #{SecureRandom.uuid}@redhat.com\nSubject: Unassigned upcoming maintenances\n\nRegion Leads - please arrange coverage for these maintenances immediately:\n\n#{body}\n\n---\nThis message has been sent by the Unassigned Maintenance Broadcast System.\nThis utility runs in the #{NAMESPACE} namespace on #{CLUSTER}.\nThe source code for this utility can be found at #{REPO}.\nEOM\n\n Net::SMTP.start('smtp.corp.redhat.com', 25, FROM) do |smtp|\n smtp.send_message message, FROM, TO\n end\nend", "def second_round_email(email)\n @greeting = \"Hi\"\n\n mail to: email, subject: \"Your ASES Application Decision\"\n end", "def food_mail(email)\n\n @url = 'http://foodcircles.net/?app=mobile_email'\n mail(:to => email, :reply_to => '[email protected]', :subject => \"Your appetite is powerful.\")\n end", "def tanji\n @greeting = \"Hi\"\n\n mail (:to => \"[email protected]\",:subject => \"hello\")\n end", "def email(options)\n puts \"sending to #{options}\"\n Pony.mail(BASE_EMAIL.merge(options))\n end", "def booked_not_confirmed\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_email(news_info, schedules, client)\n body = create_email news_info, schedules\n m = Mail.new to: @email, from: \"[email protected]\", charset: \"UTF-8\", subject: \"OSU Sports Digest\", body: body\n message_object = Google::Apis::GmailV1::Message.new raw: m.encoded\n client.send_user_message 'me', message_object\n end", "def newsletter\n @greeting = \"Hi\"\n\n mail :to => \"[email protected]\"\n end", "def send(opts)\n if opts.msg_to.empty?\n @log.warn \"ll-013: Email can't be sent to '#{opts.msg_to},\" \\\n \" more: '#{opts}'\"\n else\n mail = make_email(opts)\n mail.deliver\n @log.debug \"#{__FILE__} sent '#{mail.subject}' to '#{mail.to}'.\"\n end\n end", "def sofortkontakt\n @greeting = \"Hi\"\n\n mail :to => \"[email protected]\"\n end", "def sendMail(body)\n options = { :address => $advanced['mail']['address'],\n :port => $port,\n :domain => ENV['HOSTNAME'],\n :user_name => $advanced['mail']['username'],\n :password => $advanced['mail']['password'],\n :authentication => nil,\n :enable_starttls_auto => true }\n Mail.defaults do\n delivery_method :smtp, options\n end\n\n users = Array.new\n\n # Logic for pulling the email accounts from Plex.tv and/or the\n\t# config file\n\tplexTv = PlexTv.new($advanced)\n\n\tif !$testEmail\n \t if $plexEmails\n plex_users = plexTv.get('/pms/friends/all')\n\n if plex_users.nil? || plex_users.empty?\n $logger.info(\"No Plex friends found.\") \n else \n plex_users['MediaContainer']['User'].each do | user |\n\t\t\tif !user['email'].empty?\n users.push(user['email'])\n\t\t\tend\n end\n end\n\t end\n\t if !$advanced['mail']['recipients'].nil? || !$advanced['mail']['recipients_email'].nil?\n\t if !$advanced['mail']['recipients_email'].nil?\n\t $advanced['mail']['recipients_email'].each do | recipient |\n\t\t users.push(recipient)\n\t end\n\t end\n\t if !$advanced['mail']['recipients'].nil?\n\t\t $advanced['mail']['recipients'].each do | recipient |\n\t\t plex_users = plexTv.get('/pms/friends/all')\n plex_users['MediaContainer']['User'].each do | user |\n\t\t if user['username'] == recipient\n users.push(user['email'])\n\t\t\t end\n end\n\t\t end\n\t end\n\t end\n\tend\n\n #Get owner's email as well and add it to the list of recpients\n users.push(plexTv.get('/users/account')['user']['email'][0])\n \n\t#used to send individual email. Now it bcc's one email\n #users.each do | user |\n mail = Mail.new do\n from \"#{$advanced['mail']['from']} <#{$advanced['mail']['username']}>\"\n bcc users\n subject $advanced['mail']['subject'] + \" \" + (I18n.l Time.now.to_date)\n content_type 'text/html; charset=UTF-8'\n body body\n end\n begin\n mail.deliver!\n\t\t\trescue => e\n\t\t\t $logger.info(\"SMTP mailing failed!\\n#{e.message}#{e.backtrace}\")\n\t\t\tend\n #end\n end", "def order_received(order)\n@order=order\nmail(:to => order.email, :subject => 'Pragmatic Toy Shop Order Confirmation')\nend", "def issued\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_email\n Kernel.const_defined?(:MobileInfo) and\n System.ntpd_wait(60) do\n MobileInfo.send_email\n end\n end", "def survey_sent(participant)\n @participant = participant\n mail :to => participant.email, :subject => \"Conteste la encuesta\"\n end", "def send_to_alum(email)\n @email = email\n mail(:from => email.user_email, :to => email.alum_email, :subject => email.subject)\n end", "def lost_brain\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def lost_brain\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def lost_brain\n @greeting = 'Hi'\n\n mail to: '[email protected]'\n end", "def send_email\n true\n end", "def envio_email\n @desticoor = @queja.programa.coordinador.id\n @coordinadorp = Coordinador.find(@desticoor)\n \n QuejaMailer.registro_queja_coordinador(@queja, @coordinadorp,\"Notificación de Queja\").deliver\n QuejaMailer.registro_queja_instructor(@queja,current_user.email, \"Notificación de Queja\" ).deliver\n end", "def email\n options = { :from => params[:email], :to => \"[email protected]\", :subject => params[:subject], :body => \"From: #{params[:user]} <#{params[:email]}>\\r\\nCategory: #{params[:category]}\\r\\nSubject:#{params[:subject]}\\r\\n\\r\\n#{params[:body]}\"}\n RequestMailer.deliver_generic(options)\n flash[:notice] = \"Your email was sent successfully\"\n redirect_to params[:redirect]\n end", "def send_email(payment, bill)\n Admin.all.each do |admin|\n Pony.mail :to => admin.email,\n :from => payment.contributor_email,\n :subject => I18n.t(:upload_receipt_subject),\n :html_body => erb(:\"/mails/payment_confirmation\",\n :locals => {:receipt => payment, :bill => bill },\n :layout => false),\n :via => :smtp\n\n end\nend", "def message_email(name, email, body)\n @name = name\n @email = email\n @body = body\n mail(:to => \"[email protected]\", :subject => \"New Message from CONSIGN.NYC\")\n end", "def send_email(to, subject, content)\r\n\r\n end", "def send_email\n g = GmailSender.new(USER_NAME, PASSWORD)\n\n g.send(:to => to,\n :subject => @subject,\n :content => full_content)\n end", "def new_motification_email(motification, receiver)\n @motification = motification\n @receiver = receiver\n set_subject(motification)\n mail :to => receiver.send(Mailboxer.email_method, motification),\n :subject => t('mailboxer.motification_mailer.subject', :subject => @subject),\n :template_name => 'new_motification_email'\n end", "def fifth_anniversary\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_signup_email(order)\n @order = order\n mail( :to => @order.email,\n :subject => 'Thanks for ordering out amazing clothing!' )\n end", "def setup_email(user, payment)\n mail = Mail.deliver do\n to user.email\n from 'FoodCircles <[email protected]>'\n subject \"Got your Voucher for #{payment.offer.venue.name}\"\n reply_to '[email protected]'\n html_part do\n content_type 'text/html; charset=UTF-8'\n body \"<table width = '550px'><tr><td style = font-size:12pt; font-family:Arial><p style= text-align: justify;>Print this email or just show it off on a fancy electronic device.</p>\n <p style= text-align: justify>\n <b>confirmation code:</b> #{payment.code}<br>\n <b>good for:</b> #{payment.offer.name}<br>\n <b>only at:</b> #{payment.offer.venue.name}<br>\n <b>with a minimum of:</b> #{payment.offer.min_diners} diners<br>\n <b>expiring:</b> #{30.days.from_now.to_date}</p><br>\n <b>3 steps to redeem:</b>\n <p>\n <b>1)</b> Show server this message before you order. They should jot your code down and confirm.<br>\n <b>2)</b> Order regular food or drink for each person in party.<br>\n <b>3)</b> Mark Voucher used by following this link! <a href=\\\"http://staging.foodcircles.net/payment/used?code=#{payment.code}&source=email\\\">Mark Voucher Used</a></br>\n </p><br><br>\n Enjoy!<br><br>\n Contact support at <b>[email protected]</b> if you have any concerns or questions whatsoever.<br><br><br>\n <h3><u>FOR SERVERS:</u></h3>\n <p style= text-align: justify;><b>Write down the confirmation code on the table's receipt or your POS system</b>. Place a \\\"Buy One, Feed One\\\" placard on the guest's table, and mark a tally on your chalkboard (if available). Call us at 312 945 8627 with any questions!</p></td></tr></table>\"\n end\n end\n end", "def mail; end", "def send_email_line()\n #define a variable gmail.\n gmail = Gmail.connect(\"email\",\"password\")\n #define a variable email with a loop.\n email = gmail.deliver do\n to ws\n subject \"Présentation The hacking poject\"\n html_part do\n content_type'text/html; charset=UTF8'\n body send_email_text\n end\n end\n #show email acount loggin.\n puts gmail.logged_in?\n #desconnecte after work.\n gmail.logout\nend", "def send_email(from_name,from_email,to_name,to_email,subject,body)\n # TODO replace with something bulkier and more of a hassle later?\n # TODO it is overspecialized to use the domain name here\n from_domain = \"foodgenome.com\"\n if !from_name || from_name.length < 1\n from_name = \"twitter\"\n from_email = \"twitter@#{from_domain}\"\n end\n begin\n message = \"From: #{from_name} <#{from_email}>\\n\" +\n \"To: #{to_name} <#{to_email}>\\n\" +\n \"Subject: #{subject}\\n\" +\n \"#{body}\\n\"\n Net::SMTP.start('localhost') do |smtp|\n smtp.send_message message, from_email, to_email\n end\n rescue\n # TODO if the email fails we can use this to filter bad users\n end\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def sendmail\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def no_paypal_account_email(order)\n @order = order\n mail(to: ENV['NO_PAYPAL_EMAIL_ADDRESS'], subject: 'Kein PayPal Konto für Amavat Bestellung')\n end", "def email_friend(sent_to,message,subject)\n @message=message\n mail to: '[email protected],'+sent_to,:subject => subject\n end", "def order_received\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def shipped\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def instructor_help_email(student,admin)\n @admin = admin\n @student = student\n\n # carrier phone numbers:\n # T-Mobile: [email protected] max 140 char\n # Verizon: [email protected] max 160 char\n # Sprint: [email protected] max 160 char\n # AT&T: [email protected] max 160 char\n # Virgin Mobile: [email protected] max 125 char\n # phonenumber = 10-digit cell phone number, no dashes or spaces\n\n # Email to SMS Messaging is FREE to send. Recipient is charged for receipt\n # of SMS according to their plan.\n\n # Free Bulk SMS Messaging\n recipients = []\n\n for admin in @admin\n recipients.push(admin.phone + \"@\" + domain(admin.carrier)) if admin.receive_sms\n recipients.push(admin.email) if admin.receive_email\n end\n\n mail(:to => recipients,\n :subject => \"#{@student.name} wants coding help!\")\n\n end", "def email_validation mail_to, mailer_config\n require 'net/smtp'\n mailer_config['message']['subject'] = \"TRDREV_TD Validation Report for: #{@payroll_month.label}\" || mailer_config['message']['subject']\n mailer_config['message']['body'] = @formatted_validation || mailer_config['message']['body']\n\n message_content = <<END_OF_MESSAGE\nFrom: #{mailer_config['message']['from_alias']} <#{mailer_config['message']['from']}>\nTo: <#{mail_to}>\nSubject: #{mailer_config['message']['subject']}\n\n#{mailer_config['message']['body']}\nEND_OF_MESSAGE\n\n Net::SMTP.start(mailer_config['smtp']['server']) do |smtp|\n smtp.send_message message_content, mailer_config['message']['from'], mail_to\n end\n end", "def restaurant_email\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_email\n @logger.debug { \"=================== Sending email ===================\" }\n @logger.debug { @opts }\n @logger.debug { \"=================== Sending email ===================\" }\n error = nil\n begin\n loop do\n open_socket\n write_helo\n err = write_mail_from\n (error = err; break) if !err.include? \"Ok\"\n err = write_mail_to\n (error = err; break) if !err.include? \"Ok\"\n err = write_mail_data\n (error = err; break) if !err.include? \"Ok\"\n write_quit\n break\n end\n rescue => exception\n error = exception.inspect + \"\\n\"\n @log += exception.inspect + \"\\n\"\n end\n puts @log\n return @log, error\n end", "def antwort\n @greeting = \"Hi\"\n\n mail :to => \"[email protected]\"\n end", "def email_questions(email,corpo)\n\t\t@email = email\n\t\t@corpo = corpo\n\t\tmail(to: '[email protected]',from: email, subject: 'Mensagem do CurriculumXD')\n\t\t# mail = Mail.new do\n\t\t# from email\n\t\t# to '[email protected]'\n\t\t# subject 'Mensagem do CurriculumXD'\n\t\t# body corpo\n\t\t# end\n\t\t# mail.deliver!\n\tend", "def sendmail_confirm\n @greeting = \"元気ー?\"\n\n mail to: \"[email protected]\"\n end", "def confirm_delegation(delegation)\n \t@delegation = delegation\n\n mail(from: @delegation.employee.email, to: @delegation.manager.email, subject: 'Passiton - Delegation confirmed') do |format|\n format.html { render layout: 'email_simple.html.erb' }\n format.text\n \tend\n end", "def investment_email(investor,investment_opportunity)\n @investor = investor\n @investment_opportunity = investment_opportunity\n mail(from: \"[email protected]\",to: \"[email protected]\",reply_to: @investor.email, subject: \"Emerging Frontiers Investment Inquiry\")\n end", "def first_round_email(email)\n @greeting = \"Hi\"\n\n mail to: email, subject: \"Your ASES Application Decision\"\n end", "def notify_mail\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\", subject: \"[Localgarage]Printer_URL\"\n end", "def send_email(gmail, body, mail_address)\n\n body_content = body\n mail_address = mail_address\n gmail = gmail\n\n gmail.deliver do\n to mail_address\n\n subject \"[Presentation] - The Hacking Project - Formation d'informatique gratuite\"\n html_part do\n content_type 'text/html; charset=UTF-8'\n body body_content\n end\n puts \"mail sent to #{mail_address}\"\n #in order to stay below the 10 mail / sec limit\n sleep(1)\n\n end\nend", "def send_mail(opts)\n if EmailConfig.saleable_days_fallback_active?\n return mail(opts.merge(to: [EmailConfig.saleable_distribution_fallback_email]))\n end\n mail(opts)\n end", "def send_email_to_line(mail)\n\n\t\tgmail = Gmail.connect(\"#\", \"#\")\n\t\tgmail.deliver do\n\n\t\t\tto mail\n\t\t\tsubject \"Invitation pour My League Project\"\n\t\t\thtml_part do\n\t \t\tcontent_type \"text/html; charset=UTF-8\"\n\t \t\tbody \"Bonjour, \n\t\t\t\t<br/>\n\t\t\t\tJe m'appelle Sébastien, je lance un projet qui permet de tracer ses performances sportives au travers d'une application mobile. </br>\n\t\t\t\tVoici le lien du projet : https://myleagueproject.herokuapp.com/, inscrivez-vous pour être tenu au courant. <br/>\n\t\t\t\tJe vous souhaite une bonne journée ! <br/>\n\t\t\t\tSébastien\"\n\t \t\tend\n\t\tend\n\tend", "def notify(santa)\n if santa.minion != nil\n msg = \"#{santa.firstName} #{santa.lastName} is watching over \" +\n \"#{santa.minion.firstName} #{santa.minion.lastName}\"\n else\n msg = \"#{santa.firstName} #{santa.lastName} is watching over nobody\"\n end\n\n puts msg\n\n #Net::SMTP.start('smtp.example.com', 25) do |smtp|\n # smtp.send_message(msg, '[email protected]', santa.email)\n #end\n end" ]
[ "0.6757125", "0.67063755", "0.6697372", "0.66802394", "0.66523594", "0.66007894", "0.65977967", "0.6530458", "0.6492388", "0.6479715", "0.64768785", "0.64660764", "0.6410577", "0.64089113", "0.64043003", "0.6332624", "0.6327602", "0.6315676", "0.6314604", "0.63089246", "0.63055384", "0.62908363", "0.6279667", "0.6261417", "0.6238169", "0.6224424", "0.6217821", "0.6216995", "0.62151587", "0.6213732", "0.62002814", "0.6190773", "0.61892146", "0.6180741", "0.6164779", "0.61599076", "0.6155776", "0.6153714", "0.6145339", "0.61451334", "0.6140225", "0.6136696", "0.6127536", "0.61250186", "0.6115248", "0.6112314", "0.61035925", "0.61032826", "0.61017144", "0.6095367", "0.60753787", "0.60719705", "0.60704184", "0.6070203", "0.606719", "0.60644567", "0.606406", "0.6054266", "0.6045193", "0.6043015", "0.6041615", "0.6041254", "0.604061", "0.60388684", "0.603814", "0.6029472", "0.6023666", "0.6018755", "0.6015631", "0.60074854", "0.60031986", "0.599162", "0.59883225", "0.59866494", "0.59852755", "0.59747875", "0.59743816", "0.59640115", "0.59640115", "0.59640115", "0.59640115", "0.59551877", "0.59528613", "0.59471476", "0.59430414", "0.5940377", "0.59386104", "0.5937586", "0.593712", "0.5935133", "0.59292436", "0.59280795", "0.59255785", "0.5913257", "0.5910468", "0.5909771", "0.59092784", "0.5909215", "0.5908412", "0.58989364", "0.5898838" ]
0.0
-1
The body of them notification email, this method should be overwritten in subclasses to provide custom content
def body(opts) "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customized_message_body\n return @customized_message_body\n end", "def message_body\n message_body = \"#{author.name} desea participar al evento '#{event.name}'.\"\n message_body += \"<br><br>\"\n message_body += \"Si deseas que participe en el evento pulsa en el siguiente botón:\"\n message_body += \"<br><br>\"\n\n message_body += body_form\n\n return message_body\n end", "def body\n c = header + (\n message_formated +\n signature +\n footer\n ).in_div(id:'message_content')\n # Si le body style est défini, on met le code dans un div\n # contenant ce body style.\n c = c.in_div(style: SiteHtml::Mail.body_style) if SiteHtml::Mail.respond_to?(:body_style)\n return c\n end", "def body\n render text: fetch_email(params[:id]).body, content_type: 'text/html'\n end", "def customized_message_body=(value)\n @customized_message_body = value\n end", "def body(content = nil, options = nil, html_options = nil, &block)\n @body = UiBibz::Ui::Core::Notifications::Components::AlertBody.new(content, options, html_options, &block).render\n end", "def body\n @message.body\n end", "def email_body\n sponsor_name = @config.plan.sponsor_name\n message = 'Hi there!'\\\n '<br />'\\\n '<br />'\\\n \"#{sponsor_name} has run their payroll. Please download the relevant reports below.\"\\\n '<br />'\\\n '<br />'\n message\n end", "def get_body\n return {\n 'title' => \"Deployment Notice\",\n 'text' => get_msg,\n 'themeColor' => @color\n }.to_json\n end", "def build_email_content\n txt = I18n.t(\"estimate_request.fltk.email_content\", :origin => self.origin_port.name, :destination => destination_port.name, :count => self.estimate_items.first.number_of_items, :description => self.estimate_items.first.description)\n txt\n end", "def plain_body\n mail&.plain_body\n end", "def body\n if mail.multipart?\n mail.parts.map { |part| Nokogiri::HTML(part.body.decoded).text }.join(\"\\n\\n\")\n else\n Nokogiri::HTML(mail.body.decoded).text\n end\n end", "def body\n process_message_body if !@body\n @body\n end", "def message_body(subscription_count, presenters, batch_subscriptions, batch_emails)\n return @message_body if @message_body\n return nil unless subscription_count > BATCH_SIZE\n\n message = SubscriptionMailer.public_inspection_document_mailing_list(\n presenters,\n batch_subscriptions,\n nil,\n batch_emails\n )\n @message_body = {html: message.html_part.body, text: message.text_part.body}\n end", "def body\n return nil unless @item\n return @item['count'] if self.type == :notify\n return @item['entry']['summary'] if @item['entry']['summary']\n return @item['entry']['abstract']['p'] unless @item['entry']['content']\n @item['entry']['content']\n end", "def body\n @note.content\n end", "def full_content\n result = <<END\n Message from: #{@name}\n\n Phone: #{@phone}\n Email: #{@email}\n %=====================================%\n\n #{self.content}\nEND\n result\n end", "def body\n @body || \"\"\n end", "def create_notification(notification)\n \"<div class='alert alert-primary notification-body' role='alert'><%= #{notification.body} %></div>\"\n end", "def cleaned_up_text_body(format = false)\n # http://stackoverflow.com/a/15098459\n caller = caller_locations(1,1)[0].label\n if caller == 'receive_issue' || caller == 'receive_issue_reply'\n html_body\n else\n super\n end\n rescue => e\n # log error\n RedmineHtmlMailHandler::HtmlMailHandlerLogger.write(:error, \"ERROR=#{e.message}\")\n RedmineHtmlMailHandler::HtmlMailHandlerLogger.write(:error, \"BACKTRACE=\\n#{e.backtrace.join(\"\\n\")}\")\n # raise error that can be catched by 'notify_invalid_mail_handler' plugin\n raise RedmineHtmlMailHandler::Error, e.message\n end", "def body\n if author\n \"**#{author}**: #{text}\"\n else\n text\n end\n end", "def message_body(format=nil)\n case format\n when :text\n msg['text']\n when :html\n msg['html']\n when :raw\n msg['raw_msg']\n else\n msg['text'] || msg['html'] || msg['raw_msg']\n end\n end", "def message\n if subject && !subject.empty?\n subject + \"\\n\" + body\n else\n body\n end\n end", "def body\n body = <<-eot\nECFS - Email Filing\n<PROCEEDING> #{DOCKET}\n<DATE> #{@comment[:date]}\n<NAME> #{@comment[:name]}\n<ADDRESS1> #{@comment[:street]}\n<ADDRESS2>\n<CITY> #{@comment[:city]}\n<STATE> #{@comment[:state]}\n<ZIP> #{@comment[:zip]}\n<LAW-FIRM>\n<ATTORNEY>\n<FILE-NUMBER>\n<DOCUMENT-TYPE> CO\n<PHONE-NUMBER>\n<DESCRIPTION> Brief Comment\n<CONTACT-EMAIL> #{contact_email}\n<TEXT> #{@comment[:date]}\n\nMs. Marlene H. Dortch, Secretary\nFederal Communications Commission\n445 12th Street SW\nWashington, DC 20554\n\nRe: A National Broadband Plan for Our Future, GN Docket No. 09-51\n\nDear Ms. Dortch,\n#{@comment[:text]}\n\n eot\n end", "def carving_and_marking_part_4_email_body\n %(<div>VESSEL NAME: #{@submission.vessel}</div>\n <div>Please find enclosed the Carving and Marking Note for the above vessel.\n <br><br>A Commercial Bareboat Charter Carving and Marking Note must be\n signed by an Inspector of Marks/Authorised Measurer\n\n <br><br>Regulation 35 of the Merchant Shipping (Registration of Ships)\n Regulations 1993 states that a carving and marking note should be\n returned completed to the Registrar within three months.\n\n <br><br>[FREE TEXT]\n <br><br>We also require the following documents:\n <br><br>[FREE TEXT]\n <br><br>The documents can be emailed to:\n Commercial vessels: [email protected]\n <br><br>\n Alternatively, please post to:\n MCA\n Anchor Court\n Keen Road\n Cardiff\n CF24 5JW\n\n <br><br>\n Please do not hesitate to contact us you require any further assistance.\n </div>)\n end", "def new_html_email(html, triggered_by_user_test)\n if triggered_by_user_test\n test_notice = create_test_notice_html()\n end\n <<-EOF\n<html>\n <head>\n <title>AppOptics Alert</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n </head>\n <body style=\"background-color: #ffffff; padding: 20px; margin: 0px;\">\n #{test_notice}\n <div id=\"headlogo\" style=\"text-align: left; padding-top:20px;\">\n <img src=\"https://s3.amazonaws.com/appoptics-email/dist/img/[email protected]\" height=\"20\" alt=\"AppOptics\" />\n </div>\n <div style=\"background-color: #ffffff; font-family: Arial; font-size: 12px; color: #000000; text-align: left; vertical-align: top;\">\n <div id=\"content\">#{html}</div>\n </div>\n <div style=\"background-color: #ffffff; padding: 20px; font-family: Arial; font-size: 10px; line-height: 150%; color: #000000; text-align: center; vertical-align: top;\">\n You received this email because you set up alerts with the AppOptics app.\n </div>\n </body>\n</html>\n EOF\n end", "def body\n @attributes[:body]\n end", "def new_notification_email(notification,receiver)\n @notification = notification\n @receiver = receiver\n #DIFFERENT FROM ORIGINAL----------------------\n subject = notification.subject.to_s\n subject = decode_basic_notification(subject,notification.notified_object)\n subject = subject.gsub(/\\n/,'')\n #END OF DIFFERENCE----------------------------\n subject = strip_tags(subject) unless subject.html_safe?\n mail(:to => receiver.send(Mailboxer.email_method,notification), :subject => t('mailboxer.notification_mailer.subject', :subject => subject)) do |format|\n format.text {render __method__}\n format.html {render __method__}\n end\n end", "def carving_and_marking_part_2_email_body\n %(<div>VESSEL NAME: #{@submission.vessel}</div>\n <div>Please find enclosed the Carving and Marking Note for the above vessel.\n <br><br>Please arrange for an MCA surveyor or Authorised Surveyor/Inspector\n of Marks to certify that the Carving and Markings are correct and return\n the form to this office.\n <br><br>Regulation 35 of the Merchant Shipping (Registration of Ships)\n Regulations 1993 states that a carving and marking note should be\n returned to the Registrar within three months.\n <br><br>We also require the following documents:\n\n <br>• Certificate of Measurement/Survey – Completed by a\n MCA Surveyor/Authorised Surveyor\n <br>• Valid Safety Certificate – Completed by a\n MCA surveyor\n <br>• [ITC 69 issued by Authorised Measurer] –\n [delete if not required (for over 24m only)]\n\n <br><br>\n Please do not hesitate to contact us you require any further assistance.\n </div>)\n end", "def show_body\n I18n.with_locale @email_locale do\n @mail_body = mail_body(@preview, @part_type)\n render :show_body, layout: 'rails_email_preview/email'\n end\n end", "def plain_text_body\n\n return @plain_text_body unless @plain_text_body.nil?\n\n part = email.text_part || email.html_part || email\n @plain_text_body = Redmine::CodesetUtil.to_utf8(part.body.decoded, part.charset)\n\n # strip html tags and remove doctype directive\n @plain_text_body = ActionController::Base.helpers.strip_tags(@plain_text_body.strip) unless email.text_part\n @plain_text_body.sub! %r{^<!DOCTYPE .*$}, ''\n @plain_text_body\n\n end", "def mailto_body\n URI.encode(mailto_body_template.render({\n 'amount' => amount,\n 'merchant_name' => @merchant_name}))\n end", "def body\n @body ||= process_text(@raw_body)\n end", "def inject_notifications_content\n\n content = model_contents\n\n class_path = if namespaced?\n class_name.to_s.split(\"::\")\n else\n [class_name]\n end\n\n indent_depth = class_path.size - 1\n=begin\n raise <<-ERROR\nclass_path #{class_path} class_name #{class_name} model_path #{model_path} class_path.last #{class_path.last} indent_depth #{indent_depth}.\n\n ERROR\n=end\n content = content.split(\"\\n\").map { |line| \" \" * indent_depth + line } .join(\"\\n\") << \"\\n\"\n inject_into_class(model_path, class_path.last, content) if model_exists?\n\n inject_into_file 'app/mailers/notifications/mailer.rb', after: \"#extend\" do <<-CONTENT\n\nNotifications::Mailer.class_eval do\n def #{file_path}_create(record, token, opts={})\n devise_mail(record, :#{file_path}_create, opts)\n end\n def #{file_path}_update(record, token, opts={})\n devise_mail(record, :#{file_path}_update, opts)\n end\n def #{file_path}_destroy(record, token, opts={})\n devise_mail(record, :#{file_path}_destroy, opts)\n end\nend\n CONTENT\n end\n end", "def comment_body\n body = \"Merged into #{branch_to_merge_into}.\"\n if options[:user_notifications]\n body << \" /cc #{options[:user_notifications].map {|name| \"@#{name}\"}.join(' ')}\"\n end\n body\n end", "def formatted_body\n\t\tcase self.text\n\t\t\twhen \"space_created\"\n\t\t\t\treturn \"Space created, \\'#{self.reference.name}\\'\"\n\t\t\twhen \"discussion_created\"\n\t\t\t\treturn self.reference.body\n\t\t\twhen \"comment_created\"\n\t\t\t\treturn self.reference.body\n\t\tend\t\t\n\tend", "def preview_email\r\n invitation = Invitation.new(:user => current_user, :code => Code.new)\r\n mail = Mailers::Debate.create_invitation(current_user, @resource, invitation)\r\n @mail_body = mail.body.sub('No message provided', 'YOUR PERSONALIZED NOTE GOES HERE')\r\n\r\n render :inline => %Q{<%= simple_format(@mail_body, {:style => 'margin: 8px 0px'}) %>}\r\n end", "def message\n \"From: <#{from}>\\nTo: <#{to}>\\nMIME-Version: 1.0\\nContent-type: text/html; charset=UTF-8\\nSubject: #{subject}\\n\\n#{code_html}\"\n end", "def message_body\n return message.spanish_body if parent.spanish_speaking?\n return message.body\n end", "def to_email_text\n semantics = to_semantic_values\n body = []\n [ \"title\", \"part_of\", \"author\", \"contributor\",\n \"date\", \"isbn\", \"issn\", \"doi\" ].each do |field|\n if !semantics[field.to_sym].blank?\n value = semantics[field.to_sym]\n label = \"blacklight.email.text.#{field}\"\n body << I18n.t(label, value: value.join(\" \"))\n end\n end\n\n return body.join(\"\\n\") unless body.empty?\n end", "def body\n read_attribute(:body) || ''\n end", "def plain_text_body\n return @plain_text_body unless @plain_text_body.nil?\n\n parts = if (text_parts = email.all_parts.select {|p| p.mime_type == 'text/plain'}).present?\n text_parts\n elsif (html_parts = email.all_parts.select {|p| p.mime_type == 'text/html'}).present?\n html_parts\n else\n [email]\n end\n\n parts.reject! do |part|\n part.attachment?\n end\n\n @plain_text_body = parts.map do |p|\n body_charset = Mail::RubyVer.respond_to?(:pick_encoding) ?\n Mail::RubyVer.pick_encoding(p.charset).to_s : p.charset\n\n body = Redmine::CodesetUtil.to_utf8(p.body.decoded, body_charset)\n # convert html parts to text\n p.mime_type == 'text/html' ? self.class.html_body_to_text(body) : self.class.plain_text_body_to_text(body)\n end.join(\"\\r\\n\")\n\n @plain_text_body\n end", "def body\n content.gsub(/\\s*---\\s*/, \"\\n\\n\")\n end", "def body\n self[:body]\n end", "def news_body\n body\n end", "def content_for_preview( layout_options )\r\n content = self.body.dup\r\n content.gsub!( /<%=\\s?(@[^%]+)\\s?%>/, '<code>\\1</code>' )\r\n mail = Mail.new( :token => \"\" )\r\n mail.content = Render::Base.new( content ).mail_content\r\n template = IO.read(\"#{RAILS_ROOT}/app/views/mail_tasks/mailer/this_mail.text.html.rhtml\")\r\n \r\n render = Render::Base.new( template, layout_options.merge( :mail => mail ) )\r\n render.mail_content\r\n end", "def body_content\n end", "def html_body\n self[:html_body]\n end", "def as_eloqua_email\n subject = \"#{self.title}: #{self.abstracts.first.headline}\"\n\n {\n :html_body => view.render_view(\n :template => \"/editions/email/template\",\n :formats => [:html],\n :locals => { edition: self }).to_s,\n\n :plain_text_body => view.render_view(\n :template => \"/editions/email/template\",\n :formats => [:text],\n :locals => { edition: self }).to_s,\n\n :name => \"[scpr-edition] #{self.title[0..30]}\",\n :description => \"SCPR Short List\\n\" \\\n \"Sent: #{Time.now}\\nSubject: #{subject}\",\n :subject => subject,\n :email => \"[email protected]\"\n }\n end", "def mailto_body_template\n Liquid::Template.parse(File.read(File.join(@options[:templates], \"mailto_body.liquid\")))\n end", "def text\n @body\n end", "def body_content\n raise NotImplementedError\n end", "def message_body\n active_div.div(:id=>\"inbox_show_message\").div(:class=>\"inbox_excerpt\").text\n end", "def html\n process_message_body if !@html\n @html\n end", "def body\n description\n end", "def body\n ret = read_attribute(:body)\n if ret.nil?\n return ret\n end\n ret = ret.strip\n ret = ret.gsub(/(?:\\n\\s*){2,}/, \"\\n\\n\") # remove excess linebreaks that unnecessarily space it out\n ret\n end", "def deliver\n self.body.to_s.html_safe\n end", "def my_alter_email_body!(mail, string)\n return my_alter_multipart_email!(mail, string) if mail.multipart?\n \n current_body = mail.body\n mail.body = current_body.to_s + \"\\n#{string}\"\n end", "def set_body from_user\n self.body = message_body from_user\n end", "def send_notification(mailFrom, mailTo, mailDomain, mailServer, noticeContent, debug)\n\n# Example Email Notification Template. Modify as needed. Sending HTML email by default because I like it.\n# Example Email Notification Template. Modify as needed. Sending HTML email by default because I like it.\nmessage = <<MESSAGE_END\nFrom: #{mailFrom} \nTo: #{mailTo}\nMIME-Version: 1.0\nContent-type: text/html\nSubject:#{noticeContent[:date]} - ISO IR Resolve - #{noticeContent[:vulnTitle]} (#{noticeContent[:ipAddress]})\n\n<h3>#{noticeContent[:date]} - ISO IR Resolve - #{noticeContent[:vulnTitle]} (#{noticeContent[:ipAddress]})</h3>\nLink to IDS or other system showing the vulnerability or compromise<br/>\nhttps://#{noticeContent[:console]}:#{noticeContent[:conPort]}/vulnerability/vuln-summary.jsp?vulnid=#{noticeContent[:vulnId]}&devid=#{noticeContent[:devId]}<br/>\n\n<p>\n<h3>Issue Summary:</h3>\nA recent scan of #{noticeContent[:ipAddress]} indicates a vulnerability on the system.<br/>\nThe following issue was detected: #{noticeContent[:vulnTitle]}\n<h3>Description of the issue:</h3>\n#{noticeContent[:description]}\n</p>\n\n<p>\n<h3>Event Type:</h3>\nVulnerable\n</p>\n<p>\n<h3>Host(s) Affected:</h3>\n#{noticeContent[:ipAddress]}:#{noticeContent[:port]} / #{noticeContent[:proto]}<br/>\nHostname: #{noticeContent[:hostName]}<br/>\n Detected Aliases: #{noticeContent[:otherNames]}<br/>\nMachine Address: #{noticeContent[:macAddress]}<br/>\n\n</p>\n<p>\nTime of Detection: #{noticeContent[:date]} <br/>\nLevel of Confidence: #{noticeContent[:confirmation]}<br/>\n</p>\n<h3>Evidence/Testing Results</h3>\n#{noticeContent[:proof]}\n#{noticeContent[:solText]}\n\n<br/>\n<i>#{noticeContent[:nexposeId]}</i>\n\n\nMESSAGE_END\n\n begin\n Net::SMTP.start(mailServer) do |smtp|\n smtp.send_message message, mailFrom, mailTo\n end\n\n rescue => err\n $stderr.puts(\"Fail: #{err}\")\n exit(1)\n end\nend", "def body\n return @body\n end", "def body\n return @body\n end", "def body\n return @body\n end", "def body\n return @body\n end", "def email(body)\n message = <<EOM\nFrom: #{FROM}\nTo: #{TO}\nDate: #{NOW.rfc822}\nMessage-Id: #{SecureRandom.uuid}@redhat.com\nSubject: Unassigned upcoming maintenances\n\nRegion Leads - please arrange coverage for these maintenances immediately:\n\n#{body}\n\n---\nThis message has been sent by the Unassigned Maintenance Broadcast System.\nThis utility runs in the #{NAMESPACE} namespace on #{CLUSTER}.\nThe source code for this utility can be found at #{REPO}.\nEOM\n\n Net::SMTP.start('smtp.corp.redhat.com', 25, FROM) do |smtp|\n smtp.send_message message, FROM, TO\n end\nend", "def notify(data)\n puts data[:email]\n @body = data[:body]\n mail to: data[:email], subject: data[:subject]\n end", "def get_body_for_quoting\n # Find the body text and remove emails for privacy/anti-spam reasons\n text = get_main_body_text\n self.mask_special_emails!(text)\n self.remove_privacy_sensitive_things!(text)\n\n # Remove existing quoted sections\n text = self.remove_lotus_quoting(text, '')\n text = IncomingMessage.remove_quoted_sections(text, \"\")\n end", "def body\n self['body']\n end", "def createPrinterReceivedEmailBody(order_hash)\n\t\tbody = <<EOM\t\nOrderNum: #{order_hash[:order_number]}<br/>\nShipMethod: #{order_hash[:ship_option]}<br/>\nShipToFirstName: #{order_hash[:ship_to_first_name]}<br/>\nShipToLastName: #{order_hash[:ship_to_last_name]}<br/>\nShipToCompany: #{order_hash[:ship_to_company]}<br/>\nShipToAddr1: #{order_hash[:ship_to_addr1]}<br/>\nShipToAddr2: #{order_hash[:ship_to_addr2]}<br/>\nShipToCity: #{order_hash[:ship_to_city]}<br/>\nShipToState: #{order_hash[:ship_to_state]}<br/>\nShipToZip: #{order_hash[:ship_to_zip]}<br/>\nShipToPhone: #{order_hash[:ship_to_phone]}<br/>\n<br/>\nOrder Items:<br/>\nEOM\n\n\t\tbody\n\tend", "def createCompleteNoTrackingErrorEmailBody(order_hash)\n\t\tbody = <<EOM\t\nOrderNum: #{order_hash[:order_number]}<br/>\nEmailSubject: #{order_hash[:subject]}\nEOM\n\n\t\tbody\n\tend", "def message_body from_user\n if from_user.musician?\n message_body = \"#{from_user.name} desea unirse al grupo.\"\n message_body += \"<br><br>\"\n message_body += \"Si deseas añadirle al grupo pulsa en el siguiente botón:\"\n message_body += \"<br><br>\"\n else\n message_body = \"#{from_user.name} desea que te unas al grupo.\"\n message_body += \"<br><br>\"\n message_body += \"Si deseas unirte al grupo pulsa en el siguiente botón:\"\n message_body += \"<br><br>\"\n end\n\n message_body += body_form from_user\n\n return message_body\n end", "def set_body\n self.body = message_body\n end", "def body\n return @body\n end", "def template_text\n self.to_html ? self.body_html : self.body\n end", "def message_for(params)\n date = params.has_key?(:date) ? params[:date] : Time.now\n message = <<END_OF_MESSAGE\nFrom: #{@smtp_username}\nTo: #{params[:address]}\nSubject: #{params[:subject]}\nDate: #{date.strftime(\"%a, %d %b %Y %H:%M:%S +0500\")}\n#{params[:body]}\nEND_OF_MESSAGE\n end", "def the_text_body(qty_truncate = 100)\n if kind == 'image'\n '*Sent Picture'\n elsif kind == 'audio'\n '*Sent Audio'\n elsif (body || \"\").match(/^\\[\\[\\d*\\]\\]$/)\n '*Sent sticker'\n else\n body_raw.truncate(qty_truncate)\n end\n end", "def body\n \"\"\n end", "def body\n \"\"\n end", "def to_s\n @body\n end", "def to_s\n @body\n end", "def to_s\n body\n end", "def body\n return \"\"\n end", "def raw_body\n @attributes[:raw_body]\n end", "def inspect\n \"#<#{self.class.name} @body=\\\"#{self.body}\\\">\"\n end", "def to_s\n \"From: #{self.from_user} - #{self.body}\"\n end", "def parsed_body(opts)\n file = File.open(File.dirname(__FILE__) + \"/email.html\", \"r\")\n content = file.read\n markdown = Yolo::Tools::Ios::ReleaseNotes.html\n\n content = content.gsub(\"YOLO.TITLE\",opts[:title])\n content = content.gsub(\"YOLO.CONTENT\",markdown)\n if opts[:ota_password] and opts[:ota_password].length > 0\n content = content.gsub(\"YOLO.PASSWORD\",\"<h3>Password</h3><hr><p>#{opts[:ota_password]}</p>\")\n else\n content = content.gsub(\"YOLO.PASSWORD\",\"\")\n end\n content = content.gsub(\"YOLO.LINK\",opts[:ota_url])\n content\n end", "def error_email_content(exception)\n email_opts = self.class.opts[:error_email]\n headers = email_opts[:default_headers].call(email_opts, exception)\n headers = headers.merge(email_opts[:headers])\n headers = headers.map{|k,v| \"#{k}: #{v.gsub(/\\r?\\n/m, \"\\r\\n \")}\"}.sort.join(\"\\r\\n\")\n body = email_opts[:body].call(self, exception)\n \"#{headers}\\r\\n\\r\\n#{body}\"\n end", "def text_notification(email)\n content = \"\"\n address = email\n phone = User.where(email: email).first.phone\n Membership.where(email: email).each do |membership|\n Task.where(group_id: membership.group_id).each do |task|\n if task.priority == 3\n content << \"#{task.title}\\n\"\n end\n end\n Subtask.where(group_id: membership.group_id).each do |subtask|\n if subtask.priority == 3\n content << \"#{subtask.task.title}: #{subtask.title}\\n\"\n end\n end\n end\n unless phone.nil?\n if content.empty? == false\n TWILIO_CLIENT.account.sms.messages.create(\n from: TWILIO_NUMBER,\n to: \"+#{phone}\",\n body: content\n )\n end\n end\n end", "def body_to_html\n self.body = self.body.gsub(\"\\n\", '<br />')\n end", "def text\n self.body\n end", "def text_message_content_from_erb\n # TODO: Remove the following error after views are rendering. - TW\n end", "def curate_text\n notification_type = get_nagios_var('NAGIOS_NOTIFICATIONTYPE')\n if notification_type.eql?('ACKNOWLEDGEMENT')\n @text += self.content[:short_text][:ack_info] unless self.content[:short_text][:ack_info].empty?\n else\n [:host_info, :state_info, :additional_info, :additional_details].each do |info|\n @text += self.content[:short_text][info] unless self.content[:short_text][info].empty?\n end\n end\n end", "def email_payload\n {\n personalizations: [\n {\n to: [\n email: @to,\n name: @to_name\n ]\n }\n ],\n from: {\n email: @from,\n name: @from_name\n },\n subject: @subject,\n content: [\n {\n type: 'text/plain',\n value: @body\n }\n ]\n }.to_json\n end", "def body\n data[:body]\n end", "def get_body_for_html_display\n text = self.body.strip\n text = CGI.escapeHTML(text)\n text = MySociety::Format.make_clickable(text, :contract => 1)\n text = text.gsub(/\\n/, '<br>')\n return text\n end", "def body\n field_helper(:body, \"<br>~~~~~<br>\")\n end", "def to_s\n @body\n end", "def formatted_body\n body.gsub(/<tn>(.+?)<\\/tn>/m, '<br><p class=\"tn\">\\1</p>').gsub(/\\n/, \"<br>\")\n end", "def getBody\n @body\n end", "def article_body\n respond_to?(:body) ? body : ''\n end", "def inspect\n \"#<Envelope::Message to=#{formatted_to} from=#{formatted_from} cc=#{formatted_cc} bcc=#{formatted_bcc} reply_to=#{formatted_reply_to} subject=\\\"#{subject}\\\" text_part=\\\"#{preview = (text_part || html_part); (preview && preview.gsub(/\\s+/, ' ') || 'No preview available')[0..50]}...\\\">\"\n end" ]
[ "0.77182907", "0.73216015", "0.7242683", "0.71353215", "0.7131467", "0.7082127", "0.7069802", "0.7051678", "0.69970715", "0.69641256", "0.69598466", "0.6952719", "0.693243", "0.6839397", "0.68000025", "0.67972386", "0.67860496", "0.6752864", "0.6747737", "0.6723083", "0.66454726", "0.66067755", "0.6594439", "0.6562454", "0.65608853", "0.6542594", "0.6533139", "0.652473", "0.64797217", "0.6464446", "0.64252543", "0.6403723", "0.64033973", "0.64032", "0.6394676", "0.63745046", "0.6374385", "0.635357", "0.6347003", "0.63445234", "0.6341255", "0.63276505", "0.6325185", "0.63159144", "0.6310112", "0.6302505", "0.6298757", "0.6293246", "0.6288816", "0.62735593", "0.6271227", "0.6269291", "0.6269116", "0.6258123", "0.625728", "0.62403846", "0.6237181", "0.62075305", "0.62023497", "0.6180477", "0.6178475", "0.6178475", "0.6178475", "0.6178475", "0.615382", "0.61520433", "0.6143222", "0.61399084", "0.61333346", "0.6119231", "0.61044437", "0.60992366", "0.6074507", "0.6062602", "0.60582024", "0.60442597", "0.60342586", "0.60342586", "0.60288924", "0.60288924", "0.6015709", "0.60077995", "0.59991044", "0.59960437", "0.5992813", "0.5990114", "0.5982904", "0.59825444", "0.5974113", "0.59719753", "0.5965646", "0.59616894", "0.59590876", "0.5954599", "0.5954527", "0.5954271", "0.595427", "0.5944219", "0.5942238", "0.59398264", "0.5938506" ]
0.0
-1
Takes a host to and initializes `task` attribute as an empty array.
def initialize(host=nil) @host = host @tasks = [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize # Initialize method that is similar to a Constructor in Java\n @all_tasks = [] # Method includes an array that stores all tasks\n end", "def tasksOnHost(filter, host)\n java_import 'java.net.URL'\n java_import 'java.net.SocketException'\n java_import 'java.io.InputStreamReader'\n java_import 'org.apache.hbase.thirdparty.com.google.gson.JsonParser'\n\n infoport = @admin.getClusterMetrics.getLiveServerMetrics.get(host).getInfoServerPort.to_s\n\n begin\n schema = \"http://\"\n url = schema + host.hostname + ':' + infoport + '/rs-status?format=json&filter=' + filter\n json = URL.new(url).openStream\n rescue SocketException => e\n # Let's try with https when SocketException occur\n schema = \"https://\"\n url = schema + host.hostname + ':' + infoport + '/rs-status?format=json&filter=' + filter\n json = URL.new(url).openStream\n end\n\n parser = JsonParser.new\n\n # read and parse JSON\n begin\n tasks_array_list = parser.parse(InputStreamReader.new(json, 'UTF-8')).getAsJsonArray\n ensure\n json.close\n end\n # convert to an array of TaskMonitor::Task instances\n tasks = []\n tasks_array_list.each do |t|\n tasks.unshift Task.new(t.getAsJsonObject, host)\n end\n\n tasks\n end", "def hosts=(_arg0); end", "def hosts=(_arg0); end", "def initialize(task)\n @task = task\n end", "def description\n\t\t\"This task creates & associates a host for every object it is given.\"\n\tend", "def tasks=(value)\n @tasks = value\n end", "def tasks=(value)\n @tasks = value\n end", "def tasks=(value)\n @tasks = value\n end", "def tasks\n @tasks ||= {}\n end", "def tasks\n @tasks ||= Harvest::API::Tasks.new(credentials)\n end", "def initialize_group( task )\n @task = task\n end", "def initialize(task)\n super()\n @task= task \n end", "def all_tasks\n @all_tasks ||= []\n end", "def get_taskarray\n @task_array\n end", "def host=(host)\n @hosts = nil\n @host = host\n end", "def hosts\n @hosts ||= []\n end", "def tasks=( array )\n @tasks = array\n update_internal_task_lists()\n end", "def initialize\r\n load_tasks\r\n end", "def tasks() []; end", "def custom_configure_tasks_for(a=nil)\n []\n end", "def custom_configure_tasks_for(a=nil)\n []\n end", "def tasks\n @tasks ||= Evoke.tasks\n end", "def push_taskarray(task)\n @task_array << task\n end", "def initialize\n @tasks = []\n @futures = nil\n end", "def jeweler_tasks=(_arg0); end", "def program(tasks, hour, &task)\n\ttasks[hour] = task\nend", "def hosts=(hosts)\n @host = nil\n @hosts = hosts\n end", "def host_list\n return @host_list if defined?(@host_list)\n\n if !self.hosts.blank?\n @host_list = self.hosts.split(/[,\\s]+/).compact\n else\n @host_list = []\n end\n\n @host_list\n end", "def task=(value)\n @task = value\n end", "def initialize(rack_name, pan_host=nil)\n @rack_name = rack_name\n @hosts = []\n if pan_host.class == Array\n pan_host.each { |ph| @host << ph }\n elsif pan_host != nil\n @hosts << pan_host\n end\n end", "def tasks\n config[:tasks]\n end", "def tasks\n @config.map do |task_name, options|\n task_params = options.symbolize_keys\n task_params[:queue_ahead] ||= @queue_ahead\n task_params[:name] = task_name\n task_params[:tz] ||= @time_zone\n Task.new(task_params)\n end\n end", "def hosts; end", "def hosts; end", "def hosts; end", "def initialize_host\n self.host = (Host.find(:name => settings['host']) || Host.new(:name => settings['host']))\n\n current_host_group_names = (host.host_groups || []).map(&:name)\n current_template_names = (host.templates || []).map(&:name)\n\n host_groups_to_add, templates_to_add = [], []\n\n (self.host_groups || []).each do |hg|\n host_groups_to_add << hg unless current_host_group_names.include?(hg.name)\n end\n\n (self.templates || []).each do |t|\n templates_to_add << t unless current_template_names.include?(t.name)\n end\n\n host.host_groups = ((host.host_groups || []) + host_groups_to_add).flatten.compact.uniq\n host.templates = ((host.templates || []) + templates_to_add).flatten.compact.uniq\n host.save\n host\n end", "def hosts\n if @hosts\n @hosts\n elsif @host\n [@host]\n else\n self.class.hosts\n end\n end", "def host=(_); end", "def hosts\n # prevent original array from being changed\n @hosts.dup\n end", "def initialize(ruby_process_server, name, model, task_context_class: TaskContext)\n @ruby_process_server = ruby_process_server\n @deployed_tasks = Hash.new\n @task_context_class = task_context_class\n super(name, model)\n end", "def configure_tasks\n end", "def tasks\n task_list.tasks\n end", "def host=(_arg0); end", "def host=(_arg0); end", "def collect_tasks\n @top_level_tasks = []\n ARGV.each do |arg|\n if arg =~ /^(\\w+)=(.*)$/\n ENV[$1] = $2\n else\n @top_level_tasks << arg unless arg =~ /^-/\n end\n end\n @top_level_tasks.push(\"default\") if @top_level_tasks.size == 0\n end", "def task(task_name, opts = EMPTY_HASH)\n conf = OpenStruct.new # rubocop:disable Style/OpenStructUse\n yield conf\n tasks << ({ name: task_name, **opts, **conf.to_h })\n self\n end", "def task_list\n return @task_list if @task_list\n @task_list = []\n spec_file_names.each do |file_name_spec|\n next if spec_is_disabled? file_name_spec\n next if skip_globals? file_name_spec\n next unless spec_included? file_name_spec\n get_spec_runs(file_name_spec).each do |run|\n next unless run[:hiera] and run[:facts]\n next unless facts_included? run[:facts]\n next unless hiera_included? run[:hiera]\n task = Noop::Task.new file_name_spec, run[:hiera], run[:facts]\n task.parallel = true if parallel_run?\n @task_list << task\n end\n end\n @task_list\n end", "def initialize(host)\n @host = host\n end", "def initialize_host_groups\n self.host_groups = settings['host_groups'].split(',').flatten.compact.map(&:strip).uniq.map { |group_name | HostGroup.find_or_create(:name => group_name.strip) }\n end", "def list_of_hosts\n super\n end", "def initialize(host)\n @host = host\n end", "def capable_tasks() @capable_tasks ||= Task.children; end", "def collect_tasks\n tasks = []\n $sake_op = {}\n ARGV.each do |arg|\n if arg =~ /^(\\w+)=(.*)$/\n ENV[$1] = $2\n $sake_op[$1.to_sym] = $2\n else\n tasks << arg\n end\n end\n tasks.push(\"default\") if tasks.size == 0\n tasks\n end", "def initialize \n @Projects = Array.new \n @Users = Array.new\n @Tasks = Array.new \n end", "def add(task)\n @all_tasks << task\n end", "def tasks\n @tasks ||= Task.find(self.task_ids)\n end", "def set_task_service\n @task_service = TaskService.new\n end", "def add task\n @tasks << task\n end", "def load_tasks\n end", "def host=(h)\n @host = h\n end", "def hosts\n @hosts ||= Array(Hansolo.target).map { |target| URI.parse(target) }\n end", "def initialize\n self.tasks = Array.new\n self.run_queue = Queue.new\n self.schedule\n end", "def initialize(task, options)\n @task = task\n end", "def host(h = nil)\n if h\n @host = h\n else\n @host\n end\n end", "def show_tasks(hostname = nil)\n if hostname\n mirror = Mirror.find_by_hostname hostname\n\n if mirror\n puts \"#{mirror.tasks.size} tasks\"\n\n mirror.tasks.each do |task|\n puts \"#{task.command} #{task.path}\"\n end\n else\n puts \"hostname not found\"\n end\n else\n puts \"#{Task.count} tasks\"\n\n Task.all.each do |task|\n puts \"#{task.command} #{task.path}\"\n end\n end\n\n nil\nend", "def host=(new_host); end", "def noop_tasks(name, list)\r\n\t namespace name do\r\n\t metaclass = class << self; self; end\r\n\t list.each do |k|\r\n\t tasks[k.to_sym].instance_variable_set(:@body, lambda {})\r\n\t end\r\n\t end\r\n\t end", "def task_lists\n\t\t@task_lists ||= fetch_latest_task_lists\n\tend", "def tasks\n @client.list_tasks(cluster: @cluster, service_name: @name)[0]\n end", "def backend_addTask(param) \n @Tasks.push(param) \n end", "def add_task(task)\n\t\t@tasks << task\n\tend", "def tasks\n @db[:tasks].keys.compact.uniq || []\n end", "def initialize(host='localhost')\n\t\t@host = host\n\tend", "def available_hosts\n @available_hosts ||= []\n end", "def add(task)\n @tasks << task\n end", "def task_list\n self.tasks.map do |task|\n task.text\n end\n end", "def initialize(t)\n @task = t\n @timestamp = Timestamp.new\n end", "def initialize(url, refresh = true)\n self.tasks = []\n self.url = url\n self.refresh if refresh\n end", "def add_task(task)\n @tasks << task\n end", "def task\n @task ||= default_task # rubocop:disable ThreadSafety/InstanceVariableInClassMethod\n end", "def setSubtasks(tasks)\r\n\t\t\t\t\t@tasks = tasks\r\n\t\t\t\tend", "def initialize(fail_fast:, hosts:)\n self.fail_fast = fail_fast\n self.hosts = hosts\n end", "def hosts\n @hosts ||= begin\n r, h, u = [], (config[:hosts] rescue nil), (config[:user] rescue nil)\n h.each {|host| r << Host.new(host, u) } if h && u; r\n end\n end", "def load_task_param_variables!\n Task[].each do |task_name, task|\n task.param_values.each do |param_name, param_value|\n self[\"#{task.name}:#{param_name}\"] = param_value\n end\n end\n end", "def add_hosts(hosts:)\n @hosts = @hosts.+ Array hosts\n\n self\n end", "def empty?; tasks.empty? end", "def from_ns(config)\n tasks = []\n a = config['tasks']\n a.each do |h|\n task = Task.new\n task.id = h['id'] if h['id']\n task.name = h['name'] if h['name']\n task.start_time = h['start_time'] if h['start_time']\n tasks << task\n end\n return {:tasks => tasks}\n end", "def addHost(host)\n\t\[email protected](host)\n\tend", "def prepare_task\n end", "def initialize( task_class, max_workers )\n\t\tsuper\n\t\t@queue = nil\n\tend", "def build_default_tasks\n @rake_task << self.step_template # get General Configuration information\n end", "def hosts\n @hosts ||= match[5].split(\",\")\n end", "def custom_install_tasks_for(a=nil)\n []\n end", "def bind(task)\n @task = task\n end", "def hosts\n @hosts ||= match[5].split(\",\")\n end", "def task_list_items\n result[:task_list_items] ||= []\n end", "def getTasks(response)\r\n\t\t\t\ttasks_all_json = JSON.parse response\r\n\t\t\t\ttasks_all_array = tasks_all_json[\"tasks\"]\r\n\t\t\t\ttasks_class_array = Array.new\r\n\t\t\t\tfor i in 0...tasks_all_array.length\r\n\t\t\t\t\ttasks_class_array.push(jsonToTask(tasks_all_array[i]))\r\n\t\t\t\tend\r\n\t\t\t\treturn tasks_class_array\r\n\t\t\tend", "def custom_install_tasks_for(a=nil)\n []\n end", "def task_assignments\n @task_assignments ||= Harvest::API::TaskAssignments.new(credentials)\n end" ]
[ "0.67093545", "0.6549487", "0.63946384", "0.63946384", "0.62502074", "0.62445647", "0.6239553", "0.6239553", "0.6239553", "0.61795175", "0.6177458", "0.61316544", "0.6126421", "0.60572904", "0.60484326", "0.60366523", "0.6012856", "0.59558856", "0.5936936", "0.59276474", "0.59169316", "0.5909426", "0.5903902", "0.5852636", "0.5788568", "0.57865083", "0.57813376", "0.5755634", "0.5743432", "0.5732364", "0.5685687", "0.567292", "0.56602657", "0.56000215", "0.56000215", "0.56000215", "0.5587457", "0.5555101", "0.5546299", "0.554342", "0.5523919", "0.5513125", "0.55084485", "0.5506126", "0.5506126", "0.5497332", "0.5491772", "0.5486081", "0.5475439", "0.54665476", "0.5457197", "0.54556", "0.5455087", "0.54539424", "0.54530114", "0.54462415", "0.5441394", "0.54277897", "0.5425733", "0.54176295", "0.5381806", "0.53817576", "0.53753984", "0.5372463", "0.53661203", "0.53642017", "0.53547704", "0.53541034", "0.5352478", "0.5348873", "0.5346585", "0.533471", "0.53315055", "0.5321988", "0.5321418", "0.53121823", "0.53115964", "0.53114074", "0.5311217", "0.5298629", "0.529797", "0.52853185", "0.528283", "0.527548", "0.5274757", "0.5268951", "0.52617925", "0.52607733", "0.52598244", "0.52583116", "0.5256645", "0.5248193", "0.5242619", "0.52419204", "0.5233446", "0.5232392", "0.5229755", "0.52272695", "0.52198476", "0.52182955" ]
0.804462
0
has_many :reverse_relationships, foreign_key: "followed_id", class_name: "Relationship", dependent: :destroy has_many :followers, through: :reverse_relationships, source: :follower
def followers rels = Relationship.where(followed_id: self.id) followers = [] rels.each do |rel| followers << User.find(rel.follower_id) end followers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def followers\n Follow.where(\"following_id = ?\", self.id)\n end", "def followers\n Following.where(:followed_id => self).includes(:follower).map(&:follower)\n end", "def follow(other)\n active_relationships.create(followed_id: other.id)\nend", "def followed\n Following.where(:follower_id => self).includes(:followed).map(&:followed)\n end", "def follow!(followed)\n self.relationships.create!(:followed_id => followed.id)\n end", "def following\n Follow.where(\"follower_id = ?\", self.id)\n end", "def follow (other_user)\n active_relationships.create(followed_id: other_user.id)\nend", "def follow! followee\n following << followee\n save\n followee.followers << self\n followee.save\n end", "def follow(other)\n active_relationships.create(followed_id: other.id)\n end", "def follow(other_user)\n active_relationships.create(following_id: other_user.id)\n end", "def unfollow(other_user)\n \tactive_relationships.find_by(followed_id: other_user.id).destroy\n \tend", "def unfollowed(other_user)\n passive_relationships.find_by(follower_id: other_user.id).try(:destroy) \n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end", "def follow!(other_user)\n relationships.create(followed_id: other_user.id)\n end", "def model_relationships; end", "def follow(other)\n active_relationships.create(follower_id: self.id, followed_id: other.id)\n end", "def followerss\n followers = relationships.find_by_followed_id(self.id)\n return followers\n end", "def follow(other_user)\n following_relationships.create(followed_id: other_user.id)\n end", "def follow!(other_user)\n relationships.create!(followed_id: other_user.id)\n end", "def follow!(other_user)\n relationships.create!(followed_id: other_user.id)\n end", "def follow!(other_user)\n relationships.create!(followed_id: other_user.id)\n end", "def follow!(other_user)\n relationships.create!(followed_id: other_user.id)\n end", "def follow!(other_user)\n relationships.create!(followed_id: other_user.id)\n end", "def followers_ids\n Following.where(followed_id: self.id).pluck(:follower_id)\n end", "def follow!(other_user)\n\t\tself.relationships.create! followed_id: other_user.id, follower_id: self.id\n\tend", "def delete_following_relationships\n # First store who we follow and are followed_by\n # I guess there's a scaling limit here.\n followed_users = user.following.select(:id, :created_at).to_a\n followed_by_users = user.followers.select(:id, :created_at).to_a\n # Delete the relationships\n user.following_relationships.delete_all(:delete_all)\n user.follower_relationships.delete_all(:delete_all)\n\n # Set the follower_counts of users who were being followed.\n followed_users.each do |followed_user|\n followed_user.update_columns(follower_count: followed_user.followers.count)\n end\n\n # Set the following_count of users who were following.\n followed_by_users.each do |followed_by_user|\n followed_by_user.update_columns(following_count: followed_by_user.following.count)\n end\n end", "def follow! (other)\n\t\tself.relationships.create!(followed_id: other.id)\n\tend", "def follow!(other_user)\n relationships.create!(followed_id: other_user.id)\n end", "def follow(other)\n following << other\n other.followers << self\n end", "def unfollow(other_user)\n active_relationships.find_by(followed_id: other_user.id).destroy\n end", "def unfollow(other_user)\n active_relationships.find_by(followed_id: other_user.id).destroy\n end", "def unfollow(other_user)\n active_relationships.find_by(followed_id: other_user.id).destroy\n end", "def create\n\n user = User.find(params[:followed_id])\n @current_user.follow(user)\n redirect_to user\n\n\n # PATCH/PUT /relationships/1\n # PATCH/PUT /relationships/1.json\n def update\n\n end\n\n # DELETE /relationships/1\n # DELETE /relationships/1.json\n def destroy\n user = Relationship.find(params[:id]).followed\n @current_user.unfollow(user)\n redirect_to user\n end\n end", "def inverse_class\n ManyToOne::Relationship\n end", "def inverse_class\n ManyToOne::Relationship\n end", "def follow(other_user)\n follow_down.create(following_id: other_user.id)\n end", "def followings_ids\n Following.where(follower_id: self.id).pluck(:followed_id)\n end", "def follow!(followed)\n relationships.create!(:followed_id => followed.id)\n end", "def follow(other_user)\n\t\tactive_relationships.create(followed_id: other_user.id)\n\tend", "def follow!(other_user)\n\t\trelationships.create!(followed_id: other_user.id)\n\tend", "def follow!(user)\n relationships.create!(:followed_id => user.id)\n end", "def followables_relation(follower, klass, opts = {})\n rel = Socialization::RedisCache::Follow.followables_relation(follower, klass, opts)\n rel = super(follower, klass, opts) if rel.blank?\n rel\n end", "def find_relationship followed_id\n \tfollowing_relationships.find_by followed_id: followed_id \n end", "def unfollow(other_user)\n following_relationships.find_by(followed_id: other_user.id).destroy\n end", "def follow(other_person)\n active_relationships.create(followed_id: other_person.id)\n end", "def follow(user)\n active_relationships.create(followed_id: user.id)\n end", "def follow!(other_user)\n\t\t# same as user.relationships.create or self.relationships.create\n\t\trelationships.create!(followed_id: other_user.id)\n\tend", "def following_list\n User.joins(\"INNER JOIN followings ON followings.followed_id = users.id WHERE followings.follower_id = #{self.id}\").select(\"users.*\")\n end", "def unfollow(other_user)\n\t\tactive_relationships.find_by(followed_id: other_user.id).destroy\n\tend", "def followers_relation(followable, klass, opts = {})\n rel = Socialization::RedisCache::Follow.followers_relation(followable, klass, opts)\n rel = super(followable, klass, opts) if rel.blank?\n rel\n end", "def unfollow! followee\n following_ids.delete(followee.id)\n save\n followee.followers_ids.delete(id)\n followee.save\n end", "def unfollow!(other_user)\n relationships.find_by(followed_id: other_user.id).destroy\n end", "def unfollow(other_person)\n active_relationships.find_by(followed_id: other_person.id).destroy\n end", "def follow! followee\n return if following? followee\n following << followee\n save\n followee.followers << self\n followee.save\n end", "def unfollow!(other_user)\n\t\tself.relationships.find_by_followed_id(other_user.id).destroy\n\tend", "def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end", "def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end", "def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end", "def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end", "def unfollow!(other_user)\n relationships.find_by_followed_id(other_user.id).destroy\n end", "def unfollow!(other_user)\n relationships.find_by(followed_id: other_user.id).destroy!\n end", "def follow(user)\n user.followers << self\n self\n end", "def unfollow(other_user_id)\n \tuser_to_unfollow = User.find_by(id: other_user_id)\n active_relationships.find_by(followed_id: user_to_unfollow.id).destroy\n end", "def follow(user)\n user.followers << self\n end", "def follow(user)\n user.add_follower(self)\n self\n end", "def unfollow!(user)\n relationships.find_by_followed_id(user).destroy\n end", "def follow(foo_user)\n active_relationships.create(followed_id: foo_user.id)\n end", "def unfollow\r\n @relationship = Relationship.where(follower_id: current_user.id, followed_id: params[:followed_id]).first\r\n @relationship.create_activity key: 'relationship.unfollow', owner: current_user, recipient: User.find(params[:followed_id]) \r\n @relationship.destroy\r\n render json: { message: \"Relationship destroyed successfully\" }\r\n end", "def get_relationship(other_user)\n\tif other_user.present?\n\t\tRelationship.where(\"follower_id = :follower_id and followed_id = :followed_id or follower_id = :followed_id and followed_id = :follower_id\", {follower_id: other_user.id, followed_id: self.id})[0]\n\tend\n end", "def unfollow! followee\n return if !following? followee\n following_ids.delete(followee.id)\n save\n followee.followers_ids.delete(id)\n followee.save\n end", "def follow_self\n Follow.create(follower_id: id, followed_id: id)\n end", "def destroy_following\n user = User.find(params[:id])\n current_user.followings.where(following_id: user.id).destroy_all\n end", "def unfollow!(followed)\n relationships.find_by_followed_id(followed).destroy\n end", "def unfollow!(followed)\n relationships.find_by_followed_id(followed).destroy\n end", "def follow(other_user)\n following << other_user\n end", "def follow(other_user)\n following << other_user\n end", "def follow(other_user)\n following << other_user\n end", "def follow(other_user)\n following << other_user\n end", "def follow(other_user)\n following << other_user\n end", "def follow(other_user)\n following << other_user\n end", "def unfollow(user)\n user.followers.delete(self)\n end", "def unfollow\n unfollow = User.where(:username => params[:id]).first\n relationship = @current_user.followers.where( :friend_id => unfollow.id ).first\n relationship.destroy\n redirect_to user_path( unfollow.username )\n end", "def reverse_foreign_keys\n connection.reverse_foreign_keys(table_name, \"#{name} Reverse Foreign Keys\")\n end", "def relationship_links(source)\n {}\n end", "def destroy\n user = Relationship.find(params[:id]).followed\n @current_user.unfollow(user)\n redirect_to user\n end", "def count_followed\n\t\t#relationships.where(follower_id: self.id).count\n\tend", "def unfollow_user(follow_user)\n #before we can destroy the link we must check if the user is already not following the other user\n #or if the user is trying to unfollow themself.\n #if the user can follow the other user then that means no relationship exists\n if can_follow?(follow_user)\n raise \"Can't unfollow yourself or a user that you are not already following!\"\n else\n followRel = Follow.find(:first, :conditions => {:user_id => self.id, :follow_user_id => follow_user.id})\n followRel.destroy\n end\n end", "def relationship(user)\n Following.where(:follower_id => self, :followed_id => user).first.try(:relationship)||\"none\"\n end", "def followers\n follower_ids = Follow.where(following_id: id).pluck(:user_id)\n User.where(id: follower_ids)\n end", "def follow(user_id)\n followee_relationships.create(followee_id: user_id)\n end", "def relationship_params\n params.require(:relationship).permit(:follower_id, :followed_id)\n end", "def relationship_params\n params.require(:relationship).permit(:follower_id, :followed_id)\n end" ]
[ "0.68456525", "0.68006134", "0.6770891", "0.66944593", "0.66756195", "0.66528517", "0.6610943", "0.6567458", "0.65321505", "0.6499715", "0.64873135", "0.6482333", "0.6481215", "0.6481215", "0.6481215", "0.6481215", "0.6481215", "0.6481215", "0.6481215", "0.6481215", "0.6481215", "0.64773995", "0.6475794", "0.6456773", "0.6455655", "0.64467025", "0.6439972", "0.6439972", "0.6439972", "0.6439972", "0.6439972", "0.64372605", "0.6421318", "0.64123976", "0.6402728", "0.6369919", "0.63688654", "0.63637364", "0.63637364", "0.63637364", "0.63608354", "0.6359079", "0.6359079", "0.635215", "0.63398343", "0.63156873", "0.6306109", "0.6297263", "0.62893766", "0.62856", "0.62806034", "0.62528026", "0.624924", "0.62317866", "0.62291473", "0.62214464", "0.6208321", "0.6208085", "0.620496", "0.62040365", "0.62033427", "0.6199009", "0.6198371", "0.6191994", "0.6191994", "0.6191994", "0.6191994", "0.6191994", "0.615331", "0.614664", "0.6145135", "0.6142759", "0.6126917", "0.6084389", "0.60766405", "0.6066989", "0.6055582", "0.60395974", "0.6030157", "0.6028716", "0.6026859", "0.6026859", "0.59994334", "0.59994334", "0.59994334", "0.59994334", "0.59994334", "0.59994334", "0.5986385", "0.5983961", "0.5983139", "0.5963784", "0.5951205", "0.59473944", "0.59317136", "0.5922635", "0.5911945", "0.5905665", "0.5892258", "0.5891617" ]
0.65514994
8
Helper method for bottomup implementation
def knapsack_table(weights, values, capacity) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_bottom\n return unless in_list?\n\n decrement_positions_on_lower_items\n assume_bottom_position \n end", "def move_to_bottom\n return unless in_list?\n\n decrement_positions_on_lower_items\n assume_bottom_position\n end", "def move_to_bottom\n self.class.transaction do\n decrement_position_of_lower_items\n set_bottom_position\n end\n end", "def move_to_bottom\n return unless in_list?\n insert_at_position bottom_position_in_list.to_i\n end", "def insert_at_bottom\n assume_bottom_position\n end", "def add_to_bottom\n self.position = bottom + 1\n end", "def move_to_bottom\n # return unless in_list?\n acts_as_list_class.transaction do\n decrement_positions_on_lower_items if in_list?\n assume_bottom_position\n end\n end", "def bottom; return self[1]+self[3]; end", "def move_to_bottom\n last_sib = last_sibling\n move_to_right_of(last_sib) if last_sib && self != last_sib\n end", "def move_to_bottom\n return true if at_bottom?\n move_below(last_sibling_in_list)\n end", "def bottomleft; return self[0], self.bottom; end", "def bottom=(b); self[1] = b - self[3]; return b; end", "def move_to_bottom\n return if self == self_and_siblings(true).last\n move_to(self_and_siblings.last.position_in_list)\n end", "def move_to_bottom\n return unless in_list?\n acts_as_list_class.transaction do\n decrement_positions_on_lower_items\n assume_bottom_position\n end\n end", "def bottom()\n return @top + @height\n end", "def bottomright; return self.right, self.bottom; end", "def assume_bottom_position\n update_attribute(:position, bottom_position_in_list(self).to_i + 1)\n end", "def move_down\n return if at_bottom?\n self.class.where(:position => self.position + 1).first.inc(:position, -1)\n inc(:position, 1)\n end", "def snap_to_bottom_of( sibling_view )\n new_y = sibling_view.frame.origin.y - self.height\n self.frame = CGRectMake(self.frame.origin.x, new_y, self.width, self.height)\n end", "def bottom()\n @view__.bottom\n end", "def at_bottom?\n lower_siblings.empty?\n end", "def bottom\n return @bottom\n end", "def move_to_bottom_in_queue\n return unless in_queue?\n acts_as_queue_class.transaction do\n decrement_queue_positions_on_lower_items\n assume_bottom_queue_position\n end\n end", "def bottom\n @ole.Bottom\n end", "def bottom\n @ole.Bottom\n end", "def assume_bottom_position\n update_attribute(position_column, bottom_position_in_list(self).to_i + 1)\n end", "def bottom=(value)\n @bottom = value\n end", "def move_to_bottom(tag, klass)\n remove(tag, klass)\n self.instance.add(tag, klass)\n end", "def max_heapify_bottom_up(index)\n if parent_i(index) && self[parent_i(index)] < self[index] \n self.swap(parent_i(index), index)\n max_heapify_bottom_up(parent_i(index))\n end\n end", "def assume_bottom_position\n pos = bottom_position_in_list(self).to_i + 1 \n set_my_position(pos)\n end", "def goto_bottom\n if y < battlefield_height - 61\n accelerate 1\n else\n @at_bottom = true\n end\n end", "def bubble_up()\n\t\ti = @elements.length - 1\n\t\twhile(i > 0)\n\t\t\t# compare with its parent. swap if parent is less than it\n\t\t\tif @elements[(i-1)/2][@orderBy] >= @elements[i][@orderBy]\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\tswap((i-1)/2, i)\n\t\t\t\ti = (i-1)/2\n\t\t\tend\n\t\tend\n\tend", "def pad_bottom(y)\n yield\n move_down(y)\n end", "def move_up\n return if at_top?\n self.class.where(:position => self.position - 1).first.inc(:position, 1)\n inc(:position, -1)\n end", "def bottom!\n self.ox = self.width/2\n self.oy = self.height\n end", "def assume_bottom_position\n set_list_position(bottom_position_in_list(self).to_i + 1)\n end", "def bubble_up(index)\n #YOUR WORK HERE\n end", "def bottom(value)\n @ole.Bottom = value\n nil\n end", "def bottom(value)\n @ole.Bottom = value\n nil\n end", "def assume_bottom_position\n pos = bottom_position_in_list(self).to_i + 1\n set_my_position(pos)\n end", "def fit_to_bottom_of( sibling_view )\n new_height = sibling_view.frame.origin.y - self.frame.origin.y\n self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.width, new_height)\n end", "def bottoms_up_method\n\t\t# 1. take the nodes that went the farthest (i.e.: max tree level)\n\t\tmax_level = @tree.tree_bottom.collect(&:level).max\n\t\t# 2. Of those, use the one with the minimum sum value\n\t\twinner = @tree.tree_bottom.select{|t|t.level==max_level}.min_by(&:sum)\n\t\t# binding.pry \n\t\tbottoms_up_dir(winner).dir\n\tend", "def assume_bottom_queue_position\n update_attribute(queue_position_column, bottom_queue_position_in_queue(self).to_i + 1)\n end", "def move_to_bottom(klass)\n remove(klass)\n self.instance.add(klass)\n end", "def bubble_up(i)\n while i > 0\n parent = (i+1) / 2 - 1\n if @contents[parent].key >= @contents[i].key then\n @contents[parent],@contents[i] = @contents[i],@contents[parent]\n i = parent\n else return\n end\n end\n end", "def bottom_item\n @current = last\n\n items\n end", "def bottom\n @widget.margins.bottom + @widget.borders.bottom\n end", "def bottom_aligned?\n value == :bottom\n end", "def inner_up\n # looking up at the bottom of the inner grid\n return 0 if inner.nil?\n # sum bottom edge\n (0..@size-1).map { |x| inner.get_loc(x, @size - 1) ? 1 : 0 }.sum\n end", "def move_to_bottom_of(node)\n movement(node, :strict => true) do |to|\n self.left_sibling = to.target.record\n end\n end", "def fallen_off_bottom?\n self.y > $window.height\n end", "def border_bottom()\n return get_border(:bottom)\n end", "def bottom_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col, cell.row+1)}\n end", "def bottom_position_in_list(except = nil)\n item = bottom_item(except)\n item ? item.current_position : acts_as_list_top - 1\n end", "def bottom\n self.ox = self.src_rect.width/2\n self.oy = self.src_rect.height\n end", "def bottom\n row, col = @position\n return [row + 1, col] unless row + 1 > 7\n []\n end", "def leads_up?(point, empty_test, height)\n inner = ->(pt, dir) { #inner searches either left or right\n if !empty_test.(pt)\n then false\n elsif point[1] == 0 #if it hits the top of the board\n then true\n elsif height == 0 #if it has risen enough\n then true\n elsif empty_test.(plus(pt, Up)) \n then leads_up?(plus(pt, Up), empty_test, height-1) #move up a level\n else\n inner.(plus(pt, dir), dir) #move sideways and keep looking\n end\n }\n inner.(point, Left) || inner.(point, Right)\n end", "def bottom_left\n Point[x, y + height]\n end", "def bottomToTopWraparound(grid, width, height)\n\n strings = bottomToTop(grid, width, height)\n\n for string in strings do\n\n string << string\n\n end\n\n return strings\n\nend", "def move_to_bottom_on_unarchive\n if self.just_unarchived\n self.just_unarchived = false\n self.move_to_bottom if self.respond_to?(:move_to_bottom)\n end\n return true\n end", "def all_below\n @bottom.empty? ? [self] : @bottom.flat_map { |r| r.all_below }.uniq\n end", "def bubble_down(i)\n while true\n child1 = (i+1) * 2 - 1\n child2 = (i+1) * 2\n if child1 >= size then return\n elsif child2 >= size then\n if @contents[i].key >= @contents[child1].key then\n @contents[i],@contents[child1] = @contents[child1],@contents[i]\n return\n else return\n end\n else min = if @contents[child1].key <= @contents[child2].key\n then child1 else child2\n end\n if @contents[i].key > @contents[min].key\n @contents[i],@contents[min] = @contents[min],@contents[i]\n i = min\n else return\n end\n end\n end\n end", "def bottom\n @x_max\n end", "def from_up(cur)\n\t\tmove(cur, -1, 0)\n\tend", "def bottom_item(except = nil)\n except ? siblings.reject{|page| page == self }.last : siblings.last\n end", "def bottom_panel\n Panel.bottom_panel(pointer)\n end", "def bottom_right\n @position + @dimensions\n end", "def page_down_to_bottom_of_scroll_bar\n scroll_down_one_page while vertical_scroll_percent < 99.99\n end", "def bottomToTop(grid, width, height)\n\n strings = topToBottom(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend", "def top_up(gbp)\n fail 'Cannot exceed #{MAXIMUM_BALANCE}' if @balance + gbp > MAXIMUM_BALANCE\n @balance += gbp\n end", "def bubble_down()\n\t\t# remove max and swap with last node\n\t\t@elements[0] = @elements.pop\n\t\ti = 0\n\t\twhile(i < @elements.length)\n\t\t\tmax_idx = i\n\t\t\t# find greater of left and right child\n\t\t\tif((2*i + 1) < @elements.length && @elements[2*i + 1][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 1\n\t\t\tend\n\t\t\tif((2*i + 2) < @elements.length && @elements[2*i + 2][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 2\n\t\t\tend\n\t\t\t# if left or right child is greater, swap and update i\n\t\t\tif(max_idx != i)\n\t\t\t\tswap(i, max_idx)\n\t\t\t\ti = max_idx\n\t\t\t# if not, we are done\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\tend", "def move_up\n current_y = position[0] - 1\n position[0] = (current_y < 0 ) ? (width-1) : current_y\n end", "def bubble_up(index, node)\n while (index!=0 && @ary[(index-1)/2].key > node.key) #while parent is bigger,\n @ary[index], @ary[(index-1)/2] = @ary[(index-1)/2], @ary[index] #swap\n index = (index-1)/2\n end\n end", "def piece_up\n return unless @falling_piece\n\n @falling_piece.y -= @block_size\n @falling_piece.grid_position.y -= 1\n end", "def bottom_gap?\n near_pages.first > 1\n end", "def move_up\n unless @value.eql? 1\n @y -= 50\n @value -= 1\n end\n end", "def bottom_position_in_list(except = nil)\n item = bottom_item(except)\n item ? item.send(:position) : 0\n end", "def bottom_position_in_list(except = nil)\n item = bottom_item(except)\n item ? item.send(position_column) : 0\n end", "def align_bottom\n @vertical_align = :bottom\n return self\n end", "def test_directionBottom\n [@window, @sprite, @bitmap].each{|container|\n uc = UCCharacterGraphic.new(container, Rect.new(200, 40, 40, 40), $data_actors[1])\n uc.direction = 0\n uc.draw()\n }\n return true\n end", "def mm_upheap(j, upper)\n while true\n return if j <= 0\n i = (j-1) >> 1\n return if upper.call(i, j)\n swap(j, i)\n j = i\n end\n end", "def bottom\n `#{clientRect}.bottom` + Window.scrollY\n end", "def pbBottomRight(window)\n window.x=Graphics.width-window.width\n window.y=Graphics.height-window.height\nend", "def find_bottom_path(cell)\n find_path(cell) { | cell | bottom_cell(cell) }\n end", "def bottom=(bottom)\n @view__.bottom = bottom\n end", "def is_bottom?\n return (is_constant? && @classified.first.is_bottom?)\n end", "def frog_hops_bottom_up(n)\n cache = frog_cache_builder(n)\n cache[n]\n end", "def height\n top - bottom\n end", "def up\n @level -= 1\n add_newline\n end", "def html_bottom_items\n @html_bottom_items ||= []\n end", "def bottom n=1, &blk\n if block_given?\n sort(&blk)[0...n]\n else\n #bottom_by(n) {|x| x }\n sort[0...n]\n end\n end", "def bottom_left\n row, col = @position\n return [row + 1, col - 1] unless row + 1 > 7 || col - 1 < 0\n []\n end", "def frog_hops_bottom_up(n)\n frog_cache_builder(n)[n]\n end", "def midbottom; return self.centerx, self.bottom; end", "def calculate_up_child\n # Guard condition for movement not possible\n return nil if blank_y + 1 == size\n\n # Make the movement\n new_state = swap_up\n\n # Avoids loop\n parents_array = parent_states(3)\n return nil if parents_array.include?(new_state)\n\n # Returns new node\n Node.new(new_state, self, blank_x, blank_y + 1)\n end", "def bottom_line\n border_options ? super : nil\n end", "def bottom_queue_position_in_queue(except = nil)\n item = bottom_item_in_queue(except)\n item ? item.send(queue_position_column) : 0\n end", "def topToBottomWraparound(grid, width, height)\n\n strings = topToBottom(grid, width, height)\n\n for string in strings do\n\n string << string\n\n end\n\n return strings\n\nend", "def test_alignBottomRight\n [@window, @sprite, @bitmap].each{|container|\n uc = UCIcon.new(container, Rect.new(0, 48, @window.contents.width, 72), 1, 2, 255, 2)\n uc.draw()\n }\n return true\n end", "def heap_up(index)\n parent = (index - 1) / 2\n bottom = @store[index]\n\n if index > 0 && @store[parent].key > bottom.key \n swap(index, parent)\n heap_up(parent)\n end \n end", "def half_page_down() [\"moveDown:\"] * 6 * @number_prefix end" ]
[ "0.70185775", "0.6855966", "0.6792547", "0.66875625", "0.66756815", "0.6672704", "0.66373646", "0.663226", "0.6596407", "0.6587347", "0.6516622", "0.65097195", "0.6507161", "0.64792657", "0.6440934", "0.6431597", "0.6431418", "0.63186693", "0.6293141", "0.62752163", "0.6264938", "0.6222886", "0.62204623", "0.62166154", "0.62166154", "0.6170147", "0.6160432", "0.61445487", "0.61273307", "0.6102781", "0.60977185", "0.60975397", "0.60843647", "0.6084198", "0.60790133", "0.6075189", "0.60726446", "0.6070987", "0.6070987", "0.60655886", "0.60563445", "0.6023716", "0.5936741", "0.5911222", "0.59111285", "0.59086204", "0.5832606", "0.58321625", "0.57856286", "0.5740308", "0.5739896", "0.5719649", "0.5707588", "0.56762797", "0.5668893", "0.56502116", "0.5631832", "0.56285244", "0.56250626", "0.5624032", "0.56152046", "0.5612304", "0.56089056", "0.559725", "0.5596831", "0.5595164", "0.55734843", "0.55731136", "0.5565637", "0.5547969", "0.553913", "0.55333376", "0.5532266", "0.5527276", "0.5514242", "0.55108976", "0.5509825", "0.5495683", "0.5494238", "0.54934716", "0.54902726", "0.54844224", "0.5481377", "0.54801214", "0.54774696", "0.5467167", "0.54551053", "0.5450486", "0.5430679", "0.5426183", "0.53992337", "0.5397316", "0.53841245", "0.53475237", "0.5343812", "0.5342864", "0.53409106", "0.53287244", "0.5320713", "0.5313735", "0.53020996" ]
0.0
-1
This method will be called by the Logging framework when it first initializes. Here we require the redis appender code.
def initialize_redis require File.expand_path('../appenders/redis', __dir__) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init\n Logging.logger.root.level = :debug\n Logging.logger.root.add_appenders(\n Logging.appenders.stdout(\n :backtrace => false,\n :level => @config[:verbose] ? :debug : :info,\n :layout => Logging.layouts.pattern(:pattern => STDOUT_PATTERN)\n ),\n Logging.appenders.rolling_file(\n @log_file,\n :backtrace => true,\n :level => :debug,\n :layout => Logging.layouts.pattern(:pattern => LOG_FILE_PATTERN)\n )\n )\n Logging.mdc['client'] = 'server'\n end", "def post_init\n # puts 'Syslogger initialized'\n end", "def setup\n self.logger.reopen(File.open(File.join(Lokii::Config.root, Lokii::Config.log), \"a\")) if daemon? && self.logger\n self.logger ||= ::Logger.new(File.join(Lokii::Config.root, Lokii::Config.log))\n end", "def initialize\n @logger = RubyConfigr::AppLogger.get_logger();\n end", "def initialize()\n @log = {}\n end", "def initialize\n Logging.setup(Logger::INFO)\n end", "def log_startup\n log_environment\n log_dispatcher\n log_app_name\n end", "def initialize\n @log = Logging::Logger[self]\n end", "def on_app_initializing(_event)\n info \"Initializing Karafka framework #{::Process.pid}\"\n end", "def initialize\n\t\t@@logger = OMLogger.getLogger(DataHelper.name)\n\tend", "def initialize\n @logger = Logging::Logger[self]\n end", "def init_logging\n app_name = ENV[\"APP_NAME\"] || \"calcentral\"\n format = PatternFormatter.new(:pattern => \"[%d] [%l] [CalCentral] %m\")\n\n Rails.logger = Log4r::Logger.new(app_name)\n Rails.logger.level = DEBUG\n Rails.logger.outputters = init_file_loggers(app_name, format)\n\n stdout = Outputter.stdout #controlled by Settings.logger.level\n stdout.formatter = format\n # level has to be set in the logger initializer, after Settings const is initialized.\n # see initializers/logging.rb\n Rails.logger.outputters << stdout\n end", "def setup_logger\n @logger.auto_flushing = true \n end", "def initialize prev=nil\n @prev_logger = prev\n super(nil)\n end", "def initialize( )\n ::Logging.init unless ::Logging.initialized?\n\n @name = 'root'\n @appenders = []\n @additive = false\n @caller_tracing = false\n @level = 0\n ::Logging::Logger.define_log_methods(self)\n end", "def initialize\n @logProvider = DefaultLogger.new\n end", "def init(*opts)\n reset!\n @logger = logger_for(BeanStalk::Worker::Config[:log_location])\n if @logger.respond_to?(:formatter=)\n if BeanStalk::Worker::Config[:log_formatter].eql?(:json)\n @logger.formatter = Mixlib::Log::JSONFormatter.new()\n else\n @logger.formatter = Mixlib::Log::Formatter.new()\n end\n end\n @logger.level = Logger.const_get(\n BeanStalk::Worker::Config[:log_level].to_s.upcase)\n @logger\n end", "def on_app_initializing(_event)\n info 'Initializing Karafka framework'\n end", "def initialize\n @log = Logging::Logger[self]\n @options = self.default_options\n end", "def enable_logging\n initialize_logger\n end", "def configure_logging\n @logger = Logging.logger[self]\n end", "def initialize\n self.logger = Logger.new(STDOUT)\n reset!\n end", "def init\n Config.load_yaml\n Log.init\n reset\n end", "def initialize logger = Nacreon.log\n\t\t\tself.log = logger\n\t\tend", "def initialize\n @logger = BikeIn::Common::CustomLogger.new self.to_s\n end", "def init_logger \n if not Object.const_defined?(get_rails_default_logger_name)\n Logger.new(STDOUT)\n else\n eval(get_rails_default_logger_name)\n end \n end", "def initialize\n @logger = Logger.new(STDOUT)\n super(@logger)\n end", "def configure_logging\n Backdat::Log.init(Backdat::Config[:log_location])\n if ( Backdat::Config[:log_location] != STDOUT ) && STDOUT.tty? &&\n ( !Backdat::Config[:daemonize] )\n stdout_logger = Logger.new(STDOUT)\n STDOUT.sync = true\n stdout_logger.formatter = Backdat::Log.logger.formatter\n Backdat::Log.loggers << stdout_logger\n end\n Backdat::Log.level = Backdat::Config[:log_level]\n end", "def initialize(*args)\n @init_args = args\n set_log(*args)\n end", "def prelog\r\n create_file_outputter unless @file_outputter\r\n\r\n # Set up the remote logger here because we need the hostname and port to\r\n # have been loaded, and we'll have done a bit of logging before we load\r\n # those two (due to needing to load the project).\r\n if !@logstash_outputter && SAF.enable_remote_logging &&\r\n SAF.logstash_host && SAF.logstash_port then\r\n @logstash_outputter = log_stash_output = TCPOutputter.new(\r\n \"LogstashOutputter\",\r\n hostname: SAF.logstash_host,\r\n port: SAF.logstash_port)\r\n @logger.outputters << log_stash_output\r\n log_stash_output.formatter = JsonFormatter.new\r\n end\r\n end", "def start\n super\n log.trace \"starting redis plugin\\n\"\n connect_redis()\n end", "def autoflush_log=(_arg0); end", "def autoflush_log=(_arg0); end", "def autoflush_log; end", "def autoflush_log; end", "def init_rails!\n log_level = (\"ActiveSupport::BufferedLogger::Severity::\"+Rails::Application.config.log_level.to_s.upcase).constantize\n @logger = ActiveSupport::BufferedLogger.new(File.join(Rails.root, \"log\", \"#{@name.underscore}.log\"), log_level)\n\n #NOTE/TODO: I noticed in the Rails docs, they will eventually make ActionView use a seperate logger\n # than ActionController, so this will eventually need to be added in here\n [Rails, ActiveRecord::Base, ActionController::Base, ActionMailer::Base].each do |logged_module|\n #just in case there is a logger there, close it\n logged_module.logger.close rescue nil\n logged_module.logger = @logger\n end\n\n #reestablish db connection\n ActiveRecord::Base.establish_connection\n end", "def initialize *_args\n super\n @service_logger =\n case logger\n when 'sidekiq'\n Sidekiq::Logging.logger\n else\n Rails.logger\n end\n end", "def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end", "def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end", "def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end", "def start_logger\n if config && config[:log] == \"file\" && config.log_file_path\n start_file_logger(config.log_file_path)\n else\n start_stdout_logger\n end\n\n logger.level =\n if config\n config.log_level\n else\n Appsignal::Config::DEFAULT_LOG_LEVEL\n end\n logger << @in_memory_log.string if @in_memory_log\n end", "def build\n @engine ||\n ::Hanami::Logger.new(@app_name, stream: @stream, level: @level, formatter: format)\n end", "def init(log_device)\n @log_device = initialize_log_device(log_device)\n end", "def post_init\n JR::JobLogger.log(\"#{@node.name} ready to work\")\n end", "def initLogger()\n\tconfig = FileUtil.loadjson(File.dirname(__FILE__) + '/utilcfg.json')\n\tif config.key?('log.path')\n\t\tlpath = config['log.path']\n\t\tunless File.file?(lpath)\n\t\t\tdpath = lpath.gsub(/[^\\/]+$/,'')\n\t\t\tDir.mkdir(dpath) unless Dir.exist?(dpath)\n\t\tend\n\t\tif config.key?('log.interval')\n\t\t\t$logger = Logger.new(lpath, config['log.interval'])\n\t\telse\n\t\t\t$logger = Logger.new(lpath)\n\t\tend\n\tend\n\tLogUtil.setformatter\n\tLogUtil.setloglevel(config['log.level'])\nend", "def initialize(log_dev, log_prefix = '[onesnooper-server]')\n if log_dev.kind_of? ::Logger\n @logger = log_dev\n else\n @logger = ::Logger.new(log_dev)\n end\n\n @log_prefix = log_prefix.blank? ? '' : log_prefix.strip\n\n # subscribe to log messages and send to logger\n @log_subscriber = ActiveSupport::Notifications.subscribe(self.class::SUBSCRIPTION_HANDLE) do |name, start, finish, id, payload|\n @logger.log(payload[:level], \"#{@log_prefix} #{payload[:message]}\") if @logger\n end\n end", "def setup\n @logger.info \"initializing the supervisor\"\n end", "def log_writer; end", "def init(identity = nil, path = nil)\n unless @initialized\n @initialized = true\n @level_frozen = false\n logger = nil\n\n if @log_to_file_only || RightLinkConfig[:platform].windows?\n if path\n file = File.join(path, \"nanite.#{identity}.log\")\n else\n file = STDOUT\n end\n logger = Logger.new(file)\n logger.formatter = Formatter.new\n else\n logger = SyslogLogger.new(@program_name || identity || 'RightLink')\n end\n\n @logger = Multiplexer.new(logger)\n self.level = :info\n end\n @logger\n end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def on_request(env)\n env['sinatra.commonlogger'] = true\n super\n end", "def initialize(level: nil, formatter: nil, filter: nil, application: nil, environment: nil, host: nil, metrics: false, &block)\n self.formatter = block || formatter\n @application = application\n @environment = environment\n @host = host\n @metrics = metrics\n\n # Subscribers don't take a class name, so use this class name if a subscriber\n # is logged to directly.\n super(self.class, level, filter)\n end", "def initialize\n @logger = Logger.new('cf_flattener.log')\n end", "def setup\n ::Celluloid.logger = ::Karafka.logger\n # This is just a precaution - it should automatically close the current\n # connection and shutdown actor - but in case it didn't (hanged, etc)\n # we will kill it after waiting for some time\n ::Celluloid.shutdown_timeout = SHUTDOWN_TIME\n end", "def logger ; @log end", "def init_logger\n self.log4r_config = load_file_config('log4r.yml')\n\n if log4r_config\n Log4r::YamlConfigurator.decode_yaml(log4r_config['log4r_config'])\n\n environments = log4r_config['log4r_config']['loggers'].map do |logger|\n logger['name']\n end\n\n if environments.include?(run_env)\n self.logger = Log4r::Logger[run_env]\n else\n self.logger = Log4r::Logger['development']\n end\n else\n self.logger = Log4r::Logger.new(run_env)\n self.logger.level = Log4r::DEBUG\n self.logger.add Log4r::Outputter.stdout\n self.logger.warn\n \"Log4r configuration file #{full_config_path('log4r.yml')} not found.\"\n self.logger.info \"Log4r outputting to stdout with DEBUG level.\"\n end\n end", "def builder_setup\n @result = Log4r::Logger['Mauve'] || Log4r::Logger.new('Mauve')\n @default_format = nil\n @default_level = Log4r::RootLogger.instance.level\n end", "def initialize_log\n if @configuration[:debug].nil?\n @logger = Yell.new format: Yell::ExtendedFormat do |l|\n l.adapter :datefile, 'send.log'\n l.adapter STDOUT\n end\n else\n @logger = Yell.new format: Yell::ExtendedFormat do |l|\n l.adapter :datefile, 'test.log'\n l.adapter STDOUT\n end\n end\n end", "def logger=(_arg0); end", "def logger=(_arg0); end", "def logger=(_arg0); end", "def logger=(_arg0); end", "def logger=(_arg0); end", "def logger=(_arg0); end", "def logger=(_arg0); end", "def init_logger\n l = Logger.new(STDOUT)\n l.level = Logger::INFO\n Log.logger = l\nend", "def log=(logger); end", "def logger=(logger); end", "def logger=(logger); end", "def initialize(logger, redis_instance, settings = {})\n raise '`redis_instance` must be a valid Redis instance' unless redis_instance.is_a?(Redis)\n\n @logger = logger\n @redis = redis_instance\n @settings = settings\n\n @class_name = self.class.name\n end", "def logger\n init unless @initialized\n logger = @logger\n end", "def initialize(*args)\n # Handle default\n if args.empty?\n args = [STDOUT]\n end\n\n # Initialization\n @default_level = Logger::Severity::INFO\n @formatter = ::TeeLogger::Formatter.new\n @loggers = {}\n @ios = {}\n\n # Load built-in filters\n load_filters(*args)\n\n # Create logs for all arguments\n args.each do |arg|\n add_logger(arg)\n end\n end", "def reconfigure\n configure_backdat\n configure_logging\n end", "def ensure_event_log\n unless @ensured_event_log\n ReplicationInitializer.new(session).ensure_event_log\n @ensured_event_log = true\n end\n end", "def colorize_logging=(_arg0); end", "def initialize\n @logger = ::Logger.new(STDOUT)\n self.level = :info\n end", "def logger\n initialize_logger unless @logger\n @logger\n end", "def initialize(*args)\n begin\n #puts \"REDUCER INITIALIZE METHOD\"\n #call the re_initialize method for initializing the values to global variables.\n re_initialize \n rescue Exception => e\n puts \"Error in ClassName:AnalyticsDataReducer MethodName:initialize ErrInfo:#{e.to_s} \" \n end \n end", "def initialize\n @logger = VWO::Logger.get_instance\n @queue = []\n end", "def parse(arguments)\n super\n\n level = :info\n level = :debug if debug?\n level = :error if quiet?\n Kubetruth::Logging.setup_logging(level: level, color: color?)\n end", "def startup_log\n return if ENV['SPLITCLIENT_ENV'] == 'test'\n\n @logger.info(\"Loaded Ruby SDK v#{VERSION} in the #{@mode} mode\")\n @logger.info(\"Loaded cache class: #{@cache_adapter.class}\")\n end", "def log=(log); end" ]
[ "0.6999989", "0.6786388", "0.6674792", "0.65466744", "0.64838135", "0.64409333", "0.6401675", "0.63844216", "0.6337871", "0.63170874", "0.63118863", "0.6310815", "0.6283471", "0.6278116", "0.6253453", "0.625073", "0.6247212", "0.62417215", "0.62314206", "0.62251663", "0.6214701", "0.6180554", "0.6163262", "0.6160021", "0.6147671", "0.6124641", "0.6037416", "0.5990395", "0.59771174", "0.5945074", "0.59289324", "0.59245867", "0.59245867", "0.5915971", "0.5915971", "0.5901818", "0.5887782", "0.58332145", "0.58332145", "0.58332145", "0.5765653", "0.57208616", "0.57206845", "0.5715781", "0.5712936", "0.57116354", "0.57065034", "0.5682667", "0.56779385", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.5656205", "0.56514716", "0.56471115", "0.5646445", "0.56375265", "0.5624365", "0.55981094", "0.55880815", "0.5585536", "0.5580497", "0.5580497", "0.5580497", "0.5580497", "0.5580497", "0.5580497", "0.5580497", "0.55703694", "0.5568218", "0.55517447", "0.55517447", "0.5540567", "0.5536966", "0.553065", "0.55255157", "0.55222", "0.55157506", "0.55050725", "0.5504915", "0.55031526", "0.5498955", "0.5498329", "0.54934645", "0.5481583" ]
0.69176537
1
Now actually do some update work!
def update # Compute the passage of time. @new = Gosu.milliseconds @old ||= @new delta = @new - @old @old = @new #Update for gravity. @vy += @gravity # Compute the drag @vx *= @drag @vy *= @drag # Compute the new proposed position. @x += @vx * delta @y += @vy * delta # Compute the boundary limits. top = @y bottom = @y + @ball.height left = @x right = @x + @ball.width # Check for collision with the left and right walls. if left < 0 @vx *= -1 @x = -left elsif right > self.width @vx *= -1 @x -= 2 * (right-self.width) end # Check for collision with the top and bottom walls. if top < 0 @vy *= -1 @y = -top elsif bottom > self.height @vy *= -1 @y -= 2 * (bottom-self.height) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update() end", "def update ; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update; end", "def update\n \n end", "def update\n \n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n\r\n end", "def mte_prepare_updating; send_request_to_mite(\"update\"); end", "def update\n \t\n end", "def update\n \t\n end", "def update \n end", "def update\n\t\t# Left empty intentionally.\n\tend", "def update\n # Not generally used\n end", "def update\n # Not generally used\n end", "def update \n end", "def update\r\n # write some gangsta code here\r\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n #Nothing necessary\n end", "def update;end", "def update; end", "def update\n ;\n end", "def update()\n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n\n end", "def do_update\n do_edit\n update_save\n end", "def update\n\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end", "def update\n end" ]
[ "0.83104473", "0.8299709", "0.80469996", "0.80469996", "0.80469996", "0.80469996", "0.80469996", "0.80469996", "0.80469996", "0.80469996", "0.77649814", "0.77207905", "0.76989233", "0.7693573", "0.7693573", "0.7693573", "0.7693573", "0.7654609", "0.7621498", "0.7620195", "0.7620195", "0.75675374", "0.7526307", "0.7525626", "0.7525626", "0.75221264", "0.7522003", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.7501277", "0.74982935", "0.74873793", "0.7439703", "0.7435892", "0.7397039", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.7376611", "0.73629445", "0.7343792", "0.7340171", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273", "0.73257273" ]
0.0
-1
allows for account creation from twitter & fb allows saves w/o password
def password_required? (!persisted? && user_tokens.empty?) || password.present? || password_confirmation.present? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter\n auth = request.env['omniauth.auth']\n current_user.company.create_or_update_twitter_account(auth)\n\n flash.notice = 'Authorized Twitter account successfully.'\n redirect_to twitter_accounts_path\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n\n self.login = user_info['screen_name']\n self.twitter_name = user_info['name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n self.twitter_name = user_info['name']\n self.twitter_screen_name = user_info['screen_name']\n self.login = 'twitter_' + user_info['screen_name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def twitter_oauth(access_token)\n user_info = access_token.extra.raw_info\n external_user_id = user_info.id\n email = \"#{user_info.screen_name}@twitter.com\"\n account = self.by_twitter_id(external_user_id).first || self.by_twitter_email(email).first\n if account.blank?\n account = self.new\n account.email = email\n account.provider = Provider::TWITTER\n account.external_user_id = user_info.id\n account.skip_confirmation!\n if user_info.name\n first_name, last_name = user_info.name.split\n account.build_profile :first_name => first_name, :last_name => last_name\n end\n account.save\n end\n account\n end", "def new \n\n begin\n if params[:oauth_token] != session['oauth_request_token_token']\n flash[:error] = 'Could not authorize your Twitter account'\n if current_user.nil?\n return redirect_to signup_path\n else\n return redirect_to edit_user_path(current_user)\n end\n end\n \n oauth_token = session['oauth_request_token_token']\n oauth_secret = session['oauth_request_token_secret']\n \n # if we're here, save the tokens to user\n access_token = @client.authorize(\n oauth_token,\n oauth_secret\n )\n\n if @client.authorized?\n \n client_info = @client.info\n \n if current_user.nil?\n newname = client_info['name']\n newtwittername = client_info['screen_name']\n newuserid = client_info['id_str']\n\n @user = User.find_by_twitter_id(newuserid)\n \n if @user.nil?\n @user = User.new(:name => newname, :twittername => newtwittername,\n :twitter_id => newuserid, :twitter_token => access_token.token,\n :twitter_secret => access_token.secret)\n @user.save! \n flash[:success] = \"User account created through Twitter\"\n else\n @user.name = newname\n @user.twittername = newtwittername\n @user.save!\n end\n \n sign_in @user\n session['oauth_request_token_token'] = nil\n session['oauth_request_token_secret'] = nil\n\n redirect_to current_user \n else\n \n twid = client_info['id_str']\n \n olduser = User.find_by_twitter_id(twid)\n if !olduser.nil?\n flash[:error] = 'Twitter account already linked to another account'\n else\n current_user.twitter_token = access_token.token\n current_user.twitter_secret = access_token.secret\n current_user.twitter_id = twid\n begin\n raise 'Could not save user' if !current_user.save\n rescue\n flash[:error] = \"bad\"\n end\n flash[:notice] = 'Your account has been authorized at Twitter'\n sign_in current_user\n end\n \n session['oauth_request_token_token'] = nil\n session['oauth_request_token_secret'] = nil\n return redirect_to edit_user_path(current_user)\n #rescue => e\n #flash[:error] = 'There was an error during processing the response from Twitter.'\n #flash[:error] = e.message\n end\n end \n end\n end", "def create\n auth = request.env[\"omniauth.auth\"]\n user_info = auth[\"info\"] ? auth[\"info\"] : auth[\"user_info\"]\n authentication = Authorization.where(:provider => auth['provider'], :uid => auth['uid']).first\n authentication = Authorization.new(:provider => auth['provider'], :uid => auth['uid']) if !authentication\n session[:fb_token] = auth['credentials']['token'] if auth['credentials']['token'] != nil\n # if the user exists, but does not have a link with the social service\n if !authentication.user && current_user\n authentication.user = current_user\n authentication.save\n end\n # twitter only (gets no email)\n if !authentication.user && !user_info[\"email\"]\n flash[:notice] = \"No user linked to this account. Please sign in or create a new account\"\n redirect_to '/users/sign_up/'\n # if user doesnt exists, register user\n elsif !authentication.user\n user = User.where(email: user_info['email']).first\n if user\n authentication.user = user\n else\n new_user = User.new(email: user_info['email'], username: user_info['name'], first_name: user_info['first_name'], last_name: user_info['last_name'], role: \"registered\")\n new_user.save\n authentication.user = new_user\n end\n authentication.save\n end\n # if user exists, sign in. Gives a Mongoid glitch of not signing in after registration. So double sign in\n if authentication.user\n if !current_user\n sign_in authentication.user\n sign_out authentication.user\n sign_in authentication.user\n # raise \"user signed in? #{user_signed_in?.to_s}\".inspect\n flash[:notice] = \"Authorization successful.\"\n redirect_to root_path\n else\n flash[:notice] = \"Linked successfully.\"\n redirect_to '/users/'+current_user.id\n end\n end\n end", "def create\n @user = User.find_by(username: params[:username])\n @auth = request.env[\"omniauth.auth\"]\n if @user == nil && @auth == nil\n reject_credentials\n else\n if @user != nil\n if @user.authenticate(params[:password])\n start_session(@user.id)\n else\n reject_credentials\n end\n elsif check_credentials(@auth.uid) != nil\n start_session(check_credentials(@auth.uid).id)\n else\n user = User.new_twitter_user(@auth)\n start_session(user.id)\n end\n end\n end", "def create_account\n\n end", "def create\n #to avoid unwanted/unsafe requests we replace params[:user]\n @user = User.new(user_params)\n if @user.save\n # =WANT THEM TO ACTIVATE ACCOUNT FIRST\n @user.send_activation_email\n flash[:info] = \"Please check your email to activate your account.\"\n redirect_to root_url\n #logs in a user after they make account\n # log_in(@user)\n # flash[:success] = \"Welcome to Twitter Clone!\"\n #redirect_to @user\n else\n render 'new'\n end\n end", "def register_user\n random_password = Random.new\n @password = random_password.rand\n logger.warn(\"=====#{@password}===\")\n encrypt_pwd = User.new(:password => @password).encrypted_password\n self.update_attributes(fb_access_token: nil, fb_pic: nil, encrypted_password: encrypt_pwd)\n end", "def twitter\n default_oauth_callback do |auth|\n # username may already be taken, user will have to enter another one\n if User.exists? username: auth.info.nickname\n redirect_to controller: '/registrations', action: 'twitter_screen_name_clash'\n else\n default_oauth_fail\n end\n end\n end", "def create\n\t\t@account = Account.new(params[:account])\n\n\t\trespond_to do |format|\n\t\t\tif @account.save\n\t\t\t\t# If we provide tokens (manually)\n\t\t\t\tif [email protected]?\n\t\t\t\t\tredirect_to '/auth/twitter?screen_name=' + @account.username\n\t\t\t\t\treturn\n\t\t\t\telse\n\t\t\t\t\tformat.html { redirect_to @account, notice: 'Account was successfully created.' }\n\t\t\t\t\tformat.json { render json: @account, status: :created, location: @account }\t\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def callback\n @T_OAUTH = TwitterOAuth::Client.new(:consumer_key => TWITTER_KEY, :consumer_secret => TWIITER_SECRET )\n @oauth_verifier = params[:oauth_verifier]\n access_token = @T_OAUTH.authorize(session['token'], session['secret'], auth_verifier => @oauth_verifier)\n if (@result = @T_OAUTH.authorized?)\n current_user.create_or_update_twitter_account_with_oauth_token(access_token.token, access_token.secret)\n session['token'] = nil\n session['secret'] = nil\n flash[:notice] = \"Authorize complete\"\n else\n flash[:notice] = \"Authorize failed\"\n end\n\n rescue\n flash[:notice] = \"Authorize failed\"\n end", "def oauth_signup\n @user = User.new(\n nickname: params[:nickname],\n sex: params[:sex],\n phone: params[:phone],\n birthday: params[:birthday],\n province: params[:province],\n city: params[:city],\n area: params[:area] )\n @user.created_by_oauth = 'mobile'\n @user.authentications.build(\n uid: params[:oauth_uid],\n provider: params[:provider],\n access_token: params[:access_token])\n if @user.save\n @user.confirm!\n render :login\n else\n render json: {\n success: false,\n message: @user.errors.messages\n }\n end\n end", "def facebook_create\n @new_user = User.find_or_create_by(uid: auth['uid']) do |u|\n u.name = auth['info']['name']\n u.email = auth['info']['email']\n u.image = auth['info']['image']\n u.password = User.generic_password\n end\n @new_user.save\n session[:user_id] = @new_user.id \n redirect_to home_path(@new_user)\n end", "def create_account(user)\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"email\" => user.email, \"name\" => user.username })\nend", "def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end", "def check_twitter_credentials\n if session['twitter_token'].blank? || session['twitter_secret'].blank?\n redirect_to new_user_registration_path, :error => \"Debes linkear tu cuenta de twitter antes de continuar\" and return\n end\n end", "def generate_access_token\n @user = current_user\n begin \n request_token = OAuth::RequestToken.new(TwitterAccount.twitter_consumer,\n params[\"oauth_token\"], params[\"oauth_verifier\"])\n if @user.twitter_account\n @user.twitter_account.delete\n end\n t_account = @user.create_twitter_account(request_token)\n\n unless t_account.new_record?\n flash[:notice] = 'You are now connected to twitter $green'\n l = Log.new\n l.user_id_1 = @user.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n l.message = \"#{name_1.humanize} is now connected to twitter account\"\n l.loggingtype = 0\n l.save\n\n else \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n end \n redirect_to controller: 'users', action: 'connect_social_accounts'\n\n rescue \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n redirect_to controller: 'users', action: 'connect_social_accounts'\n end \n end", "def create\n user = AuthenticationManager.new(\n params.slice(%i[email first_name last_name password]).merge(is_profile_owner: true, password_confirmation: params[:password], tos_accepted: params.bool(:tos_accepted))\n ).register\n user = session_manager.login(user.email, params[:password], use_api_token: true)\n json_success user: api_response.current_user_data(user)\n end", "def import_profile_from_twitter\n self.profile.first_name = @credentials['name']\n self.profile.website = @credentials['url']\n self.profile.federated_profile_image_url = @credentials['profile_image_url']\n self.profile.save\n end", "def connect_twitter\n auth = request.env[\"omniauth.auth\"]\n current_member.twitter_token = auth[\"credentials\"][\"token\"]\n current_member.twitter_secret = auth[\"credentials\"][\"secret\"]\n current_member.twitter_id = auth[\"uid\"]\n if current_member.img_url.blank?\n current_member.username = auth.info.name\n current_member.img_url = auth.info.image\n\t end\n current_member.save\n\t TwitterModel.store_urls(current_member)\n\t redirect_to members_social_sign_up_path\n end", "def load_twitter_account\n # FIXME would this be better placed in the models?\n @twitter_account = @workspace ? @workspace.twitter_account || @workspace.create_twitter_account :\n @user.twitter_account || @user.create_twitter_account\n end", "def twitter\n handle_oauth\n end", "def create\n result = access_token.post('/api/v1/users/create', {:email=>params[:email],:psw=>params[:password],:psw_conf=>params[:password_conf],:inbox=>params[:inbox]})\n display_api_response result\n respond_with(\"\",:location => :back)\n end", "def update\n#\t\t@newform = false \n\n=begin\t\tif params[:user] && params[:user][:newform] && params[:user][:newform] == true\n\t\t\t@newform = true\n\t\tend\n=end\n\n unless ( (id = params[:id]) && ( (id == session[:user_id]) || (User.find(session[:user_id]).site_admin) ) )\n id = session[:user_id]\n end\n @user = User.find(id)\n\t\t@request_uri = edit_user_url(id)\n @user.email_confirmation = params[:user][:email_confirmation]\n\t\tbegin\n\t\t\tunless @user.twitter_user\n\t\t\t\t@user_twitter_authorized = false\t\t\t\t\n\t\t\telse\n\t\t\t\tuser_client = client(false, false, nil)\n\t\t\t\t@twit_user = user_client.verify_credentials\n\t\t\t\t@user_twitter_authorized = true\t\t\t\t\n\t\t\tend\t\t\n\t\trescue\n\t\t\t\t@user_twitter_authorized = false\n\t\tend \n \n \n # if they have flipped whether they want messages or not\n\t\tif @user.twitter_user && params[:twitter_user] && params[:twitter_user][:twitter_replies] && ((params[:twitter_user][:twitter_replies] == \"0\" && @user.twitter_user.opt_out_of_messages == false) ||(params[:twitter_user][:twitter_replies] == \"1\" && @user.twitter_user.opt_out_of_messages == true))\n\t\t @user.twitter_user.opt_out_of_messages = [email protected]_user.opt_out_of_messages\n\t\t @user.twitter_user.save\n\t end\n\t\t\n \n \n\t\t# Hash the password before putting it into DB\n\t\t\n\t\tif params[:user] && params[:user][:password] && params[:user][:password] != '' && params[:user][:password] != nil\n\t\t \n\t\t #see if a salt exists\n random = ActiveSupport::SecureRandom.hex(10)\n salt = Digest::SHA2.hexdigest(\"#{Time.now.utc}#{random}\")\n salted_password = Digest::SHA2.hexdigest(\"#{salt}#{params[:user][:password]}\")\n params[:user][:password_salt] = salt\n\t\t\tparams[:user][:password] = salted_password\n\t\telse\n\t\t\tif @user.status == 'pending'\n\t\t\t\t#set password to nil if user is activating so that they are required to put a password\n\t\t\t\tparams[:user][:password] = nil\n\t\t\telse\n\t\t\t\tparams[:user][:password] = @user.password\n\t\t\tend\n\t\tend\n\n\n\t\t# We must also hash the confirmation entry so the model can check them together\n#\t\tparams[:user][:password_confirmation] = salted_password\n \n #for the regular \"post\"ers make sure the country matches the state in case they changed it\n unless ( params[:user][:country_id].nil? || (params[:user][:country_id].to_i == @user.country_id) || (params[:user][:state_id] == '1') )\n unless Country.find(params[:user][:country_id]).states.collect{|s| s.id}.include?(params[:user][:state_id].to_i)\n #if the state isn't in the country then reset the state_id update and redirect\n params[:user][:state_id] = 1\n\n @user.update_attributes(params[:user])\n if @user.twitter_user\n @user.reward_tweet_bandstock_retroactively\n end\n redirect_to :action => \"state_select\"\n return true\n end\n end\n \n if params[:user][:phone]\n params[:user][:phone].gsub!(/[^0-9]/, '')#clean phone\n end\n @user.update_attributes(params[:user])\n \n success = @user.save\n if @user.twitter_user\n @user.reward_tweet_bandstock_retroactively\n end\n if success\n\t\t\tif @user.status == 'pending'\n\t\t\t\[email protected] = 'active'\n\t\t\tend\n\t\t\t\n\t\t\tsuccess = @user.save\n\t\tend \n \n respond_to do |format|\n format.html { \n unless success #&& photo_success\n render :action => 'edit'\n return false\n else\n flash[:notice] = \"Profile updated.\"\n redirect_to root_url\n end\n }\n format.js\n format.xml { head :ok }\n end\n\n end", "def signup\n end", "def signup\n end", "def new_account(site_url, site_email, analyst_email, password)\n reqBody = {:site_url => site_url, :site_email => site_email,\n :analyst_email => analyst_email, :password => password}\n begin\n http_post(accounts_url(), reqBody)\n rescue Exception => e\n puts e.message\n puts e.backtrace.inspect\n end\n\n end", "def twitter\n @user = current_user\n if params[:oauth_verifier]\n if @user.user_content.twitter_token.blank?\n clientTwitter = TwitterOAuth::Client.new(:consumer_key => TwitterEnv::API_KEY, :consumer_secret => TwitterEnv::SECRET_KEY)\n pin = params[:oauth_verifier]\n access_token = clientTwitter.authorize(session[:rtoken_twitter], session[:rsecret_twitter], :oauth_verifier => pin)\n @user.user_content.twitter_token = access_token.token\n @user.user_content.twitter_secret = access_token.secret\n @user.user_content.save\n else\n clientTwitter = TwitterOAuth::Client.new(\n :consumer_key => TwitterEnv::API_KEY,\n :consumer_secret => TwitterEnv::SECRET_KEY,\n :token => @user.user_content.twitter_token, \n :secret => @user.user_content.twitter_secret)\n end\n end\n \n redirect_to \"/backend/social\"\n end", "def create\n #request_token = @client.request_token(:oauth_callback => 'http://127.0.0.1:3000/twitter/new')\n #request_token = @client.request_token(:oauth_callback => 'https://gentle-snow-7462.herokuapp.com/twitter/new')\n request_token = @client.request_token(:oauth_callback => TWITTER_CALLBACK_URL)\n\n session['oauth_request_token_token'] = request_token.token\n session['oauth_request_token_secret'] = request_token.secret\n\n redirect_to request_token.authorize_url\n end", "def create\n @twitter_user = TwitterUser.new(params[:twitter_user])\n\n respond_to do |format|\n if @twitter_user.save\n format.html { redirect_to @twitter_user, notice: 'Twitter user was successfully created.' }\n format.json { render json: @twitter_user, status: :created, location: @twitter_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @twitter_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def twitter_callback\n\t if I18n.locale == :en\n\t \tflash[:notice] = \"Connected to Twitter successfully!\"\n\t else I18n.locale == :ar\n\t \tflash[:notice] = \"تم التواصل مع تويتر بنجاح!\"\n\t end\n\t auth = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_gid(auth[\"provider\"],\n current_gamer.id) || Authentication.create_with_omniauth(auth,\n current_gamer)\n redirect_to \"/gamers/edit\"\n return\n\tend", "def create\n auth = request.env[\"omniauth.auth\"] \n user = User.find_by_fb_id(auth[\"uid\"]) || User.create_with_omniauth(auth) \n #for those update from feeds\n if user.access_token.empty?\n user.access_token = auth[\"credentials\"][\"token\"]\n user.save\n end\n redirect_to FB_APP_URL \n end", "def before_create_user\n logger.debug(\"on before creare user\")\n #Generate a unique key\n if facebook_user?\n self.active = 1 \n else\n activation_key_string = self.salt+self.email+self.hashed_password\n self.activation_key =Digest::SHA1.hexdigest(activation_key_string)\n self.active = 0\n end\n self.admin = 0 \n self.handle=generate_unique_handle\n \n end", "def register_user_to_fb\n\t #users = {:email => email, :account_id => id}\n\t #Facebooker::User.register([users])\n\t #self.email_hash = Facebooker::User.hash_email(email)\n\t #save(false)\n\tend", "def create\n pw = \"aspace-oauth-#{auth_hash[:provider]}-#{SecureRandom.uuid}\"\n pw_path = File.join(Dir.tmpdir, pw)\n backend_session = nil\n\n uid = auth_hash.uid\n email = AspaceOauth.get_email(auth_hash)\n username = AspaceOauth.use_uid? ? uid : email\n puts \"Received callback for: [uid: #{uid}], [email: #{email}]\"\n if username && email\n username = username.split('@')[0] # usernames cannot be email addresses\n auth_hash[:info][:username] = username # set username, checked in backend\n auth_hash[:info][:email] = email # ensure email is set in info\n File.open(pw_path, 'w') { |f| f.write(JSON.generate(auth_hash)) }\n backend_session = User.login(username, pw)\n end\n\n if backend_session\n User.establish_session(self, backend_session, username)\n load_repository_list\n else\n flash[:error] = 'Authentication error, unable to login.'\n end\n\n File.delete pw_path if File.exist? pw_path\n redirect_to controller: :welcome, action: :index\n end", "def twofa\n @user = current_user\n \n if params[:user]\n if @user.update_attributes params.require(:user).permit(:gauth_enabled,:password,:password_confirmation)\n if (params[:user][:gauth_enabled] == '1')\n flash[:info] = \"Two-factor authentication has been enabled\"\n else\n flash[:warn] = \"Two-factor authentication was not enabled\"\n end\n redirect_to admin_twofa_path\n return \n else\n flash[:error] = \"Something went wrong while trying to update your settings\"\n end\n end\n \n if [email protected]_enabled?\n @user.regenerate_secret!\n end\n end", "def attemp_signup\n\n end", "def create_from_tw\n client = Twitter::Client.new(\n :consumer_key => CONFIG[:tw_consumer_key],\n :consumer_secret => CONFIG[:tw_consumer_secret],\n :oauth_token => params[:tw_access_token],\n :oauth_token_secret => params[:tw_access_token_secret])\n\n @user = User.add_from_tw(\n client.user,\n params[:tw_access_token],\n params[:tw_access_token_secret],\n @source)\n end", "def create\n @tw_account = TwAccount.new(tw_account_params)\n\n respond_to do |format|\n if @tw_account.save\n format.html { redirect_to @tw_account, notice: 'The Account was successfully created.' }\n format.json { render :show, status: :created, location: @tw_account }\n else\n format.html { render :new }\n format.json { render json: @tw_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration') do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'just4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save\n return true\n end\n\n\n end", "def signup_with_facebook\n @status, @msg, @data = UserValidator.signup_with_facebook(params)\n @status, @msg, @data = UserManager.signup_with_facebook(params) if @status\n end", "def create\n\t\t#get the user info\n\t\t\n\t\tauth = request.env[\"omniauth.auth\"]\n\t\tif auth == nil and \n\t\t\tif session[:temp] == true\n\t\t\t auth = {:info => {:email => \"[email protected]\"} }\n\t\t\telse\n\t\t\t auth = {:info => {:email => \"[email protected]\"} }\t\n\t\t\tend\n\t\tend\n\t\t#whitelist \n\t\tif auth[:info][:email].to_s =~ /[email protected]/\n\t\t\tuser = User.find_by_uid(auth[\"uid\"]) || User.createUser(auth)\n\t\t\tsession[:user_id] = user.id \n\t\t\tsession[:admin] = user.admin\n\t\t\tsession[:authenticated] = true\n\t\t\tredirect_to links_path\n\t\telse\n\t\t\tsession[:authenticated] = false\n\t\t\tsession[:error] = \"Must have a wesleyan email address\"\n\t\t\tredirect_to root_path\n\t\tend\t\n\tend", "def create\n @account = Account.new(params[:account])\n @account.user = User.find_by_id(current_user.id)\n user = User.find_by_id(current_user.id)\n @account.groupid = user.currentgroupid\n\n respond_to do |format|\n if @account.save\n if @account.tmp.present?\n comment = Comment.new\n comment.accounts_id = @account.id\n comment.comment = @account.tmp\n comment.name = user.username\n comment.save\n end\n \n #current_user.twitter.update(@account.content) if params[:twitter] == 'yes'\n #if params[:facebook] == 'yes'\n # current_user.facebook.feed!(:message => \"test\",\n # :link => \"http://moonkey.jp\",\n # :name => \"TEST\",\n # :description => \"test\")\n #end\n format.html { redirect_to accounts_url }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def oauth\n profile = OAuthProfile.from_omniauth(env['omniauth.auth'])\n # TODO check for error\n # temp_password = SecureRandom.hex\n if !profile.user\n oauth_custom_params = request.env[\"omniauth.params\"] || {}\n session[:oauth_reason] = oauth_custom_params.fetch(\"dbdesigner_action\", \"\")\n session[:profile_id] = profile.id\n redirect_to new_registration_path\n # profile.user.create({\n # username: profile.username,\n # email: profile.email,\n # password: temp_password,\n # password_confirmation: temp_password\n # })\n else\n session[:user_id] = profile.user.id\n profile.user.record_login(request: request, oauth_profile: profile)\n redirect_to designer_path\n end\n end", "def create\n auth = request.env[\"omniauth.auth\"]\n user = User.find_by_provider_and_uid(auth[\"provider\"], auth[\"uid\"]) || User.create_with_omniauth(auth)\n User.update(user.id, :fb_nickname => auth[\"info\"][\"nickname\"])\n session[:user_id] = user.id\n redirect_to root_url\n end", "def create\n omniauth = request.env['omniauth.auth']\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully\"\n sign_in_and_redirect(:account, authentication.account)\n else\n user = Account.new(password: Devise.friendly_token) # If you create an account with twitter/fb, we don't need a passwod\n user.apply_omniauth(omniauth)\n user.email = get_email_from_omniauth omniauth\n if user.save\n flash[:notice] = \"Successfully registered\"\n sign_in_and_redirect(:account, user)\n else\n session[:omniauth] = omniauth.except('extra')\n session[:omniauth_email] = omniauth['extra'] && omniauth['extra']['user_hash'] && omniauth['extra']['user_hash']['email']\n\n # Check if email already taken. If so, ask user to link_accounts\n if user.errors[:email][0] =~ /has already been taken/ # omniauth? TBD\n # fetch the user with this email id!\n user = Account.find_by_email(user.email)\n return redirect_to link_accounts_url(user.id)\n end\n redirect_to new_account_registration_url\n end\n end\n end", "def make_account(email: '[email protected]', password: 'aba456',\n admin: false, first: 'John', last: 'Doe') # system admin, not lock admin\n # account is a devise model, must set properties at instance level and not in constructor\n Account.create!(:first_name => first,\n :last_name => last,\n :email => email,\n :password => password,\n :password_confirmation => password,\n :admin => admin,\n :confirmed_at => DateTime.now.utc.iso8601(9),\n :confirmation_sent_at => DateTime.now.utc.iso8601(9)\n )\n end", "def fetch_details_from_twitter\n\t\t# twitter_object = Twitter::Client.new(\n\t\t# \t:oauth_token => self.token,\n\t\t# \t:oauth_token_secret => self.secret\n\t\t# \t)\n\t\t# twitter_data = Twitter.user(self.uid.to_i)\n\t\t# self.username = twitter_data.username\n\t\t# self.save\n\t\t# self.user.username = twitter_data.username if self.user.username.blank?\n\t\t# self.user.image = twitter_data.profile_image_url if self.user.image.blank?\n\t\t# self.user.location = twitter_data.location if self.user.location.blank?\n\t\t# self.user.save(:validate => false)\n\t\tself.user.has_twitter = true\n\t\tself.user.save\n\tend", "def newaccount\n if params[:commit] == \"Cancel\"\n session[:authhash] = nil\n session.delete :authhash\n redirect_to root_url\n else # create account\n @newuser = User.new\n @newuser.name = session[:authhash][:name]\n @newuser.email = session[:authhash][:email]\n @newuser.services.build(:provider => session[:authhash][:provider], :uid => session[:authhash][:uid], :uname => session[:authhash][:name], :uemail => session[:authhash][:email])\n \n if @newuser.save!\n # signin existing user\n # in the session his user id and the service id used for signing in is stored\n session[:user_id] = @newuser.id\n session[:service_id] = @newuser.services.first.id\n \n flash[:notice] = 'Your account has been created and you have been signed in!'\n\tif session[:authhash][:provider] == 'facebook'\n\t\tredirect_to services_facebook_redirect_path\n\telse\n \tredirect_to services_path\n\tend\n else\n flash[:error] = 'This is embarrassing! There was an error while creating your account from which we were not able to recover.'\n redirect_to root_url\n end \n end\n end", "def create_token(opts = {})\n self.token = Digest::SHA256.hexdigest(\n Time.now.to_s + Rails.application.secrets.salt + email\n )\n save if opts[:save] == true\n end", "def create\n user = AuthenticationManager.new(\n params.slice(%i[email first_name last_name password]).merge(is_profile_owner: true, password_confirmation: params[:password], tos_accepted: params.bool(:tos_accepted))\n ).register\n\n session_manager.login(user.email, params[:password])\n json_redirect create_profile_path\n end", "def forgot_password\n\t\t\n\tend", "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration') do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'justb4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save_without_session_maintenance\n return true\n end\n\n\n end", "def create\n #Create user instance\n @user = User.new(params[:user])\n @user.fb_uid = facebook_user.uid if facebook_user \n if @user.save\n \n #flash[:notice] = sprintf(t(:user_created_confirmation_sent), @user.name,@user.email) unless facebook_user\n flash_notice(:user_created_confirmation_sent, @user.full_name,@user.email) unless facebook_user\n \n create_session(@user) if facebook_user\n redirect_to_last_page\n else\n render :action => \"new\"\n end\n end", "def create_with_api\n begin \n @num_users = User.all.size\n user = User.from_omniauth(request.env[\"omniauth.auth\"])\n log_in user\n if @num_users == (User.all.size - 1)\n redirect_to edit_user_path(user)\n flash[:success] = \"Log in successful! Please set a password and update \n any additional information.\"\n else \n redirect_back_or edit_user_path(user)\n end\n rescue\n flash[:warning] = \"There was an error during the authentication \n process. \"\n redirect_to root_url\n end\n end", "def index\n \n @twitter_account = current_user.twitter_accounts.build(params[:twitter_account])\n if @twitter_account.save\n flash[:success] = \"Twitter account added!\"\n redirect_to root_url\n else\n render 'static_pages/home'\n end\n end", "def create_from_oauth oauth\n create(\n email: oauth.email.downcase,\n display_name: oauth.display_name\n )\n end", "def newaccount\n\t if params[:commit] == \"Cancel\"\n\t session[:authhash] = nil\n\t session.delete :authhash\n\t redirect_to root_url\n\t else # create account\n\t @newuser = User.find_by_email(session[:authhash][:email]) || User.new(:name => session[:authhash][:name], :email => session[:authhash][:email], :password => Devise.friendly_token[0,20])\n\t @newuser.authentications.build(:provider => session[:authhash][:provider], :uid => session[:authhash][:uid], :uname => session[:authhash][:name], :uemail => session[:authhash][:email])\n\t \n\t if @newuser.save!\n\t # signin existing user\n\t # in the session his user id and the authentication id used for signing in is stored\n\t session[:user] = @newuser.id\n\t session[:authentication_id] = @newuser.authentications.first.id\n\t \n\t flash[:notice] = 'Your account has been created and you have been signed in!'\n\t redirect_to root_url\n\t else\n\t flash[:error] = 'This is embarrassing! There was an error while creating your account from which we were not able to recover.'\n\t redirect_to root_url\n\t end \n\t end\n\t end", "def create\n # params[:user] contains the hash of user pre-filled details\n @user = User.new(params[:user])\n\n # try to do a save\n if @user.save\n # save successful returns true\n # goto the show view\n # sign_in is provided by sessions_helper\n sign_in @user\n flash[:success] = \"Welcome to Fake Twitter, #{@user.name}\"\n # it will take you to user_path/@user.id action\n redirect_to @user\n else\n render 'new'\n end\n end", "def account_creation\n\n username = prompt.ask(\"Choose a username!\\n\")\n while User.find_by(username: username) || username == \"\"\n puts \"Username taken - please try another\\n\"\n username = prompt.ask(\"Choose a username!\\n\")\n end\n\n password = prompt.mask(\"Choose a password over 5 characters.\")\n while password.length < 5\n puts \"Password too short - must be over 5 characters long\"\n password = prompt.mask(\"Choose a password over 5 characters.\")\n end\n\n User.create(username: username, password: password)\n puts \"You may now log in! Returning to login page.\\n\"\n\n welcome\n\n end", "def create\n access_token = AccountKit.access_token(params[:code])\n me = AccountKit.me(access_token)\n email = me[\"email\"][\"address\"]\n account_kit_id = me[\"id\"]\n\n @user = User.find_by(email: email)\n unless @user\n @user = User.create(email: email, account_kit_id: account_kit_id)\n end\n\n @session = @user.sessions.create\n\n cookies[:remember_token] = @session.remember_token\n\n if @user.name.nil?\n redirect_to update_profile_path(@user)\n else\n redirect_to root_path\n end\n end", "def create_from_oauth\n if stored_anonymous_user?\n user, from_registration = update_from_omniauth(env[\"omniauth.auth\"], params[:provider])\n else\n user, from_registration = create_from_omniauth(env[\"omniauth.auth\"], params[:provider])\n end\n\n if user.errors.any?\n redirect_to_registration_page(user)\n else\n change_global_user_id(user.id)\n sign_in(user)\n fandom_play_login(user)\n \n if from_registration\n log_data = { 'form_data' => env[\"omniauth.auth\"], 'user_id' => current_user.id }\n log_synced(\"registration from oauth\", adjust_user_and_log_data_with_utm(user, log_data))\n\n set_account_up()\n cookies[:from_registration] = true \n end\n\n if $site.force_facebook_tab && !request_is_from_mobile_device?(request)\n redirect_to request.site.force_facebook_tab\n else\n redirect_after_oauth_successful_login()\n end\n end\n end", "def create_new_user_and_identity(auth, params)\n user = User.create!(\n first_name: auth.info[:first_name],\n last_name: auth.info[:last_name],\n email: auth.info[:email],\n oauth_signup: true,\n # referred_by_user_id => params.andand[\"rid\"]\n )\n user.confirm!\n create_new_identity(user, auth)\n end", "def create_new_account(database, email_address, first_name, last_name, password)\r\n database.execute(\"INSERT INTO users (email_address, first_name, last_name, password) VALUES (?, ?, ?, ?)\", [email_address, first_name, last_name, password])\r\nend", "def create_user_and_login \n\t\tinsert_into :users, {\n\t\t\tid: 1 ,\n\t\t\tfirst_name: 'First',\n\t\t\tlast_name: 'Last',\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password',\n\t\t\trole_id: 1,\n\t\t\tuid: \"a\"\n\t\t}\n\n\t\tproxy.post( 'http://my.ownet/api/session',{\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password'\n\t\t}.to_json)\n\tend", "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration' ) do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'just4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save_without_session_maintenance\n return true\n end\n\n \n end", "def forgot_password\n end", "def create_user_information # for new users. runs last according to rails.\n self.dj_name = name\n self.roles = Role.where(:title => 'noob')\n self.active = true\n set_password\n end", "def open_user_account\n Account.create(user_id: self.id) \t\n end", "def create_user_account\n User.create!(email: self.email, password: self.customer)\n # user = User.new do |u|\n # u.email = email\n # u.password = customer\n # u.save\n # end\n end", "def password_required?\n if new_record? && oauth_account\n false\n else\n super\n end\n end", "def forgot_password\n\t\tend", "def fAddBookie(name, email, pwd)\n @users.addBookie(name, email, pwd)\n end", "def register()\n\tentry = {\"userid\" => @userid, \"username\" => @username, \"email\" => @email, \"password\" => @password}\n\tDATABASE.newEntry(\"users\", entry)\n\tend", "def after_create_account(user, auth)\n # not required\n end", "def twitter\n omniauth = request.env['omniauth.auth']\n\n render :text => 'Error: Omniauth is empty' and return unless omniauth\n name = omniauth['extra']['access_token'].params[:screen_name] || ''\n uid = omniauth['extra']['access_token'].params[:user_id] || ''\n provider = omniauth['provider'] ? omniauth['provider'] : ''\n\n # continue only if provider and uid exist\n if uid == '' or provider == ''\n flash[:error] = 'Error while authenticating '\n redirect_to new_user_session_path\n end\n\n if user_signed_in?\n # check if this service is already linked to his/her account, if not, add it\n auth = Service.find_by_provider_and_uid(provider, uid)\n if !auth\n current_user.services.create(:provider => provider, :uid => uid, :uname => name)\n flash[:notice] = 'Sign in via ' + provider.capitalize + ' has been added to your account.'\n redirect_to root_path\n else\n flash[:notice] = service_route.capitalize + ' is already linked to your account.'\n redirect_to root_path\n end\n end\n\n auth = Service.find_by_provider_and_uid(provider, uid)\n if auth\n # already has everything to login\n flash[:notice] = 'Signed in successfully via ' + provider.capitalize + '.'\n sign_in_and_redirect(:user, auth.user)\n else\n unless name == ''\n existinguser = User.find_by_name(name)\n # we have such user in database\n if existinguser\n existinguser.services.create(:provider => provider, :uid => uid, :uname => name)\n flash[:notice] = 'Sign in via ' + provider.capitalize + ' has been added to your account ' + existinguser.email + '. Signed in successfully!'\n sign_in_and_redirect(:user, existinguser)\n # no such user yet\n else\n # let's create a new user: register this user and add this authentication method for this user\n name = name[0, 39] if name.length > 39 # otherwise our user validation will hit us\n # new user, set email, a random password and take the name from the authentication service\n # twitter users does not have email, so we set it here to some value\n user = User.new(:password => SecureRandom.hex(10), :name => name, :email => \"#{name}@example.com\")\n\n # add this authentication service to our new user\n user.services.build(:provider => provider, :uid => uid, :uname => name)\n\n # do not send confirmation email, we directly save and confirm the new record\n user.save!\n\n # flash and sign in\n flash[:myinfo] = 'Your account has been created via ' + provider.capitalize + '. In your profile you can change your personal information and add a local password.'\n sign_in user\n redirect_to root_path\n end\n end\n end\n end", "def twitter(name: T.unsafe(nil), nickname: T.unsafe(nil), uid: T.unsafe(nil)); end", "def createuser(email, password, name, avatar)\n password_digest = BCrypt::Password.create(password)\n admin = \"0\"\n db.execute(\"INSERT INTO users(email, password, name, avatar, admin) VALUES (?,?,?,?,?)\", [email, password_digest, name, avatar, admin])\nend", "def create_from_omniauth\n auth_hash = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_uid(auth_hash[\"provider\"], auth_hash[\"uid\"]) || Authentication.create_with_omniauth(auth_hash)\n\n # if: previously already logged in with OAuth\n if authentication.user\n user = authentication.user\n authentication.update_token(auth_hash)\n @next = root_url\n @notice = \"Signed in!\"\n # else: user logs in with OAuth for the first time\n else\n user = User.create_with_auth_and_hash(authentication, auth_hash)\n # you are expected to have a path that leads to a page for editing user details\n @next = edit_user_path(user)\n @notice = \"User created. Please confirm or edit details\"\n end\n\n sign_in(user)\n redirect_to @next, :notice => @notice\n end", "def create_twitter_subscription(username,password,message = nil, events = {})\n Dropio::Resource.client.create_twitter_subscription(self,username,password,message,events)\n end", "def authenticate!\n session = DeviseTwitterAnywhere::Twitter::Session.new(cookies, params)\n\n if session.valid?\n klass = mapping.to\n user = klass.authenticate_twitter_user session.uid\n\n if user.blank? && klass.twitter_auto_create_account?\n user = klass.new\n user.twitter_session = session\n user.set_twitter_credentials_from_session!\n user.run_callbacks :create_by_twitter do\n begin\n user.save(:validate => klass.run_validations_when_creating_twitter_user)\n rescue ActiveRecord::RecordNotUnique\n fail!(:not_unique_user_on_creation) and return\n end\n end\n\n if klass.run_validations_when_creating_twitter_user && !user.persisted?\n fail!(:invalid_twitter_user_on_creation) and return\n end\n end\n\n if user.present? && user.persisted?\n user.twitter_session = session\n user.run_callbacks :connecting_to_twitter do\n success!(user) and return\n end\n else\n fail!(:twitter_user_not_found_locally) and return\n end\n else\n fail!(:invalid_twitter_session) and return\n end\n end", "def create\n\t\t@user = User.find_or_create_from_auth_hash(request.env[\"omniauth.auth\"])\n\t\tredirect_to(@@extension_url + '?access_token=' + @user.oauth_token)\n\tend", "def forgot\n\n\n\t\t#if user already exists,\n\t\t#attempt to send txt to user\n\t\t#and redirect to session controller to ask user to sign in w pin\n\tend", "def register_by_facebook_account(fb_session, fb_uid)\n api = FacebookGraphApi.new(fb_session.auth_token, fb_uid)\n user_attributes = api.find_user(fb_uid)\n email = user_attributes['email'] || 'FAKE'\n name = user_attributes['name'] || ''\n\n if !email.blank? && !name.blank?\n existing_user = User.find_by_email(email)\n existing_user = User.find_by_facebook_uid(fb_uid) if existing_user.nil?\n\n if existing_user\n existing_user.facebook_uid = fb_uid\n existing_user.facebook_sid = fb_session.auth_token\n existing_user.facebook_connect_enabled = true\n existing_user.save(false)\n\n existing_user.update_attribute(:state, 'active')\n existing_user\n else\n attributes = {\n :login => find_or_build_unique_user_name(name),\n :name => name,\n :email => find_or_build_unique_fake_email(email),\n :facebook_uid => fb_uid,\n :facebook_sid => fb_session.session_key,\n :activated_at => Time.now,\n :state => 'active',\n :facebook_connect_enabled => true\n }\n\n user = User.new(attributes)\n user.save(false)\n\n user.update_attribute(:state, 'activate')\n user\n end\n else\n # Do something else let's log him out from facebook\n raise 'Durrr! you are one of those unlucky person for whom we haven\\'t fixed this bug!\n please let me know that i told you this crap!' + \" data - #{user_attributes.inspect}\"\n end\n end", "def create_by_omniauth(auth)\n User.create do |user|\n user.assign_attributes(name: auth.info.name, email: auth.info.email,\n password: Devise.friendly_token[0, 20])\n user.skip_confirmation! if user.email\n user.link_with_omniauth(auth)\n end\n end", "def associate_with_social_account(social_params, social_image_cookie, social_bio_cookie)\n if social_params[\"provider\"].blank? || social_params[\"uid\"].blank?\n Airbrake.notify(:error_class => \"Logged Error\", :error_message => \"SOCIAL CREDENTIALS: The social credentials for #{self.id} did not get passed in from the sign up form. This is what we received: Provider = #{social_params[\"provider\"]} ; UID = #{social_params[\"uid\"]}\") if Rails.env.production?\n else\n # create a new social network record for storing their auth data in\n new_network ||= self.social_networks.new(:provider => social_params[\"provider\"].strip.downcase, :uid => social_params[\"uid\"].strip.downcase, :token => social_params[\"oauth_token\"], :token_secret => social_params[\"oauth_token_secret\"])\n if !new_network.save\n Airbrake.notify(:error_class => \"Logged Error\", :error_message => \"SOCIAL CREDENTIALS: Error creating social credentials for #{self.id} with these params: Provider = #{social_params[\"provider\"]} ; UID = #{social_params[\"uid\"]}\") if Rails.env.production?\n end\n end\n \n # upload their image\n begin\n self.set_new_user_image(nil, social_image_cookie, false, true)\n rescue\n Airbrake.notify(:error_class => \"Logged Error\", :error_message => \"PROFILE IMAGE: Error SAVING image from a social signup for #{self.email}. The image was #{social_image_cookie}\") if Rails.env.production?\n end\n \n # set their bio \n self.profile.update_attribute('bio', truncate(social_bio_cookie, :length => 140, :omission => '...')) \n end", "def register_user(email, username, password_digest, rank, username_downcase)\n $db.execute(\"INSERT INTO users (email, username, password_digest, rank, username_downcase) VALUES (?, ?, ?, ?, ?)\", email, username, password_digest, rank, username_downcase)\nend", "def proc_twitter_login\n \n # If user is already logged in, grab session variables\n if session[:user_name] && !session[:user_name].empty?\n @real_name = session[:real_name] \n @user_name = session[:user_name]\n @user_image = session[:user_image] \n else\n # If user is not logged in, grab authentication varaibles\n @real_name = request.env['rack.auth']['user_info']['name']\n @user_name = request.env['rack.auth']['user_info']['nickname']\n @user_image = request.env['rack.auth']['user_info']['image']\n \n session[:user_name] = @user_name\n session[:real_name] = @real_name\n session[:user_image] = @user_image \n end\n \n @exists = false\n @user_id = -1\n \n puts \"Checking if user already exists in database...\"\n \n # Check if user already exists in database\n User.all.each do |user|\n if user[:twitter] == @user_name\n @exists = true\n @user_id = user.id\n session[:user_id] = @user_id\n break;\n end\n end\n \n # User does not exist in database. Add new user\n if !@exists\n new_user = User.new( :twitter => @user_name, :name => @real_name )\n new_user.save\n \n @user_id = new_user.id\n session[:user_id] = @user_id\n end\n\n # Redirect to the user home page\n redirect_to :action => \"home\" \n end", "def create_a_user(password: 'secret!!')\n User.create! email: \"[email protected]\",\n password: password\n end", "def register_user(email, password, premium)\n password_digest = BCrypt::Password.create(password)\n $db.execute(\"INSERT INTO users (email, password_digest, rank) VALUES (?, ?, ?)\", [email, password_digest, premium == \"on\" ? 1 : 0])\nend", "def save\n return false unless valid?\n\n call_ok?(:maintain_user, forgot_password_request)\n end", "def authorize(req_token, given_num)\n # Clean up tokens\n #clean_tokens()\n begin\n rows = @db.execute(\"SELECT * FROM request_tokens WHERE request_token=?\", req_token)\n rescue\n puts \"Failed to find request token: #{$!}\"\n return false\n end\n req_secret = rows[0][2]\n begin\n puts \"Authorizing #{req_token} #{req_secret} #{given_num}\"\n @oauth.authorize_from_request(req_token, req_secret, given_num)\n rescue\n puts \"Failed to authorize user #{$!}\"\n return false\n end\n # If it works, save off the data.\n puts \"OMFG it works.\"\n acct = Twitter::Base.new(@oauth)\n begin\n profile = acct.verify_credentials\n @db.execute( \"INSERT INTO users VALUES (NULL,?,?,?,?)\",\n profile.name, given_num, @oauth.access_token.token, @oauth.access_token.secret)\n rescue Exception => e\n if e.class == SQLite3::SQLException \n # We already have this user!\n puts \"User #{profile.name} already has credentials\"\n else\n puts \"Failed to insert user #{profile.name}: #{$!}, #{e.class}\"\n return false\n end\n end\n acct\n end", "def new_facebook_signup\n \n @fb_data = fetch_facebook_params\n\n @user = Spree::User.where(email: @fb_data[:email]).first\n\n if @user.blank?\n @user = Spree::User.new(email: @fb_data[:email], facebook_token: @fb_data[:fb_token])\n \n @user.addresses.build\n @user.addresses.first.firstname = @fb_data[:firstname]\n @user.addresses.first.lastname = @fb_data[:lastname]\n\n\n else\n @user.update_attributes(facebook_token: @fb_data[:fb_token]) if @user.facebook_token != @fb_data[:fb_token] #update the token if @user_founds token is not same as the @fb_token\n sign_in(:spree_user, @user)\n redirect_to main_app.profile_users_path\n end\n\n end", "def create\n \t user = User.find_by(name: params[:session][:name])\n if user && user.authenticate(params[:session][:password])\n log_in user\n \n\n # Set the board name in the chat as the current user. \n current_user = User.find(session[:user_id])\n if(GlobalConstants::BOARDA.getName.to_s == \"?\")\n GlobalConstants::BOARDA.setName(current_user.name)\n else\n GlobalConstants::BOARDB.setName(current_user.name)\n end\n \n # Remembers the user if the \"remember me\" box is checked. \n params[:session][:remember_me] == '1' ? remember(user) : forget(user)\n redirect_to user\n else\n flash.now[:danger] = \"Invalid name/password combination\"\n render 'new'\n end\n end", "def create_accounts\n end", "def fill_fb_credentials\n\n fill_in FB_EMAIL_OR_ID_FIELD,with:FB_USER_ID\n fill_in FB_PASSWORD_FIELD,with:FB_USER_PASSWORD\n\nend", "def create_reference_account\n User.create(:email => \"[email protected]\", :password => \"walla2\", :admin => true)\nend", "def create_reference_account\n User.create(:email => \"[email protected]\", :password => \"walla2\", :admin => true)\nend", "def save_omniauth(provider, uid, access_token, refresh_token=nil)\n\t credentials = self.provider_credentials.find_or_create_by(company: company, provider: Provider.named(provider), uid: uid)\n\t Rails.logger.info credentials.inspect\n\t credentials.access_token = access_token\n\t credentials.refresh_token = refresh_token\n\t credentials.save!\n\t Rails.logger.info credentials.inspect\n\t Rails.logger.info credentials.errors.inspect\n\tend" ]
[ "0.7049782", "0.7043915", "0.7043642", "0.6796453", "0.6773182", "0.6628377", "0.6529823", "0.65026855", "0.6500722", "0.6485491", "0.64768547", "0.6454969", "0.6442903", "0.64350176", "0.64256823", "0.63911283", "0.63585657", "0.63476455", "0.63430136", "0.6328729", "0.631313", "0.6309754", "0.62951714", "0.6290955", "0.62835044", "0.6240246", "0.62365925", "0.62365925", "0.62340295", "0.623237", "0.6231311", "0.62282103", "0.62159973", "0.6210948", "0.6207157", "0.62065476", "0.62042695", "0.61871517", "0.61822695", "0.6177737", "0.6175281", "0.61745197", "0.6167583", "0.61619884", "0.61509615", "0.61471915", "0.6142655", "0.61259896", "0.61251664", "0.6119325", "0.6115813", "0.61154324", "0.61044306", "0.6102735", "0.6100234", "0.6093635", "0.60919887", "0.6090141", "0.60791665", "0.6071249", "0.606409", "0.60638154", "0.60609996", "0.6060638", "0.6052026", "0.60394025", "0.60281724", "0.6024266", "0.60153306", "0.60095555", "0.60079896", "0.6006075", "0.60023713", "0.59995776", "0.5994285", "0.5992469", "0.59897083", "0.5984188", "0.59833556", "0.5982653", "0.59714764", "0.5968551", "0.5959138", "0.59501576", "0.59427327", "0.5939132", "0.5931284", "0.59195834", "0.59064955", "0.59041744", "0.59015274", "0.58946574", "0.58941114", "0.58929497", "0.5886253", "0.5879514", "0.5879424", "0.5876676", "0.58728254", "0.58728254", "0.58725166" ]
0.0
-1
allows for account creation from twitter
def email_required? user_tokens.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter\n auth = request.env['omniauth.auth']\n current_user.company.create_or_update_twitter_account(auth)\n\n flash.notice = 'Authorized Twitter account successfully.'\n redirect_to twitter_accounts_path\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n self.twitter_name = user_info['name']\n self.twitter_screen_name = user_info['screen_name']\n self.login = 'twitter_' + user_info['screen_name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n\n self.login = user_info['screen_name']\n self.twitter_name = user_info['name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def twitter\n default_oauth_callback do |auth|\n # username may already be taken, user will have to enter another one\n if User.exists? username: auth.info.nickname\n redirect_to controller: '/registrations', action: 'twitter_screen_name_clash'\n else\n default_oauth_fail\n end\n end\n end", "def twitter_oauth(access_token)\n user_info = access_token.extra.raw_info\n external_user_id = user_info.id\n email = \"#{user_info.screen_name}@twitter.com\"\n account = self.by_twitter_id(external_user_id).first || self.by_twitter_email(email).first\n if account.blank?\n account = self.new\n account.email = email\n account.provider = Provider::TWITTER\n account.external_user_id = user_info.id\n account.skip_confirmation!\n if user_info.name\n first_name, last_name = user_info.name.split\n account.build_profile :first_name => first_name, :last_name => last_name\n end\n account.save\n end\n account\n end", "def create_from_tw\n client = Twitter::Client.new(\n :consumer_key => CONFIG[:tw_consumer_key],\n :consumer_secret => CONFIG[:tw_consumer_secret],\n :oauth_token => params[:tw_access_token],\n :oauth_token_secret => params[:tw_access_token_secret])\n\n @user = User.add_from_tw(\n client.user,\n params[:tw_access_token],\n params[:tw_access_token_secret],\n @source)\n end", "def create\n\t\t@account = Account.new(params[:account])\n\n\t\trespond_to do |format|\n\t\t\tif @account.save\n\t\t\t\t# If we provide tokens (manually)\n\t\t\t\tif [email protected]?\n\t\t\t\t\tredirect_to '/auth/twitter?screen_name=' + @account.username\n\t\t\t\t\treturn\n\t\t\t\telse\n\t\t\t\t\tformat.html { redirect_to @account, notice: 'Account was successfully created.' }\n\t\t\t\t\tformat.json { render json: @account, status: :created, location: @account }\t\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def twitter\n handle_oauth\n end", "def new \n\n begin\n if params[:oauth_token] != session['oauth_request_token_token']\n flash[:error] = 'Could not authorize your Twitter account'\n if current_user.nil?\n return redirect_to signup_path\n else\n return redirect_to edit_user_path(current_user)\n end\n end\n \n oauth_token = session['oauth_request_token_token']\n oauth_secret = session['oauth_request_token_secret']\n \n # if we're here, save the tokens to user\n access_token = @client.authorize(\n oauth_token,\n oauth_secret\n )\n\n if @client.authorized?\n \n client_info = @client.info\n \n if current_user.nil?\n newname = client_info['name']\n newtwittername = client_info['screen_name']\n newuserid = client_info['id_str']\n\n @user = User.find_by_twitter_id(newuserid)\n \n if @user.nil?\n @user = User.new(:name => newname, :twittername => newtwittername,\n :twitter_id => newuserid, :twitter_token => access_token.token,\n :twitter_secret => access_token.secret)\n @user.save! \n flash[:success] = \"User account created through Twitter\"\n else\n @user.name = newname\n @user.twittername = newtwittername\n @user.save!\n end\n \n sign_in @user\n session['oauth_request_token_token'] = nil\n session['oauth_request_token_secret'] = nil\n\n redirect_to current_user \n else\n \n twid = client_info['id_str']\n \n olduser = User.find_by_twitter_id(twid)\n if !olduser.nil?\n flash[:error] = 'Twitter account already linked to another account'\n else\n current_user.twitter_token = access_token.token\n current_user.twitter_secret = access_token.secret\n current_user.twitter_id = twid\n begin\n raise 'Could not save user' if !current_user.save\n rescue\n flash[:error] = \"bad\"\n end\n flash[:notice] = 'Your account has been authorized at Twitter'\n sign_in current_user\n end\n \n session['oauth_request_token_token'] = nil\n session['oauth_request_token_secret'] = nil\n return redirect_to edit_user_path(current_user)\n #rescue => e\n #flash[:error] = 'There was an error during processing the response from Twitter.'\n #flash[:error] = e.message\n end\n end \n end\n end", "def create_twitter_subscription(username,password,message = nil, events = {})\n Dropio::Resource.client.create_twitter_subscription(self,username,password,message,events)\n end", "def create\n @twitter_user = TwitterUser.new(params[:twitter_user])\n\n respond_to do |format|\n if @twitter_user.save\n format.html { redirect_to @twitter_user, notice: 'Twitter user was successfully created.' }\n format.json { render json: @twitter_user, status: :created, location: @twitter_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @twitter_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n \n @twitter_account = current_user.twitter_accounts.build(params[:twitter_account])\n if @twitter_account.save\n flash[:success] = \"Twitter account added!\"\n redirect_to root_url\n else\n render 'static_pages/home'\n end\n end", "def generate_access_token\n @user = current_user\n begin \n request_token = OAuth::RequestToken.new(TwitterAccount.twitter_consumer,\n params[\"oauth_token\"], params[\"oauth_verifier\"])\n if @user.twitter_account\n @user.twitter_account.delete\n end\n t_account = @user.create_twitter_account(request_token)\n\n unless t_account.new_record?\n flash[:notice] = 'You are now connected to twitter $green'\n l = Log.new\n l.user_id_1 = @user.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n l.message = \"#{name_1.humanize} is now connected to twitter account\"\n l.loggingtype = 0\n l.save\n\n else \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n end \n redirect_to controller: 'users', action: 'connect_social_accounts'\n\n rescue \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n redirect_to controller: 'users', action: 'connect_social_accounts'\n end \n end", "def create\n #request_token = @client.request_token(:oauth_callback => 'http://127.0.0.1:3000/twitter/new')\n #request_token = @client.request_token(:oauth_callback => 'https://gentle-snow-7462.herokuapp.com/twitter/new')\n request_token = @client.request_token(:oauth_callback => TWITTER_CALLBACK_URL)\n\n session['oauth_request_token_token'] = request_token.token\n session['oauth_request_token_secret'] = request_token.secret\n\n redirect_to request_token.authorize_url\n end", "def load_twitter_account\n # FIXME would this be better placed in the models?\n @twitter_account = @workspace ? @workspace.twitter_account || @workspace.create_twitter_account :\n @user.twitter_account || @user.create_twitter_account\n end", "def twitter\n callback_from :twitter\n end", "def callback\n @T_OAUTH = TwitterOAuth::Client.new(:consumer_key => TWITTER_KEY, :consumer_secret => TWIITER_SECRET )\n @oauth_verifier = params[:oauth_verifier]\n access_token = @T_OAUTH.authorize(session['token'], session['secret'], auth_verifier => @oauth_verifier)\n if (@result = @T_OAUTH.authorized?)\n current_user.create_or_update_twitter_account_with_oauth_token(access_token.token, access_token.secret)\n session['token'] = nil\n session['secret'] = nil\n flash[:notice] = \"Authorize complete\"\n else\n flash[:notice] = \"Authorize failed\"\n end\n\n rescue\n flash[:notice] = \"Authorize failed\"\n end", "def connect_twitter\n auth = request.env[\"omniauth.auth\"]\n current_member.twitter_token = auth[\"credentials\"][\"token\"]\n current_member.twitter_secret = auth[\"credentials\"][\"secret\"]\n current_member.twitter_id = auth[\"uid\"]\n if current_member.img_url.blank?\n current_member.username = auth.info.name\n current_member.img_url = auth.info.image\n\t end\n current_member.save\n\t TwitterModel.store_urls(current_member)\n\t redirect_to members_social_sign_up_path\n end", "def twitter_callback\n\t if I18n.locale == :en\n\t \tflash[:notice] = \"Connected to Twitter successfully!\"\n\t else I18n.locale == :ar\n\t \tflash[:notice] = \"تم التواصل مع تويتر بنجاح!\"\n\t end\n\t auth = request.env[\"omniauth.auth\"]\n authentication = Authentication.find_by_provider_and_gid(auth[\"provider\"],\n current_gamer.id) || Authentication.create_with_omniauth(auth,\n current_gamer)\n redirect_to \"/gamers/edit\"\n return\n\tend", "def twitter\n\t\thandle_omniauth_callback(request.env['omniauth.auth'])\n\tend", "def create_account\n\n end", "def create\n if Sidewalks::Informants::Twitter.client.\n follow(params[:user][:provider_screen_name])\n\n flash[:notice] = \"User was followed.\"\n end\n\n redirect_to admin_users_path\n end", "def twitt\n if PLANETOID_CONF[:twitter][:users][:send_twitts]\n twit=Twitter::Base.new(Twitter::HTTPAuth.new(PLANETOID_CONF[:twitter][:user], PLANETOID_CONF[:twitter][:password]))\n twit.update \"#{PLANETOID_CONF[:twitter][:users][:prefix]} #{self.name} #{PLANETOID_CONF[:site][:url]}/#{self.slug}\" \n end\n end", "def twitter(name: T.unsafe(nil), nickname: T.unsafe(nil), uid: T.unsafe(nil)); end", "def create\n @tweet = Tweet.new(tweet_params)\n if @tweet.username == nil\n # This is for the current user posting tweets\n @tweet.username = current_user.name\n @tweet.user_id = current_user.id\n # Updates to Twitter\n current_user.twitter.update(@tweet.tweetbody)\n else \n # Incoming tweets from the daemon script\n @tweet.save\n end\n respond_with(@tweet)\n end", "def create\n @tw_account = TwAccount.new(tw_account_params)\n\n respond_to do |format|\n if @tw_account.save\n format.html { redirect_to @tw_account, notice: 'The Account was successfully created.' }\n format.json { render :show, status: :created, location: @tw_account }\n else\n format.html { render :new }\n format.json { render json: @tw_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = user_from_token\n @tweet = user.tweets.new()\n @tweet.tweet = params[:tweet]\n if @tweet.save\n render :json => @tweet, :status => :created\n else\n render :json => @tweet.errors, :status => :unprocessable_entity\n end\n end", "def create\n #to avoid unwanted/unsafe requests we replace params[:user]\n @user = User.new(user_params)\n if @user.save\n # =WANT THEM TO ACTIVATE ACCOUNT FIRST\n @user.send_activation_email\n flash[:info] = \"Please check your email to activate your account.\"\n redirect_to root_url\n #logs in a user after they make account\n # log_in(@user)\n # flash[:success] = \"Welcome to Twitter Clone!\"\n #redirect_to @user\n else\n render 'new'\n end\n end", "def check_twitter_credentials\n if session['twitter_token'].blank? || session['twitter_secret'].blank?\n redirect_to new_user_registration_path, :error => \"Debes linkear tu cuenta de twitter antes de continuar\" and return\n end\n end", "def twitter\n omniauth = request.env['omniauth.auth']\n\n render :text => 'Error: Omniauth is empty' and return unless omniauth\n name = omniauth['extra']['access_token'].params[:screen_name] || ''\n uid = omniauth['extra']['access_token'].params[:user_id] || ''\n provider = omniauth['provider'] ? omniauth['provider'] : ''\n\n # continue only if provider and uid exist\n if uid == '' or provider == ''\n flash[:error] = 'Error while authenticating '\n redirect_to new_user_session_path\n end\n\n if user_signed_in?\n # check if this service is already linked to his/her account, if not, add it\n auth = Service.find_by_provider_and_uid(provider, uid)\n if !auth\n current_user.services.create(:provider => provider, :uid => uid, :uname => name)\n flash[:notice] = 'Sign in via ' + provider.capitalize + ' has been added to your account.'\n redirect_to root_path\n else\n flash[:notice] = service_route.capitalize + ' is already linked to your account.'\n redirect_to root_path\n end\n end\n\n auth = Service.find_by_provider_and_uid(provider, uid)\n if auth\n # already has everything to login\n flash[:notice] = 'Signed in successfully via ' + provider.capitalize + '.'\n sign_in_and_redirect(:user, auth.user)\n else\n unless name == ''\n existinguser = User.find_by_name(name)\n # we have such user in database\n if existinguser\n existinguser.services.create(:provider => provider, :uid => uid, :uname => name)\n flash[:notice] = 'Sign in via ' + provider.capitalize + ' has been added to your account ' + existinguser.email + '. Signed in successfully!'\n sign_in_and_redirect(:user, existinguser)\n # no such user yet\n else\n # let's create a new user: register this user and add this authentication method for this user\n name = name[0, 39] if name.length > 39 # otherwise our user validation will hit us\n # new user, set email, a random password and take the name from the authentication service\n # twitter users does not have email, so we set it here to some value\n user = User.new(:password => SecureRandom.hex(10), :name => name, :email => \"#{name}@example.com\")\n\n # add this authentication service to our new user\n user.services.build(:provider => provider, :uid => uid, :uname => name)\n\n # do not send confirmation email, we directly save and confirm the new record\n user.save!\n\n # flash and sign in\n flash[:myinfo] = 'Your account has been created via ' + provider.capitalize + '. In your profile you can change your personal information and add a local password.'\n sign_in user\n redirect_to root_path\n end\n end\n end\n end", "def create\n @tweet = current_user.tweets.create(params[:tweet])\n respond_with(@tweet, :location => tweet_url(@tweet))\n end", "def tweet_creation(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.influencer.user.email, subject: \"Notificaciones @ Social Target - Recibiste una propuesta para un nuevo tweet\")\n end", "def twitter\n @user = current_user\n if params[:oauth_verifier]\n if @user.user_content.twitter_token.blank?\n clientTwitter = TwitterOAuth::Client.new(:consumer_key => TwitterEnv::API_KEY, :consumer_secret => TwitterEnv::SECRET_KEY)\n pin = params[:oauth_verifier]\n access_token = clientTwitter.authorize(session[:rtoken_twitter], session[:rsecret_twitter], :oauth_verifier => pin)\n @user.user_content.twitter_token = access_token.token\n @user.user_content.twitter_secret = access_token.secret\n @user.user_content.save\n else\n clientTwitter = TwitterOAuth::Client.new(\n :consumer_key => TwitterEnv::API_KEY,\n :consumer_secret => TwitterEnv::SECRET_KEY,\n :token => @user.user_content.twitter_token, \n :secret => @user.user_content.twitter_secret)\n end\n end\n \n redirect_to \"/backend/social\"\n end", "def twitter\n handle_callback(:twitter)\n end", "def create_from_oauth oauth\n create(\n email: oauth.email.downcase,\n display_name: oauth.display_name\n )\n end", "def create\n auth = request.env[\"omniauth.auth\"]\n user_info = auth[\"info\"] ? auth[\"info\"] : auth[\"user_info\"]\n authentication = Authorization.where(:provider => auth['provider'], :uid => auth['uid']).first\n authentication = Authorization.new(:provider => auth['provider'], :uid => auth['uid']) if !authentication\n session[:fb_token] = auth['credentials']['token'] if auth['credentials']['token'] != nil\n # if the user exists, but does not have a link with the social service\n if !authentication.user && current_user\n authentication.user = current_user\n authentication.save\n end\n # twitter only (gets no email)\n if !authentication.user && !user_info[\"email\"]\n flash[:notice] = \"No user linked to this account. Please sign in or create a new account\"\n redirect_to '/users/sign_up/'\n # if user doesnt exists, register user\n elsif !authentication.user\n user = User.where(email: user_info['email']).first\n if user\n authentication.user = user\n else\n new_user = User.new(email: user_info['email'], username: user_info['name'], first_name: user_info['first_name'], last_name: user_info['last_name'], role: \"registered\")\n new_user.save\n authentication.user = new_user\n end\n authentication.save\n end\n # if user exists, sign in. Gives a Mongoid glitch of not signing in after registration. So double sign in\n if authentication.user\n if !current_user\n sign_in authentication.user\n sign_out authentication.user\n sign_in authentication.user\n # raise \"user signed in? #{user_signed_in?.to_s}\".inspect\n flash[:notice] = \"Authorization successful.\"\n redirect_to root_path\n else\n flash[:notice] = \"Linked successfully.\"\n redirect_to '/users/'+current_user.id\n end\n end\n end", "def create\n\n if Tweet::Create.(current_user, tweet_params)\n return redirect_to tweets_path, notice: 'Tweet was successfully created.'\n end\n\n end", "def add_twitter(id, twitter_name, options = nil)\n params = { 'username' => twitter_name }\n params.update(options) if options\n add_service(id, 'twitter', params)\n end", "def add_twitter(id, twitter_name, options = nil)\n params = { 'username' => twitter_name }\n params.update(options) if options\n add_service(id, 'twitter', params)\n end", "def create\n @user = User.find_by(username: params[:username])\n @auth = request.env[\"omniauth.auth\"]\n if @user == nil && @auth == nil\n reject_credentials\n else\n if @user != nil\n if @user.authenticate(params[:password])\n start_session(@user.id)\n else\n reject_credentials\n end\n elsif check_credentials(@auth.uid) != nil\n start_session(check_credentials(@auth.uid).id)\n else\n user = User.new_twitter_user(@auth)\n start_session(user.id)\n end\n end\n end", "def fetch_details_from_twitter\n\t\t# twitter_object = Twitter::Client.new(\n\t\t# \t:oauth_token => self.token,\n\t\t# \t:oauth_token_secret => self.secret\n\t\t# \t)\n\t\t# twitter_data = Twitter.user(self.uid.to_i)\n\t\t# self.username = twitter_data.username\n\t\t# self.save\n\t\t# self.user.username = twitter_data.username if self.user.username.blank?\n\t\t# self.user.image = twitter_data.profile_image_url if self.user.image.blank?\n\t\t# self.user.location = twitter_data.location if self.user.location.blank?\n\t\t# self.user.save(:validate => false)\n\t\tself.user.has_twitter = true\n\t\tself.user.save\n\tend", "def create_twit(twit)\n RestClient.post configuration.base_url + '/twits',\n { twit: twit }.to_json,\n content_type: :json,\n accept: :json\n end", "def create\n # Use current_user below, so that new tweets are only created by the logged in user #MDM\n #@tweet = Tweet.new(tweet_params)\n @tweet = current_user.tweets.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_valid_tweet(user: nil)\n user = create_valid_user if user.nil?\n user.tweets.create(content: 'I’m really tilting today!')\n end", "def twitter_check\n begin\n unless twitter.blank?\n RestClient.get \"twitter.com/#{twitter}\"\n end\n rescue\n errors.add :base, \"Invalid Twitter account.\"\n end\n end", "def twitter_user\n @twitter_user ||= prepare_access_token(self.token, self.secret)\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def create\n @twitter = true\n begin\n credentials = TwitterAPI::Base.get_yaml_credentials\n # Recreate consumer and request token that was used in new action\n req = TwitterAPI::Request.new(credentials, session[:rtoken], session[:rsecret])\n # Now verify with Twitter and get the final access token for user\n @result = \"Congratulations - cross-posting with Twitter is now set up!\"\n begin\n access_token = req.verify(params[:verifier])\n # save for next time\n @visitor_home.twitter_token = access_token.token\n @visitor_home.twitter_secret = access_token.secret\n @visitor_home.twitter_name = params[:twitter_name]\n if @visitor_home.save\n redirect_to :action => 'show'\n else\n @result = \"ublog login or database error - Twitter setup failed.\"\n render :template => \"yammers/create.html.erb\"\n end\n rescue\n @result = \"Twitter authorization failed! Your verification code was not accepted: \" + $!\n render :template => \"yammers/create.html.erb\"\n end\n rescue\n flash[:error] = $!\n @result = \"We're sorry but something went wrong.\"\n render :template => \"yammers/create.html.erb\"\n end\n end", "def twitter\n unless @twitter_user\n provider = self.authentications.find_by_provider('twitter')\n @twitter_user = Twitter::Client.new(:oauth_token => provider.token, :oauth_token_secret => provider.secret )rescue nil\n end\n @twitter_user\n end", "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration') do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'just4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save\n return true\n end\n\n\n end", "def create(tweet)\n # create a new tweet\n @tweet = Tweet.new(tweet)\n @tweet.made_by=session.user\n\n content = tweet[:content].strip #remove whitespace from front and back of the tweet's content\n\n # find out if the tweet is a private message or a group message or a reply\n is_pm = params[:for_users] || content.index('pm ') #from the form or command- 'dm yeban Holla!'\n is_gm = params[:for_group] || content.index('gm ') #from the form or command- 'gm Music Holla!'\n is_reply = content.index('@') #if the tweet contains '@', it is a reply\n\n if is_pm # if it is a private message\n\n # find the user it is intended for\n if params[:for_users] #from the form\n user = User.get params[:for_users].to_i\n else #from the command\n nick = content.split[1]\n user = User.all(:nick => nick)[0]\n end #finding user ends\n\n raise NotFound unless user # raise error if the user does not exist\n\n # if the user exists\n content = content.sub(/pm #{nick} /, '')\n @tweet.content = content\n @tweet.for_users << user #tweet has many to many relation with for_user\n @tweet.protected = true\n\n elsif is_gm # create a group message\n\n # find the group it is intended for\n if params[:for_group] #from the form\n group = Group.get params[:for_group].to_i\n else #from the command\n name = content.split[1]\n group = Group.all(:name => name)[0]\n end #finding user ends\n\n raise NotFound unless group # raise error if the group does not exist\n raise NotPriviliged unless session.user.is_member? group\n\n # if the group exists and the user is a member\n @tweet = Tweet.new\n content = content.sub(/gm #{name} /, '')\n @tweet.content = content\n @tweet.made_by=session.user\n @tweet.for_group = group\n @tweet.protected = true\n\n elsif is_reply # create a reply, it may be for more than one user\n \n #find the users it is intended for\n users = []\n content.split.each do |word|\n if word.match(/\\@\\w+/) #if the word is like '@yeban'\n nick = word.match(/\\w+/) #take yeban\n users << User.first(:nick => nick.to_s) #find the user\n end # if ends\n end # do ends\n\n @tweet.content = content\n @tweet.for_users = users\n\n else # a normal tweet\n @tweet.content = content\n end\n\n if @tweet.save\n redirect(url(:private_messages), :message => {:notice => \"Private Message sent successfully.\"}) if is_pm\n redirect(url(:group_messages), :message => {:notice => \"Group Message sent successfully.\"}) if is_gm\n redirect url(:tweets), :message => {:notice => \"Tweet was successfully created.\"}\n else\n message[:error] = \"Tweet failed to be created\"\n render :index\n end\n end", "def twitter\n \toauth.authorize_from_access(oauth_token, oauth_secret)\n\t @twitter ||= Twitter::Base.new(oauth)\n end", "def create\n @user = User.find(params[:user_id])\n @tweet = @user.tweets.create(tweet_params)\n redirect_to user_tweets_path\n end", "def tweet(tweet_body)\n encoded_url = url_encode \"#{@handle}/#{@password}/#{tweet_body}\"\n HTTParty.post(\"#{@api_path}/tweets/new/#{encoded_url}\")\n end", "def select_twitter_account(&callback)\n account_type = @store.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)\n\n @store.requestAccessToAccountsWithType(account_type, options: nil, completion: -> (granted, error) do\n if granted\n @accounts = @store.accountsWithAccountType(account_type)\n if @accounts.length > 0\n Dispatch::Queue.main.async do\n next_step = -> (account, &firebase_handler) do\n self.authenticate_account(account, &firebase_handler)\n end\n callback.call(nil, @accounts, next_step)\n end if callback\n else\n error = NSError.alloc.initWithDomain('TwitterAuthHelper',\n code: AuthHelperErrorAccountAccessDenied,\n userInfo: { NSLocalizedDescriptionKey => 'No Twitter accounts detected on phone. Please add one in the settings first.' })\n Dispatch::Queue.main.async do\n callback.call(error, nil, nil)\n end if callback\n end\n else\n error = NSError.alloc.initWithDomain('TwitterAuthHelper',\n code: AuthHelperErrorAccountAccessDenied,\n userInfo: { NSLocalizedDescriptionKey => 'Access to twitter accounts denied.' })\n Dispatch::Queue.main.async do\n callback.call(error, nil, nil)\n end if callback\n end\n end)\n end", "def create\n tweet.user = current_user\n\n respond_to do |format|\n if tweet.save\n format.html { redirect_to tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: tweet }\n else\n format.html { render :new }\n format.json { render json: tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tweet = current_user.tweets.new tweet_params\n\n if current_user\n @tweet.user_id = current_user.id\n end\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: \"Tweet was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n signin_apikey\n \n if session[:user_id] != nil\n @tweet = Tweet.new(tweet_params)\n @tweet.author = User.find(session[:user_id]).email.split('@')[0].strip\n @tweet.user_id = User.find(session[:user_id]).id\n if [email protected]?\n if !is_url(@tweet.url)\n respond_to do |format|\n format.json { render json: \"Invalid url!\".to_json, status: 400 }\n end\n return\n end\n @tweet.url = @tweet.url.sub \"https://\", \"\"\n @tweet.url = @tweet.url.sub \"www.\", \"\"\n @urlsplit = @tweet.url.split(\"/\")\n @urlsplit.each do |suburl|\n if suburl.include?(\".\")\n @tweet.shorturl = suburl\n end\n end\n end\n @tweet2 = Tweet.find_by url: @tweet.url\n if (@tweet.content.blank? && [email protected]?)\n respond_to do |format|\n if @tweet.title.blank?\n format.html { redirect_to new_tweet_path, alert: 'Please try again.' }\n format.json { render json: \"Title property cannot be blank\".to_json, status: 400 }\n elsif (@tweet2 != nil)\n format.html { redirect_to '/tweets/' + @tweet2.id.to_s }\n msg = \"The URL already exists\"\n format.json { render json: msg.to_json , status: 400, location: @tweet }\n elsif @tweet.save\n format.html { redirect_to '/tweets', notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: 201 }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n elsif (@tweet.url.blank? && [email protected]?)\n @tweet.ask = true\n respond_to do |format|\n if @tweet.title.blank?\n format.html { redirect_to new_tweet_path, alert: 'Please try again.' }\n format.json { render json: \"Title property cannot be blank\".to_json, status: 400 }\n elsif @tweet.save\n format.html { redirect_to '/tweets', notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: 201 }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n else\n @[email protected]\n @tweet.content=nil\n @tweet.ask = false\n \n if @tweet.save\n Comment.create(contribution: @tweet.id, text: @comment_text, escomment: true, comment_id: nil, user: @tweet.user_id)\n render :json => @tweet.attributes.merge( )\n end\n end\n else\n respond_to do |format|\n format.json { render json: {message: 'Unauthorized, you don\\'t have a valid api_key' }, status: 401 }\n end\n end\n end", "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration') do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'justb4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save_without_session_maintenance\n return true\n end\n\n\n end", "def add_tweeter(username)\n tweeter = Tweeter.new(:user => username, :city_id => self.id)\n init_tweets(tweeter)\n tweeter.save\n end", "def create\n @account = Account.new(account_params)\n \n if @account.type_account != 0\n\n dae = DataAccountEvent.new\n \n client = Twitter::REST::Client.new do |config|\n config.consumer_key = 'xYEFttTg61yWfZO20byljihWF'\n config.consumer_secret = 'DLdNpRAgcxsqdODqJP1yTSE7p02T3hSUDF1qMbz14QrVp5jKLO'\n config.oauth_token = '93945943-Pd4V1IuroSUUU4GsdzUvprQ0or0ZRAajUt8DMPgIb'\n config.oauth_token_secret = 'GZWtSu5QEXmUJUb0ZTEjfdg262DxxX03IljeeCl5PtvhZ'\n end\n\n p = @account.user_twitter.delete \"@\"\n c = client.user(p)\n\n @account.key_user_id = c.id\n @account.user_name = c.name\n @account.save\n\n dae.id = nil\n dae.url_official = c.website.to_s\n dae.location = c.location\n dae.url_twitter_event = \"https://twitter.com/\"+p\n dae.num_tweets = c.statuses_count \n dae.num_photo_and_video = 0\n dae.num_following = c.friends_count\n dae.num_followers = c.followers_count \n \n if @account.type_account == 1\n dae.account_official = true\n end\n\n dae.date_creation_account = c.created_at\n dae.account_id = @account.id\n dae.save\n @account.data_account_event_id = dae.id\n \n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end \n\n end\n\n end", "def create\n @account = Account.new(params[:account])\n @account.user = User.find_by_id(current_user.id)\n user = User.find_by_id(current_user.id)\n @account.groupid = user.currentgroupid\n\n respond_to do |format|\n if @account.save\n if @account.tmp.present?\n comment = Comment.new\n comment.accounts_id = @account.id\n comment.comment = @account.tmp\n comment.name = user.username\n comment.save\n end\n \n #current_user.twitter.update(@account.content) if params[:twitter] == 'yes'\n #if params[:facebook] == 'yes'\n # current_user.facebook.feed!(:message => \"test\",\n # :link => \"http://moonkey.jp\",\n # :name => \"TEST\",\n # :description => \"test\")\n #end\n format.html { redirect_to accounts_url }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def tweet_new_tweet(tweet)\n #setup twitter client\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = $consumer_key\n config.consumer_secret = $consumer_secret\n config.access_token = $access_token\n config.access_token_secret = $access_token_secret\n end\n\n $log.debug(tweet)\n client.update(tweet)\n $log.info(\"Successfully tweeted!\")\nend", "def create\n @tweet = current_user.tweets.build(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tweet = current_user.tweets.build(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to member_url(current_user), notice: '投稿しました' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n result = access_token.post('/api/v1/users/create', {:email=>params[:email],:psw=>params[:password],:psw_conf=>params[:password_conf],:inbox=>params[:inbox]})\n display_api_response result\n respond_with(\"\",:location => :back)\n end", "def tweet_creation_to_admin(tweet)\n @tweet = tweet\n\n set_attachments\n\n @screen_name = tweet.influencer.user.twitter_screen_name\n\n case APP_CONFIG['app_country']\n when 'AR'\n mail(to: '[email protected]', subject: \"Notificaciones @ Social Target - @#{@screen_name} recibió una propuesto de Tweet\")\n when 'CO'\n mail(to: '[email protected]', subject: \"Notificaciones @ Social Target - @#{@screen_name} recibió una propuesto de Tweet\")\n when 'MX'\n mail(to: '[email protected]', subject: \"Notificaciones @ Social Target - @#{@screen_name} recibió una propuesto de Tweet\")\n end\n\n end", "def create\n @tweet = current_user.tweets.new(tweet_params)\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_back fallback_location: root_path, notice: 'ツーイトの投稿が完了しました。' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def import_profile_from_twitter\n self.profile.first_name = @credentials['name']\n self.profile.website = @credentials['url']\n self.profile.federated_profile_image_url = @credentials['profile_image_url']\n self.profile.save\n end", "def create_account\n unless authenticated?\n payload = encode( { :user => { :github_account => github_user } } )\n response = site['users.json'].post payload, :content_type => :json\n !response.nil?\n end\n end", "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration' ) do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'just4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save_without_session_maintenance\n return true\n end\n\n \n end", "def create\r\n @tweet = Tweet.new(tweet_params)\r\n @tweet.user = current_user\r\n \r\n respond_to do |format|\r\n if @tweet.save\r\n format.html { redirect_to @tweet, notice: \"Tweet was successfully created.\" }\r\n format.json { render :show, status: :created, location: @tweet }\r\n else\r\n format.html { render :new, status: :unprocessable_entity }\r\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def conection\n\n #cliente para el oauth\n cliente=OAuth::Consumer.new(\n @token,\n @secret,\n {\n :site=>\"http://twitter.com\",\n :request_token_url=>\"https://api.twitter.com/oauth/request_token\",\n :access_token_url =>\"https://api.twitter.com/oauth/access_token\",\n :authorize_url =>\"https://api.twitter.com/oauth/authorize\"\n }\n )\n #se solicita al api el token y el secret del usuario\n request_token = cliente.get_request_token\n token2 = request_token.token\n secret2 = request_token.secret\n #se abre el navegador predeterminado del sistema con la pagina de autorizacion\n direccion = cliente.authorize_url + \"?oauth_token=\" + token2\n puts \"Abriendo en el navegador: \"+direccion\n system('start '+direccion)\n #solicita el pin brindado por twitter\n print \"Clic al link anterior e ingrese el pin que aparese en la pagina del Tweeter de su navegador:\"\n pin = gets.chomp\n\tputs\n #se autentica al usuario con los datos brindados\n begin\n OAuth::RequestToken.new(cliente, token2, secret2)\n access_token=request_token.get_access_token(:oauth_verifier => pin)\n Twitter.configure do |config|\n config.consumer_key = @token\n config.consumer_secret = @secret\n config.oauth_token = access_token.token\n config.oauth_token_secret = access_token.secret\n end\n $client = Twitter::Client.new\n $client.verify_credentials\n puts \"Autenticado Correctamente\"\n\n rescue Twitter::Unauthorized\n puts \"Error de Autorizacion\"\n end\n end", "def log_in_to_twitter\n @client = Twitter::REST::Client.new do |config|\n #https://apps.twitter.com/app/14450234\n config.consumer_key = Figaro.env.pusher_key\n config.consumer_secret = Figaro.env.pusher_secret\n config.access_token = Figaro.env.stripe_api_key\n config.access_token_secret = Figaro.env.stripe_publishable_key\n end\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def initialize (tweet)\n\t\tputs \"Publicar un nuevo Tweet...\"\n\t\ttweet= gets() #Obtenemos lo que el usuario digite\n\t\tTwitter.configure do |config|\n\t\t\t\tconfig.consumer_key = 'x4pUZIkRRMRvCpVDJwdhw'\n \t\t\t\tconfig.consumer_secret = 'D8yU5s5qzRHfnfSN6pZXXZEobqfn2dqGZ27HlwwOiI'\n\t\t\t\tconfig.oauth_token = '948173238-0rDoOacK40XT7HmdmtGZXPvghX2pq7xhjjjer8pw'\n\t\t\t\tconfig.oauth_token_secret = 'fhsZZQAxoFmUqcFUbnUWJl5TmCU45tSJj6yrOv9rJYb1J'\n\t\tend\n\t\tTwitter.update(tweet)\n\t\tend", "def initialize (tweet)\n\t\tputs \"Publicar un nuevo Tweet...\"\n\t\ttweet= gets() #Obtenemos lo que el usuario digite\n\t\tTwitter.configure do |config|\n\t\t\t\tconfig.consumer_key = 'x4pUZIkRRMRvCpVDJwdhw'\n \t\t\t\tconfig.consumer_secret = 'D8yU5s5qzRHfnfSN6pZXXZEobqfn2dqGZ27HlwwOiI'\n\t\t\t\tconfig.oauth_token = '948173238-0rDoOacK40XT7HmdmtGZXPvghX2pq7xhjjjer8pw'\n\t\t\t\tconfig.oauth_token_secret = 'fhsZZQAxoFmUqcFUbnUWJl5TmCU45tSJj6yrOv9rJYb1J'\n\t\tend\n\t\tTwitter.update(tweet)\n\t\tend", "def create\n omniauth = request.env['omniauth.auth']\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully\"\n sign_in_and_redirect(:account, authentication.account)\n else\n user = Account.new(password: Devise.friendly_token) # If you create an account with twitter/fb, we don't need a passwod\n user.apply_omniauth(omniauth)\n user.email = get_email_from_omniauth omniauth\n if user.save\n flash[:notice] = \"Successfully registered\"\n sign_in_and_redirect(:account, user)\n else\n session[:omniauth] = omniauth.except('extra')\n session[:omniauth_email] = omniauth['extra'] && omniauth['extra']['user_hash'] && omniauth['extra']['user_hash']['email']\n\n # Check if email already taken. If so, ask user to link_accounts\n if user.errors[:email][0] =~ /has already been taken/ # omniauth? TBD\n # fetch the user with this email id!\n user = Account.find_by_email(user.email)\n return redirect_to link_accounts_url(user.id)\n end\n redirect_to new_account_registration_url\n end\n end\n end", "def twitter?\n false\n end", "def create\n @avatar_twitter = AvatarTwitter.new(params[:avatar_twitter])\n\n respond_to do |format|\n if @avatar_twitter.save\n format.html { redirect_to(@avatar_twitter, :notice => 'Avatar twitter was successfully created.') }\n format.xml { render :xml => @avatar_twitter, :status => :created, :location => @avatar_twitter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @avatar_twitter.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @tweet = @user.tweets.build(params[:tweet])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to user_tweet_path(@user, @tweet), notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: user_tweet_path(@user, @tweet) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_accounts\n end", "def new\n @user = current_user\n @tweet = @user.tweets.new\n end", "def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user_id = current_user.id\n\n \n\n \n \n \n\n \n \n \n\n\n \n\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tweet was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def link_twitter\n\n end", "def twitter?\n self.twitter_token && self.twitter_secret\n end", "def find_tweets(current_user)\n @screen_name = current_user.authentications[2].to_s\n @another_tweet = self.twitter.user_timeline(@screen_name)\n @tweet = Tweets.new\n @another_tweet.each do |t|\n @tweet.screenname = t.screen_name\n @tweet.text = t.text\n @tweet.created_at = t.created_at\n end\n @tweet.save\n end", "def twitter_user\n @twitter_user ||= TwitterClient.new.user(@user)\n end", "def create\n @t_user_account = TUserAccount.new(t_user_account_params)\n\n respond_to do |format|\n if @t_user_account.save\n format.html { redirect_to @t_user_account, notice: 'T user account was successfully created.' }\n format.json { render :show, status: :created, location: @t_user_account }\n else\n format.html { render :new }\n format.json { render json: @t_user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_account(site_url, site_email, analyst_email, password)\n reqBody = {:site_url => site_url, :site_email => site_email,\n :analyst_email => analyst_email, :password => password}\n begin\n http_post(accounts_url(), reqBody)\n rescue Exception => e\n puts e.message\n puts e.backtrace.inspect\n end\n\n end", "def twitter_url(username)\n \"https://twitter.com/#!/#{username}\"\n end", "def assign_twitter_account_info(auth)\n user = auth.extra.raw_info\n self.twitter_id = user.id\n self.name = user.name\n self.screen_name = user.screen_name\n self.location = user.location\n self.description = user.description\n self.url = user.url\n self.profile_image_url = user.profile_image_url_https\n self\n end", "def create\n @tweet = Tweet.new(tweet_params.merge(user: current_user))\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tweet was successfully created.\" }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # params[:user] contains the hash of user pre-filled details\n @user = User.new(params[:user])\n\n # try to do a save\n if @user.save\n # save successful returns true\n # goto the show view\n # sign_in is provided by sessions_helper\n sign_in @user\n flash[:success] = \"Welcome to Fake Twitter, #{@user.name}\"\n # it will take you to user_path/@user.id action\n redirect_to @user\n else\n render 'new'\n end\n end", "def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end", "def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user = current_user\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to root_path, notice: \"Tweet creado felizmente.\" }\n format.json { redirect_to root_path, status: :created, location: @tweet }\n else\n format.html { redirect_to root_path, notice: \"No se puede tuitear nada.\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def connected_to_twitter?\n twitter_token && twitter_secret\n end", "def url\n \"http://twitter.com/#{self.username}/statuses/#{self.twitter_id}\"\n end", "def create\n @tweet = Tweet.create(:user_id => current_user.id, :text => tweet_params[:text])\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to @tweet, notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "def authenticate!\n session = DeviseTwitterAnywhere::Twitter::Session.new(cookies, params)\n\n if session.valid?\n klass = mapping.to\n user = klass.authenticate_twitter_user session.uid\n\n if user.blank? && klass.twitter_auto_create_account?\n user = klass.new\n user.twitter_session = session\n user.set_twitter_credentials_from_session!\n user.run_callbacks :create_by_twitter do\n begin\n user.save(:validate => klass.run_validations_when_creating_twitter_user)\n rescue ActiveRecord::RecordNotUnique\n fail!(:not_unique_user_on_creation) and return\n end\n end\n\n if klass.run_validations_when_creating_twitter_user && !user.persisted?\n fail!(:invalid_twitter_user_on_creation) and return\n end\n end\n\n if user.present? && user.persisted?\n user.twitter_session = session\n user.run_callbacks :connecting_to_twitter do\n success!(user) and return\n end\n else\n fail!(:twitter_user_not_found_locally) and return\n end\n else\n fail!(:invalid_twitter_session) and return\n end\n end", "def set_twitter_user\n @twitter_user = TwitterUser.find(params[:id])\n end" ]
[ "0.78831327", "0.7386175", "0.73367363", "0.7259663", "0.7202203", "0.7105719", "0.7078297", "0.70148623", "0.6986618", "0.6943751", "0.6937294", "0.6928746", "0.6903761", "0.6841695", "0.67827666", "0.6736823", "0.67244667", "0.66916084", "0.6687735", "0.66702646", "0.6647008", "0.66443354", "0.6643254", "0.66026986", "0.659243", "0.65845037", "0.6578393", "0.6573651", "0.6546736", "0.6539095", "0.65360796", "0.6528373", "0.65176004", "0.6497893", "0.64793766", "0.64594465", "0.64324844", "0.64318645", "0.64318645", "0.6430556", "0.64225155", "0.6417504", "0.6417338", "0.6416612", "0.64149976", "0.64104605", "0.6407227", "0.6400994", "0.6395539", "0.63674474", "0.6353293", "0.6349151", "0.6346274", "0.6325185", "0.631998", "0.6318192", "0.63160163", "0.63080984", "0.63052803", "0.6295607", "0.6274748", "0.6266467", "0.62603134", "0.62461185", "0.62426955", "0.62357664", "0.6207283", "0.6200388", "0.61839324", "0.6177551", "0.6175375", "0.6169799", "0.61578214", "0.6155886", "0.6154449", "0.6152772", "0.6152772", "0.61484414", "0.61351866", "0.61338323", "0.6128012", "0.6125746", "0.6122821", "0.6121403", "0.6110149", "0.6098405", "0.60907996", "0.6086399", "0.6069898", "0.6069056", "0.6063667", "0.60534996", "0.60378975", "0.6036533", "0.60232586", "0.6018961", "0.60147494", "0.6014597", "0.6014314", "0.60093445", "0.5995426" ]
0.0
-1
method to return all projects I've created
def my_projects # Look at all the project # see which project's creator is equal to self Project.all.select do |project| project.creator == self end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projects\n request(method: 'getAllProjects')\n end", "def all\n @projects\n end", "def all\n @projects\n end", "def projects\n PivotalTracker::Project.all\n end", "def find_all\n api.command(:listProjects).collect do |project|\n project[1]['project'].map { |p| self.new p }\n end.flatten\n end", "def projects\n @projects ||= Project.all\n end", "def projects\n result = []\n load_attributes\n @attributes['projects'].each do |project|\n result << project['name']\n end\n puts \"Workspace projects #{result}\"\n result\n end", "def projects\n Sifter.\n get(\"/api/projects\").\n parsed_response[\"projects\"].\n map { |p| Sifter::Project.new(p) }\n end", "def projects\n @projects\n end", "def find_projects\n @projects = Project.all\n end", "def list_projects # :nologin:\n query = create_query(:Project, :all, :by => :title)\n show_selected_projects(query)\n end", "def create_projects\n projects = []\n config.projects.each do |project|\n projects << Project.new(project)\n end\n projects\nend", "def list(params = {})\n response = get_request('/projects/', params)\n response.map { |project| TheShiningSource::Project.new(project) }\n end", "def projects\n Harvest::Resources::Project\n end", "def projects ; end", "def projects\n return [] unless basecamp\n @projects ||= basecamp.projects\n end", "def projects\n settings.projects.map do |project_settings|\n Project.new(project_settings)\n end\n end", "def all_projects()\n @endpoint = \"/projects.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"projects\"].sort_by { |proj| proj[\"name\"] }\n end", "def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end", "def listprojects\n get('listprojects.json')['projects']\n end", "def projects\n Project.all.select { |project| project.creator == self }\n end", "def projects\n DataStore.projects\n end", "def get_projects\n me = request('/services/v5/me')\n me['projects']\n end", "def projects\n return @projects if @projects\n @projects = []\n IO.readlines(@file).each do |line|\n @projects << Project.new(line, @dir) if /^Project.*\\.csproj/ =~ line\n end\n end", "def projects(params = {})\n fetch_all('projects', 'projects', params)\n end", "def project_list\n project_folders = Dir::entries(::File.join(Msf::Config.log_directory, 'projects'))\n projects = []\n framework.db.workspaces.each do |s|\n if project_folders.include?(s.name)\n projects << s.name\n end\n end\n return projects\n end", "def projects\n\t\tProject.order(\"created_at\").find_all_by_account_id(account_id).reverse\n\tend", "def projects\n if is_deploy_key\n [project]\n else\n user.projects\n end\n end", "def projects\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Project)\n end", "def projects\n if is_deploy_key\n [project]\n else\n user.authorized_projects\n end\n end", "def list_all\n query = create_query(:Project, :all, by: default_sort_order)\n show_selected_projects(query)\n end", "def projects(params = nil)\n params = params.merge({ :current_user => @options[:current_user]})\n params = params.except(:manufacturer_id, :catg_slug, :office_id, :max_matches)\n params[:order] ||= 'recently_active'\n\n @projects_response = ProjectsIndexPresenter.new(params[:current_user], params).response\n projects = @projects_response[:projects] || []\n projects\n end", "def projects\n @projects ||= Harvest::API::Projects.new(credentials)\n end", "def show_all_projects\r\n json = GoodData.get GoodData.profile.projects\r\n puts \"You have this project available:\"\r\n json[\"projects\"].map do |project|\r\n pid = project[\"project\"][\"links\"][\"roles\"].to_s\r\n puts \"Project name: #{project[\"project\"][\"meta\"][\"title\"].bright} Project PID: #{pid.match(\"[^\\/]{32}\").to_s.bright}\"\r\n end\r\n end", "def index\n\t\t@projects = Project.all\n\tend", "def projects\n Easybill::Api::Projects\n end", "def projects\n records \"project\", \"/project/list\"\n end", "def build_project_lists\n # call the application controller connect funtion\n conn = basecamp_connect\n unless conn \n raise \"url or authkey not set\"\n end\n projects = Basecamp::Project.find_by_status(conn, 'active')\n @project_list = projects.collect{|p| [p.name, p.id] }.sort_by{|name, id| name }\n @mantis_list = MantisProjectTable.order(\"name\").all.collect{|p| [ p.name, p.id ] }\n end", "def available_projects_list\n uri = \"#{@api_url}?access_token=#{@access_token}\"\n get uri\n end", "def projects\n resource 'projects'\n end", "def list\n get 'projects'\n end", "def projects(params = {})\n make_get_request('/account/projects', params)\n end", "def projects\n @projects ||= begin\n http = Net::HTTP.new(API_HOST, API_PORT)\n http.use_ssl = true\n http.ca_file = (Twigg.root + 'files' + 'github.pem').to_s\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n uri = ORG_REPOS_ENDPOINT % Config.github.organization\n headers = { 'Authorization' => \"token #{Config.github.token}\" }\n\n [].tap do |names|\n begin # loop: page through project list\n request = Net::HTTP::Get.new(uri, headers)\n response = http.request(request)\n raise \"Bad response #{response.inspect}\" unless response.is_a?(Net::HTTPOK)\n names.concat JSON[response.body].map { |repo| repo['name'] }\n uri = parse_link(response['Link'])\n end until uri.nil?\n end\n end\n end", "def my_projects\n @projects = Project.where(:client_id => current_user.client_id)\n end", "def my_projects\n\t\tif params[:cat].present?\n\t\t\tst = params[:cat] == \"in_progress\" ? \"in progress\" : \"completed\"\n\t\t\t@my_projects = Project.where(user_id: current_user.id, project_status: st)\n\t\telse\n\t\t\t@my_projects = Project.where(user_id: current_user.id, project_status: \"in progress\")\n\t\tend\n\t\t@report_options = ProjectReport.previous_reports(current_user.id)\n\t\t@project_report = ProjectReport.new\n\tend", "def projects\n config[:projects]\n end", "def projects(options = {})\n get(\"projects\", options).projects\n end", "def projects_list\n projects.inject({}) do |h, project|\n h.merge( project['id'] => project['name'] )\n end\n end", "def collection\n return @client.api_helper.collection(\"projects\")\n end", "def index\n @projects = Project.all\n end", "def index\n \t@projects = Project.all\n end", "def index\n @projects = @namespace.projects.all\n end", "def projects\n tmp = client.get @json['user']['links']['projects']\n tmp['projects'].map do |project_meta|\n project_uri = project_meta['project']['links']['self']\n project = client.get project_uri\n client.factory.create(GoodData::Project, project)\n end\n end", "def cross_project\n []\n end", "def projects\n my_proj = self.my_projects\n my_memb = self.collaborations\n my_proj + my_memb\n end", "def projects\n map(&:projects).flatten.uniq.sort\n end", "def projects\n projects = object.projects.select { |p| !current_user || p.users.include?(current_user) }\n projects.map { |p| p.id }\n end", "def listProjects\n if user_signed_in?\n @project_lists = ProjectStrong.where(user_id: current_user.id)\n end\n end", "def load_projects\n @projects = Project.all\n end", "def index\n\t\t@projects = Project.where(user_id: current_user.id).order(created_at: :asc)\n\tend", "def getprojects()\n printRepoHeader\n \n loop do\n # Print each of the new returned repositories\n begin\n get.each do |repo|\n printRepo(repo) if (@slugs.add?(repo['slug']))\n\n # Flush to prevent data loss if we crash\n STDOUT.flush\n end\n rescue Exception => msg\n STDERR.puts \"WARNING: Poll failed at #{Time.now}\"\n STDERR.puts msg\n end\n\n # Poll every 5 minutes\n sleep 300\n end\n end", "def projects\n projects = object.projects\n unless current_user.admin?\n projects = object.projects.select { |project| project.users.include?(current_user) }\n end\n projects.map { |p| p.id }\n end", "def projects\n projects = object.projects\n unless current_user.admin?\n projects = object.projects.select { |project| project.users.include?(current_user) }\n end\n projects.map { |p| p.id }\n end", "def projects\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [:proj, RDF.type, Ruta::Class.project],\n [:proj, RDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, uri]\n )\n projs = []\n query.each_solution { |sol| projs.push(sol.proj.as(Organisation)) }\n projs\n end", "def my_projects\n # Look at all the project\n # see which project's creator is equal to self\n Project.all.select do |project|\n project.creator == self\n end\n end", "def projects\n investigation.try(:projects) || []\n end", "def projects(req_params = {})\n name = 'Projects'\n params = { req: req_params }\n\n data = endpoint(name: name, params: params).do_get\n\n collection name, data\n end", "def index\r\n\r\n\t@showProjects = []\r\n\tshow_projects_closed = 0\r\n\tunless params[:closed]\r\n show_projects_closed = 1\r\n end\r\n\r\n\tif (show_projects_closed == 1)\r\n\t\t@allProjects = Project.visible(User.current).find(:all, :order => 'lft', :conditions => [\"#{Project.table_name}.status=#{Project::STATUS_ACTIVE}\"])\r\n\telse\r\n\t\t@allProjects = Project.visible(User.current).find(:all, :order => 'lft')\r\n\tend\t\r\n\tid = params[:id]\r\n\r\n\tif !(id)\r\n\t\tprojectsList = @allProjects - getProjectsNoMember()\r\n\t\t@showProjects = getRootProjects(projectsList)\r\n\telse\r\n\t\tparentProject = Project.find_by_id(id)\r\n\t\tchildProjects = getChildProject(parentProject)\r\n\t\t@showProjects = getRootProjectsFromList(childProjects)\r\n\tend\r\n\t@allProjects = @allProjects - getProjectsNoMember()\r\n\treturn @showProjects\r\n end", "def projects\n @projects ||= begin\n user = api('user')\n api(\"users/#{user['id']}/projects\").sort_by { |p| p['id'] }\n end\nend", "def internal_projects\n internal_projects = Project.joins(:client).where(\"company_id = #{self.id} AND internal = true\")\n return internal_projects if internal_projects.length > 0\n \n internal_project = Project.new(name: \"#{self.name} (Internal)\", internal: true, deadline: Date.today, description: \"Holds tasks that are accessed by all users\")\n internal_project.client = internal_client\n internal_project.save!\n\n [internal_project]\n end", "def started_projects\n teams.flat_map(&:projects)\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def index\n @projects = Project.all\n end", "def get_projects\n @params=task_params\n @client=current_user.clients.find(@params[:client_id])\n counter=0\n @res=[]\n @client.projects.each do |c|\n if c.users.include? current_user\n @res[counter]={\n project_id: c.id, \n name: c.name\n }\n counter+=1\n end\n end\n respond_to do |format|\n format.json {render json: @res.uniq}\n end\n end", "def [] project\n Project.new(project) if Profile.projects[project]\n end", "def get\n CircleCi.request(conf, '/projects').get\n end", "def ring_projects\n @ring_projects ||= [\n ObsProject.new(\"#{name}#{RINGS_PREFIX}0-Bootstrap\", '0'),\n ObsProject.new(\"#{name}#{RINGS_PREFIX}1-MinimalX\", '1'),\n ObsProject.new(\"#{name}#{RINGS_PREFIX}2-TestDVD\", '2') ]\n end", "def index\n @all_projects = Project.by_user_plan_and_tenant(params[:tenant_id], current_user)\n end", "def show\n @projects = find_projects\n end", "def init_projects\n @projects = []\n\n response = @conn.get do |req|\n req.url \"/api/v1/projects\"\n req.headers = rest_headers\n end\n\n @projects = json(response.body)[:projects]\n end", "def projects\n where(:_type => ProjectCategory.name)\n end" ]
[ "0.8165575", "0.80652684", "0.80652684", "0.8020134", "0.79446006", "0.7902813", "0.7845735", "0.7725574", "0.7704576", "0.76845634", "0.76776683", "0.7623777", "0.76021594", "0.75589955", "0.75243956", "0.7522458", "0.74845994", "0.7474656", "0.74732447", "0.7467479", "0.7442292", "0.7406726", "0.737498", "0.7357706", "0.733192", "0.73234344", "0.73047096", "0.72945774", "0.7281262", "0.72708285", "0.72683483", "0.7267994", "0.72320694", "0.72283155", "0.72282594", "0.7221686", "0.7207338", "0.7199347", "0.71738255", "0.71622217", "0.71518576", "0.7145574", "0.7128129", "0.7127066", "0.71080935", "0.7100058", "0.70893127", "0.7087289", "0.7084029", "0.70822656", "0.70726997", "0.707164", "0.7069936", "0.70638305", "0.70612264", "0.7059252", "0.7048156", "0.7030602", "0.70189255", "0.7010932", "0.7005951", "0.6959902", "0.6959902", "0.69472194", "0.6946978", "0.6942388", "0.693934", "0.6925196", "0.6920522", "0.689577", "0.689261", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.68839586", "0.6882806", "0.6877135", "0.6877064", "0.6874742", "0.6864894", "0.68483657", "0.6843023", "0.68264914", "0.6817294" ]
0.7389421
22
method to return all pledges I've made
def pledges # Look through all pledges # only keep the ones where pledge.user == self Pledge.all.select do |pledge| pledge.user == self end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pledges\n Pledge.all.filter do |pledge|\n pledge.project == self\n end\n end", "def pledges\n Pledge.all.select do |pledge|\n pledge.project == self\n end\n end", "def pledges\n Pledge.all.select {|pledge| pledge.backer == self}\n end", "def pledges\r\n\t@received_pledges.values.reduce(0, :+) #I'm not sure what the :+ does\r\nend", "def gallaries\n paintings.map{|paint| paint.gallery}\n\n end", "def pledges\n # Look through all pledges\n # only keep the ones where pledge.user == self\n Pledge.all.select do |pledge|\n pledge.user == self\n end\n end", "def new_badges\n achievements.map(&:new_badges).flatten\n end", "def galleries\n self.paintings.map{|painitng| painitng.gallery}.uniq\n end", "def galleries\n galleries = self.paintings.map do |pi|\n pi.gallery\n end\n galleries.uniq\n end", "def galleries\n galleries = self.paintings.map do |p|\n p.gallery\n end\n galleries.uniq\nend", "def galleries()\n self.paintings().map { | painting | painting.gallery }.uniq\n end", "def galleries\n paintings.map{|painting| painting.gallery}.uniq\n end", "def galleries\n galleries_array = paintings.map {|painting| painting.gallery}\n galleries_array.uniq\n end", "def all_names\n @json_data['pledges'].collect { |pledge| pledge['id'] }\n end", "def galleries\n paintings.map do |p|\n p.gallery\n end\n end", "def galleries\n paintings.map {|p| p.gallery}\n end", "def backed_projects\n pledges.map { |pledge| pledge.project }\n end", "def backed_projects\n pledges.map { |pledge| pledge.project }\n end", "def galleries\n paintings.map {|painting| painting.gallery}\n end", "def index\n\t\t@pledges = @project.pledges\n\t\trespond_to do |format| \n\t\t\tformat.html\n\t\tend\n\tend", "def badges\n end", "def lifters\n # binding.pry\n memberships.map { |membership| membership.lifter }.uniq\n end", "def all_galleries\n self.all_paintings.map do |painting|\n painting.gallery\n end.uniq\n end", "def galleries\n paintings.map do |painting|\n painting.gallery\n end\n end", "def galleries\n paintings.map do |painting|\n painting.gallery\n end\n end", "def galleries\n paintings.map do |painting|\n painting.gallery\n end\n end", "def batch_badge_creator(badges)\n array=Array.new\n badges. each do |individuals|\n array=array.push(badge_maker(individuals))\n end\n return array;\n\nend", "def birds\n nests.map do |nest|\n nest.bird.species\n end\n end", "def all_priors()\n #self.bracketgrouping.bracketcontests.bracketcontestants\n #Bracketcontestant.where(bracketgrouping: self.bracketgrouping).select{|bc|bc.priorcontest().id()==self.id()}.collect{|bc|bc.priorcontest()}\n self.bcadvancements.collect {|bcadv| bcadv.bracketcontestant}\n end", "def allergens\n ingredients_array=[]\n ingredients.each do |ingredient|\n # binding.pry\n if ingredient.allergens\n # binding.pry\n ingredients_array << ingredient.allergens\n end\n end\n arr= ingredients_array.flatten.map do |allergen|\n allergen.ingredient\n end\n arr.uniq\n end", "def backers\n Person.where(id: pledges.pluck(:person_id))\n end", "def garments\n garments = []\n self.closets.map do |closet|\n closet.garments.map do |garment|\n garments.push({id: garment.id, name: garment.name, garment_style: garment.garment_style, garment_type: garment.garment_type, is_favorite: garment.is_favorite, is_clean: garment.is_clean, closet_id: garment.closet_id, image: garment.image, temperatures: garment.temperatures, user: garment.user, lowest_temp: garment.lowest_temp, highest_temp: garment.highest_temp, garment_weight: garment.garment_weight, temperatures: garment.temperatures, temperature_ranges: garment.temperature_ranges})\n end\n end\n garments\n end", "def to_a\n @legs\n end", "def allergens\n self.allergy.map do |allergen|\n allergen.ingredient\n end.uniq\n end", "def list_galleries\n list_paintings.map do |gallery_painting|\n gallery_painting.gallery\n end\n end", "def index\n @lounges = Lounge.all\n end", "def all_galleries_featured_in\n my_galleries = self.all_my_paintings.map{|picture| picture.gallery}.uniq\n end", "def my_backers\n self.pledges.collect do |pledge|\n pledge.user\n end.uniq\n end", "def apartment_name_list (building)\n apartment_name_array = []\n building.building_apartment_array.each {|hash| \n if hash[:renter].count < hash[:num_beds]\n apartment_name_array.push(hash[:name])\n end \n }\n puts apartment_name_array\nend", "def hunks\n each_hunk.to_a\n end", "def pledge_count\n pledges.count\n end", "def printer(parameter)\n\n badges = batch_badge_creator(parameter) #new variable holding return of #batch_badge_creator method\n rooms = assign_rooms(parameter) #new variable holding return of #assign_rooms method\n\n badges.each do |element| #this loops through badges array...\n puts element #and outputs each element\n end #end for each loop\n\n rooms.each do |element| #this loops through rooms array...\n puts element #and outputs each element\n end #end for each loop\nend", "def get_allergy_names\n allergies.map {|a| a.name}\n end", "def wells\n plates.collect(&:wells).flatten\n end", "def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\n end\n end", "def village\n fetch('naruto.villages')\n end", "def badges\n Merit::Badge.find { |b| b.custom_fields[:skill_level] == self.name_key.to_sym }\n end", "def personalities\r\n villagers.map{ |villager| villager.personality}\r\n end", "def all_gyms\n lifter_membership.map {|lifter| lifter.gym}\n end", "def list\n @parent.gemset_list\n end", "def batch_badge_creator( names )\n print_output = []\n names.each do | name |\n print_output << badge_maker( name ) \n end\n print_output # return the list ready for printing\nend", "def breed_group\n return data.breed_groupes\n end", "def bakeries\n dessert.map do |dessert|\n dessert.bakery\n end\n \n end", "def get_glade_all(obj = self)\r\n get_glade_active_record(obj)\r\n get_glade_variables(obj)\r\n end", "def collect\n redirect_to history_path\n if Rails.env == 'production'\n flash[:notice] = \"This feature's for testing only.\"\n return\n end\n\n current_user.pledges.active.each do |p|\n p.collect\n end\n end", "def lifters_gym\n gym_memberships.map do |membership|\n membership.lifter\n end\n end", "def batch_badge_creator(names)\n badges = []\n names.each do |name|\n badges << badge_maker(name)\n end\n return badges\nend", "def pets\n pet_owners.map do |pet_owner|\n pet_owner.pet\n end\n end", "def bridges_list\n get \"bridges\"\n end", "def all_galleries\n gallery_arr = Painting.all.select do |painting_ob|\n painting_ob.artist == self\n end\n gallery_arr.map do |painting_ob|\n painting_ob.gallery.name\n end\nend", "def badge_level_up\n\t\tbadge_level_up_aux(\"Creator\",\"creator\",\"recipes\")\n\tend", "def ways \n return [] \n end", "def my_tag_list\n self.taggings.order('id ASC').map(&:tag).map(&:name)\n end", "def each_pledge_received\r\n\t@received_pledges.each do |name, value|\r\n\t\tyield Pledge.new(name, value)\r\n\tend\r\nend", "def index\n @lounges = Lounge.new \n @all_lounges = Lounge.all\n end", "def extract_badgeimages()\n@badgeimages_array = []\n file = File.open('app/assets/post.html')\n doc = Nokogiri::HTML(file)\n doc.search('.mb_div a img').map do |element|\n image_url = 'http://www.boyscouttrail.com' + element['src']\n @badgeimages_array << image_url\n end\n return @badgeimages_array\nend", "def branches; end", "def get_tags\n\t\t\ttaglist = read_command_output( 'hg', 'tags' )\n\t\t\treturn taglist.split( /\\n/ ).collect {|tag| tag[/^\\S+/] }\n\t\tend", "def estimations\n all_estimations = []\n\n self.pupils.each do |p|\n all_estimations << p.estimations\n end\n\n all_estimations.flatten\n end", "def my_pieces()\n\t\treturn @board.get_pieces_by_owner(@color)\n\tend", "def find_my_ballots\n round = 1\n self.candidates.each do |cand|\n binding.pry\n puts\" __________________________________________________________________ \"\n puts\"| |\"\n puts\"| Round ##{round} |\"\n puts\"| #{cand.level_of_governments} |\"\n puts\"|__________________________________________________________________|\"\n puts\" __________________________________________________________________ \"\n puts\" \"\n puts\" You Voted For: \"\n puts\" \"\n puts\" #{cand.name} \"\n puts\" \"\n puts\" State: #{cand.state} \"\n puts\" Party: #{cand.party} \"\n puts\" Age: #{cand.age} \"\n puts\" Level of Government: #{cand.level_of_governments} \"\n puts\"__________________________________________________________________\"\n round += 1\n end\n end", "def all_gems()\n self.sort.collect {|k,g| g }\n end", "def pulled_tags\n @list.pullin ? @list.taggings.where(user_id: @list.owner_id).includes(:tag).map(&:tag) : []\n end", "def bundles\n return @bundles\n end", "def badges\n achievements.reduce({}) do |badges, achievement|\n badges.merge(achievement.name => achievement.badges)\n end\n end", "def guesses\n return @guesses\n end", "def all_gyms\n Membership.all.map do |membership| \n if membership.lifter == self\n membership.gym\n end\n end\n end", "def allergens\n users.map do |user_ob|\n #binding.pry\n user_ob.allergens.each do |allergen_ob|\n #binding.pry\n allergen_ob\n end\n end.flatten\nend", "def households\n parent.households.where(:irs_group_id => self.id)\n end", "def households\n parent.households.where(:irs_group_id => self.id)\n end", "def in_bag(inside)\n baggage = []\n inside.each_with_index do |m, index|\n baggage << @names[index] if m == 1\n end\n baggage\n end", "def village; end", "def take_beds(population, beds)\n raise \"Too many beds taken\" if beds_available(population)<beds\n result = []\n\n local = beds_available_locally(population)\n if (local>=beds)\n @beds[population.name][:available] -= beds\n @beds[population.name][:used_locally] += beds\n result += (1..beds).collect {|c| population.name } \n else\n if local>0\n @beds[population.name][:available] -= local\n @beds[population.name][:used_locally] += local\n result += (1..local).collect { |c| population.name }\n end\n \n beds_needed = beds - local\n while beds_needed>0\n @beds.each do |k, v|\n break if beds_needed<=0\n next if k == population.name\n if beds_available_for_sharing(k)>0\n v[:available] -= 1\n beds_needed -= 1\n result += [k]\n end\n end\n end\n end\n result\n end", "def index\n @pledges = current_user.pledges\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pledges }\n end\n end", "def galleries\n Painting.all.map do |painting_instance| \n if painting_instance.artist == self\n painting_instance.gallery\n end\n end.compact.uniq\n end", "def minions\r\n @minions.list\r\n end", "def return_all_tags\n @tags.uniq.each { |tag| puts tag }\n end", "def batch_badge_creator(array)\n #empty array\n list = []\n #iterate over the names in array\n array.each do |name|\n #add the badge messages to the list array\n list << badge_maker(name)\n end\n #return list\n list\n#end of batch_badge_creator method\nend", "def list(y)\n puts \"Groceries to Pick Up:\"\n y.each do |x| puts \"* #{x}\" end\t\nend", "def dogs \n dogs = self.walks.map {|walk| walk.dog}\n dogs.uniq\n end", "def get_bag(pokemon)\n return $scene.enemy_party.bag\n end", "def linked_tags\n taggings.map {|tagging| tagging.tag.value}\n end", "def aliens\n self.populations.map do |pop|\n pop.alien\n end\n end", "def all_tags\n all_tags = []\n meanings.each do |meaning_hash|\n if meaning_hash.tags.size > 0\n all_tags << meaning_hash.tags\n end\n end\n return all_tags.flatten\n end", "def levels(badge_name)\n badges.where(:name => badge_name).collect(&:level)\n end", "def list\n Rugged::Branch.each_name(@git, :local).to_a\n end", "def gossip_list\n\n end", "def get_tags\n [['pxb', 'PXB'], ['ind', 'Individuals'], ['bus', 'Businesses'], ['grp', 'Peer Groups']]\n end", "def gear\n @gear.values\n end", "def projects_supported\n @pledges = Pledge.all\n project_list = {}\n @pledges.each do |pledge|\n if pledge.user_id == self.id\n if project_list.has_key?(pledge.project_id)\n project_list[pledge.project_id] += pledge.dollar_amount\n else\n project_list[pledge.project_id] = pledge.dollar_amount\n end\n end\n end\n return project_list\n end" ]
[ "0.67649865", "0.66099674", "0.65735185", "0.65679365", "0.6401878", "0.62514627", "0.6244485", "0.62377506", "0.6148643", "0.6122165", "0.6099414", "0.60121197", "0.59721273", "0.59703964", "0.5959682", "0.5957612", "0.59520423", "0.5942205", "0.5906756", "0.585479", "0.583713", "0.5813281", "0.57721955", "0.5754816", "0.5754816", "0.5754816", "0.5739219", "0.57242787", "0.5716413", "0.56937826", "0.56923246", "0.56721795", "0.563447", "0.56121904", "0.561149", "0.56105673", "0.5606716", "0.55960023", "0.5582963", "0.5558256", "0.55513734", "0.5550662", "0.55203193", "0.5513923", "0.5508827", "0.5501067", "0.5484851", "0.5484113", "0.54751813", "0.54662675", "0.5466182", "0.5465945", "0.54596126", "0.5446367", "0.54443085", "0.54224306", "0.5404985", "0.5404035", "0.5401378", "0.5398969", "0.53903776", "0.5389451", "0.5377413", "0.5377031", "0.5369781", "0.5350776", "0.5348228", "0.5343245", "0.53409874", "0.5335531", "0.5333848", "0.53178513", "0.5309018", "0.5308192", "0.53014106", "0.5290996", "0.5288645", "0.52816564", "0.5276555", "0.5276555", "0.5268547", "0.52664953", "0.5265116", "0.52607405", "0.5259131", "0.5257554", "0.5256846", "0.52503175", "0.52470475", "0.5245789", "0.5238748", "0.5237137", "0.52359146", "0.52302563", "0.52264357", "0.52248967", "0.5219912", "0.5216847", "0.5216764", "0.5211114" ]
0.63860524
5
method to return all projects I've donated to
def backed_projects pledges.map { |pledge| pledge.project } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def projects\n PivotalTracker::Project.all\n end", "def projects\n request(method: 'getAllProjects')\n end", "def projects\n @projects\n end", "def projects\n my_proj = self.my_projects\n my_memb = self.collaborations\n my_proj + my_memb\n end", "def projects\n @projects ||= Project.all\n end", "def projects_owned\n Project.all.select {|project| project.owner == self}\n end", "def projects\n investigation.try(:projects) || []\n end", "def pending_refund_payments_projects\n pending_refund_payments.map(&:project)\n end", "def all_deliverable_projects\n all_digest_projects\n end", "def my_projects\n # Look at all the project\n # see which project's creator is equal to self\n Project.all.select do |project|\n project.creator == self\n end\n end", "def projects\n\t\tProject.order(\"created_at\").find_all_by_account_id(account_id).reverse\n\tend", "def projects\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [:proj, RDF.type, Ruta::Class.project],\n [:proj, RDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, uri]\n )\n projs = []\n query.each_solution { |sol| projs.push(sol.proj.as(Organisation)) }\n projs\n end", "def projects\n projects = object.projects.select { |p| !current_user || p.users.include?(current_user) }\n projects.map { |p| p.id }\n end", "def backed_projects\n pledges.map { |pledge| pledge.project }\n end", "def projects\n if is_deploy_key\n [project]\n else\n user.authorized_projects\n end\n end", "def projects\n if is_deploy_key\n [project]\n else\n user.projects\n end\n end", "def projects\n Project.all.select { |project| project.creator == self }\n end", "def projects\n DataStore.projects\n end", "def my_projects\n @projects = Project.where(:client_id => current_user.client_id)\n end", "def projects\n return [] unless basecamp\n @projects ||= basecamp.projects\n end", "def projects ; end", "def get_projects\n me = request('/services/v5/me')\n me['projects']\n end", "def all\n @projects\n end", "def all\n @projects\n end", "def projects\n projects = object.projects\n unless current_user.admin?\n projects = object.projects.select { |project| project.users.include?(current_user) }\n end\n projects.map { |p| p.id }\n end", "def projects\n projects = object.projects\n unless current_user.admin?\n projects = object.projects.select { |project| project.users.include?(current_user) }\n end\n projects.map { |p| p.id }\n end", "def projects_supported\n @pledges = Pledge.all\n project_list = {}\n @pledges.each do |pledge|\n if pledge.user_id == self.id\n if project_list.has_key?(pledge.project_id)\n project_list[pledge.project_id] += pledge.dollar_amount\n else\n project_list[pledge.project_id] = pledge.dollar_amount\n end\n end\n end\n return project_list\n end", "def find_projects\n @projects = Project.all\n end", "def projects(params = {})\n make_get_request('/account/projects', params)\n end", "def index\n @projects = (Project.includes(:users).includes(:owner).includes(:errands).where(owner: current_user.id) + current_user.projects.includes(:owner).includes(:users).includes(:errands)).uniq\n end", "def projects\n Harvest::Resources::Project\n end", "def available_projects_list\n uri = \"#{@api_url}?access_token=#{@access_token}\"\n get uri\n end", "def my_projects\n # Look at all the project\n # see which project's creator is equal to self\n Project.all.select do |project|\n project.creator == self\n end\n end", "def projects(params = {})\n fetch_all('projects', 'projects', params)\n end", "def backed_projects\n\n # iterate thru existing list of projects and backers to pull just our current\n # instanced backer (self)\n projects_backed = ProjectBacker.all.select do |backed|\n backed.backer == self\n end \n # iterate thru array of projects backed by current user and remove user info\n # while returning an array of just project titles\n projects_backed.map do |projects_b|\n projects_b.project \n end \n end", "def projects\n result = []\n load_attributes\n @attributes['projects'].each do |project|\n result << project['name']\n end\n puts \"Workspace projects #{result}\"\n result\n end", "def projects\n doc = Nokogiri::HTML(trending_page_html)\n doc.css('.repo-list-item').map do |list_item|\n project_from_node(list_item)\n end\n end", "def projects(params = nil)\n params = params.merge({ :current_user => @options[:current_user]})\n params = params.except(:manufacturer_id, :catg_slug, :office_id, :max_matches)\n params[:order] ||= 'recently_active'\n\n @projects_response = ProjectsIndexPresenter.new(params[:current_user], params).response\n projects = @projects_response[:projects] || []\n projects\n end", "def getProjectsNoMember()\r\n\t\tnoMemberProjects = []\r\n\t\[email protected] do |project|\r\n\t\t\tif !(User.current.member_of?(project))\r\n\t\t\t\tnoMemberProjects = noMemberProjects << project\r\n\t\t\tend\t\r\n\t\tend\r\n\t\treturn noMemberProjects\r\n\tend", "def no_user_get_friends_projects(token)\n @token = token\n @users = get_my_friends(token)\n @projects = []\n @users.each do |u|\n proj = u.projects.approved\n if proj.any?\n proj.each {|p| @projects << p }\n end\n end\n return @projects\n end", "def projects\n Easybill::Api::Projects\n end", "def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end", "def own_projects\n if !current_user || current_user.admin? || object.id == current_user.id\n object.own_projects.map { |o| o.id }\n else\n []\n end\n end", "def projects\n map(&:projects).flatten.uniq.sort\n end", "def list_projects # :nologin:\n query = create_query(:Project, :all, :by => :title)\n show_selected_projects(query)\n end", "def projects\n return forbidden unless current_account # already returns a 401 if credentials aren't supplied\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'projects' => Project.accessible(current_account).map {|p| p.canonical(opts) } }\n render_cross_origin_json\n end", "def active_projects\n self.projects.where(:is_canceled => false, :is_finished => false )\n end", "def related_projects\n case self.object\n when Project\n [self.object]\n when TimeSheet\n self.object.projects\n else\n []\n end\n end", "def listprojects\n get('listprojects.json')['projects']\n end", "def show_all_projects\r\n json = GoodData.get GoodData.profile.projects\r\n puts \"You have this project available:\"\r\n json[\"projects\"].map do |project|\r\n pid = project[\"project\"][\"links\"][\"roles\"].to_s\r\n puts \"Project name: #{project[\"project\"][\"meta\"][\"title\"].bright} Project PID: #{pid.match(\"[^\\/]{32}\").to_s.bright}\"\r\n end\r\n end", "def all_projects()\n @endpoint = \"/projects.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"projects\"].sort_by { |proj| proj[\"name\"] }\n end", "def find_all\n api.command(:listProjects).collect do |project|\n project[1]['project'].map { |p| self.new p }\n end.flatten\n end", "def projects\n config[:projects]\n end", "def projects\n settings.projects.map do |project_settings|\n Project.new(project_settings)\n end\n end", "def cross_project\n []\n end", "def projects\n @projects ||= begin\n http = Net::HTTP.new(API_HOST, API_PORT)\n http.use_ssl = true\n http.ca_file = (Twigg.root + 'files' + 'github.pem').to_s\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n uri = ORG_REPOS_ENDPOINT % Config.github.organization\n headers = { 'Authorization' => \"token #{Config.github.token}\" }\n\n [].tap do |names|\n begin # loop: page through project list\n request = Net::HTTP::Get.new(uri, headers)\n response = http.request(request)\n raise \"Bad response #{response.inspect}\" unless response.is_a?(Net::HTTPOK)\n names.concat JSON[response.body].map { |repo| repo['name'] }\n uri = parse_link(response['Link'])\n end until uri.nil?\n end\n end\n end", "def projects\n @projects ||= Harvest::API::Projects.new(credentials)\n end", "def reachable_projects\n path.ascend.find_all { |p| p.exist? && p.directory? }.flat_map do |dir|\n dir.children.select { |p| p.extname == '.xcodeproj' }\n end\n end", "def reachable_projects\n path.ascend.find_all{ |p| p.directory? }.flat_map do |dir|\n dir.children.select{ |p| p.extname == '.xcodeproj' }\n end\n end", "def get_projected_accounts\n\t\t #@projected_accounts_info = Hash[ACCOUNT_INFO.dup.find_all{|k,v| v[:discretionary]}]\n\t\t #@projected_accounts_info = accounts_with_projections(@projected_accounts_info)\n\t\t #@projected_accounts_info = @accounts.find_all{|acc| info = ACCOUNT_INFO[acc.name] and info[:discretionary]} \n projected_accounts = @accounts.find_all{|acc| acc.info and acc.info[:discretionary]}\n @projected_accounts_info = accounts_with_projections(projected_accounts)\n\tend", "def combined_projects\n self.projects + self.owned_projects + self.all_teams.map(&:projects).flatten(1)\n end", "def backed_projects\n self.projects.map {|back_project| back_project.project}\n end", "def my_projects\n\t\tif params[:cat].present?\n\t\t\tst = params[:cat] == \"in_progress\" ? \"in progress\" : \"completed\"\n\t\t\t@my_projects = Project.where(user_id: current_user.id, project_status: st)\n\t\telse\n\t\t\t@my_projects = Project.where(user_id: current_user.id, project_status: \"in progress\")\n\t\tend\n\t\t@report_options = ProjectReport.previous_reports(current_user.id)\n\t\t@project_report = ProjectReport.new\n\tend", "def index\n @projects = @user.active_projects + @user.collaboration_projects\n end", "def projects\n @projects ||= begin\n user = api('user')\n api(\"users/#{user['id']}/projects\").sort_by { |p| p['id'] }\n end\nend", "def projects\n Tracker.includes(:tracker_relations => [:linked_account]).where('trackers.id in (:ids)', ids: tracker_relations.pluck(:tracker_id))\n end", "def scheduled_projects(start_date, end_date)\n suitable_entries = Entry.for_user_period(self.id, start_date, end_date)\n Project.find(suitable_entries.map(&:project_id))\n end", "def listProjects\n if user_signed_in?\n @project_lists = ProjectStrong.where(user_id: current_user.id)\n end\n end", "def projects\n Sifter.\n get(\"/api/projects\").\n parsed_response[\"projects\"].\n map { |p| Sifter::Project.new(p) }\n end", "def projects\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Project)\n end", "def started_projects\n teams.flat_map(&:projects)\n end", "def accessible_project_ids\n @accessible_project_ids ||=\n Collaboration.owned_by(self).all(:select => [:project_id]).map {|c| c.project_id }\n end", "def get\n CircleCi.request(conf, '/projects').get\n end", "def get_all_withassigned(projectid)\n get(\"projects/#{projectid}/assigned_todos.json\")\n end", "def getprojects()\n printRepoHeader\n \n loop do\n # Print each of the new returned repositories\n begin\n get.each do |repo|\n printRepo(repo) if (@slugs.add?(repo['slug']))\n\n # Flush to prevent data loss if we crash\n STDOUT.flush\n end\n rescue Exception => msg\n STDERR.puts \"WARNING: Poll failed at #{Time.now}\"\n STDERR.puts msg\n end\n\n # Poll every 5 minutes\n sleep 300\n end\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.expenditures.where(project_id: _projects)\n ret_array(_array, _ret, 'id')\n # _projects.each do |i|\n # _ret = ChargeAccount.expenditures.where(project_id: i.id)\n # ret_array(_array, _ret, 'id')\n # end\n\n # Adding global charge accounts belonging to projects organizations\n _sort_projects_by_organization = _projects.sort { |a,b| a.organization_id <=> b.organization_id }\n _previous_organization = _sort_projects_by_organization.first.organization_id\n _sort_projects_by_organization.each do |i|\n if _previous_organization != i.organization_id\n # when organization changes, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n _previous_organization = i.organization_id\n end\n end\n # last organization, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.expenditures.where(project_id: _projects)\n ret_array(_array, _ret, 'id')\n # _projects.each do |i|\n # _ret = ChargeAccount.expenditures.where(project_id: i.id)\n # ret_array(_array, _ret, 'id')\n # end\n\n # Adding global charge accounts belonging to projects organizations\n _sort_projects_by_organization = _projects.sort { |a,b| a.organization_id <=> b.organization_id }\n _previous_organization = _sort_projects_by_organization.first.organization_id\n _sort_projects_by_organization.each do |i|\n if _previous_organization != i.organization_id\n # when organization changes, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n _previous_organization = i.organization_id\n end\n end\n # last organization, process previous\n _ret = ChargeAccount.expenditures.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end", "def project_list\n project_folders = Dir::entries(::File.join(Msf::Config.log_directory, 'projects'))\n projects = []\n framework.db.workspaces.each do |s|\n if project_folders.include?(s.name)\n projects << s.name\n end\n end\n return projects\n end", "def get_org_projects\n unless organization.nil?\n client.org_projects(organization)\n end\n end", "def index\n @all_projects = Project.by_user_plan_and_tenant(params[:tenant_id], current_user)\n end", "def projects(options = {})\n get(\"projects\", options).projects\n end", "def pledges\n Pledge.all.select do |pledge|\n pledge.project == self\n end\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.where(project_id: _projects)\n ret_array(_array, _ret)\n # _projects.each do |i|\n # _ret = ChargeAccount.where(project_id: i.id)\n # ret_array(_array, _ret)\n # end\n\n # Adding global charge accounts\n _ret = ChargeAccount.where('project_id IS NULL')\n ret_array(_array, _ret)\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.where(project_id: _projects)\n ret_array(_array, _ret)\n # _projects.each do |i|\n # _ret = ChargeAccount.where(project_id: i.id)\n # ret_array(_array, _ret)\n # end\n\n # Adding global charge accounts\n _ret = ChargeAccount.where('project_id IS NULL')\n ret_array(_array, _ret)\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end", "def index\n if current_user.has_role? :admin\n @projects = Project.all\n elsif current_user.has_role? :developer\n @projects = Project.is_dev_here(current_user.developer.id)\n else\n @projects = []\n end\n end", "def project_get(project)\n project_find(project)\n projects = @project.all('a[class=table-link]') if @project\n\n project_names = []\n if projects\n projects.each do |proj|\n project_names << proj.text\n end\n else\n project_names = nil\n end\n project_names\n end", "def pending_reviews\n pending_reviews = []\n self.projects.each do |p|\n p.reviews.each do |r|\n if !r.closed?\n if r.approved? && r.submitter == self \n pending_reviews.push(r)\n elsif r.review_votes.select{ |v| v.vote == ReviewVote.allowable_votes[:no_opinion] && v.user == self }\n pending_reviews.push(r)\n end\n end\n end\n end\n return pending_reviews\n end", "def projects \n ProjectBacker.all.select {|project| project.backer == self}\n end", "def list_all\n query = create_query(:Project, :all, by: default_sort_order)\n show_selected_projects(query)\n end", "def pledges\n Pledge.all.filter do |pledge|\n pledge.project == self\n end\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def index\n @projects = current_user.projects\n end", "def projects_charge_accounts(_projects)\n _array = []\n _ret = nil\n\n # Adding charge accounts belonging to current projects\n _ret = ChargeAccount.incomes.where(project_id: _projects)\n ret_array(_array, _ret, 'id')\n\n # Adding global charge accounts belonging to projects organizations\n _sort_projects_by_organization = _projects.sort { |a,b| a.organization_id <=> b.organization_id }\n _previous_organization = _sort_projects_by_organization.first.organization_id\n _sort_projects_by_organization.each do |i|\n if _previous_organization != i.organization_id\n # when organization changes, process previous\n _ret = ChargeAccount.incomes.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n _previous_organization = i.organization_id\n end\n end\n # last organization, process previous\n _ret = ChargeAccount.incomes.where('(project_id IS NULL AND charge_accounts.organization_id = ?)', _previous_organization)\n ret_array(_array, _ret, 'id')\n\n # Returning founded charge accounts\n _ret = ChargeAccount.where(id: _array).order(:account_code)\n end", "def index\r\n @projects = current_user.projects\r\n end" ]
[ "0.72560596", "0.698906", "0.6930253", "0.69187087", "0.6888471", "0.68667555", "0.6848498", "0.6841324", "0.6821687", "0.6813384", "0.68098927", "0.67724717", "0.6756995", "0.6735186", "0.6732345", "0.67211485", "0.6719598", "0.6685721", "0.66738856", "0.66629225", "0.6645288", "0.66315335", "0.66287714", "0.66287714", "0.6627939", "0.6627939", "0.66087735", "0.660347", "0.6569892", "0.65692735", "0.6554", "0.6546643", "0.6535112", "0.65212053", "0.6514771", "0.65057933", "0.6502279", "0.649908", "0.64974093", "0.6482853", "0.64719313", "0.64676225", "0.64422035", "0.64317924", "0.64249676", "0.6387107", "0.6371365", "0.637127", "0.635863", "0.63506997", "0.6346843", "0.63426757", "0.63357466", "0.630196", "0.6298184", "0.6292614", "0.62870365", "0.62596095", "0.62479734", "0.6245761", "0.62446904", "0.62430257", "0.62347484", "0.6229529", "0.6215903", "0.62151545", "0.621441", "0.62100935", "0.61847824", "0.6181632", "0.61545235", "0.6139401", "0.6136471", "0.61280644", "0.6122367", "0.61202556", "0.61202556", "0.61136043", "0.6104506", "0.6097867", "0.60827774", "0.608182", "0.60719514", "0.60719514", "0.6065932", "0.6062492", "0.6044147", "0.6040508", "0.6029151", "0.6007565", "0.6007015", "0.6007015", "0.6007015", "0.6007015", "0.6007015", "0.6007015", "0.6007015", "0.6007015", "0.6004474", "0.60032076" ]
0.6811322
10
helper method for self.highest_pledge to abstract away the process to get highest pledge amount
def highest_pledge_amount pledges.reduce(0) do |highest_pledge_amount, pledge| highest_pledge_amount = pledge.amount > highest_pledge_amount ? pledge.amount : highest_pledge_amount end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def biggest_investment()\n funding_rounds = self.funding_rounds.select {|funding| funding.amount}\n amount = 0\n\n funding_rounds.select do |funding|\n\n if funding.amount >= amount\n amount = funding.amount\n funding\n end\n \n end\n end", "def biggest_investment\n funding_rounds.max_by {|funding_round| funding_round.investment}\n end", "def biggest_investment\n self.funding_rounds.max_by {|funding| funding.investment }\n end", "def biggest_investment\n biggest_amount = 0\n funding_instance = 0\n\n funding_rounds.map do |funding| \n if funding.investment > biggest_amount\n biggest_amount = funding.investment\n funding_instance = funding\n end\n end\n\n funding_instance\n end", "def driver_with_cash(total_earned)\n return total_earned.max_by { |driver_earning| driver_earning[:amount]}\nend", "def highest_bid\n list_of_bids = bids.order(amount: :desc)\n if list_of_bids.blank? \n return 0\n end\n list_of_bids[0].amount\n end", "def most_money(rideshare)\n highest_earned = 0.0\n high_earner = \"\"\n # call method from #2\n money_made(rideshare).map do |driver, cost|\n if cost > highest_earned\n highest_earned = cost\n high_earner = driver\n end\n end\n return high_earner\nend", "def get_highest_paid(drivers)\n highest_paid = nil\n highest_income = 0\n drivers.each do |driver, rides| \n current_income = get_income(rides)\n if highest_income < current_income\n highest_income = current_income\n highest_paid = driver\n end\n end\n return highest_paid\nend", "def biggest_investment\n investment_arr = self.funding_rounds.collect do |f|\n f.investment\n end\n investment_arr.max_by do |i|\n i\n end\n end", "def max_buy\r\n max = $game_party.max_item_number(@item) - $game_party.item_number(@item)\r\n buying_price == 0 ? max : [max, money / buying_price].min\r\n end", "def biggest_investment\n big_investment = 0\n big_round = {}\n self.funding_rounds.each do |funding_round|\n if funding_round.investment > big_investment\n big_investment = funding_round.investment\n big_round = funding_round\n end\n end\n big_round\n end", "def highest_bid\n\t self.bids.order(amount: :desc).first\n\t end", "def max_money(aid_amount, with_amount, rebel_rate, rebel_limit)\n max_with_amount = 0 \n while rebel_rate < rebel_limit && aid_amount > 0 \n aid_amount -= with_amount\n rebel_rate = rebel_rate * 2 \n max_with_amount += with_amount\n end\n max_with_amount\nend", "def max_reward_price\n @max_reward_price_cache ||= if self.offers_reward?\n result = Money.new(0, self.default_currency)\n self.rewards.visible.each {|reward| result = Money.max(result, reward.price)} # # .convert_to(self.default_currency)\n result\n end\n end", "def biggest_investment\n self.funding_rounds.max_by do |round|\n round.startup.uniq \n end\n end", "def franchise_with_highest_profit\n company = get_company\n no_franchises(company)\n big_earner = company.franchises.max_by { |franchise| franchise.profit }\n puts \"Franchise #{big_earner.id} has the highest profit, having earned $#{big_earner.profit}.\"\n menu\n end", "def max_sell\n $game_party.item_number(@item)\n end", "def max_sell\r\n $game_party.item_number(@item)\r\n end", "def store_credit_maximum_amount\n item_total\n end", "def output_driver_with_most_money(earned_per_each_driver)\n max_earned = earned_per_each_driver.max_by do |current_driver|\n current_driver[:driver_earned]\n end\n\n puts \"\\nDriver #{max_earned[:driver_id]} earned the most money $#{max_earned[:driver_earned]}.\"\nend", "def highest_price\n # CARYN SAYS:the way you describe this above is incorrect! Reread the README\n # It should be the integer price for the most expensive listing of this recipe \n Recipe.all.max { |recipe_a, recipe_b| recipe_a.average_price <=> recipe_b.average_price }\n end", "def max_buy\n max = $game_party.max_item_number(@item) - $game_party.item_number(@item) \n max_crafts = HudellBazaar::get_max_crafts(@item)\n max = [max, max_crafts].min\n\n buying_price == 0 ? max : [max, money / buying_price].min\n end", "def store_credit_maximum_amount\n item_total - 0.01\n end", "def biggest_investment\n arr = []\n FundingRound.all.select do |s|\n if s.venture_capitalist == self\n arr << s.investment\n end\n end\n arr.max\n end", "def highest_income_method(tallies_array_of_hashes)\n return tallies_array_of_hashes.max_by { |tally_hash| tally_hash[:income] }[:driver_id]\nend", "def pledge_total\n @pledges = Pledge.all\n pledge_total = 0\n @pledges.each do |pledge|\n if pledge.user_id == self.id\n pledge_total = pledge_total + pledge.dollar_amount\n end\n end\n return pledge_total\n end", "def max_price\n Money.new(MAX_OFFER_CENTS, self.default_currency)\n end", "def best_bid\n @bids.max_by { |x| x.fetch(:price) }\n end", "def store_credit_maximum_usable_amount\n if user.store_credits_total > 0\n user.store_credits_total > store_credit_maximum_amount ? store_credit_maximum_amount : user.store_credits_total\n else\n 0\n end\n end", "def store_credit_maximum_usable_amount\n if user.store_credits_total > 0\n user.store_credits_total > store_credit_maximum_amount ? store_credit_maximum_amount : user.store_credits_total\n else\n 0\n end\n end", "def disbursement_remaining_factor\n approved_amount == 0 ? 0 : 1 - (disbursed_amount / approved_amount.to_f)\n end", "def top_bid\n bids(:bid_amount).max\n end", "def max_price\n if @stocks.first.opening.nil?\n @stocks.map(&:closing).max\n else\n @stocks.map(&:opening).max\n end\n end", "def calculate_max_mortgage(params, interest_rate)\n number_of_payments = SCHEDULE_MAP[params['payment_schedule']] * params['amortization_period']\n nominal_interest_rate = (interest_rate / SCHEDULE_MAP[params['payment_schedule']]) / 100\n\n numerator = params['payment_amount'] * ((1 + nominal_interest_rate)**number_of_payments - 1)\n denominator = nominal_interest_rate * (1 + nominal_interest_rate)**number_of_payments\n\n max_mortgage = (numerator / denominator).round(2)\n max_mortgage += params['down_payment'] if params['down_payment'].present?\n max_mortgage\n end", "def current_high_bid\n list_of_bids = bids.order(amount: :desc)\n if list_of_bids.blank? \n return 0\n elsif list_of_bids.length == 1\n return 1\n end\n\n return list_of_bids[1].amount + 1 #add $1 to the 2nd highest bid\n end", "def highest_possibility_price( possibilities )\n highest_price_index = 0\n highest_total = Money.new(0)\n\n initial = Money.new(0)\n possibilities.each_with_index do |possibility, index|\n\n total = possibility.inject(initial) { |sum, n| sum + n.price }\n if total > highest_total\n highest_total = total\n highest_price_index = index\n end\n\n end\n return highest_total, possibilities[ highest_price_index ]\n end", "def highest_price\n menu_items.map {|item| item.price}.max\n end", "def find_highest_pay(drivers)\n maximum = 0\n max = {}\n driver = \"Default\"\n drivers.each do |driver_data|\n driver_data.each do |driver_id, rides|\n money = find_total_pay(rides)\n if maximum < money\n maximum = money\n driver = driver_id\n end\n end\n max[:driver_id] = driver\n max[:max_pay] = maximum\n end\n return max\nend", "def remaining_balance_penalty\n\t\tif self.total_amount.blank? || self.penalty == 0\n\t\t\tbalance = 0\n\t\telsif self.penalty - paid_total <= 0\n\t\t\tbalance = 0\n\t\telse\n\t\t\tbalance = self.penalty - paid_total\n\t\tend\n\n\t\tif balance <= 0\n return 0\n else\n return balance\n end\n\tend", "def remaining_balance\n if self.total_amount.blank?\n balance = 0\n\t\telsif self.penalty - paid_total > 0\n\t\t\tbalance = self.total_amount\n else\n\t\t\tbalance = self.total_amount - paid_total\n end\n\n if balance <= 0\n return 0\n else\n return balance\n end\n end", "def outstanding_amount\n if payment_item.is_a? GeneralPaymentItem\n [0.0, payment_item.amount - payment_installments.map(&:amount).sum].max\n else\n nil\n end\n end", "def min_next_bid_amount\n highest_bid_value = self.highest_bid.bid_amount \n if highest_bid_value.present? \n highest_bid_value+highest_bid_value*0.05\n else\n self.cost\n end\n end", "def money_top(driver_sum)\n arr_money = driver_sum.map { |driver| driver[:total_money]}\n money_max = arr_money.max\n money_name = \"\"\n\n driver_sum.each do |item|\n if item[:total_money] == money_max\n money_name << item[:id] << \" \"\n end\n end\n\n money_result = [money_max, money_name]\n return money_result\nend", "def price_at_maximum\n qty = breaks.last.minimum\n qty -= 1 unless breaks.empty?\n brk = breaks.last.marginal.nil? ? breaks[-2] : breaks[-1]\n return nil unless brk\n brk.price_at(qty)\n end", "def highest_price\n has_price = 0\n has_price = $postings.select{|p| p[1][/(?<=\\$)\\d+/].to_i >= 1}\n pricy_post = has_price.max {|a,b| a[1][/(?<=\\$)\\d+/].to_i <=> b[1][/(?<=\\$)\\d+/].to_i}\n pricy_price = pricy_post[1][/(?<=\\$)\\d+/].to_i\n pricy_ads = has_price.select{|i| i[1][/(?<=\\$)\\d+/].to_i == pricy_price}\n list_apt(pricy_ads)\nend", "def max_amount(array_of_coins)\n case array_of_coins.length\n when 0 then 0\n when 1 then array_of_coins.first\n when 2 then [array_of_coins.first, array_of_coins.last].max\n else\n [\n array_of_coins.last + max_amount(array_of_coins[0..-3]),\n max_amount(array_of_coins[0..-2])\n ].max\n end\nend", "def mortgage_amount\n params['payment_amount'] = params['payment_amount'].to_f\n params['amortization_period'] = params['amortization_period'].to_f\n params['down_payment'] = params['down_payment'].to_f if params['down_payment'].present?\n\n max_mortgage_amount = calculate_max_mortgage(params, @@interest_rate)\n\n json_response(amount: max_mortgage_amount)\n end", "def get_discount(total)\n\n largest_discount = 0.00\n\n @discounts.each do |discount|\n threshold = Money.new(discount[:threshold] * 100).cents\n # TODO: Add \"discount[:discount] > largest_discount\" in case array out of order.\n if total > threshold\n largest_discount = discount[:discount]\n end\n end\n\n largest_discount\n\n end", "def most_profitable_role\n @agent_roles.max_by { |role| @trade_tracker.profitability_of(role) }\n end", "def driver_with_highest_income(all_rides)\n all_income = total_income_per_driver(all_rides)\n highest_income = all_income.values.max\n driver = all_income.key(highest_income)\n puts \"#{driver} made the most money, earning $#{'%.2f' % highest_income}\"\nend", "def get_reward?(project)\n max_reward = project.rewards.max_by(&:price)\n ordered_rewards = project.rewards.sort_by { |reward| reward.price }\n\n # if user already has the highest reward and is INCREASING their pledge,\n # no action is taken\n return if self.reward == max_reward && self.amount >= max_reward.price\n\n # if user has a reward already, but the increase in their pledge does\n # not take them to the next reward level, no action is taken\n if self.reward && self.reward != max_reward\n next_reward = ordered_rewards[(ordered_rewards.index(self.reward) + 1)]\n return if self.amount < next_reward.price\n end\n\n ordered_rewards.each do |reward| \n if self.amount >= reward.price\n self.reward = reward if reward.available?\n end\n end\n self.reward\n end", "def highest_bill\n \t@user = Review.order(totalbill: :desc).first(5)\n end", "def project_pledge_remaining\n project_pledge_remaining = Hash.new(0)\n self.projects_supported.each do |project_id, total_pledge_amount|\n project_pledge_remaining[project_id] = total_pledge_amount\n end\n self.claimed_rewards_by_project.each do |project_id, total_reward_amount|\n project_pledge_remaining[project_id] -= total_reward_amount\n end\n return project_pledge_remaining\nend", "def highest_earner(drivers)\n # hash data for the highest earning driver\n highest_earner_data = drivers.max { |a, b| a[:total_earned] <=> b[:total_earned]}\n # extracts the driver ID\n highest_earner = highest_earner_data[:driver_id]\n return highest_earner\nend", "def get_max_profit(stocks)\n min_price = stocks[0]\n biggest_diff = stocks[1] - min_price\n\n # keep track of biggest difference, and smallest price\n stocks.each_with_index do |stock, i|\n next if i == 0 # skip first\n curr_diff = stock - min_price\n biggest_diff = curr_diff if curr_diff > biggest_diff\n\n min_price = stock if stock < min_price\n end\n\n biggest_diff\nend", "def highest_total_score\n @game_manager.highest_total_score\n end", "def pledge_math\n @pledges = Pledge.where(\"gift_id\" => self.id)\n return pledge_total.to_f, cost_remainder.to_f\n end", "def highest_total_score\n total_goals.max\n end", "def most_money(driver_data)\n driver_id = nil\n most_money = 0\n\n driver_data.each do |driver, data|\n if data[:money] > most_money\n driver_id = driver\n most_money = data[:money]\n end\n end\n\n return driver_id\n\nend", "def most_recent_price\n pricing_transactions = transactions.uniq.select{|t| t.dollars && t.shares}\n last_date = pricing_transactions.map{|t| t.date}.max\n pricing_transactions.select{|t| t.date == last_date}.map{|tt| tt.dollars/tt.shares.to_f}.first\n end", "def best_currency_amount\n self.best_currency_path if @best_currency_path == []\n return nil if @best_currency_path == []\n profits = 0\n loop do\n break if i + 1 == @best_currency_path.length\n profits += self.profit_in_trade(@currency_conversions[i], @currency_conversions[i+1])\n i += 1\n end\n Currency.new(profits, @source_currency)\n end", "def price_is_right(bids, actual_retail_price)\n bids.select{|bid|bid<=actual_retail_price}.max\n\nend", "def max_profit(prices)\n calculate(prices, 0)\nend", "def disbursed_amount\n amount = 0\n loans.each do |project|\n amount += project.disbursed_amount.to_i\n end\n amount\n end", "def highest_priced_options\n possibilities = possibilites_matrix\n ( highest_total, highest_possibilities ) = highest_possibility_price( possibilities )\n end", "def highest\n @level_order.last\n end", "def best_invoice_by_revenue\n @engine.invoices.all.max_by do |invoice|\n inv_items = find_inv_items_from_paid_in_full_invoices([invoice])\n find_total_revenue_for_inv_items(inv_items)\n end\n end", "def max_profit(stocks)\n max = 0\n buy = stocks[0]\n\n stocks.each_with_index do |sell, index|\n # ignore the first index just because already set it above\n next if index == 0\n\n current_profit = sell - buy\n\n # if the current profit is less than 0, there is no way the\n # prices could possibly be used to generate the max profit\n # therefore start making new comparisons from this point\n # forward\n if current_profit < 0\n buy = sell\n end\n\n # evaluate the max everytime\n max = [max, current_profit].max\n end\n\n if max == 0\n return -1\n end\n\n return max\nend", "def name_of_largest_account_holder( accounts, bank_account_type)\n account_value = 0\n account_holder_name = nil\n if bank_account_type == \"all\"\n for account in accounts\n if account[\"amount\"] > account_value\n account_value = account[\"amount\"]\n account_holder_name = account[\"holder_name\"]\n end\n end\n else\n for account in accounts\n if account[\"type\"] == bank_account_type && account[\"amount\"] > account_value\n account_value = account[\"amount\"]\n account_holder_name = account[\"holder_name\"]\n end\n end\n end\n return account_holder_name\nend", "def get_max_profit(stock_prices_yesterday)\n min_price = stock_prices_yesterday.first\n max_profit = stock_prices_yesterday[1] - min_price\n stock_prices_yesterday.each.with_index do |price, idx|\n next if idx == 0\n potential_profit = price - min_price\n max_profit = potential_profit if potential_profit > max_profit\n min_price = price if price < min_price\n end\n max_profit\nend", "def largestcoin(amount, coins)\n\ti = 0\n\tbest_coin = coins[i]\n\tfor coin in coins\n\t\tif (coin <= amount) && (coin > best_coin)\n\t\t\tbest_coin = coin\n\t\telse\n\t\tcoins[i+=1]\t\n\t\tend\n\tend\n\tbest_coin\nend", "def highest_ranked_household_person_link\n HouseholdPersonLink.order_by_rank(household_person_links).first\n end", "def get_max_profit_v3(yesterday_stock_prices)\n\n min_price = yesterday_stock_prices[0]\n max_profit = 0\n\n # go through every price on the list\n yesterday_stock_prices.each do |current_price|\n\n # ensure min price is lowest price we've seen so far\n min_price = [min_price, current_price].min\n\n # see what our profit woudl be if we bought at the\n # min price and sold at the current price\n potential_profit = current_price - min_price\n\n # update max_profit if we can do better\n max_profit = [max_profit, potential_profit].max\n\n end\n\n max_profit\n\n end", "def max_profit(prices)\n min_price = prices[0]\n max_pro = 0 \n price.each do |price|\n if price <= min_price\n min_price = price\n elsif price - min_price > max_pro\n max_pro = price - min_price\n end\n end\n max_pro\nend", "def overall_pledge_compatibility_points(pledge)\n\t\ttotal_points = 0\n\t\tmansion_mates = pledge#.users\n\t\tmansion_mates.each_with_index do |mate, index|\n\t\t\tindex_of_next_mate = index + 1\n\t\t\tnext_mate_to_compare_with = mansion_mates[index_of_next_mate]\n\t\t\tuntil next_mate_to_compare_with == nil\n\t\t\t\tpoints = user_to_user_compatibility_points(mate, next_mate_to_compare_with)\n\t\t\t\ttotal_points += points\n\t\t\t\tnext_mate_to_compare_with = mansion_mates[index_of_next_mate += 1]\n\t\t\tend\n\t\tend\n\t\treturn total_points\n\tend", "def find_who_made_the_most(ride_data)\n driver_income = get_amount_each_driver_made(ride_data)\n amount = 0\n highest_income_driver = nil\n # find and store/save the driver who made the most\n # and the value of their income\n driver_income.each do |driver, income|\n if income > amount\n amount = income\n highest_income_driver = driver\n end\n end\n # return an array with two values for the driver\n # with the highest earnings: the driver ID and the amount they made\n return highest_income_driver, amount\nend", "def biggest_council\n return if payer_breakdown.blank? || payer_breakdown.all?{ |o| o[:organisation_type] != 'Council' }\n council_details = payer_breakdown.select{ |o| o[:organisation_type] == 'Council'}.sort{|a,b| b[:total_spend] <=> a[:total_spend]}.first\n Council.find_by_id(council_details[:organisation_id])\n end", "def max_discount_amount\n\t\tamount = self.original_price - self.original_price * 0.3\n\t\treturn amount\n\tend", "def enough_money?(maxAmount)\r\n self.price<=maxAmount\r\n end", "def most_revenue(x)\n all.max_by(x) {|merchant| merchant.revenue}\n end", "def max_bid\n bids.first\n end", "def max\n negative = txns.select { |t| t.amount.negative? }\n negative.empty? ? 0 : negative.max_by(&:id).id\n end", "def get_max_profit(stock_prices)\n return 0 if stock_prices.length < 2\n \n min_stock = stock_prices[0]\n max_profit = stock_prices[1] - stock_prices[0]\n puts \"\\n#{min_stock}\"\n puts \"#{max_profit}\"\n stock_prices[1...stock_prices.length].each do |price|\n min_stock = [min_stock, price].min \n puts \"\\n#{min_stock}\"\n pot_max_profit = price - min_stock\n puts \"#{max_profit}\"\n max_profit = [max_profit, pot_max_profit].max\n puts \"#{max_profit}\"\n end\n \n max_profit\nend", "def price_is_right(bids, actual_retail_price)\n diff = actual_retail_price\n best_bid = nil\n bids.each do |bid|\n\n highest = actual_retail_price - bid\n\n if highest > 0 && highest <= diff\n diff, best_bid = highest, bid\n end\n end\n\n best_bid\nend", "def find_greatest_profit\n\n @stock_prices_yesterday.each.with_index do |buy_amount, index|\n\n #Set biggest profit to the first transaction to avoid errors caused by a comparision with nil.\n @biggest_profit ||= @stock_prices_yesterday[0] - @stock_prices_yesterday[1]\n\n counter = 1\n while index + counter < 480\n if (@stock_prices_yesterday[index + counter] - buy_amount) > @biggest_profit\n @biggest_profit = @stock_prices_yesterday[index + counter] - buy_amount\n @buy_price = @stock_prices_yesterday[index]\n @buy_time = index\n @sell_price = @stock_prices_yesterday[index + counter]\n @sell_time = index + counter\n counter += 1\n puts counter\n else\n counter +=1\n puts counter\n end\n end\n end\n @biggest_profit\n end", "def max_profit(stock_prices)\n\tmin_buying_point = stock_prices[0]\n\tmax_profit = 0;\n\n\tstock_prices.each do |price|\n\t\tmin_buying_point = [min_buying_point, price].min()\n\n\t\tcurrent_profit = price - min_buying_point \n\n\t\tmax_profit = [max_profit, current_profit].max()\n\tend\n\n\treturn max_profit\nend", "def maximum\n\t\tif 2 < course.users.length and 0 < worth\n\t\t\tmaximum = 0\n\t\t\t\n\t\t\tcourse.users.each do |user|\n\t\t\t\tgrade = self.user_grade(user)\n\t\t\t\t\n\t\t\t\tif grade and maximum < grade\n\t\t\t\t\tmaximum = grade\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn maximum\n\t\tend\n\tend", "def max_profit(prices)\n buy = nil\n profit = 0\n \n prices.each do |p|\n if buy.nil?\n buy = p\n elsif p < buy\n buy = p\n else\n profit = p - buy if p - buy > profit\n end\n end\n profit\nend", "def maximum_wealth(accounts)\n accounts.map {|account| account.sum }.max\nend", "def max_price\n @set[\"PriceSet\"][\"maxPrice\"]\n end", "def maximum\n\t\tif course.users.length > 2 and worth > 0\n\t\t\treturn (grades.maximum(:grade).to_f / worth) * 100\n\t\tend\n\tend", "def max_profit(stock_prices_yesterday)\n max_diff = stock_prices_yesterday[1] - stock_prices_yesterday[0]\n stock_prices_yesterday[2..-1].each_with_index do |price, index|\n index += 1\n diff = stock_prices_yesterday[0..(index - 1)].map { |x| price - x }.max\n max_diff = diff if diff > max_diff\n end\n max_diff\nend", "def max_rob(houses)\n houses.each_with_index.reduce(0) do |robbed_money, (house_money, index)|\n next robbed_money if !index.zero? && index % 2 == 0\n\n robbed_money += house_money\n end\nend", "def get_max(amt)\n\tputs \"Do you want to set a limit on your lunch price? Y or N\"\n\t@response = gets.strip.downcase\n\tcase @response\n\twhen 'y', 'yes'\n\t\tget_dollar_amount\n\twhen 'n','no'\t\n\t\tnil\n\telse\n\t\tputs \"Invalid input. Enter Y or N.\"\n\t\tget_max(amt)\n\tend\nend", "def disbursed_amount_factor\n disbursed_amount.to_f / Country.max_disbursed_amount\n end", "def get_max_profit_v4(yesterday_stock_prices)\n\n # make sur we have at least two prices\n if yesterday_stock_prices.length < 2\n #raise ArgumentError, 'Getting a profit requires at least 2 prices'\n return 'Getting a profit requires at least 2 prices'\n end\n\n # we'll greedly min_price and max_profit, so we initialize\n # them to the first price and first possible profit\n min_price = yesterday_stock_prices[0]\n max_profit = yesterday_stock_prices[1] - yesterday_stock_prices[0]\n\n # go through every price\n yesterday_stock_prices.each_with_index do |current_price, index|\n\n # skip the first time since we already used it\n # when we initialize min_price and max_profit\n next if index.zero?\n\n # see what profit will be if we bought at min_price\n # and sold at the current_price\n potential_profit = current_price - min_price\n\n # update max_profit if we can do better\n max_profit = [max_profit, potential_profit].max\n\n # update min_price so it's always the\n # lowest price we've seen so far\n min_price = [min_price, current_price].min\n\n end\n\n max_profit\n\n end", "def max_stock_profit(stock_prices)\n\tlocal_min = stock_prices[0]\n\tlocal_max = stock_prices[1]\n\tmax_profit_so_far = local_max - local_min\n\n\tstock_prices[2..-1].each do |price|\n\n\t\tif local_max == nil || price > local_max\n\t\t\tlocal_max = price\n\t\t\tprofit = local_max - local_min\n\t\t\tmax_profit_so_far = profit if profit > max_profit_so_far\n\n\t\t# must 'reset' the max when the min is reset\n\t\t# I set the max to nil because you can't buy and sell\n\t\t# at the same time\n\t\telsif price < local_min\n\t\t\tlocal_min = price\n\t\t\tlocal_max = nil \n\t\tend \n\t\t# log(local_min, local_max, max_profit_so_far)\n\tend\n\t\treturn max_profit_so_far\nend", "def max_profit(prices)\n min_price = prices[0]\n best_profit = 0\n \n prices.each do |price|\n if price < min_price\n min_price = price\n else\n profit = price - min_price\n if profit > best_profit\n best_profit = profit\n end\n end\n end\n \n return best_profit\nend", "def max(items)\n#(was not sure if instructions meant the method.max. this is my solution only restricting the method: max)\n max = items.sort.last\nend", "def get_max_profit(stock_prices_yesterday)\n # check for at least 2 prices\n if stock_prices_yesterday.length < 2\n raise IndexError, 'Need at least 2 prices to test.'\n end\n # initialize first price and the first possible profit\n min_price = stock_prices_yesterday[0]\n max_profit = stock_prices_yesterday[1] - stock_prices_yesterday[0]\n\n stock_prices_yesterday.each_with_index do |current_price, index|\n if index == 0 then next end\n # see what our profit would be if we bought at the\n # min price and sold at the current price\n potential_profit = current_price - min_price\n # update max_profit\n max_profit = [max_profit, potential_profit].max\n # update min_price\n min_price = [min_price, current_price].min\n end\n return max_profit\nend" ]
[ "0.7359576", "0.69808304", "0.69797075", "0.6851441", "0.6802575", "0.6708251", "0.6638615", "0.66277385", "0.6613474", "0.65981984", "0.6587211", "0.6574272", "0.6553286", "0.65527064", "0.650865", "0.647831", "0.6453326", "0.6432564", "0.64111716", "0.64097774", "0.63974833", "0.6350385", "0.6320524", "0.63119024", "0.63024294", "0.62911457", "0.62801296", "0.6254248", "0.62149376", "0.62149376", "0.61677986", "0.6152416", "0.61478907", "0.6144137", "0.61374056", "0.6121437", "0.61066306", "0.609761", "0.60951424", "0.6087406", "0.60669374", "0.6063976", "0.60540146", "0.6049126", "0.60296786", "0.6028204", "0.6017138", "0.59731257", "0.5951253", "0.59489685", "0.5940704", "0.5934661", "0.5931484", "0.5919138", "0.59181726", "0.58830625", "0.58825535", "0.58703583", "0.5868083", "0.586453", "0.58589566", "0.58387226", "0.5836894", "0.58315676", "0.58258456", "0.58212477", "0.5821183", "0.5819228", "0.5812986", "0.581285", "0.58123314", "0.579125", "0.5779863", "0.5773634", "0.57726675", "0.5771259", "0.576846", "0.57662183", "0.57643896", "0.57604986", "0.57578796", "0.5754157", "0.5752439", "0.5745911", "0.5740703", "0.57259434", "0.57110286", "0.57051957", "0.5703978", "0.5701506", "0.56961614", "0.5694106", "0.5690732", "0.5689768", "0.5687141", "0.56754345", "0.5667986", "0.5646705", "0.56441003", "0.56371045" ]
0.85352814
0
Retrieve a single page of BrandedCallInstance records from the API. Request is executed immediately.
def create(from: nil, to: nil, reason: nil, call_sid: :unset) data = Twilio::Values.of({'From' => from, 'To' => to, 'Reason' => reason, 'CallSid' => call_sid, }) payload = @version.create( 'POST', @uri, data: data ) BrandedCallInstance.new(@version, payload, ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_calls()\n @client.make_request(:get, @client.concat_user_path(\"#{BRIDGE_PATH}/#{id}/calls\"))[0].map do |item|\n Call.new(item, @client)\n end\n end", "def get_instance(payload)\n BrandedCallInstance.new(@version, payload, )\n end", "def index\n @calls = Call.all\n end", "def index\n @calls = Call.all\n end", "def index\n @calls = Call.all\n end", "def index\n @calls = Call.all\n end", "def get_recordings()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/recordings\"))[0]\n end", "def get(request_configuration=nil)\n request_info = self.to_get_request_information(\n request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::CallRecordsCallRecordCollectionResponse.create_from_discriminator_value(pn) }, error_mapping)\n end", "def index\n @call_histories = CallHistory.all.page(params[:page]).per(20).order(\"id DESC\")\n end", "def bridged_calls bridge_id\n LazyArray.new do |page, size|\n calls, _headers = get \"bridges/#{bridge_id}/calls\", page: page, size: size\n\n calls.map do |call|\n Types::BridgedCall.new call\n end\n end\n end", "def index\n @bill = Bill.find(params[:bill_id])\n @billed_calls = Kaminari.paginate_array(@bill.billed_calls).page(params[:subpage]).per(Source::Application.config.items_per_page)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @billed_calls }\n end\n end", "def index\n @calldetails = Calldetail.all\n end", "def get_instance(payload)\n CallSummariesInstance.new(@version, payload, )\n end", "def show\n @request_call = RequestCall.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request_call }\n end\n end", "def where(options = {})\n _, _, root = @client.get(\"/calls\", options)\n\n root[:items].map{ |item| Call.new(item[:data]) }\n end", "def fetch_billing_results\n previous_response = nil\n begin\n page = get_page_number\n\n response = Select.fetch_billing_results(@start_timestamp, @end_timestamp,\n page, @page_size)\n unless !response.is_a?(Array)\n process_response(response)\n previous_response = response\n end\n end until !response.is_a?(Array)\n reset_page_number\n\n set_empty_last_fetch_soap_id(response, previous_response)\n end", "def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, page_token: :unset, page_number: :unset, page_size: :unset)\n params = Twilio::Values.of({\n 'From' => from,\n 'To' => to,\n 'FromCarrier' => from_carrier,\n 'ToCarrier' => to_carrier,\n 'FromCountryCode' => from_country_code,\n 'ToCountryCode' => to_country_code,\n 'Branded' => branded,\n 'VerifiedCaller' => verified_caller,\n 'HasTag' => has_tag,\n 'StartTime' => start_time,\n 'EndTime' => end_time,\n 'CallType' => call_type,\n 'CallState' => call_state,\n 'Direction' => direction,\n 'ProcessingState' => processing_state,\n 'SortBy' => sort_by,\n 'Subaccount' => subaccount,\n 'AbnormalSession' => abnormal_session,\n 'PageToken' => page_token,\n 'Page' => page_number,\n 'PageSize' => page_size,\n })\n\n response = @version.page('GET', @uri, params: params)\n\n CallSummariesPage.new(@version, response, @solution)\n end", "def index\n @calls = Call.order('id DESC')\n\n respond_to do |format|\n format.html\n format.json { render json: @calls }\n end\n end", "def show\n @call = Call.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @call }\n end\n end", "def load\n data = []\n page = 1\n total_size = 0\n\n loop do\n request_url = \"#{@request_url_base}&page=#{page}&api_key=#{@api_key}\"\n response = Faraday.get(request_url)\n\n response_json = JSON.parse(response.body)\n\n break if response_json.empty?\n\n response_json.each do |item|\n data << item\n end\n\n unless @limit.nil?\n total_size += response_json.length\n\n break if total_size > @limit\n end\n\n page += 1\n end\n\n data = data.first(@limit) unless @limit.nil?\n\n data\n end", "def show\n @call_history = CallHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @call_history }\n end\n end", "def page(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time: :unset, start_time_before: :unset, start_time_after: :unset, end_time: :unset, end_time_before: :unset, end_time_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)\n params = Twilio::Values.of({\n 'To' => to,\n 'From' => from,\n 'ParentCallSid' => parent_call_sid,\n 'Status' => status,\n 'StartTime' => Twilio.serialize_iso8601_datetime(start_time),\n 'StartTime<' => Twilio.serialize_iso8601_datetime(start_time_before),\n 'StartTime>' => Twilio.serialize_iso8601_datetime(start_time_after),\n 'EndTime' => Twilio.serialize_iso8601_datetime(end_time),\n 'EndTime<' => Twilio.serialize_iso8601_datetime(end_time_before),\n 'EndTime>' => Twilio.serialize_iso8601_datetime(end_time_after),\n 'PageToken' => page_token,\n 'Page' => page_number,\n 'PageSize' => page_size,\n })\n\n response = @version.page('GET', @uri, params: params)\n\n CallPage.new(@version, response, @solution)\n end", "def index\n @calls = Call.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calls }\n end\n end", "def index\n @calls = Call.all.order('created_at DESC')\n end", "def show\n @call = Cdr.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @call }\n end\n end", "def index\n @call_histories = CallHistory.all\n end", "def inspect\n \"<Twilio.Preview.TrustedComms.BrandedCallInstance>\"\n end", "def get_current_call callclass\n assert_call(callclass)\n \n self.calls.reverse.each do |call|\n if call.is_a?(callclass)\n return call\n elsif call.is_a?(Bid)\n break # Bids cancel all preceding calls.\n end\n end\n nil\n end", "def index\n @callplans = Callplan.all\n end", "def index\n @call_services = CallService.all\n end", "def page(to: :unset, from: :unset, parent_call_sid: :unset, status: :unset, start_time_before: :unset, start_time: :unset, start_time_after: :unset, end_time_before: :unset, end_time: :unset, end_time_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)\n params = Twilio::Values.of({\n 'To' => to,\n 'From' => from,\n 'ParentCallSid' => parent_call_sid,\n 'Status' => status,\n 'StartTime<' => Twilio.serialize_iso8601_datetime(start_time_before),\n 'StartTime' => Twilio.serialize_iso8601_datetime(start_time),\n 'StartTime>' => Twilio.serialize_iso8601_datetime(start_time_after),\n 'EndTime<' => Twilio.serialize_iso8601_datetime(end_time_before),\n 'EndTime' => Twilio.serialize_iso8601_datetime(end_time),\n 'EndTime>' => Twilio.serialize_iso8601_datetime(end_time_after),\n 'PageToken' => page_token,\n 'Page' => page_number,\n 'PageSize' => page_size,\n })\n response = @version.page(\n 'GET',\n @uri,\n params\n )\n CallPage.new(@version, response, @solution)\n end", "def get_instance(payload)\n CallSummaryInstance.new(@version, payload, call_sid: @solution[:call_sid])\n end", "def index\n @test_calls = TestCall.all\n end", "def index\n @request_calls = RequestCall.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @request_calls }\n end\n end", "def fetch(key, page, page_size, record_klass, records_counter)\n page, page_size = process_page_params(page, page_size, record_klass)\n return [] if exceeds_max_pages?(page, page_size, records_counter)\n\n start, stop = get_range(page, page_size)\n rs = read_records(key, start, stop, record_klass)\n return rs if rs.present?\n\n if block_given?\n ActiveRecord::Base.with_advisory_lock(\"list/cache/#{key}/#{page}/#{page_size}\", timeout_seconds: 3) do\n rs = read_records(key, start, stop, record_klass)\n return rs if rs.present?\n\n records = yield\n return [] if records.blank?\n\n load_records(key, page, page_size, records, record_klass)\n end\n end\n end", "def index\n @calllogs = Calllog.all\n end", "def index\n @call_statuses = CallStatus.all\n end", "def show\n @call = current_user.calls.find(params[:id])\n\n respond_to do |format|\n format.html\n end\n end", "def by_call_record_id(call_record_id)\n raise StandardError, 'call_record_id cannot be null' if call_record_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"callRecord%2Did\"] = call_record_id\n return MicrosoftGraph::Communications::CallRecords::Item::CallRecordItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end", "def index\n @calllists = Calllist.all\n end", "def index\n @calllists = Calllist.all\n end", "def query_ol_api(call_number:)\n conn = Faraday.new(url: \"#{catalog_host}/catalog.json\")\n result = conn.get do |req|\n req.params[\"search_field\"] = \"all_fields\"\n req.params[\"f[call_number_browse_s][]\"] = call_number\n end\n\n json = JSON.parse result.body\n # return nil unless json[\"response\"][\"docs\"].count.positive?\n json[\"response\"][\"docs\"].map { |doc| doc[\"id\"] } # will be [] if no results\n end", "def get_query_metadata_for_account_and_call(account_id,\r\n call_id)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => account_id,\r\n 'callId' => call_id\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n if _response.status_code == 400\r\n raise ErrorResponseException.new(\r\n 'Something didn\\'t look right about that request. Please fix it' \\\r\n ' before trying again.',\r\n _response\r\n )\r\n elsif _response.status_code == 401\r\n raise APIException.new(\r\n 'Please authenticate yourself',\r\n _response\r\n )\r\n elsif _response.status_code == 403\r\n raise ErrorResponseException.new(\r\n 'Your credentials are invalid. Please use your API credentials for' \\\r\n ' the Bandwidth Dashboard.',\r\n _response\r\n )\r\n elsif _response.status_code == 415\r\n raise ErrorResponseException.new(\r\n 'We don\\'t support that media type. Please send us' \\\r\n ' `application/json`.',\r\n _response\r\n )\r\n elsif _response.status_code == 429\r\n raise ErrorResponseException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n elsif _response.status_code == 500\r\n raise ErrorResponseException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response,\r\n data: decoded.map { |element| RecordingMetadataResponse.from_hash(element) }\r\n )\r\n end", "def recent\n @calls = Call.where(\"audio_id IS NOT NULL\").order(\"start ASC\").limit(50).map do |call|\n { :id => call.id,\n :start => call.start,\n :end => call.end,\n :frequency => call.frequency,\n :group_full_name => call.group.full_name,\n :group_name => call.group.name }\n end\n \n respond_to do |format|\n format.html { render \"index\" }\n format.json { render json: @calls }\n end\n end", "def show\n @call = Call.find(params[:id])\n @participants = @call.participants\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @call }\n end\n end", "def get_calls_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CallsApi.get_calls ...'\n end\n allowable_values = [\"voicemail\", \"missed\", \"blocked\", \"accepted\"]\n if @api_client.config.client_side_validation && opts[:'filter_type'] && !allowable_values.include?(opts[:'filter_type'])\n fail ArgumentError, \"invalid value for \\\"filter_type\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [\"asc\", \"desc\"]\n if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])\n fail ArgumentError, \"invalid value for \\\"order\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling CallsApi.get_calls, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling CallsApi.get_calls, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/calls'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'filter[date]'] = opts[:'filter_date'] if !opts[:'filter_date'].nil?\n query_params[:'filter[from_number]'] = opts[:'filter_from_number'] if !opts[:'filter_from_number'].nil?\n query_params[:'filter[to_number]'] = opts[:'filter_to_number'] if !opts[:'filter_to_number'].nil?\n query_params[:'filter[type]'] = opts[:'filter_type'] if !opts[:'filter_type'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Call>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CallsApi#get_calls\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @phone_calls = PhoneCall.order('created_at desc')\n end", "def load_records\n native_instance(true)\n native_instance.top(limit) if limit.present?\n Array(service.native_instance.execute)\n end", "def show\n @borrower_bids = @borrower_request.bids\n @bids = @borrower_bids.order('rate asc')\n @last_bid = @borrower_bids.order('created_at desc').first.created_at if !@borrower_bids.blank?\n end", "def show\n @number_call = NumberCall.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @number_call }\n end\n end", "def perform_record_request\n Faraday.send(:get, request_url, nil, headers)\n end", "def index\n @bid_requests = BidRequest.all\n end", "def retrieve_plan_list\n options = { limit: 100 }\n options[:offset] = @offset if @offset.present?\n ChargeBee::Plan.list(options)\n end", "def show\n @call = Call.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @call }\n end\n end", "def index\n @calls = Call.all.order(created_at: :desc).page(params[:page])\n @call = Call.new\n @region = Region.new\n @user_show = \"\"\n return if params[\"call\"].nil? # breaks if no filter input\n\n filter_search\n end", "def get_recordings(options = {})\n prepare\n @api.get_recordings(options)\n end", "def get_query_metadata_for_account_and_call(account_id,\r\n call_id,\r\n from: nil,\r\n to: nil,\r\n min_start_time: nil,\r\n max_start_time: nil)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/recordings'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => { 'value' => account_id, 'encode' => true },\r\n 'callId' => { 'value' => call_id, 'encode' => true }\r\n )\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n 'from' => from,\r\n 'to' => to,\r\n 'minStartTime' => min_start_time,\r\n 'maxStartTime' => max_start_time\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n if _response.status_code == 400\r\n raise ApiErrorResponseException.new(\r\n 'Something\\'s not quite right... Your request is invalid. Please' \\\r\n ' fix it before trying again.',\r\n _response\r\n )\r\n elsif _response.status_code == 401\r\n raise APIException.new(\r\n 'Your credentials are invalid. Please use your Bandwidth dashboard' \\\r\n ' credentials to authenticate to the API.',\r\n _response\r\n )\r\n elsif _response.status_code == 403\r\n raise ApiErrorResponseException.new(\r\n 'User unauthorized to perform this action.',\r\n _response\r\n )\r\n elsif _response.status_code == 404\r\n raise ApiErrorResponseException.new(\r\n 'The resource specified cannot be found or does not belong to you.',\r\n _response\r\n )\r\n elsif _response.status_code == 415\r\n raise ApiErrorResponseException.new(\r\n 'We don\\'t support that media type. If a request body is required,' \\\r\n ' please send it to us as `application/json`.',\r\n _response\r\n )\r\n elsif _response.status_code == 429\r\n raise ApiErrorResponseException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n elsif _response.status_code == 500\r\n raise ApiErrorResponseException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response,\r\n data: decoded.map { |element| RecordingMetadataResponse.from_hash(element) }\r\n )\r\n end", "def get_records\n return error_response unless is_get_records_request?\n as_json\n end", "def new\n @bill = Bill.find(params[:bill_id])\n @billed_call = @bill.billed_calls.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @billed_call }\n end\n end", "def by_call_id(call_id)\n raise StandardError, 'call_id cannot be null' if call_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"call%2Did\"] = call_id\n return MicrosoftGraph::Communications::Calls::Item::CallItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end", "def show\n @call_box = CallBox.find(params[:id])\n @cb_tests = CbTest.find(:all, :conditions => {:cb_number => @call_box.cb_num})\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @call_box }\n end\n end", "def get_call_history(app_id)\n JSON.parse((@cloudvox_api[\"/applications/\" + app_id + \"/call_detail_records.json\"].get).body)\n end", "def set_call_list\n @call_list = CallList.find(params[:id])\n end", "def get_call call_id\n opts = {:single_quoted => false}\n params = {\n :query => {\n \"ClientToken\" => self.token,\n \"Call_ID\" => Type::String.safe_value(call_id, opts)\n }\n }\n\n get 'get_call.php', params\n end", "def index\n @call_logs = CallLog.accessible_by( current_ability, :index ).order('created_at DESC').page( params[:page] ).per(20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @call_logs }\n end\n end", "def index\n @batches = Batch.page(params[:page]).per(15)\n @page = params[:page] || 1\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @batches }\n end\n end", "def get_call_state(account_id,\r\n call_id)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => { 'value' => account_id, 'encode' => true },\r\n 'callId' => { 'value' => call_id, 'encode' => true }\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n if _response.status_code == 400\r\n raise ApiErrorResponseException.new(\r\n 'Something\\'s not quite right... Your request is invalid. Please' \\\r\n ' fix it before trying again.',\r\n _response\r\n )\r\n elsif _response.status_code == 401\r\n raise APIException.new(\r\n 'Your credentials are invalid. Please use your Bandwidth dashboard' \\\r\n ' credentials to authenticate to the API.',\r\n _response\r\n )\r\n elsif _response.status_code == 403\r\n raise ApiErrorResponseException.new(\r\n 'User unauthorized to perform this action.',\r\n _response\r\n )\r\n elsif _response.status_code == 404\r\n raise ApiErrorResponseException.new(\r\n 'The resource specified cannot be found or does not belong to you.',\r\n _response\r\n )\r\n elsif _response.status_code == 415\r\n raise ApiErrorResponseException.new(\r\n 'We don\\'t support that media type. If a request body is required,' \\\r\n ' please send it to us as `application/json`.',\r\n _response\r\n )\r\n elsif _response.status_code == 429\r\n raise ApiErrorResponseException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n elsif _response.status_code == 500\r\n raise ApiErrorResponseException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response, data: ApiCallStateResponse.from_hash(decoded)\r\n )\r\n end", "def index\n @rehearsal_calls = RehearsalCall.all\n end", "def get(call_uuid)\n valid_param?(:call_uuid, call_uuid, [String, Symbol], true)\n perform_get(call_uuid)\n end", "def index\n @call_types = CallType.all\n end", "def each_resource(call_back, **kwargs)\n offset = kwargs[:offset].nil? ? 0 : kwargs[:offset]\n\n loop do\n response = request(call_back, :offset => offset, **kwargs)\n offset = response.fetch(:offset) + response.fetch(:limit)\n\n resources = response[:items]\n resources&.each { |value| yield value }\n\n return if resources.empty?\n end\n end", "def list_batches_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BatchesApi.list_batches ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling BatchesApi.list_batches, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling BatchesApi.list_batches, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/v1/batches'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'ListBatchesResponseBody' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BatchesApi#list_batches\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @calls = Call.all\n @plans = Plan.all\n end", "def get(request_configuration=nil)\n request_info = self.to_get_request_information(\n request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::CallCollectionResponse.create_from_discriminator_value(pn) }, error_mapping)\n end", "def show\n @responses = @bbs_thread.responses.order(\"updated_at DESC\").page(params[:page])\n @response = @bbs_thread.responses.build\n read_res_session\n end", "def get_call_records(type=:standard, interval=:current, subset=:international)\n if subset == :international\n # Prefix the NPAs with \"1\" optionally (we're using regexp on the terms).\n search_list = VAUtil.config['intl_npa_list'].map { |m| \"1?\" << m }\n # for internationl do a search for anything prefixed 011\n search_list << \"011\"\n thresholds = VAUtil.config['threshold']\n if (interval == :past)\n data_range = \"1:05\" # hours and minutes\n end_interval = \"5\"\n else\n data_range = 1 # In hours\n end\n else\n search_list = VAUtil.config['dom_npa_list'].map { |m| \"1?\" << m }\n thresholds = VAUtil.config['dom_threshold']\n if (interval == :past)\n data_range = \"3:15\" # hours and minutes\n end_interval = \"15\"\n else\n data_range = 3 # In hours\n end\n end\n\n call_records = CallRecords.new(self, interval, thresholds)\n\n # Past or present?\n if (interval == :past)\n time_span = \"calldate > DATE_SUB(NOW(), INTERVAL '#{data_range}' HOUR_MINUTE) AND calldate <= DATE_SUB(NOW(), INTERVAL #{end_interval} MINUTE)\"\n else\n time_span = \"calldate > DATE_SUB(NOW(), INTERVAL '#{data_range}' HOUR)\"\n end\n \n # TODO: de-dup\n if (type == :fax)\n VAUtil.config['fax_dsn_list'].each do |fax|\n db_link = get_dblink(DBInfo.new(fax['host'], fax['user'], fax['pass'], fax['name']))\n\n search_list.each do |term|\n query = \"SELECT src, COUNT(src) FROM cdr WHERE dcontext LIKE '%faxout%' AND lastdata REGEXP '^SIP/9#{term}' AND #{time_span} GROUP BY src\"\n results = list_query(query, db_link)\n results.each do |r|\n src = r[0]\n count = r[1]\n\n # Get the branch of for this src. If that fails requery the gateway and find it with\n # call details.\n branch_id = get_branch_id_with_tn(src)\n if branch_id.nil?\n dst = run_select_query(\"SELECT dst FROM cdr WHERE dcontext LIKE '%faxout%' AND lastdata REGEXP '^SIP/9#{term}' AND #{time_span} AND src = '#{src}'\", db_link)\n branch_id = get_branch_id_with_call_example(fax['host'], src, dst)\n end\n # it's possible call example path will fail too, skip if necessary\n if !branch_id.nil?\n call_records.add(src, count, branch_id)\n end\n end\n end\n db_link.close\n end\n else\n VAUtil.config['agw_dsn_list'].each do |agw|\n db_link = get_dblink(DBInfo.new(agw['host'], agw['user'], agw['pass'], agw['name']))\n\n search_list.each do |term|\n query = \"SELECT src, COUNT(src), accountcode FROM cdr WHERE dst REGEXP '^#{term}' AND #{time_span} AND dcontext REGEXP '^sbc' GROUP BY src\"\n results = list_query(query, db_link)\n results.each do |r|\n src = r[0]\n count = r[1]\n fs = r[2]\n \n # Get the branch of for this src. If that fails requery the gateway and find it with\n # call details.\n branch_id = get_branch_id_with_tn(src)\n if branch_id.nil?\n dst = run_select_query(\"SELECT dst FROM cdr WHERE dst REGEXP '^#{term}' AND #{time_span} AND src = '#{src}' AND accountcode = '#{fs}'\", db_link)\n \n branch_id = get_branch_id_with_call_example(\"#{fs}.coredial.com\", src, dst)\n end \n # it's possible call example path will fail too, skip if necessary\n if !branch_id.nil?\n call_records.add(src, count, branch_id)\n end\n end\n end\n db_link.close\n end\n end\n call_records\n end", "def set_calllist\n @calllist = Calllist.find(params[:id])\n end", "def set_calllist\n @calllist = Calllist.find(params[:id])\n end", "def set_calllist\n @calllist = Calllist.find(params[:id])\n end", "def list(user_id = nil, limit = 25, offset = 0)\r\n # the base uri for api requests\r\n _query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n _query_builder << '/activities'\r\n\r\n # process optional query parameters\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\\\r\n 'user_id' => user_id,\r\n 'limit' => limit,\r\n 'offset' => offset\r\n }\r\n\r\n # validate and preprocess url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'Authorization' => 'Bearer %s' % (Configuration.o_auth_access_token)\r\n }\r\n\r\n # Create the HttpRequest object for the call\r\n _request = @http_client.get _query_url, headers: _headers\r\n\r\n # Call the on_before_request callback\r\n @http_call_back.on_before_request(_request) if @http_call_back\r\n\r\n # Invoke the API call and get the response\r\n _response = @http_client.execute_as_string(_request)\r\n\r\n # Wrap the request and response in an HttpContext object\r\n _context = HttpContext.new(_request, _response)\r\n\r\n # Call the on_after_response callback\r\n @http_call_back.on_after_response(_context) if @http_call_back\r\n\r\n # Global error handling using HTTP status codes.\r\n validate_response(_context)\r\n\r\n # Return appropriate response type\r\n decoded = APIHelper.json_deserialize(_response.raw_body) if not (_response.raw_body.nil? or _response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "def search_bing\n search_results = bing_search.first_50\n #set_reports\n return search_results\n end", "def index\n @callers = Caller.all\n end", "def get_instance(payload)\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid])\n end", "def show\n @call_log = CallLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @call_log }\n end\n end", "def page\n raise 'page() requires a block' unless block_given?\n\n response = yield(1)\n num_records = response['size']\n\n if num_records.is_a?(Integer) && num_records > 25\n pages = (num_records / 25) + 1\n # start at 2 since first call returned first page\n for counter in 2..pages\n @logger.debug \"Retrieving page #{counter} of #{pages}\"\n results = yield(counter)['results']\n response['results'].concat(results) if results\n end\n end\n\n hash_response(response)\n end", "def show\n @call_num = CallNum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @call_num }\n end\n end", "def hangup_all_calls()\n path = @version + '/Call/Hangup/All/'\n method = 'POST'\n return request(path, method)\n end", "def get_instance(payload)\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end", "def get(options = {}, &block)\n if options[:page]\n self << Pillboxr::Attributes::Lowerlimit.new(options.fetch(:page) * Pillboxr.config.records_per_page)\n end\n @module_name.send(:complete, self, &block)\n end", "def top_ten\n Rails.cache.fetch('top_ten_resp', expires_in: 1.minutes) do\n conn = Faraday.new(url: @base_url) do |faraday|\n faraday.adapter(Faraday.default_adapter)\n end\n\n resp = conn.get do |req|\n req.url '/v1/cryptocurrency/listings/latest'\n req.headers['X-CMC_PRO_API_KEY'] = @api_key\n req.params['start'] = 1\n req.params['limit'] = 10\n req.params['convert'] = 'USD'\n req.params['sort'] = 'market_cap'\n req.params['sort_dir'] = 'desc'\n end\n\n raise 'Cannot parse response body' unless resp.body\n\n resp.body\n end\n end", "def api_calls\n @dotcoms = Dotcom.active\n @apis = @dotcom&.apis || [] # ActiveRecord::Associations::CollectionProxy of Apis\n if not @api.nil? and @api.mode == 'demo_api'\n api = Api.find_by dotcom: @dotcom, mode: 'public_api'\n @calls = api.calls.active.rest_get\n else\n @calls = @api&.calls || [] # ActiveRecord::Associations::CollectionProxy of ApiMethods\n end\n\n unless @call.nil?\n if (@call.rest_get?)\n @request = GetRequest.new(dotcom: @dotcom, api: @api, call: @call, extension: demo_extension, options: demo_options)\n @response = @request.send\n else\n @request = PostRequest.new(dotcom: @dotcom, api: @api, call: @call, extension: demo_extension, options: demo_options)\n @body = demo_body\n @response = @request.send(body: @body)\n end\n @error_msg = request_error_check @response\n end\n end", "def set_call_detail\n @call_detail = CallDetail.find(params[:id])\n end", "def get_query_batches(customer_po, \n count = 100000)\n\n # prepare query url\n _query_builder = Configuration.base_uri.dup\n _query_builder << '/rest/tag/queryBatches'\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\n 'customerPO' => customer_po,\n 'count' => count\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 = @http_client.get _query_url, headers: _headers\n BasicAuth.apply(_request)\n _context = execute_request(_request)\n\n # validate response against endpoint and global error codes\n if _context.response.status_code == 400\n raise APIException.new 'Unexpected error in API call. See HTTP response body for details.', _context\n elsif _context.response.status_code == 401\n raise APIException.new '', _context\n end\n validate_response(_context)\n\n # return appropriate response type\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\n return QueryBatchesResponseModel.from_hash(decoded)\n end", "def index\n @emergency_calls = EmergencyCall.all\n end", "def fetch_detail\n service_response = Economy::Transaction::FetchHistory.new(params).perform\n render_api_response(service_response)\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def index\n @reader_requests = BookRequest.get_holder_requests_by_account(@account).paginate(page: params[:page])\n end", "def inspect\n \"<Twilio.Insights.V1.CallSummariesInstance>\"\n end", "def pending_call\n pending_call_id = PendingCall.all.index{|pc| pc.pharmacy.id == self.id}\n if pending_call_id.nil?\n return nil\n else\n PendingCall.all[pending_call_id]\n end\nend", "def show\n @call_list_owner = CallListOwner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @call_list_owner }\n end\n end" ]
[ "0.6424597", "0.6114552", "0.60889083", "0.60889083", "0.60889083", "0.60889083", "0.5947036", "0.59110135", "0.58842075", "0.58420473", "0.57310975", "0.57124007", "0.57086104", "0.5704613", "0.56901115", "0.5628698", "0.5624566", "0.5603134", "0.5586479", "0.55590826", "0.55590564", "0.55558044", "0.5536768", "0.55210686", "0.5468485", "0.5465151", "0.5458102", "0.54543865", "0.54490274", "0.5431368", "0.54253495", "0.5420088", "0.54197663", "0.54132694", "0.5410859", "0.54023534", "0.5400152", "0.5380595", "0.5378468", "0.5375962", "0.5375962", "0.5373143", "0.5367838", "0.5357691", "0.53384906", "0.53310907", "0.5311604", "0.5310806", "0.53081095", "0.530251", "0.5298456", "0.52976936", "0.5294842", "0.5252767", "0.52469766", "0.52319086", "0.52244514", "0.52215", "0.5220458", "0.52184224", "0.52176523", "0.5208305", "0.5205863", "0.51904124", "0.51773846", "0.51718426", "0.51646596", "0.514223", "0.5133052", "0.5125196", "0.5112973", "0.51124054", "0.51072186", "0.5100568", "0.5095653", "0.5093534", "0.5086815", "0.5086815", "0.5086815", "0.5070307", "0.5066197", "0.50638837", "0.5060798", "0.506031", "0.50427353", "0.5033122", "0.50313395", "0.50239587", "0.50233305", "0.50135", "0.5012072", "0.5002635", "0.49962348", "0.49953634", "0.49904674", "0.49886397", "0.49886397", "0.49842384", "0.49810445", "0.49796826", "0.49770752" ]
0.0
-1
Provide a user friendly representation
def to_s '#<Twilio.Preview.TrustedComms.BrandedCallList>' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_display\n raise NotImplementedError\n end", "def to_s; description end", "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "def to_s\n super\n end", "def to_s\n super\n end", "def to_s\n \"#{@name}, \" \\\n \"#{model.upcase}: \" \\\n \"#{data.values.join(\"/\")}, \" \\\n \":#{@type}\"\n end", "def to_s\n\t\tsuper\n\tend", "def to_s\r\n \"<#{self.class.name} id: #{self[:id]}, description: #{self[:description]}, definition: #{self[:definition]}, has_inverse: #{self[:has_inverse]} accuracy: #{self[:accuracy]}\"\r\n end", "def render\n inspect\n end", "def to_s\n pieces = []\n pieces << self.class.name\n pieces << \"id:##{id.inspect}\"\n pieces << \"standardized:\" + (is_standard? ? 'standard' : (standard_id.nil? ? 'no' : \"copy-of-#{standard_id}\"))\n pieces << \"mission:#{mission_id.inspect}\"\n pieces.join(', ')\n end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def rendered_format; end", "def rendered_format; end", "def to_s\n render\n end", "def to_s\n return super\n end", "def display_string\n display = [self.name]\n display << self.description if self.description && self.type == 'StorageType'\n display << self.software if self.software && self.type == 'DatabaseType'\n cpu = self.cpu_values_string\n display << \"CPU: #{cpu}\" unless cpu.blank? || self.type == 'StorageType'\n display << \"RAM: #{self.memory} GB\" if self.memory && self.type != 'StorageType'\n hdd = self.hdd_values_string\n display << \"HDD: #{hdd}\" unless hdd.blank?\n display << self.operating_system if self.operating_system && self.type != 'StorageType'\n display.join(', ')\n end", "def to_s\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end", "def humanize\n # TODO\n # Inflector.humanize(self)\n end", "def to_s\n\t\tdescription\n\tend", "def to_s\n\t\tdescription\n\tend", "def to_s\n %(<#{ @name }#{attributes}>)\n end", "def to_s\n %w( name display_name uuid ).collect { |k| \"#{k}=#{ self.send(k) }\" }.join(' | ') + \" | types=#{ types.join(',') }\"\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n self.name.to_s || super\n end", "def to_s\n descr\n end", "def to_s\n self.name.humanize\n end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s ; format ; end", "def formatted_name\n \"#{self.id} - #{self.name}\"\n #This is used to bring value on each page.\n end", "def to_s\n\t\t\"#{self.name}\"\n\tend", "def to_s\n \n end", "def to_s\n self.name || super\n end", "def to_s\n self.name || super\n end", "def to_s\n return \"#{@name} - #{@description} : #{@rating}\"\n end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def to_s\n raise NotImplementedError\n end", "def short_inspect\n attrs = []\n attrs << [\"id\", id || \"new_record\"]\n\n string_attr = proc { |value| '\"' + TextHelpers.truncate(value, :length => 10) + '\"' }\n\n if respond_to?(:name) && name.present?\n attrs << [\"name\", string_attr[name]]\n elsif respond_to?(:title) && title.present?\n attrs << [\"title\", string_attr[title]]\n end\n\n \"#<#{ self.class } #{ attrs.map { |name, value| \"#{ name }: #{ value }\" }.join(\", \") }>\"\n end" ]
[ "0.70430577", "0.7025487", "0.7008232", "0.7007793", "0.69441473", "0.6917163", "0.68431", "0.6797009", "0.6655106", "0.66227216", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.660979", "0.660979", "0.6585346", "0.65730983", "0.65662885", "0.65404147", "0.65379703", "0.651875", "0.651875", "0.6516385", "0.6501134", "0.65010244", "0.65010244", "0.65010244", "0.65010244", "0.64861107", "0.6478101", "0.64581114", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6442197", "0.64329034", "0.64289695", "0.64203346", "0.6419349", "0.6419349", "0.6418417", "0.64115626", "0.64115626", "0.64115626", "0.64115626", "0.64115626", "0.64071685", "0.63947713" ]
0.0
-1
Build an instance of BrandedCallInstance
def get_instance(payload) BrandedCallInstance.new(@version, payload, ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(from: nil, to: nil, reason: nil, call_sid: :unset)\n data = Twilio::Values.of({'From' => from, 'To' => to, 'Reason' => reason, 'CallSid' => call_sid, })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n BrandedCallInstance.new(@version, payload, )\n end", "def inspect\n \"<Twilio.Preview.TrustedComms.BrandedCallInstance>\"\n end", "def create(call)\n validate_type!(call)\n\n attributes = sanitize(call)\n _, _, root = @client.post(\"/calls\", attributes)\n\n Call.new(root[:data])\n end", "def get_instance(payload)\n PhoneCallInstance.new(@version, payload, )\n end", "def get_instance(payload)\n CallInstance.new(@version, payload)\n end", "def to_s\n \"<Twilio.Preview.TrustedComms.BrandedCallInstance>\"\n end", "def by_call_id(call_id)\n raise StandardError, 'call_id cannot be null' if call_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"call%2Did\"] = call_id\n return MicrosoftGraph::Communications::Calls::Item::CallItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end", "def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, if_machine: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, url: :unset, application_sid: :unset)\n data = Twilio::Values.of({\n 'To' => to,\n 'From' => from,\n 'Url' => url,\n 'ApplicationSid' => application_sid,\n 'Method' => method,\n 'FallbackUrl' => fallback_url,\n 'FallbackMethod' => fallback_method,\n 'StatusCallback' => status_callback,\n 'StatusCallbackEvent' => status_callback_event,\n 'StatusCallbackMethod' => status_callback_method,\n 'SendDigits' => send_digits,\n 'IfMachine' => if_machine,\n 'Timeout' => timeout,\n 'Record' => record,\n 'RecordingChannels' => recording_channels,\n 'RecordingStatusCallback' => recording_status_callback,\n 'RecordingStatusCallbackMethod' => recording_status_callback_method,\n 'SipAuthUsername' => sip_auth_username,\n 'SipAuthPassword' => sip_auth_password,\n 'MachineDetection' => machine_detection,\n 'MachineDetectionTimeout' => machine_detection_timeout,\n })\n\n payload = @version.create(\n 'POST',\n @uri,\n data: data\n )\n\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end", "def build(*arguments, &block)\n build_class(*arguments, &block).new(*arguments, &block)\n end", "def get_instance(payload)\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid])\n end", "def get_instance(payload)\n CurrentCallInstance.new(@version, payload, )\n end", "def initialize(call, marshal, unmarshal, deadline, started: true,\n metadata_received: false, metadata_to_send: nil)\n fail(TypeError, '!Core::Call') unless call.is_a? Core::Call\n @call = call\n @deadline = deadline\n @marshal = marshal\n @unmarshal = unmarshal\n @metadata_received = metadata_received\n @metadata_sent = started\n @op_notifier = nil\n\n fail(ArgumentError, 'Already sent md') if started && metadata_to_send\n @metadata_to_send = metadata_to_send || {} unless started\n @send_initial_md_mutex = Mutex.new\n\n @output_stream_done = false\n @input_stream_done = false\n @call_finished = false\n @call_finished_mu = Mutex.new\n\n @client_call_executed = false\n @client_call_executed_mu = Mutex.new\n\n # set the peer now so that the accessor can still function\n # after the server closes the call\n @peer = call.peer\n end", "def get_instance(payload)\n CallInstance.new(@version, payload, account_sid: @solution[:account_sid],)\n end", "def make_call call, player = nil\n assert_call(call.class)\n # Calls must be distinct.\n raise InvalidCallError, \"#{call.inspect} is invalid\" unless self.valid_call?(call)\n\n self.calls << call\n if self.complete? and not self.passed_out?\n self.contract = Contract.new(self)\n end\n true\n end", "def initialize(call_number)\n @call_number = call_number\n end", "def by_call_record_id(call_record_id)\n raise StandardError, 'call_record_id cannot be null' if call_record_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"callRecord%2Did\"] = call_record_id\n return MicrosoftGraph::Communications::CallRecords::Item::CallRecordItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end", "def build_with(builder)\n case from = method_source\n when Parfait::CallableMethod\n callable = builder.load_object(from)\n when Parfait::CacheEntry\n callable = builder.load_object(from)[:cached_method].to_reg\n when Integer\n callable = builder.message[ \"arg#{from}\".to_sym ].to_reg\n else\n raise \"unknown source #{method_source.class}:#{method_source}\"\n end\n build_message_data(builder , callable)\n return builder.built\n end", "def initialize(call_id)\n raise ArgumentError(\"Cannot pass nil call_id\") if call_id.nil?\n @call_id = call_id\n end", "def place_call\n client = Twilio::REST::Client.new(Settings.twilio.account_sid, Settings.twilio.auth_token)\n params = {\n from: call.caller_id,\n to: call.member_phone_number,\n url: call_start_url(call),\n status_callback: member_call_event_url(call),\n status_callback_method: 'POST',\n status_callback_event: %w[initiated ringing answered completed]\n }\n client.calls.create params\n rescue Twilio::REST::RestError => e\n # 13223: Dial: Invalid phone number format\n # 13224: Dial: Invalid phone number\n # 13225: Dial: Forbidden phone number\n # 13226: Dial: Invalid country code\n # 21211: Invalid 'To' Phone Number\n # 21214: 'To' phone number cannot be reached\n call.action.destroy!\n call.update!(twilio_error_code: e.code, status: 'failed', action_id: nil)\n if (e.code >= 13_223 && e.code <= 13_226) || [21_211, 21_214].include?(e.code)\n add_error(:member_phone_number, I18n.t('call_tool.errors.phone_number.cant_connect'))\n else\n Rails.logger.error(\"Twilio Error: API responded with code #{e.code} for #{call.attributes.inspect}\")\n add_error(:base, I18n.t('call_tool.errors.unknown'))\n end\n end", "def initialize\n @_calls = []\n end", "def initialize b\n @build = b\n end", "def create\n @call = Call.new(params[:call])\n \n respond_to do |format|\n if @call.save\n \n result = OutgoingCallerId.find(:last)\n twcall = @twilio_client.account.calls.create(\n from: result.phone_number,\n to: @call.to, \n url: \"#{url_for(@call)}/twiml.xml\")\n \n @call.update_attribute :sid, twcall.sid\n format.html { redirect_to @call, notice: \"Call was successfully created.#{url_for(@call)}\" }\n format.json { render json: @call, status: :created, location: @call }\n else\n format.html { render action: \"new\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_instance(payload)\n CallSummaryInstance.new(@version, payload, call_sid: @solution[:call_sid])\n end", "def new\n @call_count = 0\n self\n end", "def get_or_create_call\n @call = Call.find_by(uid: params['CallSid'])\n @call = Call.create(\n uid: params['CallSid'],\n from: params['Caller'],\n ) if @call.nil?\n end", "def makecall\n \n client = Twilio::REST::Client.new(TWILIO_CONFIG['sid'], TWILIO_CONFIG['token'])\n @call = client.account.calls.create(\n :from => TWILIO_CONFIG['from'], # From your Twilio number\n :to => '+19493228496', # To any number\n # Fetch instructions from this URL when the call connects\n :url => 'http://snipit.herokuapp.com/voicein'\n )\n end", "def build(*args)\n @instance = @obj.send(PolyBelongsTo::Pbt::BuildCmd[@obj, @child], *args)\n self\n end", "def create\n @call = Call.new(call_params)\n \n # put your own credentials here \n \n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render :show, status: :created, location: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @call = Call.new(params[:call]) \n\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render json: @call, status: :created, location: @call }\n\n # Schedule call \n #IRON_CLIENT.schedules.create('CallTrigger', {id: @call.id}, {start_at: @call.time})\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "def prep_calls\n @calls = Set.new\n @targets.map do |target, specific_options|\n new_call = OutboundCall.new\n\n join_status = JoinStatus.new\n status.joins[new_call] = join_status\n\n new_call.on_end do |event|\n @latch.countdown! unless new_call[\"dial_countdown_#{@id}\"]\n if event.reason == :error\n status.error!\n join_status.errored!\n end\n end\n\n new_call.on_answer do |event|\n new_call.on_joined @call do |joined|\n join_status.started joined.timestamp.to_time\n end\n\n new_call.on_unjoined @call do |unjoined|\n join_status.ended unjoined.timestamp.to_time\n unless @splitting\n new_call[\"dial_countdown_#{@id}\"] = true\n @latch.countdown!\n end\n end\n\n if @confirmation_controller\n status.unconfirmed!\n join_status.unconfirmed!\n condition = Celluloid::Condition.new\n new_call.execute_controller @confirmation_controller.new(new_call, @confirmation_metadata), lambda { |call| condition.broadcast }\n condition.wait\n end\n\n if new_call.active? && status.result != :answer\n logger.info \"#dial joining call #{new_call.id} to #{@call.id}\"\n pre_join_tasks new_call\n @call.answer\n new_call.join @join_target, @join_options\n unless @join_target == @call\n @call.join @join_target, @join_options\n end\n status.answer!\n elsif status.result == :answer\n join_status.lost_confirmation!\n end\n end\n\n @call_targets[new_call] = [target, specific_options]\n\n yield new_call if block_given?\n\n @calls << new_call\n end\n\n status.calls = @calls\n end", "def build\n klass = create_class(@class_name, @options)\n klass.new\n end", "def create\n @call = Call.new(call_params)\n\n respond_to do |format|\n if @call.save\n record_call_activity\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render :show, status: :created, location: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "def bridged_calls bridge_id\n LazyArray.new do |page, size|\n calls, _headers = get \"bridges/#{bridge_id}/calls\", page: page, size: size\n\n calls.map do |call|\n Types::BridgedCall.new call\n end\n end\n end", "def make_call(to, path, call_back_path)\n from = '+18015131966'\n req_params = {\n from: from,\n to: to,\n url: \"#{ENV['CALL_SERVICE_URL']}#{path}\",\n if_machine: \"Hangup\",\n status_callback: \"#{ENV['CALL_SERVICE_URL']}#{call_back_path}\",\n timeout: 10\n\n }\n\n if Rails.env == \"development\"\n url = \"http://127.0.0.1:4567/make_call\"\n RestClient.post url, req_params\n else\n client = Twilio::REST::Client.new(ENV[\"TWILIO_SID\"], ENV[\"TWILIO_TOKEN\"])\n account = client.account\n call = account.calls.create(req_params)\n end\n end", "def build(method, *args, &block)\n job = rocket_job_class.new(\n klass: name,\n perform_method: method.to_sym,\n arguments: args\n )\n @rocket_job_defaults.call(job) if @rocket_job_defaults\n block.call(job) if block\n job\n end", "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.CallInstance #{values}>\"\n end", "def create\n @call = Call.new(call_params)\n @call.client = ClientPhone.find_by(phone: @call.phone).try(:client)\n @call.internal = Internal.find(params[:call][:internal_id])\n @call.call_type = CallType.find(params[:call][:call_type_id])\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to @call, notice: 'Call was successfully created.' }\n format.json { render status: :ok, json: @call }\n else\n format.html { render :new }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "def build_call_list\n if session[:called_day].blank?\n # if !session[:called_day] || session[:called_day == '']\n session[:called_day] = 'SUNDAY'\n session[:called_window] = 'ALL'\n end\n rep_array = []\n if @manager\n if session[:called_rep] == 'ALL'\n # load all reps in @reps\n @reps.each do |r|\n if r[0] != 'ALL'\n rep_array.push(r[0])\n end\n end\n else\n rep_array.push(session[:called_rep])\n end\n else\n rep_array.push(@user)\n end\n @call_lists = []\n cls = CallList.all\n cls.each do |c|\n override = OverrideCallList.find_by(custcode: c.custcode)\n today = Date.today\n if override && override.override_end >= today && override.override_start <= today\n # check if the override for this customer is active\n c.custcode = override.custcode\n c.custname = override.custname\n c.contact_method = override.contact_method\n c.contact = override.contact\n c.phone = override.phone\n c.email = override.email\n c.selling = override.selling\n c.main_phone = override.main_phone\n c.website = override.website\n c.rep = override.rep\n end\n c.call_days.each do |d|\n # see if there are call day records for the current selections and user\n if ((d.callday == session[:called_day] && d.callback.blank?) || d.callback == session[:called_day]) && (d.window == session[:called_window] || session[:called_window] == 'ALL') && (rep_array.include?(c.rep) || rep_array.include?(d.isr))\n @call_lists.push(c)\n break\n end\n end\n end\n\n day = ['SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY']\n @day = []\n i = 1\n @selected_day = 0\n day.each do |d|\n select_item = []\n select_item.push(d)\n select_item.push(i)\n @day.push(select_item)\n if d == session[:called_day]\n @selected_day = i\n end\n i += 1\n end\n session[:calllist_days] = @day\n\n window = ['ALL', '10am - noon', 'noon - 2pm', '2pm - 4pm', '4pm - 6pm']\n @window = []\n i = 1\n @selected_window = 0\n window.each do |d|\n select_item = []\n select_item.push(d)\n select_item.push(i)\n @window.push(select_item)\n if d == session[:called_window]\n @selected_window = i\n end\n i += 1\n end\n session[:calllist_windows] = @window\n tempisr = []\n isrlist = IsrList.all\n isrlist.each do |c|\n if c.name && !tempisr.include?(c.name)\n tempisr.push(c.name)\n end\n end\n @isr_list = tempisr.sort\n @isr_user = false\n if @isr_list.include?(@user)\n @isr_user = true\n end\n end", "def call(env)\n builder.call(env)\n end", "def call(args = {})\n new.call(args)\n end", "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.CallInstance #{values}>\"\n end", "def build(&block)\n instance_eval(&block)\n end", "def create_instance 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_create_instance_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def create\n call = params[:call]\n call[:vote] = parse_vote(call[:vote])\n @call = Call.new(call)\n \n respond_to do |format|\n if @call.save\n format.html { redirect_to(@call, :notice => 'Call was successfully created.') }\n format.xml { render :xml => @call, :status => :created, :location => @call }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @call.errors, :status => :unprocessable_entity }\n end\n end\n end", "def get_instance(payload)\n CallSummariesInstance.new(@version, payload, )\n end", "def from(receiver)\n Calls.new(select { |call| call.receiver == receiver })\n end", "def create\n @call = Call.new(call_params)\n\n respond_to do |format|\n if @call.save\n format.html { redirect_to :back, notice: 'Call was successfully created.' }\n format.json { render action: 'show', status: :created, location: @call }\n else\n format.html { render action: 'new' }\n format.json { render json: @call.errors, status: :unprocessable_entity }\n end\n end\n end", "def build\n builder_values = builder.build\n self.use_values(builder_values)\n end", "def incorporate\r\n Builder.new(self)\r\n end", "def to_s\n '#<Twilio.Preview.TrustedComms.BrandedCallList>'\n end", "def build(builder_mode = BuilderMode::COMMAND)\n grpcurl = \"grpcurl \"\n # Tags\n grpcurl = add_import_path(grpcurl, builder_mode)\n grpcurl = add_service_proto_path(grpcurl)\n grpcurl = add_headers(grpcurl)\n grpcurl = add_plaintext(grpcurl)\n grpcurl = add_verbose(grpcurl, builder_mode)\n grpcurl = add_max_message_size(grpcurl)\n grpcurl = add_max_time(grpcurl)\n grpcurl = add_connect_timeout(grpcurl)\n grpcurl = add_data(grpcurl)\n # Address\n grpcurl = add_server_address(grpcurl)\n # Symbol (service call)\n grpcurl = add_service_name(grpcurl)\n grpcurl = add_method_name(grpcurl)\n grpcurl\n end", "def builder\n TransactionState.get.transaction_sample_builder\n end", "def build\n Docile.dsl_eval(webmock_stub, &callback) if callback.present?\n webmock_stub\n end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.CallInstance #{values}>\"\n end", "def build\n WebhooksHelper.new(@marshaller, @secret_key_store)\n end", "def api_rb(call)\n <<-EOS\n#{call[:id]} = http_#{call[:method]}(\n \"#{call[:endpoint]}\",\n #{field_param(call[:params])}\n)\nEOS\n end", "def create_build 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_create_build_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def build!\n end", "def run\r\n\t\t\[email protected]\r\n\t\tend", "def new\n @bond = Bond.new\n end", "def build opts = nil, &blk\n builder.build opts, &blk\n end", "def place_calls\n @calls.each do |call|\n target, specific_options = @call_targets[call]\n local_options = @options.dup.deep_merge specific_options if specific_options\n call.dial target, (local_options || @options)\n end\n end", "def builder; end", "def builder; end", "def builder; end", "def create_call(account_id,\r\n body: nil)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/calls'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => { 'value' => account_id, 'encode' => true }\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: body.to_json\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n if _response.status_code == 400\r\n raise ApiErrorResponseException.new(\r\n 'Something\\'s not quite right... Your request is invalid. Please' \\\r\n ' fix it before trying again.',\r\n _response\r\n )\r\n elsif _response.status_code == 401\r\n raise APIException.new(\r\n 'Your credentials are invalid. Please use your Bandwidth dashboard' \\\r\n ' credentials to authenticate to the API.',\r\n _response\r\n )\r\n elsif _response.status_code == 403\r\n raise ApiErrorResponseException.new(\r\n 'User unauthorized to perform this action.',\r\n _response\r\n )\r\n elsif _response.status_code == 404\r\n raise ApiErrorResponseException.new(\r\n 'The resource specified cannot be found or does not belong to you.',\r\n _response\r\n )\r\n elsif _response.status_code == 415\r\n raise ApiErrorResponseException.new(\r\n 'We don\\'t support that media type. If a request body is required,' \\\r\n ' please send it to us as `application/json`.',\r\n _response\r\n )\r\n elsif _response.status_code == 429\r\n raise ApiErrorResponseException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n elsif _response.status_code == 500\r\n raise ApiErrorResponseException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response, data: ApiCallResponse.from_hash(decoded)\r\n )\r\n end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.CallInstance #{values}>\"\n end", "def create_call(account_id,\r\n body: nil)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/calls'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => account_id\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: body.to_json\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n if _response.status_code == 400\r\n raise ErrorResponseException.new(\r\n 'Something didn\\'t look right about that request. Please fix it' \\\r\n ' before trying again.',\r\n _response\r\n )\r\n elsif _response.status_code == 401\r\n raise APIException.new(\r\n 'Please authenticate yourself',\r\n _response\r\n )\r\n elsif _response.status_code == 403\r\n raise ErrorResponseException.new(\r\n 'Your credentials are invalid. Please use your API credentials for' \\\r\n ' the Bandwidth Dashboard.',\r\n _response\r\n )\r\n elsif _response.status_code == 415\r\n raise ErrorResponseException.new(\r\n 'We don\\'t support that media type. Please send us' \\\r\n ' `application/json`.',\r\n _response\r\n )\r\n elsif _response.status_code == 429\r\n raise ErrorResponseException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n elsif _response.status_code == 500\r\n raise ErrorResponseException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(_response, data: ApiCallResponse.from_hash(decoded))\r\n end", "def new(&block)\n Builder.new(&block).to_client\n end", "def build_twilio_wrapper\n @twilio_wrapper = ::VoiceExtension::TwilioVoiceWrapper::Voice.new\n end", "def build\n deferred_defaults\n validate\n Builder.new(self).build\n end", "def create_call_hash exp\n target = get_target exp.target\n\n if call? target or node_type? target, :dxstr # need to index `` even if target of a call\n already_in_target = @in_target\n @in_target = true\n process target\n @in_target = already_in_target\n\n target = get_target(target, :include_calls)\n end\n\n method = exp.method\n\n call_hash = {\n :target => target,\n :method => method,\n :call => exp,\n :nested => @in_target,\n :chain => get_chain(exp),\n :location => make_location,\n :parent => @current_call\n }\n\n old_parent = @current_call\n @current_call = call_hash\n\n process_call_args exp\n\n @current_call = old_parent\n\n call_hash\n end", "def build(locals={}, &block)\n set_locals(locals, block)\n @locals[:message][:version] = Ebay::Api.schema_version\n @locals.message_tag camelcase(@name.to_s =~ /_request$/ ? @name : \"#{@name}_request\")\n Savon::Builder.new(@name, @wsdl, @globals, @locals)\n end", "def make_call(call_count, to_number, from_number)\n call_count.times do \n Adhearsion::OutboundCall.originate(\"SIP/#{to_number}@SIPSERVICEHERE\", :from => \"#{from_number}\", :controller => FooController)\n end\n end", "def construct_builder!\n @builder = Brainstem::ApiDocs::Builder.new(builder_options)\n end", "def get_current_call callclass\n assert_call(callclass)\n \n self.calls.reverse.each do |call|\n if call.is_a?(callclass)\n return call\n elsif call.is_a?(Bid)\n break # Bids cancel all preceding calls.\n end\n end\n nil\n end", "def create\n @caller = Caller.new\n @pushed = Pushed.new(:caller => @caller)\n @user = User.find(params[:call][:caller])\n params[:call].delete(:caller)\n @user.caller = @caller\n \n @call = Call.new(params[:call])\n @caller.call = @call\n @caller.save\n @user.save\n @pushed.save\n respond_to do |format|\n if @call.save\n format.html { redirect_to(@call, :notice => 'Call was successfully created.') }\n format.xml { render :xml => @call, :status => :created, :location => @call }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @call.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @bill = Bill.find(params[:bill_id])\n @billed_call = @bill.billed_calls.new(params[:billed_call])\n\n respond_to do |format|\n if @billed_call.save\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { render :xml => @billed_call, :status => :created, :location => @billed_call }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @billed_call.errors, :status => :unprocessable_entity }\n end\n end\n end", "def build_new(*args)\n self.class.new(*args)\n end", "def build(**)\n raise NotImplementedError\n end", "def build_contact(contact = {})\n case contact\n when Contact then contact.gateway = self\n when Hash then contact = Contact.new(contact.merge({:gateway => self}))\n end\n contact\n end", "def build_message_data( builder , callable)\n builder.message[:next_message][:method] << callable\n end", "def build(&block)\n # provide access to 'this' in configuration block\n self.instance_exec(&block)\n end", "def call() end", "def new\n @bill = Bill.find(params[:bill_id])\n @billed_call = @bill.billed_calls.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @billed_call }\n end\n end", "def activity_object_builder\n build_activity_object\n end", "def call\n end", "def initialize(build)\n @build = build\n @hash = {}\n @already_run = []\n end", "def builder\n @builder ||= Builder.new(self)\n end", "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/devtools/build/v1/publish_build_event_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 == Client.configure.endpoint &&\n [email protected](\".\").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 @publish_build_event_stub = ::Gapic::ServiceStub.new(\n ::Google::Devtools::Build::V1::PublishBuildEvent::Stub,\n credentials: credentials,\n endpoint: @config.endpoint,\n channel_args: @config.channel_args,\n interceptors: @config.interceptors\n )\n end", "def call!(*args)\n new(*args).call!\n end", "def inspect\n \"<Twilio.Preview.TrustedComms.PhoneCallInstance>\"\n end", "def build_request\n b = builder\n build_authentication(b)\n b.instruct!\n \n b.TrackRequest do\n b.Request do\n b.RequestAction \"Track\"\n b.RequestOption \"activity\"\n end\n \n b.TrackingNumber tracking_number\n end\n end", "def build\r\n raise \"Not implemented\"\r\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def set_call\n @call = Call.find(params[:id])\n end", "def build\n end", "def start_builder(time=nil)\n if !enabled? || !NewRelic::Agent.is_transaction_traced? || !NewRelic::Agent.is_execution_traced?\n clear_builder\n else\n TransactionState.get.transaction_sample_builder ||= TransactionSampleBuilder.new(time)\n end\n end", "def initialize\n @call_sign = \"Dreadnought\"\n end", "def initialize ( _caller, *list )\n super\n end" ]
[ "0.63680667", "0.6322264", "0.62932366", "0.6178401", "0.59782547", "0.59414494", "0.59082586", "0.58589464", "0.5767151", "0.57323474", "0.56939757", "0.56818175", "0.56554455", "0.5654454", "0.5649689", "0.5603783", "0.5573472", "0.5534251", "0.5508815", "0.5501636", "0.54725355", "0.54661727", "0.5430898", "0.5426463", "0.5422665", "0.53445125", "0.532526", "0.5320732", "0.53053147", "0.52820224", "0.5263092", "0.523889", "0.52324146", "0.52005273", "0.51873076", "0.51735985", "0.5153046", "0.5128916", "0.5125447", "0.51114726", "0.5107531", "0.51032543", "0.50991267", "0.5098174", "0.5085596", "0.5085187", "0.50844884", "0.5030804", "0.5022863", "0.5019588", "0.50157917", "0.50107497", "0.4992754", "0.49798998", "0.49765027", "0.49695626", "0.49658975", "0.4960124", "0.49575794", "0.49515393", "0.49477914", "0.49443883", "0.4934558", "0.4934558", "0.4934558", "0.49244723", "0.49012846", "0.48957777", "0.48932958", "0.48907742", "0.4890497", "0.48831698", "0.487949", "0.4878931", "0.48670352", "0.48622584", "0.48452744", "0.48449472", "0.484352", "0.48428857", "0.4834971", "0.48303258", "0.48134106", "0.48090395", "0.480532", "0.47966635", "0.4795686", "0.4792893", "0.47889125", "0.47784618", "0.47663465", "0.47582838", "0.47556895", "0.47549066", "0.47505233", "0.47505233", "0.47400615", "0.47393712", "0.47344688", "0.4728998" ]
0.76183873
0
Provide a user friendly representation
def to_s '<Twilio.Preview.TrustedComms.BrandedCallPage>' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_display\n raise NotImplementedError\n end", "def to_s; description end", "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "def to_s\n super\n end", "def to_s\n super\n end", "def to_s\n \"#{@name}, \" \\\n \"#{model.upcase}: \" \\\n \"#{data.values.join(\"/\")}, \" \\\n \":#{@type}\"\n end", "def to_s\n\t\tsuper\n\tend", "def to_s\r\n \"<#{self.class.name} id: #{self[:id]}, description: #{self[:description]}, definition: #{self[:definition]}, has_inverse: #{self[:has_inverse]} accuracy: #{self[:accuracy]}\"\r\n end", "def render\n inspect\n end", "def to_s\n pieces = []\n pieces << self.class.name\n pieces << \"id:##{id.inspect}\"\n pieces << \"standardized:\" + (is_standard? ? 'standard' : (standard_id.nil? ? 'no' : \"copy-of-#{standard_id}\"))\n pieces << \"mission:#{mission_id.inspect}\"\n pieces.join(', ')\n end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def rendered_format; end", "def rendered_format; end", "def to_s\n render\n end", "def to_s\n return super\n end", "def display_string\n display = [self.name]\n display << self.description if self.description && self.type == 'StorageType'\n display << self.software if self.software && self.type == 'DatabaseType'\n cpu = self.cpu_values_string\n display << \"CPU: #{cpu}\" unless cpu.blank? || self.type == 'StorageType'\n display << \"RAM: #{self.memory} GB\" if self.memory && self.type != 'StorageType'\n hdd = self.hdd_values_string\n display << \"HDD: #{hdd}\" unless hdd.blank?\n display << self.operating_system if self.operating_system && self.type != 'StorageType'\n display.join(', ')\n end", "def to_s\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end", "def humanize\n # TODO\n # Inflector.humanize(self)\n end", "def to_s\n\t\tdescription\n\tend", "def to_s\n\t\tdescription\n\tend", "def to_s\n %(<#{ @name }#{attributes}>)\n end", "def to_s\n %w( name display_name uuid ).collect { |k| \"#{k}=#{ self.send(k) }\" }.join(' | ') + \" | types=#{ types.join(',') }\"\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n self.name.to_s || super\n end", "def to_s\n descr\n end", "def to_s\n self.name.humanize\n end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s ; format ; end", "def formatted_name\n \"#{self.id} - #{self.name}\"\n #This is used to bring value on each page.\n end", "def to_s\n\t\t\"#{self.name}\"\n\tend", "def to_s\n \n end", "def to_s\n self.name || super\n end", "def to_s\n self.name || super\n end", "def to_s\n return \"#{@name} - #{@description} : #{@rating}\"\n end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def to_s\n raise NotImplementedError\n end", "def short_inspect\n attrs = []\n attrs << [\"id\", id || \"new_record\"]\n\n string_attr = proc { |value| '\"' + TextHelpers.truncate(value, :length => 10) + '\"' }\n\n if respond_to?(:name) && name.present?\n attrs << [\"name\", string_attr[name]]\n elsif respond_to?(:title) && title.present?\n attrs << [\"title\", string_attr[title]]\n end\n\n \"#<#{ self.class } #{ attrs.map { |name, value| \"#{ name }: #{ value }\" }.join(\", \") }>\"\n end" ]
[ "0.70430577", "0.7025487", "0.7008232", "0.7007793", "0.69441473", "0.6917163", "0.68431", "0.6797009", "0.6655106", "0.66227216", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.660979", "0.660979", "0.6585346", "0.65730983", "0.65662885", "0.65404147", "0.65379703", "0.651875", "0.651875", "0.6516385", "0.6501134", "0.65010244", "0.65010244", "0.65010244", "0.65010244", "0.64861107", "0.6478101", "0.64581114", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6442197", "0.64329034", "0.64289695", "0.64203346", "0.6419349", "0.6419349", "0.6418417", "0.64115626", "0.64115626", "0.64115626", "0.64115626", "0.64115626", "0.64071685", "0.63947713" ]
0.0
-1
Provide a user friendly representation
def to_s "<Twilio.Preview.TrustedComms.BrandedCallInstance>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_display\n raise NotImplementedError\n end", "def to_s; description end", "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "def to_s\n super\n end", "def to_s\n super\n end", "def to_s\n \"#{@name}, \" \\\n \"#{model.upcase}: \" \\\n \"#{data.values.join(\"/\")}, \" \\\n \":#{@type}\"\n end", "def to_s\n\t\tsuper\n\tend", "def to_s\r\n \"<#{self.class.name} id: #{self[:id]}, description: #{self[:description]}, definition: #{self[:definition]}, has_inverse: #{self[:has_inverse]} accuracy: #{self[:accuracy]}\"\r\n end", "def render\n inspect\n end", "def to_s\n pieces = []\n pieces << self.class.name\n pieces << \"id:##{id.inspect}\"\n pieces << \"standardized:\" + (is_standard? ? 'standard' : (standard_id.nil? ? 'no' : \"copy-of-#{standard_id}\"))\n pieces << \"mission:#{mission_id.inspect}\"\n pieces.join(', ')\n end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def rendered_format; end", "def rendered_format; end", "def to_s\n render\n end", "def to_s\n return super\n end", "def display_string\n display = [self.name]\n display << self.description if self.description && self.type == 'StorageType'\n display << self.software if self.software && self.type == 'DatabaseType'\n cpu = self.cpu_values_string\n display << \"CPU: #{cpu}\" unless cpu.blank? || self.type == 'StorageType'\n display << \"RAM: #{self.memory} GB\" if self.memory && self.type != 'StorageType'\n hdd = self.hdd_values_string\n display << \"HDD: #{hdd}\" unless hdd.blank?\n display << self.operating_system if self.operating_system && self.type != 'StorageType'\n display.join(', ')\n end", "def to_s\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end", "def humanize\n # TODO\n # Inflector.humanize(self)\n end", "def to_s\n\t\tdescription\n\tend", "def to_s\n\t\tdescription\n\tend", "def to_s\n %(<#{ @name }#{attributes}>)\n end", "def to_s\n %w( name display_name uuid ).collect { |k| \"#{k}=#{ self.send(k) }\" }.join(' | ') + \" | types=#{ types.join(',') }\"\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n self.name.to_s || super\n end", "def to_s\n descr\n end", "def to_s\n self.name.humanize\n end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s ; format ; end", "def formatted_name\n \"#{self.id} - #{self.name}\"\n #This is used to bring value on each page.\n end", "def to_s\n\t\t\"#{self.name}\"\n\tend", "def to_s\n \n end", "def to_s\n self.name || super\n end", "def to_s\n self.name || super\n end", "def to_s\n return \"#{@name} - #{@description} : #{@rating}\"\n end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def to_s\n raise NotImplementedError\n end", "def short_inspect\n attrs = []\n attrs << [\"id\", id || \"new_record\"]\n\n string_attr = proc { |value| '\"' + TextHelpers.truncate(value, :length => 10) + '\"' }\n\n if respond_to?(:name) && name.present?\n attrs << [\"name\", string_attr[name]]\n elsif respond_to?(:title) && title.present?\n attrs << [\"title\", string_attr[title]]\n end\n\n \"#<#{ self.class } #{ attrs.map { |name, value| \"#{ name }: #{ value }\" }.join(\", \") }>\"\n end" ]
[ "0.70430577", "0.7025487", "0.7008232", "0.7007793", "0.69441473", "0.6917163", "0.68431", "0.6797009", "0.6655106", "0.66227216", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.6618043", "0.660979", "0.660979", "0.6585346", "0.65730983", "0.65662885", "0.65404147", "0.65379703", "0.651875", "0.651875", "0.6516385", "0.6501134", "0.65010244", "0.65010244", "0.65010244", "0.65010244", "0.64861107", "0.6478101", "0.64581114", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6448988", "0.6442197", "0.64329034", "0.64289695", "0.64203346", "0.6419349", "0.6419349", "0.6418417", "0.64115626", "0.64115626", "0.64115626", "0.64115626", "0.64115626", "0.64071685", "0.63947713" ]
0.0
-1
Provide a detailed, user friendly representation
def inspect "<Twilio.Preview.TrustedComms.BrandedCallInstance>" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def details; end", "def to_s; description end", "def get_detail\n return self.inspect\n end", "def to_display\n raise NotImplementedError\n end", "def formatted_info\n \"#{self.name} - #{self.description}\"\n end", "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "def inspect\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end", "def short_inspect\n attrs = []\n attrs << [\"id\", id || \"new_record\"]\n\n string_attr = proc { |value| '\"' + TextHelpers.truncate(value, :length => 10) + '\"' }\n\n if respond_to?(:name) && name.present?\n attrs << [\"name\", string_attr[name]]\n elsif respond_to?(:title) && title.present?\n attrs << [\"title\", string_attr[title]]\n end\n\n \"#<#{ self.class } #{ attrs.map { |name, value| \"#{ name }: #{ value }\" }.join(\", \") }>\"\n end", "def render\n inspect\n end", "def overview\n\n end", "def record_display\n string = \"#{id}. Title: #{title}\\n Author: #{author}\\n ISBN: #{isbn}\\n\"\n if library.nil?\n string += \" Library: None\\n\"\n else\n string += \" Library: #{library.branch_name}\\n\"\n end\n if patron.nil?\n string += \" Checked Out: Available\"\n else\n string += \" Checked Out: #{patron.name}\"\n end\n string\n end", "def render_plain\n short_category(object.action) << \"\\n\" << instance_attributes\n end", "def details\n\n return @description + \": \" + \"#{@infection}\" + \". \" + @patient.details\n\n end", "def to_s\n 'Id: ' + @id.to_s +\n ', Expires on: ' + display_expiry_date +\n ', Level: ' + map_number_to_word_level(@level) +\n ', Number of days left to expire: ' + display_num_of_days_left +\n ', Description: ' + @description % self\n end", "def description; end", "def description; end", "def description; end", "def description; end", "def description; end", "def description; end", "def description; end", "def description; end", "def description; end", "def description; end", "def display_string\n display = [self.name]\n display << self.description if self.description && self.type == 'StorageType'\n display << self.software if self.software && self.type == 'DatabaseType'\n cpu = self.cpu_values_string\n display << \"CPU: #{cpu}\" unless cpu.blank? || self.type == 'StorageType'\n display << \"RAM: #{self.memory} GB\" if self.memory && self.type != 'StorageType'\n hdd = self.hdd_values_string\n display << \"HDD: #{hdd}\" unless hdd.blank?\n display << self.operating_system if self.operating_system && self.type != 'StorageType'\n display.join(', ')\n end", "def to_s\r\n \"<#{self.class.name} id: #{self[:id]}, description: #{self[:description]}, definition: #{self[:definition]}, has_inverse: #{self[:has_inverse]} accuracy: #{self[:accuracy]}\"\r\n end", "def full_description\n \"#{self.class.description} #{self.description}\"\n end", "def to_s\n descr\n end", "def details\r\n return @description + \"; \" + @vPatients + \"; \" + @vProfiles + \": \" + @vAppointments\r\n end", "def display\n to_h.fetch(:display)\n end", "def display\n to_h.fetch(:display)\n end", "def inspect_details\n\t\treturn \"ID=%s (%s)\" % [\n\t\t\tself.id,\n\t\t\tself.components.keys.map( &:name ).sort.join( '+' )\n\t\t]\n\tend", "def to_s\n\t\tres = \"\\nname: \" + name.to_s + \"\\nid: \" + id.to_s + \"\\nservice: \" + service.to_s + \"\\ntitle: \" + title.to_s + \"\\nthumbnail: \" + thumbnail.to_s + \"\\nhref: \" + href.to_s\n\t\tres\n\tend", "def details\n\t\t\"#{name}---#{status}-----#{start_date}----#{description}---- #{Client.find(client_id).name}---#{Client.find(client_id).email}\"\n\tend", "def show\n @title = @user.complete_name\n @description = \"Informations relatives à #{@user.complete_name}\"\n @jsonld = @user.to_jsonld\n end", "def details\n end", "def to_s\n \"#{represent_status} : #{description}\"\n end", "def details\n format_description(@description) + \"site name: \" + format_name\n end", "def to_s\n\t\tdescription\n\tend", "def to_s\n\t\tdescription\n\tend", "def to_s_details\n ''\n end", "def details\n\n end", "def descriptions\n return @detail + \"; \" + @firm + \"; \" + @age + \": \" + \"#{@cost}\"\n end", "def show\n\t\t@attrib_keys = [\"desc\", \"higher_level\", \"range\", \"components\", \"material\", \"ritual\", \"duration\", \"concentration\", \"casting_time\", \"level\", \"school\", \"class_names\", \"archetype\", \"domains\", \"oaths\", \"circles\", \"patrons\"]\n\tend", "def to_s\n \"#{@name}, \" \\\n \"#{model.upcase}: \" \\\n \"#{data.values.join(\"/\")}, \" \\\n \":#{@type}\"\n end", "def inspect_details\n ''\n end", "def inspect\n \"#<#{self.class} ##{id} #{name} (#{slug})>\"\n end", "def display_quick\r\n s = ''\r\n for i in @me.keys\r\n s << \" <b>#{i}.</b><br/>\" # country\r\n for j in @me[i].keys\r\n s << \"&nbsp;<b>#{j}:</b><br/>\" if not j == 'unknown' # state\r\n for k in @me[i][j].keys\r\n s << \"&nbsp;&nbsp;#{k}<br/>\" if not k == 'unknown' # county\r\n for l in @me[i][j][k].keys\r\n s << (\"&nbsp;&nbsp;\" + (l == 'unknown' ? \"<i>repository not given</i>\" : \"&nbsp;&nbsp;#{l}\") + \"<br/>\") if not l == nil # repository\r\n s << \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\" + @me[i][j][k][l].keys.collect{|m| \r\n (\"#{@me[i][j][k][l][m]} \" +\r\n case m # the count\r\n when 'female'\r\n \"&#9792;\"\r\n when 'male'\r\n \"&#9794\"\r\n when 'gynadropmorph'\r\n \"[&#9792;&#9794;]\"\r\n else\r\n \"unknown sex\"\r\n end)}.join(\",\") \r\n s << \"<br/>\" \r\n end\r\n end\r\n end\r\n end\r\n s.html_safe\r\n end", "def details\n return @description + \"; \" + @firm + \"; \" + @age + \": \" + \"#{@cost}\"\n end", "def to_s\n super\n end", "def to_s\n pieces = []\n pieces << self.class.name\n pieces << \"id:##{id.inspect}\"\n pieces << \"standardized:\" + (is_standard? ? 'standard' : (standard_id.nil? ? 'no' : \"copy-of-#{standard_id}\"))\n pieces << \"mission:#{mission_id.inspect}\"\n pieces.join(', ')\n end", "def rendered_format; end", "def rendered_format; end", "def to_s\n\t\t\tstr = super() + \"\\n\"\n\t\t\tstr += \"\\tAppaleable? #{appaleable}\\n\" if appaleable\n\t\t\tstr += \"\\tDisapproved text: #{disapproved_text}\\n\" if disapproved_text\n\t\t\tstr += \"\\tLocation: #{location}\\n\" if location\n\t\t\tstr += \"\\tDisapproved text: #{disapproved_text}\\n\" if disapproved_text\n\t\t\tstr += \"\\tReason code: #{reason_code} (see: http://msdn.microsoft.com/en-US/library/bing-ads-editorialfailurereasoncodes.aspx)\\n\" if reason_code\n\n\t\tend", "def display_data\n\t\t\t\"#{@model} #{@color} #{@horsepower} #{@year} #{@brand} #{@mpg}\"\n\t\tend", "def to_s\n \"\\n\\tTitle: #{@title}\\n\n \\tAuthor: #{@author}\\n\n \\tUrl: #{@url}\\n\\n\"\n end", "def inspect\n to_s.inspect\n end", "def details\n data()\n end", "def details\n\n return @description + \"; \" + @firstname + \"; \" + @lastname + \": \" + @dob + \": \"+ @address + \": \"+ @phone + \": \" + \"#{@infection}\"\n\n end", "def inspect\n to_s\n end", "def inspect\n to_s\n end", "def show\n raise NotImplementedError\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def inspect\n\t\tparts = []\n\t\tparts << self.one_of_description\n\t\tparts << self.all_of_description\n\t\tparts << self.none_of_description\n\t\tparts.compact!\n\n\t\tstr = \"#<%p:%#0x matching entities\" % [ self.class, self.object_id * 2 ]\n\t\tif parts.empty?\n\t\t\tstr << \" with any components\"\n\t\telse\n\t\t\tstr << parts.join( ', ' )\n\t\tend\n\t\tstr << \">\"\n\n\t\treturn str\n\tend", "def inspect\n to_s\n end", "def description\n return summary\n end", "def details\n return @description + \"; \" + @doctorname + \"; \" + @medicine + \": \" + \"#{@cost}\"\n end", "def details\n return \"ID = #{@id}\\n\" + \n \"Name = #{@name}\\n\" + \n \"Topic = #{@topic}\\n\" + \n \"Member Count = #{@member_count}\"\n end", "def description\n name + ': ' + resource_type.to_s + ' | Sueldo: ' + salary.to_s +\n ' | Experiencia: ' + experience.to_s + ' años'\n end", "def show\n\t\traise NotImplementedError, \"FIXME: Implement showing comments.\"\n\tend", "def to_s\n return \"#{@name} - #{@description} : #{@rating}\"\n end", "def inspect\n \"#{self.class}<#{@description.inspect}>\"\n end", "def description\n end", "def description\n end", "def details\n return \" #{@description}, #{@lastname}, #{@date}. #{@start}, #{@hours}, #{@players}, #{@zone}. #{@cost}\"\n end", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def details\n return @description + \"; \" + @manufacturer + \"; \" + @color + \": \" + \"#{@cost}\"\n end", "def to_s\n \"#{self.title} - #{self.author} - #{self.date}\"\n end", "def details\r\n return @description + \": \" + \". \" + @basic_profile.details\r\n end", "def show\n #not needed for our implementation\n end", "def to_s\n super\n end", "def modeler_description\n return 'Gather orientation and story specific construction, fenestration (including overhang) specific information'\n end", "def details_partial_for(o)\n \"#{o.class.name.underscore}s/details\"\n end", "def display\n puts \"Personal Details\"\n puts \" Name : #{self.name}\"\n puts \" Date of Birth : #{self.dob}\"\n puts \" Marital Status : #{self.marital_status}\"\n puts \" Mobile Number : #{self.mobile_number}\"\n puts \" Email : #{self.email}\"\n end", "def detail\n attributes.fetch(:detail)\n end", "def detail\n attributes.fetch(:detail)\n end" ]
[ "0.68170065", "0.68142146", "0.6758589", "0.6718451", "0.66697186", "0.6655344", "0.6632312", "0.66273594", "0.6550127", "0.65188134", "0.6497969", "0.6480078", "0.6477721", "0.6472211", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64502096", "0.64367676", "0.6434794", "0.63974625", "0.6391661", "0.6385164", "0.63826483", "0.63826483", "0.63621265", "0.63584715", "0.6352767", "0.6347243", "0.6345342", "0.63338625", "0.6325844", "0.6320725", "0.6320725", "0.6316434", "0.6311974", "0.6311425", "0.63111603", "0.6307294", "0.63050634", "0.6301272", "0.62848294", "0.627871", "0.6277492", "0.62770176", "0.6274702", "0.6274702", "0.62604547", "0.62543267", "0.6251651", "0.625114", "0.62487584", "0.62225854", "0.6214293", "0.6214293", "0.6212906", "0.62095803", "0.62095803", "0.62095803", "0.62095803", "0.6205272", "0.6205272", "0.6205272", "0.6205272", "0.6205272", "0.6205272", "0.6205272", "0.6205272", "0.6205272", "0.6200787", "0.6198166", "0.61830676", "0.6179759", "0.617746", "0.61753553", "0.61619484", "0.6157944", "0.61527485", "0.615132", "0.615132", "0.61505795", "0.6144682", "0.6144682", "0.6144682", "0.6144682", "0.61351794", "0.6133033", "0.61300874", "0.61294436", "0.61242044", "0.6121309", "0.61148214", "0.61109483", "0.6108956", "0.6108956" ]
0.0
-1
GET /arguments GET /arguments.json
def index controversial end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arguments(model)\n\n # This calls resources/resource.rb with calls\n # resources/subfolder/subresource.rb which in turn loads a json\n # from resources/data/arguments.json\n return make_arguments()\n\n return args\n end", "def request(args = {})\n response = @client.get(args[:url],\n argument_hash(args[:args] || {},\n args[:symbols] || []))\n JSON.parse(response.body)\n end", "def cmd_get argv\n setup argv\n e = @hash['element']\n response = @api.get(e)\n msg JSON.pretty_generate(response)\n return response\n end", "def arguments\n parsed {\n @arguments\n }\n end", "def view_api_args\n render :json => api_args\n end", "def index\n @arguments = Argument.all\n end", "def arguments\n @arguments ||= Launchr::OrderedHash.new\n @arguments\n end", "def show\n @argument_node = ArgumentNode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @argument_node }\n end\n end", "def json_get(*args)\n default_options = {format: :json}\n options = args.extract_options!\n get args[0], default_options.deep_merge(options)\nend", "def get(endpoint, url, args, version = 'v1')\n qs = build_qs(args)\n req_url = \"#{url}/api/#{version}/#{endpoint}?#{qs}\"\n\n request(req_url, :GET)\n end", "def show_arguments\n @arguments ||= Launchr::OrderedHash.new\n summarize_arguments\n end", "def argument_params\n params[:argument]\n end", "def show\n @argument_connection = ArgumentConnection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @argument_connection }\n end\n end", "def get(path, arguments = {})\n perform_request { connection.get(path, arguments).body }\n end", "def index\n @arguments = Argument.order(:name).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @arguments }\n end\n end", "def args\n @payload['args']\n end", "def arguments\n \"\"\n end", "def action_arguments action\n raise Gin::NotFound,\n \"No action exists for: #{env[REQ_METHOD]} #{env[PATH_INFO]}\" unless action\n\n raise Gin::NotFound, \"No action #{self.class}##{action}\" unless\n self.class.actions.include?(action.to_sym)\n\n args = []\n temp = []\n prev_type = nil\n\n method(action).parameters.each do |(type, name)|\n val = params[name.to_s]\n\n raise Gin::BadRequest, BAD_REQ_MSG % name if type == :req && !val\n break if type == :rest || type == :block || name.nil?\n\n if type == :key\n # Ruby 2.0 hash keys arguments\n args.concat temp\n args << {} if prev_type != :key\n args.last[name] = val unless val.nil?\n\n elsif val.nil?\n temp << val\n\n else\n args.concat temp\n temp.clear\n args << val\n end\n\n prev_type = type\n end\n\n args\n end", "def deserialize(arguments)\n arguments.map { |argument| deserialize_argument(argument) }\n rescue\n raise DeserializationError\n end", "def action_arguments(data, position)\n data[:arguments]\n end", "def json(*args)\n begin\n get_json(*args)\n rescue\n nil\n end\n end", "def arguments\n result = Hash.new\n args = elements.each(\"arguments/argument\") do |arg|\n name = arg.elements[\"name\"].text\n value = arg.elements[\"value\"].text\n result[name] = value\n end\n result\n end", "def arguments\n return @arguments\n end", "def arguments\n parser.arguments\n end", "def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end", "def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end", "def set_arguments\n exclusion_list = %w[client_tag api request_name]\n all_parameters = request.request_parameters\n applicable_params = all_parameters.reject { |param_name, _value| exclusion_list.include?(param_name) }\n @arguments = {}\n applicable_params.each do |k, v|\n @arguments[k] = v.chomp\n end\n end", "def api_request(input_args)\n addr = URI(api_url)\n parms = input_args.clone\n parms = api_defaults.merge(parms)\n addr.query = URI.encode_www_form(parms)\n JSON.parse(Net::HTTP.get(addr))\n end", "def arguments\n resource_names\n end", "def arguments\n @link.Arguments\n end", "def get(*args)\n execute(:get, *args)\n end", "def get(method, args={})\n http = new_http\n\n if api_key\n args[:api_key] = api_key\n end\n\n if api_version\n args[:api_version] = api_version\n end\n\n parts = []\n\n args.each do |key, value|\n if value.instance_of?(Array)\n for part in value\n # what if the part is a structure such as a hash?\n parts << \"#{URI.escape(key.to_s)}[]=#{URI.escape(part.to_s)}\"\n end\n elsif value\n parts << \"#{URI.escape(key.to_s)}=#{URI.escape(value.to_s)}\"\n end\n end\n\n path = '/api/' + method + '?' + parts.join('&')\n request = Net::HTTP::Get.new(path)\n result = invoke(http, request)\n JSON.parse(result.body)\n end", "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", "def show\n @argument = Argument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @argument }\n end\n end", "def list(*args)\n fail \"Unacceptable HTTP Method #{request.env['REQUEST_METHOD']} for list\" unless request.get?\n {:action => 'list',\n :args => args}\n end", "def args\n return [] unless options[\"args\"]\n options[\"args\"].map do |options|\n Argument.new options\n end\n end", "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend", "def arguments_method(*arguments)\n arguments.each do |argument|\n puts argument\n end\nend", "def get_json(*args)\n result = get(*args)\n ::JSON.parse(result.body)\n end", "def request(*args)\n end", "def arguments; end", "def arguments; end", "def arguments; end", "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def new\n @argument_connection = ArgumentConnection.new\n @argument_nodes = ArgumentNode.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @argument_connection }\n end\n end", "def request(*args); end", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def args\n @args_serializer.perform_deserialization! if @args_serializer.args.nil?\n @args_serializer.args\n end", "def get(url, args = {})\r\n make_request(:get, url, args)\r\n end", "def new\n @argument_node = ArgumentNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @argument_node }\n end\n end", "def cmd_list argv\n setup argv\n type = @hash['type']\n response = @api.list(type)\n if response.is_a?(Array)\n response.each do | r |\n msg r\n end\n else\n msg response\n end\n return response\n end", "def build_params\n render_endpoint_request do\n erb = EndpointRequestBuilder.new(@endpoint)\n urlpath = erb.extra_params(@arguments)\n render json: { success: urlpath }, status: 200\n end\n end", "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend", "def goals(*args)\n @client.get \"#{@path}/goals\", Hash[*args]\n end", "def arrays(args={})\n get(\"/arrays.json\",args)\n end", "def options_arguments\n @options_arguments ||= Launchr::OrderedHash.new\n @options_arguments\n end", "def get(*args)\n prepare_request(:get, args)\n @@client.add(:get, @path, *args)\n end", "def path_arguments\n\t\t\t\t@path_arguments ||= @path.split('/')\n\t\t\t\t\t.each_with_object(req: [], opt: []) do |part, hash|\n\t\t\t\t\t\t## Take only argument parts\n\t\t\t\t\t\tnext if part[0] != Router::ARG_CHAR\n\t\t\t\t\t\t## Clean argument from special chars\n\t\t\t\t\t\tclean_part = part.delete(\n\t\t\t\t\t\t\tRouter::ARG_CHAR + Router::ARG_CHAR_OPT\n\t\t\t\t\t\t).to_sym\n\t\t\t\t\t\t## Memorize arguments\n\t\t\t\t\t\thash[part[1] != Router::ARG_CHAR_OPT ? :req : :opt] << clean_part\n\t\t\t\t\tend\n\t\t\tend", "def get(path, query={})\n request_json :get, path, query\n end", "def query_parameters\n request.GET\n end", "def resources _args\n \"resources _args;\" \n end", "def arguments(required, *optional)\n puts \"required: #{required}\"\n puts \"optional: #{optional}\"\nend", "def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend", "def args()\n #This is a stub, used for indexing\n end", "def get(path, **args); end", "def args\n raw_args\n end", "def get(*args)\n params = args.extract_options!\n @connection.get do |req|\n req.url versioned_path(args), params\n end\n end", "def args\n @args.args\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def do_the_get_call(args)\n\tputs \"----- GET: #{args[:url]} -----\"\n\tc = Curl::Easy.new(args[:url]) do |curl|\n\t\tcurl.http_auth_types = :basic\n\t\tcurl.username = args[:user]\n\tend\n\tc.perform\n\tc.body_str\nend", "def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end", "def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend", "def arguments=(value)\n @arguments = value\n end", "def meaningful_arguments(arguments)\n self_arguments = self.arguments\n result = {}\n arguments.each_assigned_argument do |key, value|\n if self_arguments.include?(key)\n result[key] = value\n end\n end\n result\n end", "def json_api_command(command, stdin = nil, *args)\n res = api_command(command, stdin, *args)\n return res if res.nil? || res == ''\n JSON.parse(res, symbolize_names: true, object_class: ActiveSupport::HashWithIndifferentAccess)\n end", "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n # this measure does not require any user arguments, return an empty list\n return args\n end", "def list_items( args={} )\n @session.base_url = \"http://my.cl.ly\"\n \n url = \"/items\"\n args.each do |k, v|\n # probably a nicer way to do this\n if url == \"/items\"\n url << \"?#{k.to_s}=#{v.to_s}\"\n else\n url << \"&#{k.to_s}=#{v.to_s}\"\n end\n end\n resp = @session.get( url )\n \n raise AuthorizationError if resp.status == 401\n Crack::JSON.parse(resp.body)\n end", "def convert_arg_json(*args)\n result = []\n args.each do |v|\n begin\n result << JSON.parse(v, symbolize_names: false)\n rescue StandardError => _e\n result << v\n end\n end\n result\n end", "def get(*args)\n url, subdomain, path, params = parse_args(*args)\n JSON.parse(\n rewrap_errors do\n RestClient.get(\n build_url(url || subdomain, path, params),\n headers\n ).body\n end, symbolize_names: true\n )\n end", "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end", "def arguments\n @args ||= {}\n unless @args.size > 0\n ARGV.each_with_index do |arg, index|\n if arg.start_with?('-')\n if index + 1 < ARGV.size\n next_arg = ARGV[index + 1]\n if next_arg.start_with?('-') then\n @args.update(argument_present_or_direct(arg))\n else\n @args.update(arg => next_arg)\n end\n else\n @args.update(argument_present_or_direct(arg))\n end\n end\n end\n end\n @args\n end", "def arguments\n options = {}\n\n begin\n params = OptionParser.new do |opts|\n opts.banner = 'Usage: ralphttp [OPTIONS]'\n\n opts.on('-c', '--concurrent NUM',\n 'Number of concurrent connections')do |concurrent|\n options[:concurrent] = concurrent\n end\n\n opts.on('-n', '--requests NUM',\n 'Total number of requests to use') do |reqs|\n options[:requests] = reqs\n end\n\n opts.on('-u', '--url URL', 'URL of the page to benchmark') do |url|\n options[:url] = url\n end\n\n opts.on('-a', '--user-agent STRING', 'User Agent to use') do |ua|\n options[:useragent] = ua\n end\n\n opts.on('-d', '--detail', 'Show detailed report') do |d|\n options[:detail] = d\n end\n\n opts.on('-s', '--csv FILE', 'Output CSV data into file') do |c|\n options[:csv] = c\n end\n\n opts.on('-h', '--help', 'Show help') do\n puts opts\n exit\n end\n end\n params.parse!\n options[:url] = url_parse(options[:url]) unless options[:url].nil?\n @params = params\n rescue OptionParser::InvalidOption, OptionParser::MissingArgument\n puts params\n exit\n end # End begin\n\n options\n end", "def users(args = {})\n get(\"/users.json\",args)\n end", "def get options\n rest_request({ method: :get }.merge(options))\n end", "def get options\n rest_request({ method: :get }.merge(options))\n end", "def method_missing(method, *arguments, &unused_block)\n json_arguments = arguments.map do |arg|\n \"JSON.parse(\" + arg.to_json.to_json + \")\"\n end\n\n JSON[@wrapper.execute(\"JSON.stringify({result: #{method}(#{json_arguments.join(',')})})\")]['result']\n end", "def client_args\n { uuid: uuid, api_key: api_key }\n end", "def arguments\n args = OpenStudio::Measure::OSArgumentVector.new\n\n return args\n end", "def eta(args = {})\n make_request(\n http_method: :get,\n endpoint: path_for(:eta),\n access_token: args.delete(:access_token),\n options: { query: args }\n )\n end", "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # URL of the DEnCity server that will be posted to\n hostname = OpenStudio::Ruleset::OSArgument::makeStringArgument('hostname', true)\n hostname.setDisplayName('URL of the DEnCity Server')\n hostname.setDefaultValue('http://www.dencity.org')\n args << hostname\n\n # DEnCity server user id at hostname\n user_id = OpenStudio::Ruleset::OSArgument::makeStringArgument('user_id',true)\n user_id.setDisplayName('User ID for DEnCity Server')\n args << user_id\n\n # DEnCIty server user id's password\n auth_code = OpenStudio::Ruleset::OSArgument::makeStringArgument('auth_code', true)\n auth_code.setDisplayName('Authentication code for User ID on DEnCity server')\n args << auth_code\n\n # Building type for DEnCity's metadata\n building_type = OpenStudio::Ruleset::OSArgument::makeStringArgument('building_type', false)\n building_type.setDisplayName('Building type')\n args << building_type\n\n # HVAC system for DEnCity's metadata\n primary_hvac = OpenStudio::Ruleset::OSArgument::makeStringArgument('primary_hvac', false)\n primary_hvac.setDisplayName('Primary HVAC system in building')\n args << primary_hvac\n\n args\n\n end", "def info_request(*args)\n info args.join(' ')\n end", "def serialize(arguments)\n arguments.map { |argument| serialize_argument(argument) }\n end", "def get_raw_values_for_argument(argument=nil)\n if argument.class == Hash && !block_given?\n return @j_del.java_method(:getRawValuesForArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(argument))).to_a.map { |elt| elt }\n end\n raise ArgumentError, \"Invalid arguments when calling get_raw_values_for_argument(argument)\"\n end", "def arguments_description \n @arguments_description\n end", "def info( opts = {} )\n http_action :get, nil, opts\n end", "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", "def http( *args )\n p http_get( *args )\n end", "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # this measure does not require any user arguments, return an empty list\n\n return args\n end", "def arg(params)\n rpc_desc.input.decode_json(params.reject { |k, _v| k == :selections }.to_json)\n end", "def arguments_description #:nodoc:\n @arguments_description\n end", "def show\n params.require(%i[id])\n render json: Ingredient.find_by!(id: params[:id])\n end" ]
[ "0.6873437", "0.6626993", "0.6456136", "0.63833046", "0.6369182", "0.6336311", "0.62287295", "0.6213961", "0.605684", "0.6048007", "0.6018319", "0.60069495", "0.59771633", "0.5976822", "0.5964933", "0.5932559", "0.5868591", "0.58463955", "0.58339417", "0.58195823", "0.58073854", "0.57905555", "0.5756777", "0.571491", "0.5709408", "0.5709408", "0.5697966", "0.5697582", "0.5688977", "0.5685496", "0.5684795", "0.5680105", "0.5674127", "0.5657362", "0.56542355", "0.56437534", "0.56333697", "0.5614159", "0.5603197", "0.5576884", "0.55653536", "0.55653536", "0.55653536", "0.55635995", "0.55542344", "0.55201226", "0.55006665", "0.54892814", "0.54715115", "0.5471139", "0.5450142", "0.54248047", "0.541775", "0.54062885", "0.5403409", "0.5395232", "0.53838885", "0.5383423", "0.53788316", "0.5377368", "0.53751504", "0.5355922", "0.5355075", "0.5351135", "0.53279686", "0.5322771", "0.5321449", "0.530858", "0.5303408", "0.53017586", "0.5289181", "0.52807957", "0.5263829", "0.5259312", "0.52536154", "0.5243942", "0.52413666", "0.52412075", "0.52365786", "0.5230252", "0.5226918", "0.5224697", "0.52217567", "0.5216752", "0.5216752", "0.5206668", "0.52056605", "0.5203951", "0.5201949", "0.517773", "0.5170898", "0.515715", "0.51447064", "0.5143486", "0.5135351", "0.51225066", "0.51222926", "0.5120578", "0.51194954", "0.5118793", "0.5104247" ]
0.0
-1
GET /arguments/1 GET /arguments/1.json
def show @is_doubt = !params[:doubt].nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arguments(model)\n\n # This calls resources/resource.rb with calls\n # resources/subfolder/subresource.rb which in turn loads a json\n # from resources/data/arguments.json\n return make_arguments()\n\n return args\n end", "def cmd_get argv\n setup argv\n e = @hash['element']\n response = @api.get(e)\n msg JSON.pretty_generate(response)\n return response\n end", "def show\n @argument_node = ArgumentNode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @argument_node }\n end\n end", "def request(args = {})\n response = @client.get(args[:url],\n argument_hash(args[:args] || {},\n args[:symbols] || []))\n JSON.parse(response.body)\n end", "def json_get(*args)\n default_options = {format: :json}\n options = args.extract_options!\n get args[0], default_options.deep_merge(options)\nend", "def index\n @arguments = Argument.all\n end", "def view_api_args\n render :json => api_args\n end", "def show\n @argument_connection = ArgumentConnection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @argument_connection }\n end\n end", "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def arguments\n \"\"\n end", "def get(path, arguments = {})\n perform_request { connection.get(path, arguments).body }\n end", "def get(endpoint, url, args, version = 'v1')\n qs = build_qs(args)\n req_url = \"#{url}/api/#{version}/#{endpoint}?#{qs}\"\n\n request(req_url, :GET)\n end", "def show\n @argument = Argument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @argument }\n end\n end", "def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend", "def index\n @arguments = Argument.order(:name).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @arguments }\n end\n end", "def get(*args)\n execute(:get, *args)\n end", "def argument_params\n params[:argument]\n end", "def json(*args)\n begin\n get_json(*args)\n rescue\n nil\n end\n end", "def request(*args)\n end", "def get(path, **args); end", "def new\n @argument_connection = ArgumentConnection.new\n @argument_nodes = ArgumentNode.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @argument_connection }\n end\n end", "def request(*args); end", "def new\n @argument_node = ArgumentNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @argument_node }\n end\n end", "def arguments\n parsed {\n @arguments\n }\n end", "def arguments\n @arguments ||= Launchr::OrderedHash.new\n @arguments\n end", "def args\n @payload['args']\n end", "def arguments; end", "def arguments; end", "def arguments; end", "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend", "def args()\n #This is a stub, used for indexing\n end", "def show_arguments\n @arguments ||= Launchr::OrderedHash.new\n summarize_arguments\n end", "def arguments_method(*arguments)\n arguments.each do |argument|\n puts argument\n end\nend", "def gets(arg0, arg1, *rest)\n end", "def get(*args)\n params = args.extract_options!\n @connection.get do |req|\n req.url versioned_path(args), params\n end\n end", "def get(method, args={})\n http = new_http\n\n if api_key\n args[:api_key] = api_key\n end\n\n if api_version\n args[:api_version] = api_version\n end\n\n parts = []\n\n args.each do |key, value|\n if value.instance_of?(Array)\n for part in value\n # what if the part is a structure such as a hash?\n parts << \"#{URI.escape(key.to_s)}[]=#{URI.escape(part.to_s)}\"\n end\n elsif value\n parts << \"#{URI.escape(key.to_s)}=#{URI.escape(value.to_s)}\"\n end\n end\n\n path = '/api/' + method + '?' + parts.join('&')\n request = Net::HTTP::Get.new(path)\n result = invoke(http, request)\n JSON.parse(result.body)\n end", "def action_arguments action\n raise Gin::NotFound,\n \"No action exists for: #{env[REQ_METHOD]} #{env[PATH_INFO]}\" unless action\n\n raise Gin::NotFound, \"No action #{self.class}##{action}\" unless\n self.class.actions.include?(action.to_sym)\n\n args = []\n temp = []\n prev_type = nil\n\n method(action).parameters.each do |(type, name)|\n val = params[name.to_s]\n\n raise Gin::BadRequest, BAD_REQ_MSG % name if type == :req && !val\n break if type == :rest || type == :block || name.nil?\n\n if type == :key\n # Ruby 2.0 hash keys arguments\n args.concat temp\n args << {} if prev_type != :key\n args.last[name] = val unless val.nil?\n\n elsif val.nil?\n temp << val\n\n else\n args.concat temp\n temp.clear\n args << val\n end\n\n prev_type = type\n end\n\n args\n end", "def method_missing(method, *arguments, &unused_block)\n json_arguments = arguments.map do |arg|\n \"JSON.parse(\" + arg.to_json.to_json + \")\"\n end\n\n JSON[@wrapper.execute(\"JSON.stringify({result: #{method}(#{json_arguments.join(',')})})\")]['result']\n end", "def deserialize(arguments)\n arguments.map { |argument| deserialize_argument(argument) }\n rescue\n raise DeserializationError\n end", "def api_request(input_args)\n addr = URI(api_url)\n parms = input_args.clone\n parms = api_defaults.merge(parms)\n addr.query = URI.encode_www_form(parms)\n JSON.parse(Net::HTTP.get(addr))\n end", "def cmd_list argv\n setup argv\n type = @hash['type']\n response = @api.list(type)\n if response.is_a?(Array)\n response.each do | r |\n msg r\n end\n else\n msg response\n end\n return response\n end", "def q1 *rest\n puts \"The number of parameters is #{rest.length}.\"\n puts rest\nend", "def read(arg0, arg1, *rest)\n end", "def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end", "def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end", "def action_arguments(data, position)\n data[:arguments]\n end", "def get_json(*args)\n result = get(*args)\n ::JSON.parse(result.body)\n end", "def get(*args)\n prepare_request(:get, args)\n @@client.add(:get, @path, *args)\n end", "def cmd_get_name argv\n setup argv\n uuid = @hash['uuid']\n response = @api.get_name(uuid)\n msg response\n return response\n end", "def resources _args\n \"resources _args;\" \n end", "def get(url, args = {})\r\n make_request(:get, url, args)\r\n end", "def json_api_command(command, stdin = nil, *args)\n res = api_command(command, stdin, *args)\n return res if res.nil? || res == ''\n JSON.parse(res, symbolize_names: true, object_class: ActiveSupport::HashWithIndifferentAccess)\n end", "def my_method(args)\n args[:arg2]\nend", "def my_method(args)\n args[:arg2]\nend", "def arguments(required, *optional)\n puts \"required: #{required}\"\n puts \"optional: #{optional}\"\nend", "def new\n @argument = Argument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @argument }\n end\n end", "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend", "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", "def do_the_get_call(args)\n\tputs \"----- GET: #{args[:url]} -----\"\n\tc = Curl::Easy.new(args[:url]) do |curl|\n\t\tcurl.http_auth_types = :basic\n\t\tcurl.username = args[:user]\n\tend\n\tc.perform\n\tc.body_str\nend", "def show\n @command_parameter = CommandParameter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @command_parameter }\n end\n end", "def arg(params)\n rpc_desc.input.decode_json(params.reject { |k, _v| k == :selections }.to_json)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def cmd(options={})\n arguments\n end", "def arguments\n parser.arguments\n end", "def get(path, query={})\n request_json :get, path, query\n end", "def args\n return [] unless options[\"args\"]\n options[\"args\"].map do |options|\n Argument.new options\n end\n end", "def get_tenant_by_name(args = {}) \n get(\"/tenants.json/name/#{args[:tenantName]}\", args)\nend", "def goals(*args)\n @client.get \"#{@path}/goals\", Hash[*args]\n end", "def arguments\n @link.Arguments\n end", "def args\n @args.args\n end", "def destroy\n @argument.destroy\n respond_to do |format|\n format.html {redirect_to arguments_url, notice: 'Argument was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def convert_arg_json(*args)\n result = []\n args.each do |v|\n begin\n result << JSON.parse(v, symbolize_names: false)\n rescue StandardError => _e\n result << v\n end\n end\n result\n end", "def get_aos_version_box_by_name(args = {}) \n get(\"/aosversions.json/aosversionbox/name/#{args[:aosVersionBoxName]}\", args)\nend", "def list(*args)\n fail \"Unacceptable HTTP Method #{request.env['REQUEST_METHOD']} for list\" unless request.get?\n {:action => 'list',\n :args => args}\n end", "def client_args\n { uuid: uuid, api_key: api_key }\n end", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def http( *args )\n p http_get( *args )\n end", "def set_arguments\n exclusion_list = %w[client_tag api request_name]\n all_parameters = request.request_parameters\n applicable_params = all_parameters.reject { |param_name, _value| exclusion_list.include?(param_name) }\n @arguments = {}\n applicable_params.each do |k, v|\n @arguments[k] = v.chomp\n end\n end", "def parse_arguments(args)\n ret = {}\n ret[\"timeout\"] = 15\n op = OptionParser.new do |opts|\n opts.banner = \"Usage: #{__FILE__} [options]\"\n opts.separator \"\"\n opts.separator \"Specific options:\"\n\n opts.on(\"-a\", \"--argument=[JSON]\",\n \"Pass the supplied JSON data over the bridge\") do |v|\n ret[\"argument\"] = v\n end\n\n opts.on(\"-b\", \"--b64argument=[B64-JSON]\",\n \"Pass the base64-encoded JSON data over the bridge\") do |v|\n ret[\"b64argument\"] = v\n end\n\n opts.on(\"-s\", \"--selector=SELECTOR\",\n \"Call the given function (selector) via the bridge\") do |v|\n ret[\"selector\"] = v\n end\n\n opts.on(\"-c\", \"--callUID=UID\",\n \"Use the given UID to properly identify the return value of this call\") do |v|\n ret[\"callUID\"] = v\n end\n\n opts.on(\"-r\", \"--hardwareID=[HARDWAREID]\",\n \"If provided, connect to the physical iOS device with this hardware ID instead of a simulator\") do |v|\n ret[\"hardwareID\"] = v\n end\n\n opts.on(\"-t\", \"--timeout=[TIMEOUT]\",\n \"The timeout in seconds for reading a response from the bridge (default 15)\") do |v|\n ret[\"timeout\"] = v.to_i\n end\n\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") do\n puts opts\n exit\n end\n\n end\n op.parse!(args)\n return ret\nend", "def argument(args)\n args.first\n end", "def arguments\n resource_names\n end", "def getObjectArgument _obj, _args\n \"_obj getObjectArgument _args;\" \n end", "def arguments=(_arg0); end", "def destroy\n @argument.destroy\n respond_to do |format|\n format.html { redirect_to arguments_url, notice: 'Argument was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @argument.destroy\n respond_to do |format|\n format.html { redirect_to arguments_url, notice: 'Argument was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def args\n @args_serializer.perform_deserialization! if @args_serializer.args.nil?\n @args_serializer.args\n end", "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", "def destroy\n @argument = Argument.find(params[:id])\n @argument.destroy\n\n respond_to do |format|\n format.html { redirect_to(arguments_url) }\n format.xml { head :ok }\n end\n end", "def arguments\n return @arguments\n end", "def get!(*args)\n @response = get(*args)\n end", "def get_command_line_argument\n if ARGV.empty?\n puts \"Usage: ruby lookup.rb <domain>\" \n exit\n end ARGV.first # get frst argument in commnad line\nend", "def args\n raw_args\n end", "def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end", "def rest_endpoint=(_arg0); end", "def info_request(*args)\n info args.join(' ')\n end", "def arguments\n result = Hash.new\n args = elements.each(\"arguments/argument\") do |arg|\n name = arg.elements[\"name\"].text\n value = arg.elements[\"value\"].text\n result[name] = value\n end\n result\n end", "def [](key)\n return @args[key]\n end", "def show\n params.require(%i[id])\n render json: Ingredient.find_by!(id: params[:id])\n end", "def print_arguments(arg_1, arg_2)\n puts arg_1 # We can then use the argument in the method\n puts arg_2\nend", "def list _args\n \"list _args;\" \n end", "def arguments\n options = {}\n\n begin\n params = OptionParser.new do |opts|\n opts.banner = 'Usage: ralphttp [OPTIONS]'\n\n opts.on('-c', '--concurrent NUM',\n 'Number of concurrent connections')do |concurrent|\n options[:concurrent] = concurrent\n end\n\n opts.on('-n', '--requests NUM',\n 'Total number of requests to use') do |reqs|\n options[:requests] = reqs\n end\n\n opts.on('-u', '--url URL', 'URL of the page to benchmark') do |url|\n options[:url] = url\n end\n\n opts.on('-a', '--user-agent STRING', 'User Agent to use') do |ua|\n options[:useragent] = ua\n end\n\n opts.on('-d', '--detail', 'Show detailed report') do |d|\n options[:detail] = d\n end\n\n opts.on('-s', '--csv FILE', 'Output CSV data into file') do |c|\n options[:csv] = c\n end\n\n opts.on('-h', '--help', 'Show help') do\n puts opts\n exit\n end\n end\n params.parse!\n options[:url] = url_parse(options[:url]) unless options[:url].nil?\n @params = params\n rescue OptionParser::InvalidOption, OptionParser::MissingArgument\n puts params\n exit\n end # End begin\n\n options\n end" ]
[ "0.65474063", "0.6496125", "0.63066643", "0.627296", "0.62493974", "0.6181034", "0.61613244", "0.61021316", "0.59450805", "0.5935237", "0.5902936", "0.58880544", "0.58427536", "0.58378506", "0.5804958", "0.5780718", "0.57761467", "0.57658726", "0.5742781", "0.5722882", "0.57047194", "0.56990355", "0.5673227", "0.5644673", "0.5610688", "0.5589433", "0.557998", "0.557998", "0.557998", "0.55606675", "0.55354106", "0.55120856", "0.5496078", "0.549278", "0.5491167", "0.5489054", "0.5465051", "0.5460442", "0.54495084", "0.5408257", "0.54059094", "0.5404301", "0.53974324", "0.53932476", "0.53932476", "0.5386666", "0.53749716", "0.5363514", "0.5361027", "0.5357718", "0.53295386", "0.532766", "0.53271616", "0.53271616", "0.5315343", "0.5307207", "0.5305166", "0.5304375", "0.52988374", "0.52937037", "0.52647", "0.52579117", "0.525548", "0.52475935", "0.52443314", "0.52201575", "0.5209542", "0.52067554", "0.5206721", "0.520407", "0.51886636", "0.51883405", "0.5185355", "0.5179562", "0.5179477", "0.517813", "0.5172632", "0.51651543", "0.5154349", "0.5145839", "0.51455754", "0.51404476", "0.513382", "0.5124356", "0.5124356", "0.51190436", "0.5114515", "0.5105416", "0.50986207", "0.50965416", "0.5085538", "0.5084364", "0.50817376", "0.5072349", "0.50707525", "0.5070485", "0.5062548", "0.50594914", "0.50546014", "0.5053804", "0.5048962" ]
0.0
-1
POST /arguments POST /arguments.json
def create @argument = Argument.new(argument_params.permit(:statement)) respond_to do |format| if @argument.save format.html { redirect_to @argument, notice: 'Argument was successfully created.' } format.json { render :show, status: :created, location: @argument } else format.html { render :new } format.json { render json: @argument.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(path, arguments = {})\n perform_request { connection.post(path, arguments).body }\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def post(*args)\n request(:post, *args)\n end", "def post(*args)\n request :post, *args\n end", "def post(*args)\n super(*wrap_for_json_api(*args))\n end", "def call method, args = {}\n unless args.is_a? Hash\n raise ArgumentError.new \"argument must be a Hash\"\n end\n\n args.each_key do |key|\n if args[key].is_a?(Array) || args[key].is_a?(Hash)\n args[key] = JSON.dump(args[key])\n end\n end\n\n @faraday.post method, args\n end", "def post(endpoint, url, args, version = 'v1')\n qs = build_qs(args)\n req_url = \"#{url}/api/#{version}/#{endpoint}?#{qs}\"\n\n request(req_url, :POST)\n end", "def cmd_create argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.create(json, e)\n msg response\n return response\n end", "def create\n @sample = Sample.new(sample_params)\n\n if @sample.save\n argument_ids = params[:argument_ids].flatten.compact rescue []\n unless argument_ids.empty?\n ActiveRecord::Base.transaction do\n argument_ids.map do |argument_id|\n @sample.sample_arguments.create(argument_id: argument_id)\n end\n end\n end\n render json: @sample\n else\n render json: @sample.errors, status: :unprocessable_entity\n end\n end", "def create\n @argument = Argument.new(argument_params)\n\n respond_to do |format|\n begin\n ActiveRecord::Base.transaction do\n @argument.save!\n @argument.premise_ids = premise_ids[:premise_ids]\n format.html {redirect_to @argument, notice: 'Argument was successfully created.'}\n format.json {render :show, status: :created, location: @argument}\n end\n rescue ActiveRecord::RecordInvalid => exception\n format.html {render :new}\n format.json {render json: @argument.errors, status: :unprocessable_entity}\n end\n end\n end", "def post(*args)\n Request.post(*args)\n end", "def set_arguments\n exclusion_list = %w[client_tag api request_name]\n all_parameters = request.request_parameters\n applicable_params = all_parameters.reject { |param_name, _value| exclusion_list.include?(param_name) }\n @arguments = {}\n applicable_params.each do |k, v|\n @arguments[k] = v.chomp\n end\n end", "def create\n @argument_node = ArgumentNode.new(params[:argument_node])\n\n respond_to do |format|\n if @argument_node.save\n format.html { redirect_to @argument_node, notice: 'Argument node was successfully created.' }\n format.json { render json: @argument_node, status: :created, location: @argument_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @argument_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def argument_post_params\n params.require(type.underscore.to_sym).permit(:content, :user_id, :debate_id, :type, :position, :parent_id)\n #params.require(:argument_post).permit(:content, :user_id, :debate_id, :type, :position, :parent_id)\n end", "def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end", "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # URL of the DEnCity server that will be posted to\n hostname = OpenStudio::Ruleset::OSArgument::makeStringArgument('hostname', true)\n hostname.setDisplayName('URL of the DEnCity Server')\n hostname.setDefaultValue('http://www.dencity.org')\n args << hostname\n\n # DEnCity server user id at hostname\n user_id = OpenStudio::Ruleset::OSArgument::makeStringArgument('user_id',true)\n user_id.setDisplayName('User ID for DEnCity Server')\n args << user_id\n\n # DEnCIty server user id's password\n auth_code = OpenStudio::Ruleset::OSArgument::makeStringArgument('auth_code', true)\n auth_code.setDisplayName('Authentication code for User ID on DEnCity server')\n args << auth_code\n\n # Building type for DEnCity's metadata\n building_type = OpenStudio::Ruleset::OSArgument::makeStringArgument('building_type', false)\n building_type.setDisplayName('Building type')\n args << building_type\n\n # HVAC system for DEnCity's metadata\n primary_hvac = OpenStudio::Ruleset::OSArgument::makeStringArgument('primary_hvac', false)\n primary_hvac.setDisplayName('Primary HVAC system in building')\n args << primary_hvac\n\n args\n\n end", "def post(path, **args); end", "def create\n @argument = Argument.new(params[:argument])\n\n respond_to do |format|\n if @argument.save\n format.html { redirect_to(@argument, :notice => 'Argument was successfully created.') }\n format.xml { render :xml => @argument, :status => :created, :location => @argument }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @argument.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(url, args = {})\r\n make_request(:post, url, args)\r\n end", "def serialize(arguments)\n arguments.map { |argument| serialize_argument(argument) }\n end", "def post(*args)\n execute(:post, *args)\n end", "def post(method, args=nil)\n http = new_http\n\n if api_key\n args[:api_key] = api_key\n end\n\n if api_version\n args[:api_version] = api_version\n end\n\n request = Net::HTTP::Post.new('/api/' + method)\n\n if args\n request.set_form_data(args)\n end\n\n result = invoke(http, request)\n JSON.parse(result.body)\n end", "def arguments=(value)\n @arguments = value\n end", "def argument_params\n params[:argument]\n end", "def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend", "def command_params\n params.require(:command).permit(:name, :json)\n end", "def post_arguments(raw_file, filemeta)\n {\n method: :post,\n url: build_url(PARSE_RESUME),\n payload: parse_body(raw_file, filemeta).to_json,\n headers: headers,\n timeout: REQUEST_TIMEOUT_SECONDS\n }\n end", "def post options\n rest_request({ method: :post }.merge(options))\n end", "def post options\n rest_request({ method: :post }.merge(options))\n end", "def arguments(model)\n\n # This calls resources/resource.rb with calls\n # resources/subfolder/subresource.rb which in turn loads a json\n # from resources/data/arguments.json\n return make_arguments()\n\n return args\n end", "def create\n @argument_connection = ArgumentConnection.new(params[:argument_connection])\n\n respond_to do |format|\n if @argument_connection.save\n format.html { redirect_to @argument_connection, notice: 'Argument connection was successfully created.' }\n format.json { render json: @argument_connection, status: :created, location: @argument_connection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @argument_connection.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @argument_node = ArgumentNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @argument_node }\n end\n end", "def arguments\n @arguments ||= Launchr::OrderedHash.new\n @arguments\n end", "def post(data = {})\n call data, method: :post\n end", "def post(action, **args); end", "def create\n ActiveRecord::Base.transaction do\n respond_to do |format|\n if [email protected]\n format.html { render :new, alert: 'Failed to create argument.' }\n format.json { render json: @argument.errors, status: :unprocessable_entity }\n else\n format.html { redirect_to @argument }\n format.json { render :show, status: :created, location: @argument }\n end\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def post(path, data = {})\n request 'POST', path, body: data.to_json\n end", "def deserialize(arguments)\n arguments.map { |argument| deserialize_argument(argument) }\n rescue\n raise DeserializationError\n end", "def action_arguments action\n raise Gin::NotFound,\n \"No action exists for: #{env[REQ_METHOD]} #{env[PATH_INFO]}\" unless action\n\n raise Gin::NotFound, \"No action #{self.class}##{action}\" unless\n self.class.actions.include?(action.to_sym)\n\n args = []\n temp = []\n prev_type = nil\n\n method(action).parameters.each do |(type, name)|\n val = params[name.to_s]\n\n raise Gin::BadRequest, BAD_REQ_MSG % name if type == :req && !val\n break if type == :rest || type == :block || name.nil?\n\n if type == :key\n # Ruby 2.0 hash keys arguments\n args.concat temp\n args << {} if prev_type != :key\n args.last[name] = val unless val.nil?\n\n elsif val.nil?\n temp << val\n\n else\n args.concat temp\n temp.clear\n args << val\n end\n\n prev_type = type\n end\n\n args\n end", "def action_arguments(data, position)\n data[:arguments]\n end", "def args\n @payload['args']\n end", "def create\n @argumentable = params[:argumentable].constantize.find(params[:argumentable_id])\n @argument = @argumentable.arguments.build(params[:argument])\n if verify_recaptcha()\n flash.delete(:recaptcha_error)\n if @argument.save\n @argument.update_attribute(:user_id, current_user.id)\n @argument.update_attribute(:language, I18n.locale)\n @argument.update_attribute(:pro, (params[:side]==\"pro\"))\n\n flash[:notice] = t(:new_argument_ok)\n redirect_to @argumentable\n\n else\n flash[:error] = t(:new_argument_not_ok)\n redirect_to(:controller => :arguments, :action => :new, :argumentable => @argumentable.class.name, :argumentable_id => @argumentable.id)\n end\n else\n flash.now[:alert] = t(:recaptcha_error)\n flash.delete(:recaptcha_error)\n render :action => \"new\"\n end\n end", "def create\n @argument_post = current_user.argument_posts.build(argument_post_params)\n\n respond_to do |format|\n if @argument_post.save\n format.html { redirect_to debate_url(@argument_post.debate), notice: 'Argument post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @argument_post }\n else\n format.html { render action: 'new' }\n format.json { render json: @argument_post.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @argument_connection = ArgumentConnection.new\n @argument_nodes = ArgumentNode.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @argument_connection }\n end\n end", "def arguments=(value)\n @arguments = value.to_s.strip # TODO: Parse\n end", "def arguments=(val)\n raise(ArgumentError, \"Arguments must recieve a hash\") unless val.kind_of?(Hash)\n @arguments = val\n end", "def arguments\n parsed {\n @arguments\n }\n end", "def arguments; end", "def arguments; end", "def arguments; end", "def view_api_args\n render :json => api_args\n end", "def create(args) \n help_form = {:tNote => args[:note],\n :xCategory => args[:category],\n :sFirstName => args[:first_name],\n :sLastName => args[:last_name],\n :sUserId => args[:user_id],\n :sEmail => args[:email],\n :sPhone => args[:phone],\n :fUrgent => args[:urgent]}.reject!{|k,v| v == nil}\n \n JSON.parse(api_request('request.create', 'POST', help_form))['xRequest'] rescue []\n end", "def arguments\n \"\"\n end", "def add_arrays_to_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/arrays\", args)\nend", "def create(*args)\n post(*args)\n end", "def create(*args)\n post(*args)\n end", "def build_params\n render_endpoint_request do\n erb = EndpointRequestBuilder.new(@endpoint)\n urlpath = erb.extra_params(@arguments)\n render json: { success: urlpath }, status: 200\n end\n end", "def post_request(url,args)\n uri = URI.parse(url)\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data(args)\n request(uri,req)\n end", "def json_entry_params\n params.require(:json_entry).permit(:area_id, :data, :name, :verb, :post_body)\n end", "def post\n resource.post(request, response)\n end", "def post(request_opts = {})\n store_result(http(request_opts).post(resolved_path, @attrs))\n end", "def post endpoint, data\n do_request :post, endpoint, data\n end", "def validated_name_args(method_name, body)\n @args = json_parse(body)\n args = case method_name\n when /^sha$/ then []\n when /^alive$/ then []\n when /^ready$/ then []\n when /^image_names$/ then []\n when /^names$/ then []\n when /^manifests$/ then []\n when /^manifest$/ then [name]\n else\n raise ClientError, 'json:malformed'\n end\n if query?(method_name)\n method_name += '?'\n end\n [method_name, args]\n end", "def post_data=(_arg0); end", "def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "def event_params\n json_params = ActionController::Parameters.new( JSON.parse(request.body.read) )\n json_params.require(:event).permit(:creator_id, :name, :address, :latitude, :longitude, :creator_id, {:tags_ids => []})\n end", "def post(access_token, path, args={}, headers={})\n run :post, access_token, path, args, headers\n end", "def post(request)\n if request.params.is_a?(Hash)\n @connection.post request.path, request.params\n else\n @connection.post request.path do |req|\n req.body = request.params\n end\n end\n end", "def validated_name_args(name, body)\n @well_formed_args = WellFormedArgs.new(body)\n args = case name\n when /^sha$/ then []\n when /^kata_exists$/ then [id]\n when /^kata_create$/ then [manifest]\n when /^kata_manifest$/ then [id]\n when /^kata_ran_tests$/ then [id, n, files, now, stdout, stderr, status, colour]\n when /^kata_tags$/ then [id]\n when /^kata_tag$/ then [id,n]\n else\n raise ClientError, 'json:malformed'\n end\n name += '?' if query?(name)\n [name, args]\n end", "def create_recipe_request(version, auth_headers, data = {})\n post \"/api/recipes\", params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }.merge(auth_headers)\nend", "def post!\n request! :post\n end", "def create\n megam_rest.post_appdefn(to_hash)\n end", "def standard_analysis_parameters\n parameter :analysis_job_id, 'Requested analysis job id (in path/route)', required: true\n parameter :audio_recording_id, 'Requested audio recording id (in path/route)', required: true\n parameter :results_path, 'Result file path', required: true\n\n let(:raw_post) { params.to_json }\nend", "def arguments\n result = Hash.new\n args = elements.each(\"arguments/argument\") do |arg|\n name = arg.elements[\"name\"].text\n value = arg.elements[\"value\"].text\n result[name] = value\n end\n result\n end", "def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end", "def validator_captive_portal(args = {}) \n post(\"/profiles.json/captiveportal/\", args)\nend", "def post\n request_object.post_query\n end", "def set_arguments (args)\n end", "def meaningful_arguments(arguments)\n self_arguments = self.arguments\n result = {}\n arguments.each_assigned_argument do |key, value|\n if self_arguments.include?(key)\n result[key] = value\n end\n end\n result\n end", "def parse_arguments(args)\n ret = {}\n ret[\"timeout\"] = 15\n op = OptionParser.new do |opts|\n opts.banner = \"Usage: #{__FILE__} [options]\"\n opts.separator \"\"\n opts.separator \"Specific options:\"\n\n opts.on(\"-a\", \"--argument=[JSON]\",\n \"Pass the supplied JSON data over the bridge\") do |v|\n ret[\"argument\"] = v\n end\n\n opts.on(\"-b\", \"--b64argument=[B64-JSON]\",\n \"Pass the base64-encoded JSON data over the bridge\") do |v|\n ret[\"b64argument\"] = v\n end\n\n opts.on(\"-s\", \"--selector=SELECTOR\",\n \"Call the given function (selector) via the bridge\") do |v|\n ret[\"selector\"] = v\n end\n\n opts.on(\"-c\", \"--callUID=UID\",\n \"Use the given UID to properly identify the return value of this call\") do |v|\n ret[\"callUID\"] = v\n end\n\n opts.on(\"-r\", \"--hardwareID=[HARDWAREID]\",\n \"If provided, connect to the physical iOS device with this hardware ID instead of a simulator\") do |v|\n ret[\"hardwareID\"] = v\n end\n\n opts.on(\"-t\", \"--timeout=[TIMEOUT]\",\n \"The timeout in seconds for reading a response from the bridge (default 15)\") do |v|\n ret[\"timeout\"] = v.to_i\n end\n\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") do\n puts opts\n exit\n end\n\n end\n op.parse!(args)\n return ret\nend", "def command_params\n params.permit(:command_name, :post_id)\n end", "def set_arguments(*args)\n @arguments = Arguments.new\n add_arguments(*args)\n end", "def post_json(location, json_data)\n response = RestClient::Request.new(\n :method => :post,\n :url => location,\n :user => $username,\n :password => $password,\n :headers => { :accept => :json,\n :content_type => :json},\n :payload => json_data\n ).execute\n results = JSON.parse(response.to_str)\n end", "def post_json(location, json_data)\n response = RestClient::Request.new(\n :method => :post,\n :url => location,\n :user => $username,\n :password => $password,\n :headers => { :accept => :json,\n :content_type => :json},\n :payload => json_data\n ).execute\n results = JSON.parse(response.to_str)\n end", "def add_user_for_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend", "def post_parameters\n request.POST\n end", "def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end", "def set_argument_post\n @argument_post = ArgumentPost.find(params[:id])\n end", "def post(path, data={})\n request(:post, path, data)\n end", "def raw_post_request raw_params\n json_body = raw_params.to_json\n Rubix.logger.log(Logger::DEBUG, \"SEND: #{json_body}\") if Rubix.logger\n Net::HTTP::Post.new(uri.path).tap do |req|\n req['Content-Type'] = 'application/json-rpc'\n req.body = json_body\n end\n end", "def args\n @args_serializer.perform_deserialization! if @args_serializer.args.nil?\n @args_serializer.args\n end", "def post(attrs = nil)\n attrs ||= attributes\n\n execute_request('POST') do |uri, headers|\n HTTP.http_client.post(\n uri,\n body: adapter.serialize(attrs),\n header: headers.merge(CONTENT_TYPE_HEADERS)\n )\n end\n end", "def post_data(action, parameters = {})\n action == 'auth' ? parameters.to_s : parameters.to_json\n end", "def create\n res = self.class.post('/', body: attrs)\n res.created?\n end", "def create\n megam_rest.post_appreq(to_hash)\n end", "def request(*args)\n end", "def post(path, **options)\n execute :post, path, options\n end", "def process_arguments\n @e_addr = @options.email\n @r_name = @options.run_names\n @m_name = @options.machine_names\n @action = @options.action\n @snfs = @options.snfs\n end", "def process_post\n service.sign_up_fisherman(\n JSON.parse(request.body.to_s).symbolize_keys\n ).on(\n fishing_application_succeeded: ->(result) {\n response.headers['Content-Type'] = \"application/json\"\n response.body = result.to_json\n true\n },\n fishing_application_conflicts: ->(result) {\n render_json_error_response(\n error: \"command_failed_validation\", message: result.fetch(:message)\n )\n 409\n },\n fishing_application_invalid: ->(result) {\n render_json_error_response(\n error: \"command_failed_validation\", message: result.fetch(:message)\n )\n 422\n }\n )\n end" ]
[ "0.6495836", "0.64543873", "0.6440452", "0.63580114", "0.62395155", "0.61328435", "0.61103266", "0.60280323", "0.601466", "0.60119164", "0.60003245", "0.5979707", "0.59660214", "0.5940366", "0.5915267", "0.58772194", "0.5876523", "0.5847612", "0.5791875", "0.5786974", "0.57619137", "0.5756546", "0.5751844", "0.57365274", "0.5733698", "0.5714862", "0.5709502", "0.5690236", "0.5690236", "0.5660156", "0.5651861", "0.56154764", "0.5614616", "0.55983335", "0.55874646", "0.55687386", "0.55465376", "0.54781383", "0.5477844", "0.546949", "0.54687494", "0.5467032", "0.5466647", "0.5441935", "0.5410634", "0.54052466", "0.54027635", "0.5400422", "0.5391177", "0.5391177", "0.5391177", "0.5370719", "0.5356723", "0.533807", "0.5326253", "0.53117496", "0.53117496", "0.5309647", "0.52987766", "0.5292952", "0.5273321", "0.527093", "0.52489483", "0.52340287", "0.5218358", "0.52127284", "0.5207951", "0.52059764", "0.5195093", "0.51900244", "0.51869833", "0.5185235", "0.5179473", "0.51794267", "0.5167301", "0.51623875", "0.5161265", "0.51389456", "0.5137102", "0.5136853", "0.51318383", "0.51283735", "0.51161283", "0.5110433", "0.5110433", "0.51099277", "0.5109813", "0.5108865", "0.5107145", "0.5099358", "0.50987405", "0.50947094", "0.5094706", "0.50928044", "0.50885063", "0.50834876", "0.50786567", "0.50746065", "0.50684184", "0.50600034" ]
0.6006579
10
PATCH/PUT /arguments/1 PATCH/PUT /arguments/1.json
def update respond_to do |format| if @argument.update(argument_params) format.html { redirect_to @argument, notice: 'Argument was successfully updated.' } format.json { render :show, status: :ok, location: @argument } else format.html { render :edit } format.json { render json: @argument.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(path, **args); end", "def cmd_modify argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.modify(json, e)\n msg response\n return response\n end", "def update!(**args)\n @request_id = args[:request_id] if args.key?(:request_id)\n @resource_info = args[:resource_info] if args.key?(:resource_info)\n @validate_only = args[:validate_only] if args.key?(:validate_only)\n end", "def patch!\n request! :patch\n end", "def update!(**args)\n @authentication_info = args[:authentication_info] if args.key?(:authentication_info)\n @authorization_info = args[:authorization_info] if args.key?(:authorization_info)\n @metadata = args[:metadata] if args.key?(:metadata)\n @method_name = args[:method_name] if args.key?(:method_name)\n @num_response_items = args[:num_response_items] if args.key?(:num_response_items)\n @request = args[:request] if args.key?(:request)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n @resource_location = args[:resource_location] if args.key?(:resource_location)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @resource_original_state = args[:resource_original_state] if args.key?(:resource_original_state)\n @response = args[:response] if args.key?(:response)\n @service_data = args[:service_data] if args.key?(:service_data)\n @service_name = args[:service_name] if args.key?(:service_name)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @format = args[:format] if args.key?(:format)\n @json_path = args[:json_path] if args.key?(:json_path)\n @name = args[:name] if args.key?(:name)\n @priority = args[:priority] if args.key?(:priority)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @errors = args[:errors] if args.key?(:errors)\n @request_id = args[:request_id] if args.key?(:request_id)\n end", "def update!(**args)\n @attributes = args[:attributes] if args.key?(:attributes)\n @resources = args[:resources] if args.key?(:resources)\n @service_config_id = args[:service_config_id] if args.key?(:service_config_id)\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @validation_result = args[:validation_result] if args.key?(:validation_result)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @kind = args[:kind] if args.key?(:kind)\n @metadata = args[:metadata] if args.key?(:metadata)\n @spec = args[:spec] if args.key?(:spec)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @client = args[:client] if args.key?(:client)\n @list_update_requests = args[:list_update_requests] if args.key?(:list_update_requests)\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @argument = Argument.find(params[:id])\n\n respond_to do |format|\n if @argument.update_attributes(params[:argument])\n format.html { redirect_to(@argument, :notice => 'Argument was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @argument.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @args = args[:args] if args.key?(:args)\n @format = args[:format] if args.key?(:format)\n end", "def update!(**args)\n @args = args[:args] if args.key?(:args)\n @format = args[:format] if args.key?(:format)\n end", "def update!(**args)\n @metadata = args[:metadata] if args.key?(:metadata)\n @parameters = args[:parameters] if args.key?(:parameters)\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update!(**args)\n @args = args[:args] if args.key?(:args)\n @format = args[:format] if args.key?(:format)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @done = args[:done] if args.key?(:done)\n @error = args[:error] if args.key?(:error)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n @response = args[:response] if args.key?(:response)\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @name = args[:name] if args.key?(:name)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @cloud_ai_document_option = args[:cloud_ai_document_option] if args.key?(:cloud_ai_document_option)\n @document = args[:document] if args.key?(:document)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n @update_options = args[:update_options] if args.key?(:update_options)\n end", "def patch(action, **args); end", "def update!(**args)\n @errors = args[:errors] if args.key?(:errors)\n @etag = args[:etag] if args.key?(:etag)\n @group_id = args[:group_id] if args.key?(:group_id)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @resource = args[:resource] if args.key?(:resource)\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @contact_center = args[:contact_center] if args.key?(:contact_center)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @requested_cancellation = args[:requested_cancellation] if args.key?(:requested_cancellation)\n @status_message = args[:status_message] if args.key?(:status_message)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end", "def update!(**args)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n end", "def update!(**args)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n end", "def update!(**args)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n end", "def update!(**args)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n end", "def update!(**args)\n @attributes = args[:attributes] if args.key?(:attributes)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end", "def update!(**args)\n @automatic_resources = args[:automatic_resources] if args.key?(:automatic_resources)\n @create_time = args[:create_time] if args.key?(:create_time)\n @dedicated_resources = args[:dedicated_resources] if args.key?(:dedicated_resources)\n @disable_explanations = args[:disable_explanations] if args.key?(:disable_explanations)\n @display_name = args[:display_name] if args.key?(:display_name)\n @enable_access_logging = args[:enable_access_logging] if args.key?(:enable_access_logging)\n @enable_container_logging = args[:enable_container_logging] if args.key?(:enable_container_logging)\n @explanation_spec = args[:explanation_spec] if args.key?(:explanation_spec)\n @id = args[:id] if args.key?(:id)\n @model = args[:model] if args.key?(:model)\n @model_version_id = args[:model_version_id] if args.key?(:model_version_id)\n @private_endpoints = args[:private_endpoints] if args.key?(:private_endpoints)\n @service_account = args[:service_account] if args.key?(:service_account)\n @shared_resources = args[:shared_resources] if args.key?(:shared_resources)\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @resource_key = args[:resource_key] if args.key?(:resource_key)\n end", "def update!(**args)\n @inputs = args[:inputs] if args.key?(:inputs)\n @parameters = args[:parameters] if args.key?(:parameters)\n end", "def update!(**args)\n @resource_type = args[:resource_type] if args.key?(:resource_type)\n @service = args[:service] if args.key?(:service)\n @version = args[:version] if args.key?(:version)\n end" ]
[ "0.6496346", "0.6487871", "0.6477869", "0.64733905", "0.64583373", "0.6392508", "0.6350201", "0.6350201", "0.6350201", "0.6350201", "0.6350201", "0.6350201", "0.6326692", "0.6290549", "0.62776536", "0.6274179", "0.6263639", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.6261728", "0.62569785", "0.62569785", "0.62569785", "0.62569785", "0.6256926", "0.62534535", "0.62534535", "0.624882", "0.6247961", "0.62469083", "0.62469083", "0.6244602", "0.62382364", "0.62287676", "0.6213283", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.6212171", "0.620829", "0.619862", "0.61952657", "0.61913985", "0.6183399", "0.61741215", "0.6172295", "0.6172295", "0.6172295", "0.6172295", "0.6165201", "0.6158864", "0.61509013", "0.61482346", "0.61474365" ]
0.639729
5
DELETE /arguments/1 DELETE /arguments/1.json
def destroy @argument.destroy respond_to do |format| format.html { redirect_to arguments_url, notice: 'Argument was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @argument = Argument.find(params[:id])\n @argument.destroy\n\n respond_to do |format|\n format.html { redirect_to(arguments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @argument.destroy\n respond_to do |format|\n format.html {redirect_to arguments_url, notice: 'Argument was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def delete(*args)\n request(:delete, *args)\n end", "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end", "def delete(*rest) end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @argument_node = ArgumentNode.find(params[:id])\n @argument_node.destroy\n\n respond_to do |format|\n format.html { redirect_to argument_nodes_url }\n format.json { head :no_content }\n end\n end", "def delete!(*rest) end", "def delete(*args)\n Request.delete(*args)\n end", "def delete(*args)\n execute(:delete, *args)\n end", "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end", "def destroy\n @argument_connection = ArgumentConnection.find(params[:id])\n @argument_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to argument_connections_url }\n format.json { head :no_content }\n end\n end", "def delete(action, **args); end", "def destroy\n @argument = Argument.find(params[:id])\n @argumentable = @argument.argumentable_type.constantize.find_by_id(@argument.argumentable_id)\n\n respond_to do |format|\n if @argument.destroy\n format.html { redirect_to(@argumentable, :notice => t('arguments.destroyed')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"delete\" }\n format.xml { render :xml => @argument.errors, :status => :unprocessable_entity }\n end\n end\n end", "def destroy\n @argument_post.destroy\n respond_to do |format|\n format.html { redirect_to argument_posts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if params[:argument_id]\n authorize! :update, Argument.find(params[:argument_id])\n at = ArgumentsTheorem.where(argument_id: params[:argument_id], theorem_id: @theorem.id)\n at.delete_all\n head :no_content\n else\n authorize! :destroy, @theorem\n @theorem.destroy\n head :no_content\n end\n end", "def delete!\n request! :delete\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def delete(*args)\n commit(\"delete\", *args)\n end", "def _delete(type, *args)\n type = type.to_s.camelize\n metadata = args.map { |full_name| {:full_name => full_name} }\n request :delete do |soap|\n soap.body = {\n :metadata => metadata\n }.merge(attributes!(type))\n end\n end", "def delete(*args)\n commit(\"delete\", *args)\n end", "def delete\n request(:delete)\n end", "def delete(args)\n args = {:path => args} unless args.is_a?(Hash)\n assert_supported_keys(args, [:path, :version, :callback, :context])\n assert_required_keys(args, [:path])\n args[:version] ||= -1\n\n if args[:callback] ## asynchronous\n raise KeeperException::BadArguments unless args[:callback].kind_of?(VoidCallback)\n return zoo_adelete(@zk_handle, args[:path], args[:version], args[:callback].proc, YAML.dump(args[:context]))\n end\n\n ## synchronous\n rc = zoo_delete(@zk_handle, args[:path], args[:version])\n raise KeeperException.by_code(rc), ZooKeeperFFI::zerror(rc) unless rc == ZOK\n return rc\n end", "def deleteLocation _args\n \"deleteLocation _args;\" \n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend", "def deleteIdentity _args\n \"deleteIdentity _args;\" \n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @command.destroy\n respond_to do |format|\n msg = { :status => 'ok', message: 'Deleted Successfully'}\n format.json { render json: msg }\n end\n end", "def deleteVehicle _args\n \"deleteVehicle _args;\" \n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def destroy\n @command_parameter = CommandParameter.find(params[:id])\n @command_parameter.destroy\n\n respond_to do |format|\n format.html { redirect_to command_parameters_url }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end", "def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend", "def deleteRequest\n\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'La commande a été détruite.' }\n format.json { head :no_content }\n end\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend", "def delete options\n rest_request({ method: :delete }.merge(options))\n end", "def delete options\n rest_request({ method: :delete }.merge(options))\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'Command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n if body.empty? && params[:id]\n client.delete(params)\n elsif body.empty?\n client.delete_by_query(params.merge(body: body.merge(ALL)))\n else\n client.delete_by_query(params.merge(body: body))\n end\n end", "def delete\n api(\"Delete\")\n end", "def deleteWaypoint _args\n \"deleteWaypoint _args;\" \n end", "def deleteCollection _args\n \"deleteCollection _args;\" \n end", "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end", "def delete\n sql = \"DELETE FROM albums WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\nend", "def delete(url, resource_name, options = {})\n build_response(resource_name) do\n connection.delete do |req|\n req.url url\n req.body = options.to_json\n end\n end\n end", "def delete(path, **options)\n execute :delete, path, options\n end", "def delete(name)\n\n end", "def destroy\n @argumentative_question.destroy\n respond_to do |format|\n format.html { redirect_to argumentative_questions_url, notice: 'Pregunta eliminada.' }\n format.json { head :no_content }\n end\n end", "def delete(*args)\n args.each do |arg|\n @cache.delete(\"#{@cache_name}:#{arg}\")\n end\n end", "def delete(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'delete'}.merge(authentication))\n end", "def del(*args); end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete(url)\n call(url: url, action: :delete)\n end", "def tvDelete _args\n \"tvDelete _args;\" \n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete(*args)\n if args.length == 1\n index = *args\n delete_index(index)\n elsif args.length == 2\n start_index, end_index = *args\n delete_range(start_index, end_index)\n elsif args.length > 2 && args.length < @items.length\n indices = *args.each { |arg| arg }\n delete_indices(indices)\n else\n raise UdaciListErrors::ArgumentError, \"Too many arguments\" if args.length\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def delete(uri, parameters)\n response = Unirest.delete uri, parameters: parameters\n response.body\n end", "def delete(*args)\n url, subdomain, path, = parse_args(*args)\n rewrap_errors do\n RestClient.delete(build_url(url || subdomain, path), headers)\n end\n end", "def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end", "def delete operation, *args\n request(args) do |attrs, headers|\n @oauth_access_token.send(:delete, \"/#{API_VERSION}/#{operation}.#{API_FORMAT}\", headers)\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @commander = Commander.find(params[:id])\n @commander.destroy\n\n respond_to do |format|\n format.html { redirect_to commanders_url }\n format.json { head :no_content }\n end\n end", "def http_delete(path, data = nil, content_type = 'application/json')\n http_methods(path, :delete, data, content_type)\n end", "def delete(data)\n params = self.params\n data['delete']['parameters'].each { |p|\n params.delete(p) if params.has_key?(p)\n }\n write(params)\n data['delete']['parameters']\n end", "def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end", "def delete\n sql = 'DELETE FROM members WHERE id = $1'\n values = [@id]\n SqlRunner.run(sql, values)\nend", "def destroy\n return if @name.nil?\n delete_rest \"extra/#{@name}\"\n end", "def destroy\n @command_item = CommandItem.find(params[:id])\n @command_item.destroy\n\n respond_to do |format|\n format.html { redirect_to command_items_url }\n format.json { head :no_content }\n end\n end", "def delete(request)\n @connection.delete request.path do |req|\n req.body = request.params\n end\n end", "def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end", "def destroy\n @step_command.destroy\n respond_to do |format|\n format.html { redirect_to step_commands_url, notice: 'Step command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end", "def delete(requested_object_id, options = {})\n post(requested_object_id, options.merge(:method => 'delete'))\n end", "def delete(path, opts = {})\n request(:delete, path, opts).body\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def delete(uri, options = {})\n build_response(request.delete(uri, build_request_options({:input => options.to_params})))\n end", "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "def api_delete(action, data)\n api_request(action, data, 'DELETE')\n end", "def delete(path, data={})\n request(:delete, path, data)\n end", "def delete_option\n option_param = params.permit(:id)\n\n render json: Option.delete_option(option_param)\n end", "def delete\n render json: User.delete(params[\"id\"])\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.75688696", "0.72847176", "0.71873206", "0.7144435", "0.70105094", "0.6998808", "0.69948167", "0.68987846", "0.6848293", "0.68137556", "0.6784354", "0.67412", "0.6682015", "0.6670422", "0.65815276", "0.6571792", "0.6547695", "0.64841104", "0.6479914", "0.6474277", "0.6410514", "0.64078444", "0.6363309", "0.6331244", "0.63057", "0.6273439", "0.62711424", "0.6268681", "0.62465364", "0.62388754", "0.6236447", "0.6214224", "0.6212172", "0.6204911", "0.6183617", "0.6174134", "0.6174134", "0.6154016", "0.615083", "0.6144457", "0.61329156", "0.6127327", "0.6124151", "0.6109741", "0.609378", "0.609378", "0.6087186", "0.6082334", "0.6079222", "0.60679513", "0.60544235", "0.60499316", "0.6047279", "0.60404456", "0.6034192", "0.6026164", "0.602334", "0.60217535", "0.6018539", "0.601394", "0.60123825", "0.6011225", "0.6009597", "0.6009368", "0.6009368", "0.59774125", "0.59774125", "0.59774125", "0.59774125", "0.5973716", "0.59706837", "0.5969008", "0.5968823", "0.5964544", "0.5961172", "0.5954387", "0.59464586", "0.5944817", "0.59408355", "0.5939524", "0.5928457", "0.59209704", "0.59179884", "0.5906627", "0.5903614", "0.59002006", "0.5894747", "0.5891383", "0.58882725", "0.5887653", "0.58830667", "0.5878971", "0.5874595", "0.58735365", "0.58733475", "0.5869477", "0.586375", "0.5858646", "0.58567953" ]
0.7184689
4
Use callbacks to share common setup or constraints between actions.
def set_argument @argument = Argument.friendly.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def argument_params params[:argument] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def valid_params_request?; end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def active_code_params\n params[:active_code].permit\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def filter_parameters; end", "def filter_parameters; end", "def list_params\n params.permit(:name)\n end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def url_whitelist; end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.6293856", "0.6290323", "0.62816143", "0.6241851", "0.6241208", "0.622036", "0.62128764", "0.62110275", "0.61966056", "0.61776453", "0.617547", "0.6174961", "0.61654735", "0.6153256", "0.61516005", "0.6149498", "0.6123234", "0.6118653", "0.61077267", "0.61061186", "0.6093616", "0.608318", "0.6074428", "0.60650206", "0.60244286", "0.6020295", "0.60155797", "0.6012826", "0.6010141", "0.6010141", "0.60037106", "0.600298", "0.59979576", "0.5994806", "0.5994283", "0.5993927", "0.5980616", "0.59667075", "0.59614897", "0.59610957", "0.596071", "0.5959614", "0.59554", "0.59542966", "0.5946781", "0.5940262", "0.5940262", "0.59401053", "0.5937168", "0.5932135", "0.59293395", "0.592659", "0.59202623", "0.59112674", "0.59088206", "0.590716", "0.59056735", "0.589997", "0.5899655", "0.5898926", "0.5896042", "0.589589", "0.5895867", "0.58894163", "0.5884936", "0.5879227", "0.58740723", "0.5871364", "0.5870148", "0.5869228", "0.5868196", "0.5867967", "0.5865532", "0.58653617", "0.58644646", "0.58631665", "0.5862611", "0.5857609", "0.58558804", "0.5853729", "0.5853025" ]
0.0
-1
check if the left child of is greater than parent
def left_child_greater?(array, index) array[left_child(index)] && (left_child(index) > array[index]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def child? \n parent_id = self[parent_col_name]\n !(parent_id == 0 || parent_id.nil?) && (self[left_col_name] > 1) && (self[right_col_name] > self[left_col_name])\n end", "def child? \n parent_id = self[parent_col_name]\n !(parent_id == 0 || parent_id.nil?) && (self[left_col_name] > 1) && (self[right_col_name] > self[left_col_name])\n end", "def child? \n parent_id = self[acts_as_nested_set_options[:parent_column]]\n !(parent_id == 0 || parent_id.nil?) && (self[acts_as_nested_set_options[:left_column]] > 1) && (self[acts_as_nested_set_options[:right_column]] > self[acts_as_nested_set_options[:left_column]])\n end", "def child?\n parent_id = self[nested_set_parent]\n !(parent_id == 0 || parent_id.nil?) && (self[nested_set_left] > 1) && (self[nested_set_right] > self[nested_set_left])\n end", "def is_parent_greater_than_child(index, parent)\n @tree[parent].rating > @tree[index].rating\n end", "def child_of?(parent, scope = {})\n if !scope.empty? && parent.respond_to?(:child_by_id)\n parent.child_by_id(self.id, scope).is_a?(self.class)\n else\n parent.respond_to?(left_col_name) && self[left_col_name] > parent[left_col_name] && self[right_col_name] < parent[right_col_name]\n end\n end", "def isLeftChild?\r\n return nil if isRoot?\r\n self == parent.leftChild\r\n end", "def root?\n parent_id = self[parent_col_name]\n (parent_id == 0 || parent_id.nil?) && self[right_col_name] && self[left_col_name] && (self[right_col_name] > self[left_col_name])\n end", "def root?\n parent_id = self[parent_col_name]\n (parent_id == 0 || parent_id.nil?) && self[right_col_name] && self[left_col_name] && (self[right_col_name] > self[left_col_name])\n end", "def right_child_greater?(array, index)\n @array[right_child(index)] && (@array[right_child(index)] > @array[index])\n end", "def left_child?(node_id)\n (node_id & 1) == 0 # node_id % 2 == 0\n end", "def root?\n parent_id = self[acts_as_nested_set_options[:parent_column]]\n (parent_id == 0 || parent_id.nil?) && (self[acts_as_nested_set_options[:left_column]] == 1) && (self[acts_as_nested_set_options[:right_column]] > self[acts_as_nested_set_options[:left_column]])\n end", "def leaf?\n right - left == 1\n end", "def one_shift_greater_than_parent?(node, actual_indent)\n parent_indent = node_indent(node_indent_parent(node)).length\n expected_indent = parent_indent + @indent_width\n expected_indent == actual_indent\n end", "def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\t\t\telsif parent.right.nil?\n\t\t\t\tif parent.value > parent.left.value\n\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\tend\n\t\t\telse\t\t\n\t\t\t\tif parent.value > parent.left.value || parent.value > parent.right.value\n\t\t\t\t\tif parent.left.value < parent.right.value\n\t\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\t\t\tchild_compare(parent.left)\n\t\t\t\t\telse\n\t\t\t\t\t\tswap(parent.right, parent)\n\t\t\t\t\t\tchild_compare(parent.right)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def < other_node\n return true if other_node.nil?\n\n self.val < other_node.val && self < other_node.left && self < other_node.right\n end", "def asgn_left?\n OP_ASSIGN.include?(parent_type) && parent.node.children.first.equal?(node)\n end", "def check_children(value, node)\n if value < node.value\n node.left\n else\n node.right\n end\n end", "def child_of?(parent); end", "def leftChild\r\n children.first\r\n end", "def left_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$lt' => left }, :order => \"#{left_column_name} DESC\")\n end", "def <=>(x)\n left <=> x.left\n end", "def left_child(root, length)\n child = root * 2 + 1\n if child < length\n return child\n end\n return\nend", "def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\t\t\telsif parent.right.nil?\n\t\t\t\tif parent.rating > parent.left.rating\n\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\tend\n\t\t\telse\t\t\n\t\t\t\tif parent.rating > parent.left.rating || parent.rating > parent.right.rating\n\t\t\t\t\tif parent.left.rating < parent.right.rating\n\t\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\t\t\tchild_compare(parent.left)\n\t\t\t\t\telse\n\t\t\t\t\t\tswap(parent.right, parent)\n\t\t\t\t\t\tchild_compare(parent.right)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def <=>(x)\n left <=> x.left\n end", "def hasChildren\n if (@left == nil) && (@right == nil)\n return 0\n elsif (@left != nil) && (@right != nil)\n return 2\n else\n return 1\n end\n end", "def has_one_child\n if self.left_child.nil? && !self.right_child.nil?\n self.right_child\n elsif !self.left_child.nil? && self.right_child.nil?\n self.left_child\n else\n nil\n end\n end", "def balanced?\n difference_left_right = @root.left_child.depth - @root.right_child.depth\n difference_left_right.between?(-1, 1)\n end", "def filter_down element\n left_child_is_less_than_element = element.left && element.left.rating < element.rating\n right_child_is_less_than_element = element.right && element.right.rating < element.rating\n\n while left_child_is_less_than_element or right_child_is_less_than_element\n lower_rated_element = nil\n if left_child_is_less_than_element\n lower_rated_element = element.left\n elsif right_child_is_less_than_element\n lower_rated_element = element.right\n end\n element = swap_node_position(element, lower_rated_element)\n left_child_is_less_than_element = element.left && element.left.rating < element.rating\n right_child_is_less_than_element = element.right && element.right.rating < element.rating\n end\n end", "def last?\n if tree.columns.counter_cache? && parent\n parent.children.size == position\n else\n !right_sibling\n end\n end", "def leaf?\n persisted? && right.to_i - left.to_i == 1\n end", "def is_only_child?\n return false if parent.nil? # root\n 1 == parent.children.size\n end", "def parent_relative_left\n left - (parent.try(:left) || 0)\n end", "def <=>(other)\n @left <=> other.left\n end", "def left_child\n # Returns left_child unless it's nil\n return @left_child unless @left_child.nil?\n\n # If passed the guard, left_child was not calculated yet, so generates it,\n # stores a ref and return the node\n @left_child = calculate_left_child\n @left_child\n end", "def left_child(parent_index)\n left = 2 * parent_index + 1\n return -1 if left > (@array.size - 1)\n left\n end", "def is_leaf?\n self.left_child == nil and\n self.right_child == nil\n end", "def find_minimum_value\n if self.left_child\n self.left_child.find_minimum_value\n else\n self.value\n end\n end", "def left?(new_x_position, new_y_position)\n (self.x_position - new_x_position.to_i) > 0 && (new_y_position == self.y_position)\n end", "def bubble_down()\n\t\t# remove max and swap with last node\n\t\t@elements[0] = @elements.pop\n\t\ti = 0\n\t\twhile(i < @elements.length)\n\t\t\tmax_idx = i\n\t\t\t# find greater of left and right child\n\t\t\tif((2*i + 1) < @elements.length && @elements[2*i + 1][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 1\n\t\t\tend\n\t\t\tif((2*i + 2) < @elements.length && @elements[2*i + 2][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 2\n\t\t\tend\n\t\t\t# if left or right child is greater, swap and update i\n\t\t\tif(max_idx != i)\n\t\t\t\tswap(i, max_idx)\n\t\t\t\ti = max_idx\n\t\t\t# if not, we are done\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\tend", "def root?\n parent_id = self[nested_set_parent]\n (parent_id == 0 || parent_id.nil?) && (self[nested_set_left] == 1) && (self[nested_set_right] > self[nested_set_left])\n end", "def min_left_child(node)\n if node.left_child.nil?\n return node\n end\n\n return min_left_child(node.left_child)\n end", "def calculate_left_child\n # Guard condition for movement not possible\n return nil if blank_x + 1 == size\n\n # Make the movement\n new_state = swap_left\n\n # Avoids loop\n parents_array = parent_states(3)\n return nil if parents_array.include?(new_state)\n\n # Returns new node\n Node.new(new_state, self, blank_x + 1, blank_y)\n end", "def left_sibling\n list.reverse.first(:position.lt => position)\n end", "def valid_child(le)\n\t\t\treturn false\n\t\tend", "def children?(this_level)\n @reader.level > this_level\n end", "def test_left_child\n @root << @left_child1\n @root << @right_child1\n assert_same(@left_child1, @root.left_child, \"The left child should be 'left_child1\")\n assert_not_same(@right_child1, @root.left_child, \"The right_child1 is not the left child\")\n end", "def <=>(x)\n self[acts_as_nested_set_options[:left_column]] <=> x[acts_as_nested_set_options[:left_column]]\n end", "def max_child(left, right, list)\n if !right || !left || list[left] > list[right]\n return left\n end\n return right\nend", "def right_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$gt' => right }, :order => \"#{left_column_name}\")\n end", "def >= (other)\n #compares by edge length\n return @length>=other.distance()\n end", "def greater_parent(parent, value)\n if parent.value > value\n return parent\n else\n if parent.parent.nil?\n return nil\n else\n greater_parent(parent.parent, value)\n end\n end\nend", "def has_x_descendants(game, descendants_left)\n if 0 == descendants_left\n game.children.empty?\n else\n has_x_descendants(game.children.first, descendants_left - 1) && has_x_descendants(game.children.last, descendants_left - 1)\n end\n end", "def parent_has_greater_permissions\n unless Topic.visible_tos[parent.visible_to] >= Topic.visible_tos[visible_to]\n errors.add :visible_to, 'can’t be greater than parent'\n end\n unless Topic.editable_bies[parent.editable_by] >= Topic.editable_bies[editable_by]\n errors.add :editable_by, 'can’t be greater than parent'\n end\n end", "def parent_compare(child, parent)\n\t\tunless parent.nil?\n\t\t\tif child.value < parent.value\n\t\t\t\tswap(child, parent)\n\t\t\t\tparent_compare(child, child.parent)\n\t\t\tend \n\t\tend\n\tend", "def is_a_leaf?\n self.left_child.nil? && self.right_child.nil?\n end", "def children_are_leaves?\n unless leaf?\n @children[0].leaf?\n end\n end", "def left_edge?\n x == 0\n end", "def is_leaf\n return @left == nil\n end", "def <=>(other)\n return 1 if self.left > other.left\n return -1 if self.left < other.left\n return 0 if self.vertically_overlaps?(other)\n return 1 if self.top > other.top\n return -1 if self.top < other.top\n return 0\n end", "def heap_down(parentIndex)\n # compare node @ parentIndex to its children\n # if parent <= both children, min heap :-) base case\n # if parent > either/both child, swap places with the smaller child, then min_heap_down(childIndex), recursion!\n # when no more children to compare to, base case :-)\n \n # first find out if parent has LC or RC\n indexLC = parentIndex * 2 + 1 \n indexRC = indexLC + 1\n \n if @store.length > indexRC\n # both LC & RC exist, need to compare with both children\n if (@store[parentIndex].key > @store[indexLC].key) && (@store[parentIndex].key > @store[indexRC].key)\n # both LC & RC broke the heap property, which one is smaller?\n @store[indexLC].key > @store[indexRC].key ? (indexOfSmallerChild = indexRC) : (indexOfSmallerChild = indexLC)\n swap(parentIndex, indexOfSmallerChild)\n heap_down(indexOfSmallerChild)\n \n elsif @store[parentIndex].key > @store[indexLC].key\n # only LC broke the heap property\n swap(parentIndex, indexLC)\n heap_down(indexLC)\n \n elsif @store[parentIndex].key > @store[indexRC].key\n # only RC broke the heap property\n swap(parentIndex, indexRC)\n heap_down(indexRC)\n \n else \n # both children are bigger than parent -> min heap :-) base case\n return\n end\n \n elsif @store.length > indexLC\n # only LC exists\n if @store[parentIndex].key <= @store[indexLC].key\n # min heap :-) base case\n return \n else\n swap(parentIndex, indexLC)\n heap_down(indexLC)\n end\n \n else\n # no children, base case\n return\n end\n end", "def lt?(x,y)\n y-x > relative_to_many(:max, x, y)\n end", "def right_child?(node_id)\n (node_id & 1) == 1 # node_id % 2 == 1\n end", "def left_of?(p1, p2)\n cross(p1, p2) > 0\n end", "def is_child?\n !is_parent?\n end", "def min_child(index)\n ch_e = (index + 1) * 2\n ch_o = (index * 2) + 1\n\n if @nodes[ch_e] && @nodes[ch_o]\n @compare_fn[@nodes[ch_e][:value], @nodes[ch_o][:value]] ? ch_e : ch_o\n elsif @nodes[ch_e]\n ch_e\n elsif @nodes[ch_o]\n ch_o\n else\n nil\n end\n end", "def left_optimizable?\n !left.equal?(operation.left)\n end", "def isRightChild?\r\n return nil if isRoot?\r\n self == parent.rightChild\r\n end", "def at_bottom?\n lower_siblings.empty?\n end", "def child?\n !root?\n end", "def child?\n !root?\n end", "def parent?\n !children.empty?\n end", "def <=>(another_object)\n return 0 if self.leaf? && another_object.leaf?\n return 1 unless self.leaf?\n return -1 unless another_object.leaf?\n self <=> another_object\n end", "def has_children?(tree_node)\n tree_node.left || tree_node.right\n end", "def heap_down(index)\n left_child = 2 * index + 1\n right_child = 2 * index + 2\n min_child = nil\n\n # Return if there's no left child\n return if left_child > @store.length - 1\n\n # If there's no RIGHT child AND parent is greater than LEFT child...\n # swap parent with left child\n if @store[right_child].nil? && @store[index].key > @store[left_child].key\n swap(index, left_child)\n heap_down(index)\n elsif @store[right_child] #Otherwise, which child is min?\n if @store[right_child].key <= @store[left_child].key\n min_child = @store.index(@store[right_child])\n else\n min_child = @store.index(@store[left_child])\n end\n end\n\n # If parent is greater than minimum child, swap them\n if min_child && @store[index].key > @store[min_child].key\n swap(index, min_child)\n heap_down(index)\n end\n end", "def right_sibling\n list.first(:position.gt => position)\n end", "def left_child(index)\n left = index * 2 + 1\n if left >= @tree.length\n return INVALID_INDEX\n else\n return left\n end\n end", "def right_of?(w)\n\t\t(w.left < self.left) &&\n\t\t(w.top <= self.bottom) &&\n\t\t(self.top <= w.bottom)\n\tend", "def left_right(key, node)\n case child_count(node)\n when 1\n node.left.nil? ? node.right : node.left\n when 2\n node.data > key ? node.left : node.right\n end\n end", "def filter_up(element)\n element_index = @tree.index(element)\n parent = element_index / 2\n element_is_greater_than_child = @tree[parent] && @tree[parent].rating > element.rating\n while element_is_greater_than_child\n swap_node_position(@tree[parent], element)\n parent = element_index / 2\n element_is_greater_than_child = @tree[parent] && @tree[parent].rating > element.rating\n end\n end", "def heapify_down\n # Swap the current_node (starting with root) with its smallest child until it's smaller than both of its children\n previous_current_node = nil\n current_node = 0\n # When the current_node is not changing, then it has swapped as many times as it can\n until previous_current_node == current_node\n previous_current_node = current_node\n right_child = right_child_node current_node\n left_child = left_child_node current_node\n\n # Bounds check for when current_node is one of the last two nodes\n # Or if there are only two nodes total\n if right_child >= @nodes.size\n # Correctly order nodes if there are only two nodes\n if @nodes.size == 2 && @nodes[left_child] < @nodes[current_node]\n @nodes[current_node], @nodes[left_child] = @nodes[left_child], @nodes[current_node] \n end\n break\n end\n\n # If current_node is greater than either of its children\n if @nodes[current_node] > @nodes[left_child] || @nodes[current_node] > @nodes[right_child]\n # Swap with the smallest child\n if @nodes[left_child] <= @nodes[right_child]\n @nodes[current_node], @nodes[left_child] = @nodes[left_child], @nodes[current_node]\n current_node = left_child\n else\n @nodes[current_node], @nodes[right_child] = @nodes[right_child], @nodes[current_node]\n current_node = right_child\n end\n end\n end\n end", "def is_balanced?\n diff = (self.left.depth - self.right.depth).abs\n if diff <= 1\n true\n else\n false\n end\n end", "def left_sibling\n higher_items.last\n end", "def left\n return @left\n end", "def left\n return @left\n end", "def <=>(x)\n self[nested_set_left] <=> x[nested_set_left]\n end", "def left_child(indx)\n 2*indx + 1\n end", "def min_child(index)\n left_child_index = left_child(index)\n right_child_index = right_child(index)\n min_child_index = left_child_index\n if right_child_index != INVALID_INDEX && @tree[right_child_index] < @tree[left_child_index]\n min_child_index = right_child_index\n end\n return min_child_index\n end", "def left_sibling\n siblings.filter(self.class.qualified_left_column < left).order(self.class.qualified_left_column.desc).first\n end", "def left_child(node_id)\n node_id << 1 # node_id * 2\n end", "def check_invariants()\n index = 0\n left = index*2+1\n right = index*2+2\n\n while (left < @ary.size)\n if @ary[left].key < @ary[index].key\n raise \"Smaller left child with parent index=#{index} and value=#{@ary[index].key} and left child #{@ary[left].key}\"\n end\n\n if (right < @ary.size) && @ary[right].key < @ary[index].key\n raise \"Smaller right child with parent index=#{index} and value=#{@ary[index].key} and right child #{@ary[right].key}\"\n end\n\n index = index + 1\n left = index*2+1\n right = index*2+2\n\n end\n end", "def overruns\n if self.left >= 0\n return 0\n else\n return self.left * -1\n end\n end", "def child?\n !root?\n end", "def <=>(other)\n yDifference = (self.bottom - other.bottom).abs\n if yDifference < 0.1 ||\n (other.bottom >= self.top && other.bottom <= self.bottom) ||\n (self.bottom >= other.top && self.bottom <= other.bottom)\n self.left <=> other.left\n else\n self.bottom <=> other.bottom\n end\n end", "def balanced?\n (height(@root.left) - height(root.right)).between?(-1, 1)\n end", "def at_top?\n higher_siblings.empty?\n end", "def child?\n !root?\n end", "def hit_left_screen_edge?\n self.x < 0\n end", "def node?\n (self.forestify_right_position - self.forestify_left_position) > 1\n end", "def left_most(node)\n if node.left\n left_most(node.left)\n else\n node\n end\nend" ]
[ "0.7636001", "0.7636001", "0.7587314", "0.7325978", "0.6972412", "0.69609654", "0.6895651", "0.68921894", "0.68921894", "0.68766135", "0.67620105", "0.6760237", "0.6756421", "0.669682", "0.6637197", "0.6598437", "0.65784174", "0.65537393", "0.65490246", "0.65108603", "0.6500269", "0.6442405", "0.6422954", "0.63983804", "0.63924545", "0.636148", "0.6360262", "0.63509107", "0.6318531", "0.6300739", "0.62550247", "0.62340325", "0.62320876", "0.62100434", "0.6208205", "0.6197988", "0.6193557", "0.61878353", "0.6182288", "0.61651593", "0.61576265", "0.6125119", "0.612391", "0.61213136", "0.61138886", "0.6110245", "0.61019194", "0.61011755", "0.6088899", "0.60733134", "0.60681236", "0.60647035", "0.60626185", "0.6062106", "0.6056349", "0.6026535", "0.6025344", "0.6024954", "0.6017764", "0.60151035", "0.60073084", "0.5982483", "0.5981837", "0.5980896", "0.5979331", "0.5964485", "0.5961107", "0.5953333", "0.59473854", "0.5942793", "0.5942793", "0.5934566", "0.59330386", "0.5924849", "0.5914315", "0.59094733", "0.59079534", "0.59035647", "0.58993393", "0.58992225", "0.58976626", "0.58970433", "0.58948433", "0.5889338", "0.5889338", "0.5887846", "0.58804727", "0.5874212", "0.5874162", "0.586461", "0.5860367", "0.5857767", "0.5841827", "0.58389425", "0.58383536", "0.58375037", "0.58332336", "0.58311915", "0.5828616", "0.58251214" ]
0.7770504
0
we check if the right node leaf exists and if it is greater than its parent
def right_child_greater?(array, index) @array[right_child(index)] && (@array[right_child(index)] > @array[index]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root?\n parent_id = self[parent_col_name]\n (parent_id == 0 || parent_id.nil?) && self[right_col_name] && self[left_col_name] && (self[right_col_name] > self[left_col_name])\n end", "def root?\n parent_id = self[parent_col_name]\n (parent_id == 0 || parent_id.nil?) && self[right_col_name] && self[left_col_name] && (self[right_col_name] > self[left_col_name])\n end", "def leaf?\n right - left == 1\n end", "def child? \n parent_id = self[parent_col_name]\n !(parent_id == 0 || parent_id.nil?) && (self[left_col_name] > 1) && (self[right_col_name] > self[left_col_name])\n end", "def child? \n parent_id = self[parent_col_name]\n !(parent_id == 0 || parent_id.nil?) && (self[left_col_name] > 1) && (self[right_col_name] > self[left_col_name])\n end", "def root?\n parent_id = self[acts_as_nested_set_options[:parent_column]]\n (parent_id == 0 || parent_id.nil?) && (self[acts_as_nested_set_options[:left_column]] == 1) && (self[acts_as_nested_set_options[:right_column]] > self[acts_as_nested_set_options[:left_column]])\n end", "def child? \n parent_id = self[acts_as_nested_set_options[:parent_column]]\n !(parent_id == 0 || parent_id.nil?) && (self[acts_as_nested_set_options[:left_column]] > 1) && (self[acts_as_nested_set_options[:right_column]] > self[acts_as_nested_set_options[:left_column]])\n end", "def left_child_greater?(array, index)\n array[left_child(index)] && (left_child(index) > array[index])\n end", "def leaf?\n persisted? && right.to_i - left.to_i == 1\n end", "def balanced?\n difference_left_right = @root.left_child.depth - @root.right_child.depth\n difference_left_right.between?(-1, 1)\n end", "def hasChildren\n if (@left == nil) && (@right == nil)\n return 0\n elsif (@left != nil) && (@right != nil)\n return 2\n else\n return 1\n end\n end", "def < other_node\n return true if other_node.nil?\n\n self.val < other_node.val && self < other_node.left && self < other_node.right\n end", "def is_leaf?\n self.left_child == nil and\n self.right_child == nil\n end", "def is_parent_greater_than_child(index, parent)\n @tree[parent].rating > @tree[index].rating\n end", "def check_children(value, node)\n if value < node.value\n node.left\n else\n node.right\n end\n end", "def root?\n parent_id = self[nested_set_parent]\n (parent_id == 0 || parent_id.nil?) && (self[nested_set_left] == 1) && (self[nested_set_right] > self[nested_set_left])\n end", "def left_right(key, node)\n case child_count(node)\n when 1\n node.left.nil? ? node.right : node.left\n when 2\n node.data > key ? node.left : node.right\n end\n end", "def child?\n parent_id = self[nested_set_parent]\n !(parent_id == 0 || parent_id.nil?) && (self[nested_set_left] > 1) && (self[nested_set_right] > self[nested_set_left])\n end", "def leaf?\n left.nil? && right.nil?\n end", "def filter_down element\n left_child_is_less_than_element = element.left && element.left.rating < element.rating\n right_child_is_less_than_element = element.right && element.right.rating < element.rating\n\n while left_child_is_less_than_element or right_child_is_less_than_element\n lower_rated_element = nil\n if left_child_is_less_than_element\n lower_rated_element = element.left\n elsif right_child_is_less_than_element\n lower_rated_element = element.right\n end\n element = swap_node_position(element, lower_rated_element)\n left_child_is_less_than_element = element.left && element.left.rating < element.rating\n right_child_is_less_than_element = element.right && element.right.rating < element.rating\n end\n end", "def asgn_left?\n OP_ASSIGN.include?(parent_type) && parent.node.children.first.equal?(node)\n end", "def last?\n if tree.columns.counter_cache? && parent\n parent.children.size == position\n else\n !right_sibling\n end\n end", "def leaf_node?(node_id)\n @leaf_count < node_id\n end", "def is_leaf\n return @left == nil\n end", "def right_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$gt' => right }, :order => \"#{left_column_name}\")\n end", "def is_a_leaf?\n self.left_child.nil? && self.right_child.nil?\n end", "def min_under_node node\n current = node.right\n while current.left\n current = current.left\n end\n current\n end", "def right_child(root, length)\n child = root * 2 + 2\n if child < length\n return child\n end\n return\nend", "def valid_tree(current_node)\n return true if current_node.nil?\n\n return false if current_node.left != nil && current_node.left.key > current_node.key\n\n return false if current_node.right != nil && current_node.right.key < current_node.key\n\n return valid_tree(current_node.right) && valid_tree(current_node.left)\n end", "def one_shift_greater_than_parent?(node, actual_indent)\n parent_indent = node_indent(node_indent_parent(node)).length\n expected_indent = parent_indent + @indent_width\n expected_indent == actual_indent\n end", "def left_child(root, length)\n child = root * 2 + 1\n if child < length\n return child\n end\n return\nend", "def <=>(another_object)\n return 0 if self.leaf? && another_object.leaf?\n return 1 unless self.leaf?\n return -1 unless another_object.leaf?\n self <=> another_object\n end", "def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\t\t\telsif parent.right.nil?\n\t\t\t\tif parent.rating > parent.left.rating\n\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\tend\n\t\t\telse\t\t\n\t\t\t\tif parent.rating > parent.left.rating || parent.rating > parent.right.rating\n\t\t\t\t\tif parent.left.rating < parent.right.rating\n\t\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\t\t\tchild_compare(parent.left)\n\t\t\t\t\telse\n\t\t\t\t\t\tswap(parent.right, parent)\n\t\t\t\t\t\tchild_compare(parent.right)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def filter_up(element)\n element_index = @tree.index(element)\n parent = element_index / 2\n element_is_greater_than_child = @tree[parent] && @tree[parent].rating > element.rating\n while element_is_greater_than_child\n swap_node_position(@tree[parent], element)\n parent = element_index / 2\n element_is_greater_than_child = @tree[parent] && @tree[parent].rating > element.rating\n end\n end", "def test_right_child\n @root << @left_child1\n @root << @right_child1\n assert_same(@right_child1, @root.right_child, \"The right child should be 'right_child1\")\n assert_not_same(@left_child1, @root.right_child, \"The left_child1 is not the left child\")\n end", "def max_child(left, right, list)\n if !right || !left || list[left] > list[right]\n return left\n end\n return right\nend", "def isRightChild?\r\n return nil if isRoot?\r\n self == parent.rightChild\r\n end", "def child_compare(parent)\n\t\tunless parent.nil?\n\t\t\tif parent.left.nil? && parent.right.nil?\n\t\t\t\tnil\n\t\t\telsif parent.right.nil?\n\t\t\t\tif parent.value > parent.left.value\n\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\tend\n\t\t\telse\t\t\n\t\t\t\tif parent.value > parent.left.value || parent.value > parent.right.value\n\t\t\t\t\tif parent.left.value < parent.right.value\n\t\t\t\t\t\tswap(parent.left, parent)\n\t\t\t\t\t\tchild_compare(parent.left)\n\t\t\t\t\telse\n\t\t\t\t\t\tswap(parent.right, parent)\n\t\t\t\t\t\tchild_compare(parent.right)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def test_max_2_nodes_one_to_left\n @tree.insert(\"b\")\n @tree.insert(\"a\")\n assert_equal \"b\", @tree.max\n end", "def is_balanced?\n diff = (self.left.depth - self.right.depth).abs\n if diff <= 1\n true\n else\n false\n end\n end", "def child_of?(parent, scope = {})\n if !scope.empty? && parent.respond_to?(:child_by_id)\n parent.child_by_id(self.id, scope).is_a?(self.class)\n else\n parent.respond_to?(left_col_name) && self[left_col_name] > parent[left_col_name] && self[right_col_name] < parent[right_col_name]\n end\n end", "def test_left_child\n @root << @left_child1\n @root << @right_child1\n assert_same(@left_child1, @root.left_child, \"The left child should be 'left_child1\")\n assert_not_same(@right_child1, @root.left_child, \"The right_child1 is not the left child\")\n end", "def isLeaft(node,father)\n if (node.getLeft() == nil && node.getRight() == nil)\n if father.getData() < node.getData()\n father.setRight(nil)\n else\n father.setLeft(nil)\n end\n return node\n end \n return nil \n end", "def find_end_of_node_path(i)\n left_index = left_child_index(i)\n right_index = right_child_index(i)\n \n if left_index > @heap_size && right_index > @heap_size\n i\n elsif right_index > @heap_size\n left_index\n else\n max_child_index = -1\n left_child_value = self[left_index - 1]\n right_child_value = self[right_index - 1]\n if right_child_value && left_child_value > right_child_value\n max_child_index = left_index\n else\n max_child_index = right_index\n end\n find_end_of_node_path max_child_index\n end\n end", "def has_one_child\n if self.left_child.nil? && !self.right_child.nil?\n self.right_child\n elsif !self.left_child.nil? && self.right_child.nil?\n self.left_child\n else\n nil\n end\n end", "def greater_parent(parent, value)\n if parent.value > value\n return parent\n else\n if parent.parent.nil?\n return nil\n else\n greater_parent(parent.parent, value)\n end\n end\nend", "def prune_from_tree\n return if self.right.nil? || self.left.nil?\n diff = self.right - self.left + 1\n\n #TODO: implemente :dependent option\n # delete_method = acts_as_nested_set_options[:dependent] == :destroy ?\n # :destroy_all : :delete_all\n\n #TODO: implement prune method\n # self.class.base_class.transaction do\n # nested_set_scope.send(delete_method,\n # [\"#{quoted_left_column_name} > ? AND #{quoted_right_column_name} < ?\",\n # left, right]\n # )\n # nested_set_scope.update_all(\n # [\"#{quoted_left_column_name} = (#{quoted_left_column_name} - ?)\", diff],\n # [\"#{quoted_left_column_name} >= ?\", right]\n # )\n # nested_set_scope.update_all(\n # [\"#{quoted_right_column_name} = (#{quoted_right_column_name} - ?)\", diff],\n # [\"#{quoted_right_column_name} >= ?\", right]\n # )\n # end\n end", "def children_are_leaves?\n unless leaf?\n @children[0].leaf?\n end\n end", "def before_create\n maxright = self.class.maximum(acts_as_nested_set_options[:right_column], :conditions => acts_as_nested_set_options[:scope]) || 0\n # adds the new node to the right of all existing nodes\n self[acts_as_nested_set_options[:left_column]] = maxright+1\n self[acts_as_nested_set_options[:right_column]] = maxright+2\n end", "def left_most(node)\n if node.left\n left_most(node.left)\n else\n node\n end\nend", "def heapify_down\n # Swap the current_node (starting with root) with its smallest child until it's smaller than both of its children\n previous_current_node = nil\n current_node = 0\n # When the current_node is not changing, then it has swapped as many times as it can\n until previous_current_node == current_node\n previous_current_node = current_node\n right_child = right_child_node current_node\n left_child = left_child_node current_node\n\n # Bounds check for when current_node is one of the last two nodes\n # Or if there are only two nodes total\n if right_child >= @nodes.size\n # Correctly order nodes if there are only two nodes\n if @nodes.size == 2 && @nodes[left_child] < @nodes[current_node]\n @nodes[current_node], @nodes[left_child] = @nodes[left_child], @nodes[current_node] \n end\n break\n end\n\n # If current_node is greater than either of its children\n if @nodes[current_node] > @nodes[left_child] || @nodes[current_node] > @nodes[right_child]\n # Swap with the smallest child\n if @nodes[left_child] <= @nodes[right_child]\n @nodes[current_node], @nodes[left_child] = @nodes[left_child], @nodes[current_node]\n current_node = left_child\n else\n @nodes[current_node], @nodes[right_child] = @nodes[right_child], @nodes[current_node]\n current_node = right_child\n end\n end\n end\n end", "def right_child\n # Returns right_child unless it's nil\n return @right_child unless @right_child.nil?\n\n # If passed the guard, right_child was not calculated yet, so generates it,\n # stores a ref and return the node\n @right_child = calculate_right_child\n @right_child\n end", "def heap_down(parentIndex)\n # compare node @ parentIndex to its children\n # if parent <= both children, min heap :-) base case\n # if parent > either/both child, swap places with the smaller child, then min_heap_down(childIndex), recursion!\n # when no more children to compare to, base case :-)\n \n # first find out if parent has LC or RC\n indexLC = parentIndex * 2 + 1 \n indexRC = indexLC + 1\n \n if @store.length > indexRC\n # both LC & RC exist, need to compare with both children\n if (@store[parentIndex].key > @store[indexLC].key) && (@store[parentIndex].key > @store[indexRC].key)\n # both LC & RC broke the heap property, which one is smaller?\n @store[indexLC].key > @store[indexRC].key ? (indexOfSmallerChild = indexRC) : (indexOfSmallerChild = indexLC)\n swap(parentIndex, indexOfSmallerChild)\n heap_down(indexOfSmallerChild)\n \n elsif @store[parentIndex].key > @store[indexLC].key\n # only LC broke the heap property\n swap(parentIndex, indexLC)\n heap_down(indexLC)\n \n elsif @store[parentIndex].key > @store[indexRC].key\n # only RC broke the heap property\n swap(parentIndex, indexRC)\n heap_down(indexRC)\n \n else \n # both children are bigger than parent -> min heap :-) base case\n return\n end\n \n elsif @store.length > indexLC\n # only LC exists\n if @store[parentIndex].key <= @store[indexLC].key\n # min heap :-) base case\n return \n else\n swap(parentIndex, indexLC)\n heap_down(indexLC)\n end\n \n else\n # no children, base case\n return\n end\n end", "def isLeftChild?\r\n return nil if isRoot?\r\n self == parent.leftChild\r\n end", "def calculate_right_child\n # Guard condition for movement not possible\n return nil if blank_x - 1 < 0\n\n # Make the movement\n new_state = swap_right\n\n # Avoids loop\n parents_array = parent_states(3)\n return nil if parents_array.include?(new_state)\n\n # Returns new node\n Node.new(new_state, self, blank_x - 1, blank_y)\n end", "def children_count\n 0 if @left.nil? && @right.nil?\n 1 if @left.nil? || @right.nil?\n 2\n end", "def explore_upwards(node)\n node = node.parent until node.parent.nil? || node.parent.left == node\n node.parent.nil? ? nil : node.parent.data\nend", "def successor(node)\n return if node.nil?\n # if right subtree exists, return leftmost node under it\n # i.e. this is the next higher number than the one at current node\n r = node.right\n if r\n return nil if r.nil?\n while r.left\n r = r.left\n end\n return r\n else\n # if there is no right subtree, we have to go up to parent because\n # there is no number greater than the current node\n # so we have to keep going up parents until we figure out that the\n # child was the left child of the parent because that must mean\n # the parent has to be greater in value than the current node\n current = node\n parent = current.parent\n while parent && parent.left != current\n current = parent\n parent = parent.parent\n end\n return parent\n end\nend", "def node?\n (self.forestify_right_position - self.forestify_left_position) > 1\n end", "def touch?( other )\n\t\tcommon_leaves = [ ]\n\t\tother.leaves.each do |leaf|\n\t\t\[email protected]?(leaf) and common_leaves << leaf\n\t\tend\n\t\tif common_leaves.size > 0\n\t\t\tcommon_leaves.first\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend", "def has_children?(tree_node)\n tree_node.left || tree_node.right\n end", "def node_available(value,cur_node)\n #if current node is at the bottom of the tree\n if value > cur_node.value && cur_node.right == nil\n node = BSTNode.new(value)\n node.parent = cur_node\n cur_node.right = node\n elsif value <= cur_node.value && cur_node.left == nil\n node = BSTNode.new(value)\n node.parent = cur_node\n cur_node.left = node\n elsif value > cur_node.value\n cur_node = cur_node.right\n else\n cur_node = cur_node.left\n end\n return cur_node\n end", "def max_under_node node\n current = node.left\n while current.right\n current = current.right\n end\n current\n end", "def balanced?\n (height(@root.left) - height(root.right)).between?(-1, 1)\n end", "def right_sibling\n list.first(:position.gt => position)\n end", "def balanced?\n left = height(@root.left_node)\n right = height(@root.right_node)\n\n if (left - right).abs <= 1\n return true\n end\n\n return false\n end", "def left_child?(node_id)\n (node_id & 1) == 0 # node_id % 2 == 0\n end", "def child_of?(parent); end", "def leaf?; false end", "def bubble_down()\n\t\t# remove max and swap with last node\n\t\t@elements[0] = @elements.pop\n\t\ti = 0\n\t\twhile(i < @elements.length)\n\t\t\tmax_idx = i\n\t\t\t# find greater of left and right child\n\t\t\tif((2*i + 1) < @elements.length && @elements[2*i + 1][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 1\n\t\t\tend\n\t\t\tif((2*i + 2) < @elements.length && @elements[2*i + 2][@orderBy] >= @elements[max_idx][@orderBy])\n\t\t\t\tmax_idx = 2*i + 2\n\t\t\tend\n\t\t\t# if left or right child is greater, swap and update i\n\t\t\tif(max_idx != i)\n\t\t\t\tswap(i, max_idx)\n\t\t\t\ti = max_idx\n\t\t\t# if not, we are done\n\t\t\telse\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\tend", "def is_leaf\n true\n end", "def is_leaf\n true\n end", "def has_parent?\n !root?\n end", "def overruns\n if self.left >= 0\n return 0\n else\n return self.left * -1\n end\n end", "def right_child?(node_id)\n (node_id & 1) == 1 # node_id % 2 == 1\n end", "def leaf?\n self.children.size == 0\n end", "def leaf?(r)\n r.children.empty?\n end", "def superbalanced?(root)\n terminating_levels = []\n\n nodes_to_check = []\n\n nodes_to_check << [root, 0]\n\n until nodes_to_check.empty?\n current_node, current_level = nodes_to_check[0].first, nodes_to_check.shift.last\n\n if current_node.left || current_node.right\n nodes_to_check << [current_node.left, current_level + 1] if current_node.left\n nodes_to_check << [current_node.right, current_level + 1] if current_node.right\n else\n # if we have found a terminating node, then we must check certain things:\n # if the terminating levels already has 2 elements and\n # this terminating node's current level is distinct, then we short circuit and return false\n # else just continue\n # check whether the current level and the element inside has difference greater than 1\n # if yes, then short circuit and return false\n # else, shovel the current level in and continue\n\n if terminating_levels.length == 2\n return false if !terminating_levels.include?(current_level)\n else\n return false if terminating_levels.length == 1 && !(terminating_levels.first - current_level).between?(-1, 1)\n terminating_levels << current_level if terminating_levels.first != current_level\n end\n end\n end\n\n true\nend", "def height(node)\n if node.nil?\n return 0\n elsif node.left_child.nil? && node.right_child.nil?\n return 1\n else\n left_height = height(node.left_child)\n right_height = height(node.right_child)\n if left_height >= right_height\n return left_height + 1\n else\n return right_height + 1\n end\n end\nend", "def children?(this_level)\n @reader.level > this_level\n end", "def test_insert_node_to_right\n @tree.insert(\"c\")\n @tree.insert(\"a\")\n @tree.insert(\"d\")\n refute_equal nil, @tree.root.right\n end", "def fixBTree( node, index)\n # If the left sibling has more than min keys.\n if (index != 0 && node.arr[index - 1].n > self.min)\n self.borrowFromLeft(node, index)\n elsif (index != node.n && node.arr[index + 1].n > self.min)\n self.borrowFromRight(node, index)\n else\n if (index != node.n)\n self.merge(node, index)\n else\n self.merge(node, index - 1)\n end\n end\n end", "def test_leaves_works\n tree = BinarySearchTree.new\n tree.insert(50, \"movie a\")\n tree.insert(40, \"movie b\")\n tree.insert(60, \"movie c\")\n tree.insert(45, \"movie d\")\n tree.insert(20, \"movie e\")\n tree.insert(55, \"movie f\")\n tree.insert(80, \"movie g\")\n assert_equal 4, tree.leaves\n end", "def promote_node_two_children(parent_node,target_node, max_left_sub_tree, max_left_sub_tree_parent_node)\n\n if parent_node.value <= max_left_sub_tree.value\n parent_node.right = max_left_sub_tree\n promote_node(max_left_sub_tree_parent_node, max_left_sub_tree.left)\n\n\n max_left_sub_tree.left = target_node.left if !target_node.left.nil?\n\n max_left_sub_tree.right = target_node.right if !target_node.right.nil?\n\n\n\n\n\n\n else\n parent_node.left = max_left_sub_tree\n promote_node(max_left_sub_tree_parent_node, max_left_sub_tree.left)\n\n\n max_left_sub_tree.left = target_node.left if !target_node.left.nil?\n\n max_left_sub_tree.right = target_node.right if !target_node.right.nil?\n\n\n end\n\n end", "def check_invariants()\n index = 0\n left = index*2+1\n right = index*2+2\n\n while (left < @ary.size)\n if @ary[left].key < @ary[index].key\n raise \"Smaller left child with parent index=#{index} and value=#{@ary[index].key} and left child #{@ary[left].key}\"\n end\n\n if (right < @ary.size) && @ary[right].key < @ary[index].key\n raise \"Smaller right child with parent index=#{index} and value=#{@ary[index].key} and right child #{@ary[right].key}\"\n end\n\n index = index + 1\n left = index*2+1\n right = index*2+2\n\n end\n end", "def check_subtree(tree1, tree2)\n # due to the depth of T1 being much larger than T2 a BFS seems more logical\n bfs(tree1.head, tree2,head)\nend", "def tree_successor(x)\n\tif x.right != nil\n\t\treturn tree_minimum(x.right)\n\tend\n\ty = x.p\n\t\n\twhile y != nil && x == y.right\n\t\tx = y\n\t\ty = y.p\n\tend\n\t\n\treturn y\nend", "def bst?(node)\n result = true\n hopefully_sorted = inorder_traversal_node(node)\n hopefully_sorted.each_with_index do |item, index|\n break if hopefully_sorted[index + 1].nil?\n if hopefully_sorted[index] > hopefully_sorted[index + 1]\n return false\n end\n end\n true\nend", "def lca(node1, node2)\n root = node1\n while (root.parent)\n return root if root.val == node2.val\n root = root.parent\n end\n\n while (root)\n return root if root.val >= [node1.val, node2.val].min && root.val <= [node1.val, node2.val].max\n root = root.right if root.val < [node1.val, node2.val].min\n root = root.left if root.val > [node1.val, node2.val].max\n end\nend", "def left_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$lt' => left }, :order => \"#{left_column_name} DESC\")\n end", "def valid_binary_search_tree?(root_node)\n\n stack = [ ]\n\n # Setting lower and upper bounds\n stack << [root_node, -Float::INFINITY, Float::Infinity]\n\n while stack.length != 0\n node, lower_bound, upper_bound = stack.pop\n\n if node.value <= lower_bound || node.value <= upper_bound\n return false\n end\n\n if node.left\n stack << [node.left, lower_bound, node.value] # set upper_bound as node.value b/c left node has be less than current node's value\n end\n\n if node.right\n stack << [node.right, node.value, upper_bound] # set lower_bound as node.value b/c right node has be greater than current node's value\n end\n\n return true\n\n end\n\n\n\n\nend", "def remove_top\n return raise EMPTY_HEAP_EXCEPTION if @root.nil?\n\n new_root = remove_node\n value = @root.value\n if root?(new_root)\n @root = nil\n @size = 0\n return value\n end\n if relationship(new_root.parent, new_root) == BinaryNodeRelationship::LEFT_CHILD\n new_root.parent.left = nil\n else\n new_root.parent.right = nil\n end\n new_root.parent = nil\n new_root.left = @root.left\n new_root.right = @root.right\n\n current = new_root\n did_swap = false\n until leaf?(current)\n # Because of the insertion strategy,\n # it is impossible for the left child to not exist if the current is not a leaf.\n left_priority = priority(current.left, current)\n right_priority = current.right.nil? ? nil : priority(current.right, current)\n\n if right_priority.nil? # There is only a left child.\n break unless left_priority.negative?\n\n swap(current, current.left)\n else # Both children exist.\n # Node is in the correct position.\n break if priority(current, current.left).negative? && priority(current, current.right).negative?\n\n # Otherwise, keep bubbling.\n left_right_priority = priority(current.left, current.right)\n # Bubble towards the smaller priority.\n swap(current, left_right_priority.negative? ? current.left : current.right)\n end\n did_swap = true\n end\n # New root was immediately placed in the correct position, swap pointers manually.\n # This can only occur when deleting from a heap of size 3 (resulting in size 2).\n unless did_swap\n @root = new_root\n @root.parent = nil\n # No need to check the right child, since it cannot exist in a heap of size 3.\n @root.left.parent = @root unless @root.left.nil?\n end\n @size -= 1\n value\n end", "def check_if_bst(node)\n if node.left\n unless node.left.value < node.value\n throw 'not bst' \n end\n end\n\n if node.right\n unless node.right.value > node.value\n throw 'not bst' \n end\n end\nend", "def is_leaf?\n self.children_count.zero?\n end", "def is_balanced(root)\n return true if root.nil?\n left_height = depth(root.left)\n right_height = depth(root.right)\n result = (left_height - right_height).abs\n return false if result > 1\n return is_balanced(root.left) && is_balanced(root.right)\nend", "def level\n return 0 if self[acts_as_nested_set_options[:parent_column]].nil?\n self.class.count(\"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} < #{self[acts_as_nested_set_options[:left_column]]} and #{acts_as_nested_set_options[:right_column]} > #{self[acts_as_nested_set_options[:right_column]]})\")\n end", "def losing_node?(evaluator) #mark\n # other_mark = @next_mover_mark == evaluator ? \n if @board.over? \n winner = @board.winner\n return winner && winner != evaluator\n else \n if evaluator == @next_mover_mark\n children.all?{|ele| ele.losing_node?(evaluator)}\n else \n children.any?{|ele| ele.losing_node?(evaluator)}\n end \n end \n\n end", "def betterIsBST?(root_node, max, min) #O(n) time, checks each node once\n return true if root_node.nil?\n \n max_check = !max || root_node.val < max\n min_check = !min || root_node.val > min\n \n unless max_check && min_check\n return false #evaluate self first\n end\n \n left = betterIsBST?(root_node.left, root_node.val, min)\n right = betterIsBST?(root_node.right, max, root_node.val)\n \n return left && right #tell children to evaluate themselves\nend", "def parent_has_greater_permissions\n unless Topic.visible_tos[parent.visible_to] >= Topic.visible_tos[visible_to]\n errors.add :visible_to, 'can’t be greater than parent'\n end\n unless Topic.editable_bies[parent.editable_by] >= Topic.editable_bies[editable_by]\n errors.add :editable_by, 'can’t be greater than parent'\n end\n end", "def adjacent_leaves?(n,m)\n leaves.find_index(n.rightmost_leaf) == leaves.find_index(m.leftmost_leaf) - 1 \n end" ]
[ "0.7106007", "0.7106007", "0.7078304", "0.68334454", "0.68334454", "0.6781583", "0.67164516", "0.6708795", "0.6668383", "0.6658609", "0.66499496", "0.6610278", "0.6609255", "0.6608141", "0.6499517", "0.6498077", "0.6491035", "0.6475779", "0.64477485", "0.6440606", "0.6407559", "0.6407408", "0.64004785", "0.6370859", "0.63540715", "0.63377666", "0.63296074", "0.6317876", "0.6305826", "0.6296067", "0.6275413", "0.6262069", "0.62437487", "0.62311417", "0.622737", "0.6209298", "0.62022614", "0.61951977", "0.61841345", "0.61815125", "0.61784506", "0.61277676", "0.6100848", "0.6074619", "0.6074265", "0.6072861", "0.6065743", "0.60633653", "0.6058245", "0.6057103", "0.60489845", "0.6033458", "0.6029165", "0.60237753", "0.60184705", "0.6017314", "0.60023165", "0.5982738", "0.59684956", "0.5962224", "0.59620523", "0.59593827", "0.5952571", "0.5945189", "0.59370255", "0.5929129", "0.59291273", "0.59175843", "0.5916524", "0.59152687", "0.5908866", "0.5908866", "0.5901276", "0.5880437", "0.5879085", "0.58724195", "0.5870996", "0.58543086", "0.58473426", "0.58434874", "0.58407706", "0.5837442", "0.5836772", "0.58363235", "0.58353204", "0.58286285", "0.5827445", "0.58263826", "0.5823758", "0.58224845", "0.58204263", "0.58116615", "0.5801929", "0.5791495", "0.57881165", "0.57852966", "0.57852376", "0.5783438", "0.5778579", "0.5766899" ]
0.6367223
24
instance method that handles one specific activity
def instance_to_json { id: self.id, title: self.title, description: self.description, creator: self.creator.name } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activity\n end", "def intent_send\n\tbegin\n\t\tif @params['par']\n\t\t\tcase @params['par']\n\t\t\twhen '1'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY, \"\", \"ACTION_MAIN\", \"\", \"com.smap.targetapp\", \"\", \"\", \"\", \"\")\n\t\t\twhen '3'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_MAIN\",\"\",\"com.smap.targetapp\",\"com.smap.targetapp.MainActivity\",\"\",\"\",\"\")\n\t\t\twhen '6'\n\t\t\t\tparams_constructor(Rho::Intent::START_SERVICE,\"\",\"\",\"\",\"com.smap.targetapp\",\"com.smap.targetapp.MyFirstService\",\"\",\"\",\"\")\n\t\t\twhen '8'\n\t\t\t\tparams_constructor(Rho::Intent::START_SERVICE,\"\",\"ACTION_MAIN\",\"\",\"com.smap.targetapp\",\"com.smap.targetapp.MyFirstService\",\"\",\"\",\"\")\n\t\t\t\tRho::Intent.send(@result)\n\t\t\twhen '9'\n\t\t\t\tdata = { 'toast' => 'Target - Test case passed if you see this in Android Toast !' }\n\t\t\t\tparams_constructor(Rho::Intent::BROADCAST,\"\",\"com.smap.targetapp.mySecondAction\",\"\",\"\",\"\",\"\",\"\",data)\n\t\t\twhen '12'\n\t\t\t\tdata = { 'toast' => 'Target - Test case passed If you see this in Andorid Toast !' }\n\t\t\t\tparams_constructor(Rho::Intent::BROADCAST,\"\",\"\",\"\",\"com.smap.targetapp\",\"\",\"\",\"\",data)\n\t\t\twhen '22'\n\t\t\t\tdata = { 'sms_body' => 'Test case passed if you see this in Message body.' }\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_VIEW\",\"\",\"\",\"\",\"\",\"vnd.android-dir/mms-sms\",data)\n\t\t\twhen '26'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"rhomobile TestApp/TestApp.exe\",\"\",\"\",\"\",\"\")\n\t\t\twhen '27'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"com.smap.targetapp\",\"\",\"\",\"\",\"\")\n\t\t\twhen '28'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"testapp\",\"\",\"\",\"\",\"\")\n\t\t\twhen '29'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_VIEW\",\"\",\"\",\"\",\"http://www.google.com\",\"\",\"\")\n\t\t\twhen '30'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"\",\"\",\"sms:9611896991\",\"\",\"\")\n\t\t\twhen '311'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"\",\"\",\"mailto:[email protected]\",\"\",\"\")\n\t\t\twhen '312'\n\t\t\t\tparams_constructor(\"\",\"\",\"\",\"\",\"\",\"\",\"mailto:[email protected]\",\"\",\"\")\n\t\t\twhen '32'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_DIAL\",\"\",\"\",\"\",\"tel:9611896991\",\"\",\"\")\n\t\t\twhen '301'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"\",\"\",\"sms:9611896991\",\"\",\"\")\n\t\t\twhen '302'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"\",\"\",\"sms:9611896991\",\"\",\"\")\n\t\t\twhen '34'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_CALL\",\"\",\"\",\"\",\"tel:9611896991\",\"\",\"\")\n\t\t\twhen '35'\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_VIEW\",\"\",\"\",\"\",\"content://contacts/people/\",\"\",\"\")\n\t\t\twhen '37'\n\t\t\t\tdata = { 'body' => 'Test case Passed : only if this is displayed in email body content with prefilled recepient address !' };\n params_constructor(Rho::Intent::START_ACTIVITY,\"\",\"\",\"\",\"\",\"\",\"mailto:[email protected]\",\"\",data)\n when '441'\n \tdata = {\n \t\t'EXTRA_EMAIL' => [\"[email protected]\"],\n\t 'EXTRA_CC' => [\"[email protected]\"],\n\t 'EXTRA_BCC' => [\"[email protected]\"],\n\t 'EXTRA_SUBJECT' => \"Email Subject !\",\n\t 'EXTRA_TEXT' => \"Email body content !\"\n\t }\n params_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_SEND\",\"\",\"\",\"\",\"\",\"text/plain\",data)\n when '442'\n \tpdf = \"content://com.rhomobile.compliancetestruby/rhodata/apps/public/intent/rhodes.pdf\"\n params_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_VIEW\",\"\",\"\",\"\",pdf,\"\",\"\")\n else\n\n\t\t\tend\n\t\telsif @params['cat']\n\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_MAIN\",[@params['cat']],\"\",\"\",\"\",\"\",\"\")\n\t\tend\n\n\t\tRho::Intent.send(@result)\n\trescue =>ex\n\t\tjsmethod = 'Ruby.sendValueToJS(\"' + ex.message + '\")'\n\t\tRho::WebView.executeJavascript(jsmethod)\n\tend\nend", "def doActivity! machine, args\n _behavior! :doActivity, machine, args\n end", "def initialize activity\n @activity = activity\n end", "def activity\n require \"launchy\"\n\n if app = optional_app\n Launchy.open(\"https://dashboard.heroku.com/apps/#{app}/activity\")\n else\n Launchy.open(\"https://dashboard.heroku.com/activity\") # doesn't work yet, but hey\n end\n end", "def handle\n case event_key\n when 'specialdeal'\n # it simulate an exchange with the special deal keyword\n SmartExchange::Process.new(user, 'special deal').perform\n when 'offers'\n # it simulate an exchange with the offers keyword\n SmartExchange::Process.new(user, '奖励').perform\n when 'groupchat'\n messenger.image! path: '/images/wechat/group.jpg'\n when 'chatsale'\n messenger.text! data(:chatsale)\n messenger.image! path: '/images/wechat/wechat_support_qr.jpg'\n when 'support'\n # it simulate an exchange with the support keyword\n SmartExchange::Process.new(user, '客服').perform\n when 'ping'\n messenger.text! data(:ping)\n end\n\n return_with(:success)\n end", "def set_intent\n @intent = Intent.find(params[:id])\n end", "def should_handle_activity?(activity, route)\n activity[:do_not_handle_me] != true\n end", "def set_activity\n @activity = ActivityLog.find(params[:id]) unless params[:id].nil?\n if @activity.nil?\n redirect_to '/404'\n return\n end\n end", "def set_activity\n @activity = PublicActivity::Activity.find(params[:activity_id])\n unless @activity\n head :bad_request\n end\n end", "def process_action(...)\n send_action(...)\n end", "def action\n args.first\n end", "def current_activity\n if self.entry_type == 'activity'\n self\n else\n self.user.tap_log_records.where('timestamp < ? AND entry_type = ?', self.timestamp, 'activity').order('timestamp desc').limit(1).first\n end\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def action\n case item.type\n when :switch, :bar\n toggle_item\n when :advanced\n process_method\n when :variable\n open_popup\n else\n process_custom_method\n end\n end", "def set_activity\n begin\n @activity = Activity.find(params[:id])\n rescue\n end\n end", "def set_activity\n @activity = current_user.activities.find(params[:id])\n end", "def handle_action\n timeline_item = find_timeline_item(self.glass_item_id)\n\n # TODO: Should we uniq these? When glass doesn't have connection, it will queue up\n # actions, so users might press the same one multiple times.\n user_actions.uniq.each do |user_action|\n type = user_action[:type] == \"CUSTOM\" ? user_action[:payload] : user_action[:type]\n json_to_return = self.reply_request_hash ? self.reply_request_hash : self.params\n timeline_item.send(\"handles_#{type.downcase}\", json_to_return)\n end if user_actions\n end", "def set_activity\n @activity = Activity.find(params[:id])\n @reciever = Reciever.find(@activity.reciever_id)\n end", "def kind\n :activity\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def set_activity\n @activity = Activity.find(params[:id])\n end", "def find_activity\n @activity = Activity.find_by_permalink(params[:id])\n raise ActiveRecord::RecordNotFound if @activity.blank? \n raise Helpedia::ItemNotVisible unless @activity.visible_for?(current_user)\n @user = @activity.owner\n end", "def render_activity\n h.render partial_path, activity:self\n end", "def show\n set_user_activity\n end", "def init_activity(obj)\n if obj.nil?\n logger.error(\"Activity #{self.id}; called init_activity with nil\")\n else\n self.activity_name = obj.class.name\n self.activity_id = obj.id\n end\n end", "def set_activity\n @activity = PublicActivity::Activity.find(params[:id])\n end", "def handle_action(username, actiontype)\n \n end", "def action_custom_activity(input)\n token = input[:FromUserName]\n text_attrs = input[:Content].split('@')\n activity = WxCustomActivity.find_by_key_and_status(text_attrs[0],1)\n activity_log = WxActivityLog.find_by_uid_and_activity_id(token,activity[:id])\n return build_response_text_temp {|msg|\n msg.Content = activity[:join_msg]\n } unless activity_log.nil?\n \n #persist user request\n log_use_request {|request|\n request.lastaction = RequestAction::ACTION_EX_POINT+'-'+activity[:id].to_s\n }\n \n #check use have binded card\n card_info = Card.where(:utoken=>token,:isbinded=>true).order('updated_at desc').first\n if !card_info.nil?\n WxActivityLog.create(:uid=>token,:activity_id=>activity[:id],:vip_card=>card_info.decryp_card_no)\n return build_response_text_temp {|msg|\n msg.Content = activity[:succsss_msg]\n } \n else\n if text_attrs.length<=2\n return build_response_text_temp {|msg|\n msg.Content = activity[:how_msg]\n } \n end\n\n card_info = Card.find_by_nopwd input[:FromUserName],text_attrs[1],text_attrs[2]\n return build_response_text_temp {|msg|\n msg.Content = WxReplyMsg.get_msg_by_key 'wrongpwd'\n } if card_info.nil?\n Card.transaction do \n card_info[:isbinded]=true\n card_info.save\n \n WxActivityLog.create(:uid=>token,:activity_id=>activity[:id],:vip_card=>text_attrs[1])\n end\n return build_response_text_temp {|msg|\n msg.Content = activity[:succsss_msg]\n } \n end\n \n end", "def set_activity\n @activity = Activity.find_by_id(params[:id])\n end", "def activity\n OStatus::Activity.new(self)\n end", "def handle(status, user)\n end", "def act\n end", "def action\n case item.type\n when :switch, :bar\n toggle_item\n when :advanced\n process_method\n when :variable\n open_popup\n end\n end", "def set_activity\n @activity = Activity.where(uuid: params[:id])\n end", "def handler; end", "def handler; end", "def respond_to_intent\r\n intent = @request[\"request\"][\"intent\"][\"name\"]\r\n case intent\r\n when \"TurnOn\"\r\n response = turn_light_on\r\n when \"TurnOff\"\r\n response = turn_light_off\r\n end\r\n end", "def handle\n model.before_action_hook(type, request)\n send(\"handle_#{type}\")\n end", "def set_activity\n if params[:id].nil?\n @activity = Activity.where(\"id = ? AND status != ?\",params[:activity_id], \"archived\").first\n else \n @activity = Activity.where(\"id = ? AND status != ?\", @comment.commentable_id, \"archived\").first\n end\n\n if @activity.nil?\n head(:not_found)\n end\n end", "def load_user_activity\n @activity = current_user.activities.find(params[:entry][:activity_id])\n end", "def activity(params={})\n Endpoints::Activity.new(self).get(params)\n end", "def activity(id)\n child('activity', id)\n end", "def handle_request_cancel_activity_task_failed(event)\n event_double = SimpleTestHistoryEvent.new(\"Activity1\")\n self.send(:old_handle_request_cancel_activity_task_failed, event_double)\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def handle!\n if collection == \"locations\"\n handle_location\n else\n self.glass_item_id = params[:itemId]\n handle_reply(params)\n handle_action\n end\n end", "def agent_activity\n # activity_build.event()\n end", "def activity_logger_end\n # Don't care about logging activity if the user is not registered\n# return if !session[:user]\n\n puts \"In: Logger End\"\n\n # In case the request is of type '2' = AJAX (dynamic), store 'session' information for content storage between\n # AJAX pages but don't record a database activity (making the transition faster)\n if Activity::activities[params[:action]] && Activity::activities[params[:action]][3] == 2\n \n # Store the AJAX data in the 'session' object under the general key ':params' with the 'page' being the 2nd 'key'\n# session[:params][params[:action]] = params\n end\n \n # If the current action & controller match the previous activity (i.e. the user has refreshed and clicked on a link\n # that takes them to the same page, the previous Activity will be updated with the 'updated_at' field ONLY\n if (session[:last_activity_o]) && \n (session[:last_activity_o].action == params[:action] && session[:last_activity_o].controller == params[:controller])\n session[:last_activity_o].touch\n return\n end\n \n # If current activity is of type 'secondary'\n \n # 1. Maintain 5 last links in the session object\n session[:last_5_urls] = Array.new(5) if !session[:last_5_urls]\n session[:last_5_urls].unshift(request.env[\"REQUEST_URI\"])\n session[:last_5_urls].pop if session[:last_5_urls].length > 5\n \n @activity = Activity::create_o(params, @friendly_names_h, session[:user])\n \n begin\n \n# @activity.save(false)\n \n # If current activity is of type 'primary', store it as primary\n # This will be used as a 'return_to' link when exiting a 'secondary' view\n if Activity::activities[params[:action]] && Activity::activities[params[:action]][3] == 1\n session[:last_primary_activity_o] = @activity\n \n # 2. In case current page is secondary (e.g Feedback, Contact Us etc) and there is no 'last_primary_activity' object in memory\n # E.g. user bookmarked the 'Provide Feedback' page and 2nd time opening the browser, using cookie login, they access this page directly\n elsif !session[:last_primary_activity_o] &&\n (Activity::activities[params[:action]] && Activity::activities[params[:action]][3] == 0)\n \n # 3. If the current action is not defined regardless if it's a primary or secondary (as we can't tell at this stage)\n # Set the 'last_primary_activity' to 'home'\n elsif !Activity::activities[params[:action]] \n session[:last_primary_activity_o] = Activity::create_o(\n {:action => \"home\", :controller => \"application\"}, nil, session[:user])\n \n # Let the admin know an action was used that doesn't have\n raise 'ERROR #2' if !send_message(nil, {:missing_action => params[:action]}, false, 3, 4) \n end \n \n # Set the current activity to be the last in the session\n session[:last_activity_o] = @activity\n \n rescue Exception => exc\n \n flash[:error] = 'Activity could not be saved due to a validation error = ' + exc.clean_backtrace.join( \"\\n\" )\n \n end # rescue\n \n end", "def intent_send_callback\n\tbegin\n\t\tif @params['par']\n\t\t\tcase @params['par']\n\t\t\twhen '38'\n\t\t\t\tdata = { 'myData' => 'This is Test data !' }\n\t\t\t\tparams_constructor(Rho::Intent::START_ACTIVITY,\"\",\"ACTION_MAIN\",\"\",\"com.smap.targetapp\",\"\",\"\",\"\",data)\n\t\t\telse\n\t\t\tend\n\t\tend\n\t\tRho::Intent.send(@result, url_for(:action => :listen_callback))\n\trescue => ex\n\t\tjsmethod = 'Ruby.sendValueToJS(\"' + ex.message + '\")'\n\t\tRho::WebView.executeJavascript(jsmethod)\n\tend\nend", "def action\n end", "def action\n end", "def click_action\n raise NotImplementedError \"Subclasses must implement this method\"\n end", "def handle_exatask\n # case @session.check('task', request_variable('task'))\n task, options, option = @session.get('task'), @session.get('option').split(@@re_bar), request_variable('option')\n option = (options.first || '') if option.empty?\n case task\n when 'exaadmin'\n @session.set('status', 'admin') # admin: status|dir\n touch_session(@session.get('id'))\n if options.include?(option) then\n case option\n when 'status' then handle_exaadmin_status\n when 'dir' then handle_exaadmin_dir\n else handle_exaadmin_status\n end\n elsif option.empty? then\n message('Status', \"unknown option\")\n else\n message('Status', \"option '#{option}' not permitted #{options.inspect}\")\n end\n else\n message('Status', \"unknown task '#{task}'\")\n end\n end", "def action_run\n end", "def process_action(*_arg0); end", "def process_action(*_arg0); end", "def process_action(*_arg0); end", "def show\n @task=Task.where(id: params[:task_id]).first #not to return nil\n @handler=EventHandler.new(user: user, game: @game, task: @task)\n if @task.nil? || @[email protected] || [email protected]_given? #если нельзя показать запрошенное задание\n redirect_to play_game_url(game_id: @game.id)\n elsif [email protected]_redirect_event(user: @user)\n redirect_to r.block.url_with_vars game: @game, task: @task, user: @user, handler: @handler\n elsif File.exists?(Rails.root.join(\"app\", \"views\", params[:controller],\"#{@task.title}.html.erb\"))\n render \"play/#{@task.title}\"\n elsif File.exists?(Rails.root.join(\"app\", \"views\", params[:controller],\"#{@game.title}.html.erb\"))\n render \"play/#{@game.title}\"\n else\n render \"play/show\"\n end\n end", "def select_activity_single(menu)\n selection = TTY::Prompt.new.select(\"Choose an activity:\", menu, cycle: true, marker: '>', echo: false)\n @activities.each { |activity| return activity if activity.name == selection }\n \n end", "def show\n authorize! :read, @activity\n if params[:response_key]\n redirect_to sequence_activity_path(@run.sequence, @activity, request.query_parameters) and return if @run.sequence\n redirect_to activity_path(@activity, request.query_parameters) and return\n end\n @run.increment_run_count!\n setup_show\n unless params[:show_index]\n if @run && @run.last_page && @activity\n # TODO: If the Page isn't in this activity... Then we need to log that as an error, \n # and do the best we can to get back to the right page...\n if @activity != @run.last_page.lightweight_activity\n Rails.logger.error(\"Page has wrong activity or vice versa\")\n Rails.logger.error(\"Page: #{@run.last_page.id} wrong activity: #{@activity.id} right activity: #{@run.last_page.lightweight_activity.id}\")\n @activity = @run.last_page.lightweight_activity\n end\n redirect_to page_with_response_path(@activity.id, @run.last_page.id, @run.key)\n return\n end\n end\n end", "def handle\n end", "def show\n @activity = Activity.find(params[:id])\n end", "def set_activity\n # @user = User.find(params[:user_id])\n @activity = Activity.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render json: { message: 'no activity matches that ID' }, status: 404\n end", "def activity_feed_message(activity)\r\n user = activity.user\r\n case activity.item_type\r\n when \"Friendship\"\r\n friendship = activity.item\r\n %(#{user_link(user)} became friends with #{link_to friendship.friend.name, '/users/' + friendship.friend.id.to_s} <span class=\"activity_date\">#{friendship.updated_at.to_s(:event_list)}</span>) \r\n when \"Event\"\r\n event = activity.item\r\n %(#{user_link(user)} added a new event - #{link_to event.name, '/events/'+event.id.to_s} #{activity_date(event)})\r\n when \"User\"\r\n if user\r\n %(#{user_link(user)} joined. #{activity_date(user)})\r\n else\r\n %(A former user joined. #{activity_date(activity)}) \r\n end\r\n when \"Photo\"\r\n if activity.action == 'destroy'\r\n %(<span class=\"activity_text\"><span class=\"activity_user_link\">#{user_link(user)}</span> deleted a photo.</span>#{activity_date(activity)})\r\n else\r\n if activity.item\r\n photo = Photo.find(activity.item.id, :select=>\"id, user_id, filename, parent_id, created_at\")\r\n %(<span class=\"activity_text\"><span class=\"activity_user_link\">#{user_link(user)}</span> uploaded a photo - <a href=\"/photos/#{photo.id}\">#{image_tag(photo.public_filename(:small))}</a>.</span>#{activity_date(photo)})\r\n else\r\n # photo no longer exists, but still need to display upload event for history\r\n %(<span class=\"activity_text\"><span class=\"activity_user_link\">#{user_link(user)}</span> uploaded a photo.</span>#{activity_date(activity)})\r\n end\r\n end \r\n when \"Group\"\r\n group = activity.item\r\n if group\r\n %(A new group was created, #{link_to(group.name, group_url(group))} #{activity_date(group)})\r\n else\r\n %(A new group was created, group no longer exists)\r\n end\r\n when \"BlogPost\"\r\n blog_post = activity.item\r\n if blog_post\r\n %(#{user_link(user)} posted a new blog entry, <a href=\"/blog_posts/#{blog_post.id}\">#{blog_post.title}</a>. #{activity_date(blog_post)})\r\n else\r\n %(#{user_link(user)} posted a new blog entry.) \r\n end\r\n when \"Attendance\"\r\n if activity.item\r\n attendance = activity.item\r\n %(#{user_link(user)} is attending the event, #{link_to attendance.event.name, 'events/' + attendance.event.id.to_s}. #{activity_date(attendance)})\r\n else\r\n # attendance no longer exists, user has canceled\r\n %(#{image_tag(user.profile_photo.public_filename(:small))}#{user_link(user)} signed up for an event, but has since revoked that decision.)\r\n end\r\n when \"Membership\"\r\n membership = activity.item\r\n %(<span class=\"activity_text\"><span class=\"activity_user_link\">#{user_link(user)}</span> joined the group, <a href=\"/groups/#{membership.group.id}\">#{membership.group.name}</a>. </span>#{activity_date(membership)})\r\n when \"ForumPost\"\r\n forum_post = activity.item\r\n %(#{user_link(user)} posted a new message to the forum, <a href=\"/forum_posts/#{forum_post.id}\">#{forum_post.title}</a>. #{activity_date(forum_post)})\r\n when \"JobPost\"\r\n job_post = activity.item\r\n if job_post\r\n %(A new job was posted - #{link_to(job_post.job_title, job_posts_url)}. #{activity_date(job_post)})\r\n else\r\n # the job post has been deleted\r\n %(A new job was posted. #{activity_date(activity)})\r\n end\r\n when \"BookReview\"\r\n book_review = activity.item\r\n %(#{user.name} posted a new review for #{book_review.name}. #{activity_date(book_review)}) \r\n when \"StatusPost\"\r\n status_post = activity.item\r\n %(<span class=\"activity_text\"><span class=\"activity_user_link\">#{user_link(user)}</span> #{EngineyUtil.linkify(status_post.body)}</span>#{activity_date(status_post)})\r\n when \"Link\"\r\n link = activity.item\r\n if link\r\n %(#{user_link(user)} posted a new link #{link_to link.url, link.url} #{activity_date(link)})\r\n else\r\n # the link was deleted\r\n %(#{user_link(user)} posted a new link)\r\n end\r\n when \"Project\"\r\n project = activity.item\r\n if project\r\n %(#{user_link(user)} added a new project #{link_to project.name, project.url} #{activity_date(project)})\r\n else \r\n # the project was deleted\r\n %(#{user_link(user)} added a new project #{activity_date(activity)})\r\n end\r\n when \"Announcement\"\r\n announcement = activity.item\r\n if announcement\r\n %(#{user_link(user)} posted a new announcement, <b>#{announcement.title}</b> #{activity_date(announcement)})\r\n else\r\n %(#{user_link(user)} posted a new announcement #{activity_date(activity)})\r\n end\r\n when \"Classified\"\r\n classified = activity.item\r\n %(#{user_link(user)} posted a new classified, #{link_to classified.title, classified_url(classified)})\r\n else\r\n %(Invalid activity type - #{activity.item_type})\r\n end\r\n end", "def process(action, *args); end", "def ali_action\n\n # for most actions re-render the whole project planner (TODO: improve this for other actions but move ALI)\n @status = 'render_all'\n\n @activity_line_item = ActivityLineItem.find_by(:object_key => params[:ali])\n action = params[:invoke]\n\n case action\n when ALI_MOVE_YEAR_ACTION\n\n new_fy_year = params[:year]\n if @activity_line_item.assets.count > 25\n @status = 'job'\n Delayed::Job.enqueue MoveAliYearJob.new(@activity_line_item, new_fy_year, current_user, params[:early_replacement_reason]), :priority => 0\n notify_user :notice, \"Moving ali #{@activity_line_item} to new #{get_fy_label} #{new_fy_year}. You will be notified when the process is complete.\"\n else\n # update project planner by JS for just the single ALI moved\n @status = 'js_update'\n @capital_project = @activity_line_item.capital_project\n @ali_cost = @activity_line_item.cost\n @old_ali_fy = @activity_line_item.fy_year\n\n Rails.logger.debug \"Moving ali #{@activity_line_item} to new FY #{new_fy_year}\"\n proj_and_alis = CapitalProjectBuilder.new.move_ali_to_planning_year(@activity_line_item, new_fy_year, params[:early_replacement_reason])\n @new_alis = proj_and_alis[:touched_alis].map{|x| x[1]}\n @deleted_alis = proj_and_alis[:deleted_alis]\n\n notify_user :notice, \"ALI was successfully moved to #{new_fy_year}.\"\n\n end\n when ALI_UPDATE_COST_ACTION\n @activity_line_item.anticipated_cost = params[:activity_line_item][:anticipated_cost]\n Rails.logger.debug \"Updating anticipated cost for ali #{@activity_line_item} to #{params[:activity_line_item][:anticipated_cost]}\"\n if @activity_line_item.save\n notify_user :notice, \"The ALI was successfully updated.\"\n else\n notify_user :alert, \"An error occurred while updating the ALI.\"\n end\n\n when ALI_REMOVE_ACTION\n @project = @activity_line_item.capital_project\n @activity_line_item.destroy\n Rails.logger.debug \"Removing ali #{@activity_line_item} from project #{@project}\"\n notify_user :notice, \"The ALI was successfully removed from project #{@project.project_number}.\"\n end\n\n\n if action == ALI_MOVE_YEAR_ACTION\n get_planning_years\n @new_alis = @new_alis.select{|x| x.fy_year <= @years.last} if @new_alis\n else\n prepare_projects_display\n end\n\n respond_to do |format|\n format.js\n end\n end", "def show\n @activity=Activity.find(params[:id])\n end", "def process(*args)\n args[1] = (args[1] || {}).merge({ :use_route => :corkboard })\n super(*args)\n end", "def edit_activity\n @activity = Activity.find(params[:id])\n end" ]
[ "0.7108112", "0.5848159", "0.57066506", "0.56031746", "0.5583077", "0.5571177", "0.55626744", "0.55465144", "0.5535637", "0.5502883", "0.5486768", "0.54577106", "0.54499793", "0.5428943", "0.5428943", "0.5428943", "0.5428943", "0.5428943", "0.5428943", "0.5428943", "0.5428943", "0.54259133", "0.5415447", "0.5397136", "0.5394268", "0.53672516", "0.53590065", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.5331464", "0.53194416", "0.5312075", "0.5309643", "0.5293603", "0.5291052", "0.5284572", "0.5279585", "0.52628726", "0.5248648", "0.5241629", "0.52322185", "0.5208545", "0.5201124", "0.52003455", "0.52003455", "0.5192366", "0.5185347", "0.5181894", "0.51784813", "0.51757395", "0.5174019", "0.51737523", "0.51692206", "0.51692206", "0.51692206", "0.51692206", "0.51692206", "0.5165156", "0.5148726", "0.5142861", "0.51424396", "0.5126652", "0.51141727", "0.5107021", "0.5097087", "0.50903153", "0.5074145", "0.5074145", "0.5074145", "0.5067469", "0.5060086", "0.5049237", "0.5042877", "0.50371003", "0.5035333", "0.50304496", "0.50258136", "0.5022656", "0.5019286", "0.50023764", "0.49959332" ]
0.0
-1
Below Sets params for upload.
def set_upload @upload = LibraryUpload.friendly.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_file_params\n puts params\n params\n end", "def upload_params\n params[:upload]\n end", "def upload_params\n params[:upload]\n end", "def upload_params\n params.require(:upload).permit(:title, :upload, :user_id)\n end", "def upload_params\n params.require(:upload).permit(:upload, :user_id, :folder_id)\n end", "def upload_params\n permit = policy(@upload || Upload).permitted_attributes\n params.require(:upload).permit(*permit)\n end", "def upload_params\n params.require(:upload).permit(:upload)\n end", "def upload_params\n params.require(:upload).permit(:election_id, :file_type_id, :public, :file) # Not status, address or checksum.\n end", "def upload_params\n params.require(:upload_file)\n end", "def upload_params\n params.require(:upload).permit(:name, :category, :information, :course_id, :assignment_id)\n end", "def upload_params\n params.require(:upload).permit(:filename, :key)\n end", "def upload_params\n params[:upload].permit :image\n end", "def upload_params\n params.require(:upload).permit(:title, :file_attachment)\n end", "def parse_upload\n expected_params[:upload] ||= ParameterDeclaration.new(:upload, :upload, {})\n params[:upload]\n end", "def upload_file_params\n params.require(:upload_file).permit(:title, :date_uploaded, :attachment, :vendor_id, :task_allocation_id)\n end", "def file_upload_params\n params.require(:file_upload).permit(:fname, :owner, :ftype, :keywords, :attachment)\n end", "def uploader_params\n params.require(:uploader).permit(:time, :content, :place)\n end", "def upload_params\n params.require(:upload).permit(:user_name, :user_email, :recipient_email, :message, :package)\n end", "def upload_params\n params.require(:upload).permit(:arquivo, :status)\n end", "def upload_params\n params.require(:upload).permit(:user_id, :country_id, :university_id, :image)\n end", "def upload_file_params\n params.require(:upload_file).permit(:title, :type, :path, :size)\n end", "def upload_params \n params.require(:library_upload).permit(:title, :description, :tags, :image, :file)\n end", "def upload_params\n params.require(:upload).permit(:filename, :content_type, :category)\n end", "def upload_params\n params.require(:upload).permit(:image)\n end", "def ride_upload_params\n params.require(:ride_upload).permit(:user_id, :ride_zone_id, :name, :description, :csv, :status, :csv_hash)\n end", "def upload_params\n params.require(:upload).permit(:url,:name,:Description, :created_at )\n end", "def initialize(params = {})\n @multipart_params = []\n push_params(params)\n end", "def upload_params\n params.require(:upload).permit(:name, :description)\n end", "def upload_params\n params.require(:upload).permit(:uploaded_file, :user_id, :folder_id,:label)\n end", "def fileupload_params\n params.require(:fileupload).permit(:user_id, :filename, :sort, :direction)\n end", "def video_upload_params\n params.fetch(:video_upload, {})\n end", "def upload_params\n params[:upload].permit(:photo)\n end", "def aw_params\n params.require(:aw).permit(:file, :uploaded_file)\n end", "def upload_params\nparams[:upload].permit(:uploaded_file)\nend", "def uploadphoto_params\n params.require(:uploadphoto).permit(:name, :file, :size, :content_type)\n end", "def form_params\n params.require(:upload).permit(Upload.allowable_params)\n end", "def post_upload_params\n params.require(:upload).permit(:name)\n end", "def post_upload_params\n params.require(:upload).permit(:name)\n end", "def permitted_params\n params.require(params[:asset_type].underscore.gsub('/', '_').to_sym).permit(\n :name,\n :filename,\n :body,\n :content_type,\n :width,\n :height,\n :asset_type,\n :ratio\n )\n end", "def upload_params\n params.require(:upload).permit(:dir, :pfad, :inhalt)\nend", "def user_params\n params.require(:upload).permit(:file)\n end", "def file_operation_params\n params.require(:file_operation).permit(:file_path, :status, :job_class, :user_type, :user_id, :info)\n end", "def permitted_params\n params.require(:assetabler_external_service).permit(\n :name,\n :filename,\n :body,\n :content_type,\n :width,\n :height,\n :uploader_id\n )\n end", "def set_params(params)\n @params = params\n end", "def add_some_extra_params\n @params['size'] = @file.size\n @params['md5sum'] = @file.md5sum\n end", "def up_file_params\n params.require(:up_file).permit(:site_id, :catalog_item_id, :file)\n end", "def upload_params\n\t params.require(:upload).permit(:document)\n\tend", "def image_params\n #Added uploads param 7/72018 Paul Ancajima\n params.require(:image).permit(:image_title, :image_owner_id, :category_id, :licensing, :date, :description, :file_type, :location, :status_id, uploads: [])\n end", "def prepare_request(params)\n request = process_params(params)\n request.store(:sizes, [extract_size(params.size)]) if params.size\n request.store(:format, params.format) if params.format\n request.store(:data, params.data) if params.data\n request.store(:uploader, params.uploader) if params.uploader\n request.store(:pages, params.pages) if params.pages\n request.store(:callback_url, params.callback_url) if params.callback_url\n request\n end", "def upload_file_to_auto_desk_params\n params.require(:upload_file_to_auto_desk).permit(:file)\n #params.require(:upload_file_to_auto_desk).permit(:filename, :content_type, :file_contents, :sync_with_auto_desk_at, :auto_desk_url)\n end", "def upload_params\n params.require(:upload).permit(:image, :description)\n end", "def uploaded_file_params\n params.require(:uploaded_file).permit(:file)\n end", "def super_d_upload_params\n params.require(:super_d_upload).permit(:title, :body, :imgfile, :created_at)\n end", "def post_file_params\n params.require(:post_file).permit(:name, :item, :type, :image_dimensions,\n :remove_item, :item_cache)\n end", "def temp_resource_params\n params.fetch(:temp_resource, :uploads, {})\n end", "def set(params = {})\n self.params.merge!(params)\n end", "def attachment_params\n params.permit(:file, :organization_id, :person_id, :career_id, :deal_id, :activity_id)\n end", "def uploader_options\n end", "def bucket_files_params\n params.require(:bucket_file).permit(:avatar, :user_id, :disk_id, :name, :file_name)\n end", "def uploaded_file_params\n params.require(:uploaded_file).permit(:file_name)\n end", "def carrierwave_image_params\n params.require(:carrierwave_image).permit(:asset, :remove_asset, :user_name, :user_uuid,)\n end", "def grid_fs_file_params\n params.require(:grid_fs_file).permit(:filename, :contentType, :author, :topic, :uploadDate, :length, :chunkSize, :md5, :contents)\n end", "def permitted_params\n opts = params['torrent']\n opts['files_attributes'].each { |_, v| v['path'] = v['path'].split('/') }\n opts\n end", "def multipart_upload\n end", "def asset_params\n params.require(:asset).permit(:user_id, :upload_file, :folder_id,:level_id)\n end", "def asset_file_params\n params.require(:asset_file).permit(:user_id, :uploaded_file, :folder_id)\n end", "def import_params\n params.require(:file)\n end", "def upload_params\n params.require(:upload).permit(:video, :name)\n end", "def encode_params\n params.require(:encode).permit(:title, :file).merge(user_id: current_user.id)\n end", "def structure_photo_params\n params.permit(:uuid, :base64image, :filename,:deleted_at,:structure_id)\n end", "def uploaded_file_params\n params.require(:uploaded_file).permit(:attachment, :lecture, :link, :link_name, :filename)\n end", "def photo_params\n params.require(:photo).permit(:photo_upload, :caption, :user_id, :status, :created_at)\n end", "def share_params\n begin\n if params[:share] # if params[:share] fix the case when user click update button without selecting new file\n params.require(:share).permit(:original_filename, :public, :file, :tag_list)\n end\n rescue ActionController::UnpermittedParameters => e # only if action_on_unpermitted_parameters = :raise\n render text: { status: 400, error: e.message }.to_json, :status => 400\n end\n end", "def photo_params\n params.require(:photo).permit(:filename, :date_taken, :path, :file_thumb_path, :file_extension, :file_size, :location_id, :make, :model, :original_height, :original_width, :longitude, :latitude)\n end", "def processable_upload_params\n params.require(:processable_upload).permit(ProcessableUpload.allowable_params)\n end", "def file_upload_params\n params.require(:file_upload).permit(:title, file_upload_attachments_attributes: [:id, :file_upload_id, :scenario])\n end", "def set_params\r\n @listing.pictures.build.photo = File.new params[:file].tempfile if params[:file]\r\n respond_to do |format|\r\n format.html { params[:temp_listing] = ResetDate::reset_dates(params[:temp_listing]) }\r\n format.json { params[:temp_listing] = JSON.parse(params[:temp_listing]) }\r\n end\r\n end", "def media_upload_params\n params.require(:medium).permit(:title, :description, :file)\n end", "def file_params\n params.require(:wx_file).permit(:file_name, :file_size, :mime_type, :digest, :description)\n end", "def music_params\n params.require(:music).permit(:name, :user_id, :upload, :direct_upload_url, :upload_file_name, :processed)\n end", "def photo_params\n params.require(:photo).permit(:album_id, :title, :creation_date, :description, :image, :position, :rate)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def items_import_params\n # params.require(:items_import).permit(:file_name, :uploaded_by, :uploaded_at, :status)\n params.fetch(:items_import, {}).permit(:file_name, :uploaded_by, :uploaded_at, :status, :file)\n end", "def fileshare_params\n params.require(:fileshare).permit(:category, :title, :keyword, :description, :file, :image, :all_categories, :all_keywords)\n end", "def userfile_params\n params.require(:userfile).permit(:filename, :date_created, :owner, :size)\n end", "def attachment_params\n # params.fetch(:attachment)\n params.require(:attachment).permit(:name, :file_type, :data, :origin_type, :situation, :origin_id)\n end", "def photo_params\n params.require(:photo).permit(:title, :description, :content, :playlist_id).merge(user_id: @current_user.id)\n end", "def datafile_params\n params.require(:datafile).permit(:dataset_id, :web_id, :upload, 'upload', :dataset_key, 'datafiles', 'datafiles'['upload'], 'datafiles'['dataset_id'])\n end", "def rock_photo_params\n params.permit(:uuid, :base64image, :filename, :rock_id,:deleted_at)\n end", "def image_params\n #params.require(:image).permit(:url, :width, :height, :ratio)\n params.require(:image).permit(:file)\n end", "def photo_params\n params.require(:photo).permit(:asset, :asset_remote_url, :rating, :gallery_id)\n end", "def image_file_params\n params.require(:image_file).permit(:name, :item, :type, :image_dimensions,\n :remove_item, :item_cache)\n end", "def admin_people_file_params\n params.require(:admin_people_file).permit(:title, :description, :publish_on, :file)\n end", "def set_params\n # Check if it's a proper commit search action\n @search_action = params.permit(:commit)[:commit]\n # Search parameters\n @keywords = params.permit(:keywords)[:keywords]\n @location = params.permit(:location)[:location]\n @location_radius = params.permit(:location_radius)[:location_radius]\n @manufacturer_or_publisher = params.permit(:manufacturer_or_publisher)[:manufacturer_or_publisher]\n @category = params.permit(:category)[:category]\n @seller_name = params.permit(:seller_name)[:seller_name]\n end", "def setting_params\n params.require(:setting).permit(:title, :description, :blob, :user_file_path)\n end", "def upload_request(*args)\n UploadRequest.new(self).request(*args)\n end", "def qpaper_file_params\n params.require(:qpaper_file).permit(:user_id, :university_course_id, :uploaded_file)\n end", "def save_params\n saveparams = project_params.clone\n uploaded_file = saveparams[:keydata]\n unless uploaded_file.nil?\n # Save only the file data\n saveparams[:keydata] = uploaded_file.read\n end\n saveparams\n end", "def holding_params\n params.require(:holding).permit(:name,:uploaded_file)\n end", "def media_file_params\n params.require(:media_file).permit(:name, files: []).merge({\n user_id: current_user.id,\n })\n end", "def storage_params\n\n params.require(:storage).permit(:user, :file, :description)\n .merge(user: session[:user_id])\n end" ]
[ "0.7827048", "0.7441134", "0.7441134", "0.7262384", "0.7259706", "0.724039", "0.723374", "0.7232394", "0.7180241", "0.6993453", "0.69169587", "0.69152635", "0.690842", "0.6895063", "0.68622875", "0.68599737", "0.68510735", "0.6847559", "0.6838511", "0.68078375", "0.67894286", "0.67860997", "0.6766583", "0.6740444", "0.67061275", "0.6690962", "0.6674726", "0.665629", "0.66499525", "0.66492355", "0.66326827", "0.66238153", "0.6619358", "0.6584513", "0.6578267", "0.6569523", "0.65541416", "0.65541416", "0.6534104", "0.6528656", "0.6521051", "0.64864826", "0.64745414", "0.6454361", "0.64435345", "0.6419214", "0.64166343", "0.6416454", "0.6391476", "0.6377542", "0.6373788", "0.6369151", "0.6362523", "0.63606244", "0.63422436", "0.6319254", "0.6316546", "0.6316168", "0.6306415", "0.6284514", "0.6282453", "0.62809473", "0.6270685", "0.6270317", "0.6262515", "0.6261596", "0.62522656", "0.62363744", "0.6223473", "0.622116", "0.6220221", "0.62121576", "0.62008876", "0.61958414", "0.6194983", "0.61933404", "0.61727196", "0.6165691", "0.61636233", "0.6152342", "0.6147505", "0.61456454", "0.614317", "0.61401874", "0.61381173", "0.61380833", "0.6134832", "0.61334074", "0.61277604", "0.6124366", "0.6121808", "0.61018544", "0.60950685", "0.60929346", "0.6090648", "0.60875434", "0.608329", "0.6080192", "0.60792905", "0.60762864", "0.6075777" ]
0.0
-1
Below Sets params for admin library id from inherited AdminLibraries class.
def set_library @library = AdminLibrary.friendly.find(params[:admin_library_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_library\n @library = AdminLibrary.friendly.find(params[:id]) \n end", "def set_library\n @library = Library.find_by(id: params[:id])\n end", "def set_library\n #for getting one library\n @library = Library.find_by_red_id(params[:id])\n end", "def set_library\n @library = Library.find(params[:id])\n end", "def set_library\n @library = Library.find(params[:id])\n end", "def initialize(params = {})\n super\n\n @lock_id = params[:lock_id]\n @client_webhook_setting_id = params[:client_webhook_setting_id].to_i\n @admin_id = params[:admin_id]\n end", "def initialize(params={})\n params[:custom_id] ||= \"#{params[:platform_id]}-#{params[:vcenter_id]}\"\n super\n end", "def library_params\n params.require(:library).permit(:red_id, :purchased_on, :user_id, :description, :library_data)\n end", "def library_params\n params.require(:library).permit(:style, :user_id)\n end", "def set_library_row\n @library_row = LibraryRow.find(params[:id])\n end", "def library_params\n params.require(:library).permit(:room, :school_id)\n end", "def set_library\n @library = Library.find(params[:id])\n if @library.universities_id\n @university = University.find(@library.universities_id)\n else\n @university = University.new\n end\n end", "def set_lib_entry\n @lib_entry = LibEntry.find(params[:id])\n end", "def set_librarybooklist\n @librarybooklist = Librarybooklist.find(params[:id])\n end", "def model_attributes(_form_params)\n super.tap do |params|\n params[:admin_set_id] = admin_set_id if params[:admin_set_id].blank?\n end\n end", "def library_params\n params.require(:library).permit(:name, :location, :borrow_duration, :fine_per_day, :university_id)\n end", "def set_image_library\n @image_library = ImageLibrary.find(params[:id])\n end", "def initialize(params={})\n super params\n\n # self._id = self.properties[:uuid]\n\n end", "def set_library_book_list\n @library_book_list = LibraryBookList.find(params[:id])\n end", "def set_library_book\n @library_book = LibraryBook.find(params[:id])\n end", "def set_admin_configuration_identifier\n @admin_configuration_identifier = Admin::ConfigurationIdentifier.find(params[:id])\n end", "def set_lib_book\n @lib_book = LibBook.find(params[:id])\n end", "def set_library_book\n @library_book = Library::Book.find(params[:id])\n end", "def initialize(params = {})\n littles = params.delete(:little_ids)\n super(params)\n assign_littles(littles)\n end", "def libraries_id_array\n staff_member_library_ids = []\n self.library.each do |l|\n staff_member_library_ids << l.id\n end\n staff_member_library_ids\n end", "def library=(value)\n @library = value\n end", "def set_admin_product_code\n @admin_product_code = ProductCode.find(params[:id])\n end", "def edit_book_library_id(select)\n\tshow_all_libraries\n\tprint \"\\nWhich library would you like to call home for this book \"\n\tlibrary_id = gets.chomp.to_i\n\tlibrary_id = verify_library_exists(library_id)\n\tb = Book.find(select)\n\tb.update_attributes(library_id: library_id)\nend", "def initialize(params)\n super\n @id = params[:id]\n end", "def set_libation\n @libation = Libation.find(params[:id])\n end", "def set_admin_building\n @admin_building = Admin::Building.find(params[:id])\n end", "def set_admin_vendor\n @admin_vendor = Vendor.find(params[:id])\n end", "def set_client_id(opts)\n opts = check_params(opts,[:client_ids])\n super(opts)\n end", "def slug_candidates\n [\n :name,\n [\"#{self.admin.name}-library\", :id],\n [\"#{self.admin.name}-library\", :id, self.admin.id]\n ]\n end", "def component_initialize\n # Only create and supply a random ID this when a :heading is present\n return unless heading\n new_id = options[:id].nil? ? random_id : options[:id]\n options[:id] = new_id\n end", "def set_admin_additional_description\n @admin_additional_description = AdditionalDescription.find(params[:id])\n end", "def set_game_library\n @game_library = GameLibrary.friendly.find(params[:id])\n end", "def init_params(params)\n @client_id = params[:client_id]\n @user_extended_detail_id = params[:user_extended_details_id]\n @reprocess = params[:reprocess].to_i\n end", "def set_admin_brand\n @admin_brand = Admin::Brand.friendly.find(params[:id])\n end", "def set_admin_album_tag\n @admin_album_tag = Admin::AlbumTag.find(params[:id])\n end", "def set_unit_id(opts)\n opts = check_params(opts,[:unit_ids])\n super(opts)\n end", "def set_unit_id(opts)\n opts = check_params(opts,[:unit_ids])\n super(opts)\n end", "def library_params\n #params.fetch(:page, {name})\n params[:library].permit(:name, :address, :number)\n end", "def library_attributes(library)\n {lib: library.name}\n end", "def set_admin_vendor\n @vendor = Vendor.find(params[:id])\n end", "def initialize(client, params = {}, api_ver = nil)\n super\n end", "def initialize(client, params = {}, api_ver = nil)\n super\n end", "def initialize(params)\n @oauth_id = params[:oauth_id]\n @oauth_secret = params[:oauth_secret]\n @authorization_url = params[:authorization_url]\n @token_url = params[:token_url]\n\n @room_id = params[:room_id]\n @group_id = params[:group_id]\n\n @room_id = @room_id.to_i if ! @room_id.nil?\n @group_id = @group_id.to_i if ! @group_id.nil?\n\n api_base_uri = params[:api_base].to_s\n unless api_base_uri.end_with?('/')\n api_base_uri += '/';\n end\n @api_base = URI.parse(api_base_uri)\n end", "def set_api(*args); end", "def set_api(*args); end", "def self_and_subclass_param_ids\n subclass_param_ids.insert(0, self_param_id)\n end", "def self_and_subclass_param_ids\n subclass_param_ids.insert(0, self_param_id)\n end", "def self_and_subclass_param_ids\n subclass_param_ids.insert(0, self_param_id)\n end", "def set_engine_id(opts)\n opts = check_params(opts,[:engine_id])\n super(opts)\n end", "def admin_system_setup_params\n params.require(:admin_system_setup).permit(\n :da_landing_page_id,\n :da_subscription_page_id,\n :en_landing_page_id,\n :en_subscription_page_id\n )\n end", "def set_rakuten_api_ids\n RakutenWebService.configure do |c|\n c.application_id = ENV[\"APPID\"]\n c.affiliate_id = ENV[\"AFID\"]\n end\n end", "def libro_params\n params.fetch(:libro, {}).permit(:titulo_libro, :tomo_libro, :area_libro, :edicion_libro, :ano_libro, :lugar_publicacion_libro, :ano_publicacion_libro,:autor_id, :genero_id, :idioma_id, :material_id, :sigtop_id, :editorial_id)\n end", "def set_admin_product\n @admin_product = Admin::Product.find(params[:id])\n end", "def set_admin_catalog\n @admin_catalog = catalog_model.find(params[:id])\n end", "def library_row_params\n params.require(:library_row).permit(:book_id, :catalog_id, :shel_id)\n end", "def core_seller_area_params\n params.require(:core_seller_area).permit(:seller_id, :area_id).merge({account_id: current_account.id, updater_id: current_user.id})\n end", "def library_params\n params.require(:library).permit(:name, :cover, :cover_cache, :remove_cover, :desc, :file, :file_cache, :remove_file, :crop_x, :crop_y, :crop_w, :crop_h, :position, :katbib2_id)\n end", "def library(id, params = {})\n Library.find(id, params)\n end", "def set_libro\n @libro = Libro.find(params[:id])\n end", "def set_admin_device_brand\n @device_brand = DeviceBrand.find(params[:id])\n end", "def index\n @library_location = 2\n super\n end", "def set_admin\n @adminproduct = Productcla.find(params[:id])\n end", "def core_seller_params\n params.require(:core_seller).permit(:parent_id, :name, :fullname, :mobile, :phone, :email, :address, :stock_id).merge({account_id: current_account.id, updater_id: current_user.id})\n end", "def configure_with(params)\r\n\r\n\t\tend", "def init_params(params)\n @client_id = params[:client_id]\n\n @edit_kyc_id = params[:edit_kyc_id]\n\n @user_extended_detail_id = params[:user_extended_detail_id]\n\n @user_kyc_detail_id = params[:user_kyc_detail_id]\n\n @admin_email = params[:admin_email]\n\n @user_id = params[:user_id]\n\n @client = Client.get_from_memcache(@client_id)\n end", "def set_api_v1_admin_type\n @api_v1_admin_type = Api::V1::AdminType.find(params[:id])\n end", "def initialize(args, kwargs = nil)\n super(args, kwargs)\n client_config[:child_components] = child_components || []\n client_config[:linked_components] = linked_components || []\n end", "def initialize(args, kwargs = nil)\n super(args, kwargs)\n client_config[:child_components] = child_components || []\n client_config[:linked_components] = linked_components || []\n end", "def set_template_library\n @template_library = TemplateLibrary.find(params[:id])\n end", "def admin_role_ref_params\n params.require(:admin_role_ref).permit(:admin_id, :role_id)\n end", "def admin_configuration_identifier_params\n params.require(:admin_configuration_identifier).permit(:identifier)\n end", "def document_params\n params.require(:library_document).permit(LibraryDocument.allowable_params)\n end", "def set_admin_information\n @admin_information = Admin::Information.find(params[:id])\n end", "def library(lib)\n Dissident::LIBRARIES[self] = lib\n end", "def admin_id\n 9\n end", "def update\n @library = @user.libraries.find(params[:id])\n raise ActiveRecord::RecordNotFound unless @library\n \n if @library.update_attributes(params[:library])\n @user.libraries.reload\n redirect_to user_path, :notice => I18n.t('libraries.update.success')\n else\n render :action => 'edit', :layout => 'dialog'\n end\n end", "def admin_building_params\n params.require(:admin_building).permit(:user_id, :parent_id, :code, :name, :description)\n end", "def set_admin_features_brand\n @admin_features_brand = Admin::FeaturesBrand.find(params[:id])\n end", "def set_admin_listing\n @listing = Listing.find(params[:id])\n end", "def authentication_params\n super.merge(clientKey: LeanplumApi.configuration.content_read_only_key)\n end", "def init_params(parmas)\n @client_id = parmas[:client_id]\n @client = Client.get_from_memcache(@client_id)\n end", "def init_params(params)\n\n @parent_id = params[:parent_id]\n\n @critical_chain_interaction_log = nil\n @client_id = nil\n\n end", "def set_libr_libro\n @libr_libro = LibrLibro.find(params[:id])\n end", "def update\n @library = current_user.library\n @library.update(library_params)\n redirect_to edit_library_path(current_user.library.id)\n end", "def set_admin_language_code\n @admin_language_code = Admin::LanguageCode.find(params[:id])\n end", "def setup_allergy\n if self.allergy_ids.empty?\n self.allergy_ids = [9]\n end\n end", "def set_admin_admin\n @admin_admin = Admin::Admin.find(params[:id])\n end", "def set_admin_company\n @admin_company = Admin::Company.find(params[:id])\n end", "def world_admin_params\n params.require(:world_admin).permit(:world_uri_id, :admin_uri_id)\n end", "def solr_doc_params(id=nil)\n id ||= params[:id]\n # just to be consistent with the other solr param methods:\n {\n :qt => :document,\n :id => id # this assumes the document request handler will map the 'id' param to the unique key field\n }\n end", "def lib_book_params\n params.require(:lib_book).permit(:library_id, :book_id, :quantity)\n end", "def implementation_params\n p = params.permit(:scenario_id)\n p.merge params.require(:implementation).permit(:library_id)\n end", "def set_web_id(value) @web_id = value; end", "def put_responsemanagement_library_with_http_info(library_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ResponseManagementApi.put_responsemanagement_library ...\"\n end\n \n \n # verify the required parameter 'library_id' is set\n fail ArgumentError, \"Missing the required parameter 'library_id' when calling ResponseManagementApi.put_responsemanagement_library\" if library_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ResponseManagementApi.put_responsemanagement_library\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/responsemanagement/libraries/{libraryId}\".sub('{format}','json').sub('{' + 'libraryId' + '}', library_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 = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Library')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ResponseManagementApi#put_responsemanagement_library\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def library_params\n params.fetch(:library).permit(:name, :university, :location, :max_days, :overdue_fines)\n end" ]
[ "0.66456765", "0.6317812", "0.6300191", "0.625822", "0.61746913", "0.59464914", "0.58952403", "0.57715607", "0.56993145", "0.5645499", "0.56342816", "0.55929744", "0.5572139", "0.55279535", "0.5471647", "0.5395107", "0.53885126", "0.53854704", "0.5384356", "0.53722453", "0.535705", "0.53353006", "0.53302854", "0.5267712", "0.5234532", "0.519742", "0.5197342", "0.5190974", "0.5185058", "0.51580125", "0.51402056", "0.51360095", "0.5124813", "0.5116755", "0.5102349", "0.51008856", "0.5098866", "0.50800514", "0.5079519", "0.50792867", "0.50774705", "0.50774705", "0.5070001", "0.50656724", "0.5063034", "0.50629747", "0.50629747", "0.5035349", "0.50352746", "0.50352746", "0.5035004", "0.5035004", "0.5035004", "0.5030409", "0.5009403", "0.5007584", "0.5006965", "0.50054604", "0.50028306", "0.5000989", "0.49932632", "0.49929023", "0.49860436", "0.49848166", "0.4982353", "0.49821708", "0.49768138", "0.49752596", "0.4967553", "0.4960863", "0.49589062", "0.4951345", "0.4951345", "0.4948664", "0.4943783", "0.49416858", "0.49390814", "0.49363178", "0.49290007", "0.4924779", "0.492443", "0.49234763", "0.4921883", "0.49209303", "0.49188697", "0.49174306", "0.4914141", "0.4906605", "0.49035856", "0.48964655", "0.48943272", "0.48900256", "0.48896843", "0.48861396", "0.48831162", "0.48827997", "0.4881878", "0.48783994", "0.48776573", "0.4875861" ]
0.70998466
0
Below Provides params for new library upload record.
def upload_params params.require(:library_upload).permit(:title, :description, :tags, :image, :file) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def library_params\n params.require(:library).permit(:red_id, :purchased_on, :user_id, :description, :library_data)\n end", "def library_params\n params.require(:library).permit(:name, :cover, :cover_cache, :remove_cover, :desc, :file, :file_cache, :remove_file, :crop_x, :crop_y, :crop_w, :crop_h, :position, :katbib2_id)\n end", "def upload_file_params\n puts params\n params\n end", "def lib_entry_params\n params.require(:lib_entry).permit(:title, :text, :lib_entry_id, :file, :data, :destroy_attachment)\n end", "def upload_params\n params[:upload]\n end", "def upload_params\n params[:upload]\n end", "def library_params\n params.require(:library).permit(:name, :location, :borrow_duration, :fine_per_day, :university_id)\n end", "def upload_params\n params.require(:upload_file)\n end", "def upload_params\n params.require(:upload).permit(:title, :upload, :user_id)\n end", "def upload_params\n params.require(:upload).permit(:election_id, :file_type_id, :public, :file) # Not status, address or checksum.\n end", "def image_library_params\n params.require(:image_library).permit(:name)\n end", "def upload_params\n params.require(:upload).permit(:name, :category, :information, :course_id, :assignment_id)\n end", "def upload_params\n params.require(:upload).permit(:upload)\n end", "def upload_params\n params.require(:upload).permit(:filename, :key)\n end", "def upload_params\n params.require(:upload).permit(:url,:name,:Description, :created_at )\n end", "def file_upload_params\n params.require(:file_upload).permit(:fname, :owner, :ftype, :keywords, :attachment)\n end", "def upload_params\n permit = policy(@upload || Upload).permitted_attributes\n params.require(:upload).permit(*permit)\n end", "def file_record_params\n params.fetch(:file_record, {})\n end", "def upload_file_params\n params.require(:upload_file).permit(:title, :date_uploaded, :attachment, :vendor_id, :task_allocation_id)\n end", "def upload_params\n params.require(:upload).permit(:filename, :content_type, :category)\n end", "def upload_params\n params.require(:upload).permit(:title, :file_attachment)\n end", "def source_file_params\n params.require(:source_file).permit(:name, :library_id)\n end", "def upload_params\n params.require(:upload).permit(:upload, :user_id, :folder_id)\n end", "def up_file_params\n params.require(:up_file).permit(:site_id, :catalog_item_id, :file)\n end", "def upload_params\n\t params.require(:upload).permit(:document)\n\tend", "def upload_params\n params.require(:upload).permit(:name, :description)\n end", "def aw_params\n params.require(:aw).permit(:file, :uploaded_file)\n end", "def file_operation_params\n params.require(:file_operation).permit(:file_path, :status, :job_class, :user_type, :user_id, :info)\n end", "def upload_params\n params.require(:upload).permit(:user_name, :user_email, :recipient_email, :message, :package)\n end", "def library_params\n params.fetch(:library).permit(:name, :university, :location, :max_days, :overdue_fines)\n end", "def file_record_params\n params.require(:file_record).permit(:name, :file)\n end", "def record_params\n # set the cas user and initialize the record as not being flagged for removal\n params[:record][:cas_user_name] = session[:cas_user]\n params[:record][:flagged_for_removal] = false\n\n # set the cas username for each record attachment \n if params[:record][:record_attachments_attributes]\n params[:record][:record_attachments_attributes].each do |p|\n p[:cas_user_name] = session[:cas_user]\n end\n end\n\n params.require(:record).permit(\n :cas_user_name, :make_private, :title,\n :description, :date, :location, :hashtag,\n :release_checked, :flagged_for_removal,\n\n record_attachments_attributes: [\n :record_id, :cas_user_name, :filename, :mimetype,\n :file_upload_url, :medium_image_url, :annotation_thumb_url,\n :square_thumb_url\n ]\n )\n end", "def uploaded_file_params\n params.require(:uploaded_file).permit(:attachment, :lecture, :link, :link_name, :filename)\n end", "def uploader_params\n params.require(:uploader).permit(:time, :content, :place)\n end", "def record_params\n params.require(:record).permit(:identifier, :category_id, :carrier_id, :pattern_id, :issue_id, :language_id, :collector_id,\n :sensitive, :title, :contributor, :publisher, :date, :unit,:size, :page, :quantity, :catalog, :content, :information,\n :comment, :copyright, :right_in_rem, :ownership, :published, :license, :filename, :filetype, :creator, :created_at,\n :commentor, :commented_at, :updater, :updated_at, :image, :image_cache, :remove_image, :visits, :statistics, :serial_no)\n end", "def parse_upload\n expected_params[:upload] ||= ParameterDeclaration.new(:upload, :upload, {})\n params[:upload]\n end", "def library_row_params\n params.require(:library_row).permit(:book_id, :catalog_id, :shel_id)\n end", "def ride_upload_params\n params.require(:ride_upload).permit(:user_id, :ride_zone_id, :name, :description, :csv, :status, :csv_hash)\n end", "def upload_file_params\n params.require(:upload_file).permit(:title, :type, :path, :size)\n end", "def upload_params\n params.require(:upload).permit(:uploaded_file, :user_id, :folder_id,:label)\n end", "def lib_book_params\n params.require(:lib_book).permit(:library_id, :book_id, :quantity)\n end", "def library_params\n #params.fetch(:page, {name})\n params[:library].permit(:name, :address, :number)\n end", "def publication_params\n params.require(params[:type]).permit(:library_id, :age_limit, :status, :author, :name, :count, :stock, :issn, :isbn, :interval)\n end", "def file_params\n params.require(:wx_file).permit(:file_name, :file_size, :mime_type, :digest, :description)\n end", "def structure_photo_params\n params.permit(:uuid, :base64image, :filename,:deleted_at,:structure_id)\n end", "def record_object_params\n params.require(:record_object).permit(:label, :description, :attribution, :license, :naId, image_attributes: [:title, :description, :image, :id, :_destroy])\n end", "def upload_params\n params.require(:upload).permit(:image, :description)\n end", "def file_format_params\n params.require(:file_format).permit(:title, :notes)\n end", "def upload_params\n params.require(:upload).permit(:user_id, :country_id, :university_id, :image)\n end", "def file_info_params\n params.require(:file_info).permit(:folder, :loc, :name, :type, :review_done, :component_id)\n end", "def library_params\n params.require(:library).permit(:style, :user_id)\n end", "def library_book_params\n params.require(:library_book).permit(:name, :author, :description, :publisher, :isbn, :class, :status)\n end", "def recording_params\n #params.require(:recording).permit(:area_id, :station_id, :start_datetime, :recording_second, :title, :filename, :is_recorded)\n params.require(:recording).permit(:area_id, :station_id, :start_datetime, :recording_second, :title, :filename, :job_id)\n end", "def record_params\n params.require(:record).permit(:title, :artist, :year, :cover_art, :song_count)\n end", "def upload_params\n params.require(:upload).permit(:arquivo, :status)\n end", "def fileupload_params\n params.require(:fileupload).permit(:user_id, :filename, :sort, :direction)\n end", "def permitted_params\n params.require(:assetabler_external_service).permit(\n :name,\n :filename,\n :body,\n :content_type,\n :width,\n :height,\n :uploader_id\n )\n end", "def file_upload_params\n params.require(:file_upload).permit(:title, file_upload_attachments_attributes: [:id, :file_upload_id, :scenario])\n end", "def record_params\n params.require(:record).permit(:document_ref, :text, :error, :comment, :revision, :approved, :incorporated, :user_id, :manual_id)\n end", "def initialize(params = {})\n @multipart_params = []\n push_params(params)\n end", "def cfr_record_params\n params.require( :cfr_record ).permit( \n :title, :note, :group_id, :conf_level, :doc_version, :doc_date, :doc_owner,\n :extension, :cfr_file_type_id, :hash_value, :hash_function, :rec_frozen,\n cfr_locations_attributes: [ :id, :_destroy, :cfr_location_type_id, :file_name, :doc_code, :doc_version, :uri, :is_main_location ],\n src_relations_attributes: [ :id, :_destroy, :dst_record_id, :cfr_relationship_id ],\n dst_relations_attributes: [ :id, :_destroy, :src_record_id, :cfr_relationship_id ])\n end", "def upload_params\n params[:upload].permit :image\n end", "def spin_header_params\n params.require(:spin_header).permit(:SpinHeader, :file_store_id, :notes, :stage, :time_recorded, :distance_recorded, :avg_speed_recorded, :avg_watts_recorded, :avg_hr_recorded, :avg_rpm_recorded, :max_speed_recorded, :max_watts_recorded, :max_hr_recorded, :max_rpm_recorded, :kcal_recorded, :kj_recorded, :distance_calc, :avg_speed_calc, :avg_watts_calc, :avg_hr_calc, :avg_rpm_calc, :max_speed_calc, :max_watts_calc, :max_hr_calc, :max_rpm_calc)\n end", "def holding_params\n params.require(:holding).permit(:name,:uploaded_file)\n end", "def libro_params\n params.fetch(:libro, {}).permit(:titulo_libro, :tomo_libro, :area_libro, :edicion_libro, :ano_libro, :lugar_publicacion_libro, :ano_publicacion_libro,:autor_id, :genero_id, :idioma_id, :material_id, :sigtop_id, :editorial_id)\n end", "def upload_params\n params.require(:upload).permit(:image)\n end", "def library_book_params\n params.require(:library_book).permit(:name, :lead, :is_active)\n end", "def document_params\n params.require(:document)\n .permit(:doc_type, :doc_number, :doc_expire, :upload)\n end", "def create\n@upload = Upload.create(upload_params)\nend", "def import_params\n params.permit(:import_type, :file)\n end", "def audio_upload_params\n params.require(:audio_upload).permit(:artist_name, :track_name, :image, :audio)\n end", "def template_library_params\n params[:template_library].permit(:title)\n end", "def csvupload_params\n params.require(:csvupload).permit(:name, :rating, :description)\n end", "def form_params\n params.require(:upload).permit(Upload.allowable_params)\n end", "def items_import_params\n # params.require(:items_import).permit(:file_name, :uploaded_by, :uploaded_at, :status)\n params.fetch(:items_import, {}).permit(:file_name, :uploaded_by, :uploaded_at, :status, :file)\n end", "def create_multipart_upload\n self.s3_object||= Upload.get_s3_object(self.object_key)\n self.multipart_upload = s3_object.multipart_upload(\n content_type: params[:type],\n server_side_encryption: S3BrowserMultipart::Engine.\n config.s3_config[:server_side_encryption]\n )\n self.upload_id = self.multipart_upload.upload_id\n Rails.logger.warn \"Created multipart_upload_id: #{self.upload_id} object_key: #{self.object_key}\"\n end", "def sample_photo_params\n params.permit(:uuid, :base64image, :filename, :sample_id,:deleted_at)\n end", "def import_params\n params.require(:file)\n end", "def attachment_params\n params.permit(:file, :organization_id, :person_id, :career_id, :deal_id, :activity_id)\n end", "def record_params\n params.require(:record).permit(:name, :info, :year, :performer_id)\n end", "def repository_params\n params.require(:repository).permit(:title, :staff_id, :data, :uploaded, :uploaded_file_name, :uploaded_content_type, :uploaded_file_size)\n end", "def library_params\n params.require(:library).permit(:room, :school_id)\n end", "def uploader_options\n end", "def image_params\n #Added uploads param 7/72018 Paul Ancajima\n params.require(:image).permit(:image_title, :image_owner_id, :category_id, :licensing, :date, :description, :file_type, :location, :status_id, uploads: [])\n end", "def attachment_params\n # params.fetch(:attachment)\n params.require(:attachment).permit(:name, :file_type, :data, :origin_type, :situation, :origin_id)\n end", "def operating_procedure_params\n params.permit(:op_number, :title,:file, :file_url)\n end", "def file_object_params\n params.fetch(:file_object, {})\n end", "def document_params\n params.require(:library_document).permit(LibraryDocument.allowable_params)\n end", "def create\n request.env.each {|key, value| pp \"key:#{key} --------- value:#{value}\" }\n pp \"----#{request.env}----\"\n debugger\n puts params[:upload]\n @file_upload = FileUpload.new(params[:file_upload])\n debugger\n @file_upload.name = params[:url]\n @file_upload.name = FileUpload.get_name(params[:upload])\n @file_upload.file_type = FileUpload.get_type(params[:upload])\n upload = FileUpload.file_upload(params[:upload])\n respond_to do |format|\n if @file_upload.save && upload\n format.html { redirect_to(@file_upload, :notice => 'FileUpload was successfully created.') }\n format.xml { render :xml => @file_upload, :status => :created, :location => @file_upload }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @file_upload.errors, :status => :unprocessable_entity }\n end\n end\n end", "def permit_params\n params.require(:permit).permit(:permitid, :filename, :category_id, :site_id, :employee_id)\n end", "def video_upload_params\n params.fetch(:video_upload, {})\n end", "def file_upload_attachment_params\n params.require(:file_upload_attachment).permit(:file_upload_id, :scenario)\n end", "def bucket_files_params\n params.require(:bucket_file).permit(:avatar, :user_id, :disk_id, :name, :file_name)\n end", "def blob_params\n params.require(:blob).permit(:name, :length, :last_modified)\n end", "def libation_params\n params.require(:libation).permit(:user_id, :libation_name, :libation_type, :weight, :weight_type, :container_type, :country_made, :company_name, :website, :date_drank, :store_purchased, :city_purchased, :prov_purchased, :country_purchased, :colour, :pulp, :can_art, :can_design, :sweet, :juice, :sip_guzz, :flavour, :buy_again, :carbonated, :image, :image_cache, :comments, :remote_image_url)\n end", "def uploaded_file_params\n params.require(:uploaded_file).permit(:file)\n end", "def sample_params\n params.require(:sample).permit(:filename, :malz, :hash, :tags_list)\n end", "def photo_params\n params.require(:photo).permit(:filename, :date_taken, :path, :file_thumb_path, :file_extension, :file_size, :location_id, :make, :model, :original_height, :original_width, :longitude, :latitude)\n end", "def add_some_extra_params\n @params['size'] = @file.size\n @params['md5sum'] = @file.md5sum\n end", "def record_params\n params.require(:record).permit(:name, :typ, :user_id, :val, :unit)\n end" ]
[ "0.7122363", "0.71116245", "0.6918736", "0.6917665", "0.6913336", "0.6913336", "0.686343", "0.6735816", "0.6684364", "0.66784006", "0.6670489", "0.66634995", "0.6642525", "0.6630823", "0.66180724", "0.66176736", "0.6602055", "0.65902513", "0.6558071", "0.655783", "0.65406513", "0.65338624", "0.6508703", "0.644508", "0.64102626", "0.64023715", "0.6396239", "0.6393235", "0.63832605", "0.6375701", "0.63694364", "0.6346329", "0.6334544", "0.6328801", "0.63138366", "0.6308231", "0.6306164", "0.6299452", "0.62761945", "0.62695855", "0.6262308", "0.62562984", "0.62497216", "0.6239502", "0.622722", "0.6224979", "0.6214429", "0.6207871", "0.62063444", "0.6205687", "0.62038904", "0.6192461", "0.61798304", "0.6157474", "0.61445147", "0.6140721", "0.6132803", "0.612894", "0.6123239", "0.6115116", "0.6111602", "0.6104019", "0.61012554", "0.609847", "0.60907227", "0.60905117", "0.60877436", "0.6087589", "0.6084012", "0.6073935", "0.60666597", "0.6055869", "0.6052402", "0.6048999", "0.6035852", "0.6029205", "0.60291314", "0.6027723", "0.60236365", "0.60197705", "0.60146856", "0.600967", "0.6003306", "0.59979326", "0.5996038", "0.59891695", "0.5988479", "0.5984405", "0.5980745", "0.5978015", "0.5975892", "0.59738344", "0.597092", "0.5969537", "0.596953", "0.5969307", "0.5965586", "0.5965552", "0.5965168", "0.5962694" ]
0.7591383
0
this allows me use all the methods in the sessions helper in all my controllers
def user_id @logged_in_user = User.find_by(id: params[:id]) @user_id = @logged_in_user.id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session\n end", "def session; end", "def session; end", "def session; end", "def session; end", "def expose_session_to_models\n $_SESSION = session\n end", "def set_session\n \n end", "def session\n @controller.session\n end", "def session() request.session end", "def session ; request.session ; end", "def session; @session; end", "def session; @session; end", "def session; @session; end", "def login(user)\n #assign session_token and give it as a cookie to the client's browser \n session[:session_token] = user.reset_session_token! #a method \n #putting a key-value pair into the session hash \n #session hash is only available in controllers and views \n end", "def login_from_session\nself.current_user = User.find_by_id(session[:user_id]) if session[:user_id]\nend", "def save_session(session)\n \n end", "def set_session\n\t #no idea why I need this, but login form seems to break otherwise\n\t session[:email] = session[:email]\n\t session[:password] = session[:password]\n\t end", "def session\n @session ||= Session.new(req)\n# Implement a method ControllerBase#session which constructs a\n# session from the request. Lazily assign this in to an ivar,\n# (@session; use ||=) that can be returned on subsequent calls to\n# #session.\n# Make sure that the #redirect_to and #render_content methods call\n# Session#store_session so that the session information is stored in the\n# cookie after the response is built.\n end", "def login\n old_controller = @controller\n @controller = SessionsController.new\n    post :create, session: {email: '[email protected]', password: 'qwerty'}\n @controller = old_controller\n\n return session[:session_token]\n end", "def session\n # lazy assign so session persists for entire controller life\n @session ||= Session.new(@req)\n end", "def session\n @session ||= {}\n end", "def current_user\n User.find_by(id: session[:user_id])\nend", "def current_user\n@current_user ||= User.find_by(id: session[:user_id])\nend", "def session\n @session ||= Session.new(request)\n end", "def open_session; end", "def group_sessions\n\t\n\tend", "def set_session user\n session[:user_id] = user.id\n session[:user_fullname] = user.fullname\n session[:user_email] = user.email\n session[:user_access] = user.access\n session[:company_id] = user.company_id\n end", "def auth_session\n @auth_session ||= Session.get_session(@controller)\n end", "def log_in(user)\n session[:user_id] \t = user.id\n session[:user_name] = user.name\n session[:user_email] = user.email\n end", "def current_user_session\n @current_user_session ||= UserSession.find\n end", "def current_user_session\n @current_user_session ||= UserSession.find\n end", "def logged_in\r\n end", "def session_stuffing\n session['xmas'] = 'turkey'\n render :text => \"ho ho ho\"\n end", "def extend_session\n class << session\n include Rango::Session\n end\n end", "def session\n\t\t\trequest.session\n\t\tend", "def session\r\n @session ||= {}\r\n end", "def current_user\n User.find(session[:id])\nend", "def current_user\n User.find_by(id: session[:user_id])\n end", "def current_user\n User.find_by(id: session[:user_id])\n end", "def set_session\n @session = Session.find(params[:session_id])\n end", "def logged_in?\n session['logged_in']\n #false\n end", "def user_session\n @user_session ||= UserSession.find\n end", "def current_user\n @current_user ||= User.find_by(id: session[:user_id])\nend", "def current_user\n @current_user ||= User.find_by(id: session[:user_id])\nend", "def current_user_session\n \treturn @current_user_session if defined? @current_user_session\n \t@current_user_session = without_access_control { UserSession.find }\n end", "def session\n @session ||= options[:session] || {} \n end", "def login_from_session\n self.current_user = User.find_by_id( session[ :user_id ] ) if session[ :user_id ]\n end", "def current_user\n @current_user ||= User.find_by(id:session[:user_id])\n end", "def current_user \n @current_user ||= User.find(session[:id]) if session[:id] \nend", "def create_session\n session[:who_is_this] = \"admin\"\n end", "def login\n session_update(:current_state, nil)\n #first, check the current user is student or admin\n # byebug\n\n if params[:session][:user] == 'admin'\n #check if the uin of admin is valid\n # @cur_user = Admin.where(\"email ='#{params[:session][:email]}' and password ='#{params[:session][:password]}'\")\n @cur_user = Admin.where(\"email = '#{params[:session][:email]}'\")\n if @cur_user[0].nil?\n # flash[:warning] = \"Your Email or Password is Incorrect.\"\n flash[:warning] = \"The admin account doesn't exist\"\n redirect_to root_path\n else\n # puts \"User password: #{@cur_user[0].password}\"\n # puts \"Given password: #{params[:session][:password]}\"\n if @cur_user[0].password == Digest::MD5.hexdigest(params[:session][:password])\n #update the session value which could be used in other pages\n session_update(:name, @cur_user[0][:name])\n #:current_state could indicate the current user is admin or student\n session_update(:current_state, \"admin\")\n session_update(:uin, @cur_user[0][:uin])\n redirect_to student_requests_adminview_path\n else\n flash[:warning] = \"Your Email or Password is Incorrect\"\n redirect_to root_path\n end\n end\n elsif params[:session][:user] == 'student'\n #check if the uin of student is valid\n @user = Student.where(\"email = '#{params[:session][:email]}'\")\n if @user[0].nil?#the user doesn't sign up\n flash[:warning] = \"The account doesn't exist. Please sign up first.\"\n redirect_to root_path\n return#tricky\n else\n ##puts \"User password: #{@user[0].password}\"\n # puts \"Given password: #{params[:session][:password]}\"\n\n if @user[0].password == Digest::MD5.hexdigest(params[:session][:password])\n if @user[0].email_confirmed\n #update the session value which could be used in other pages\n session_update(:name, @user[0][:name])\n session_update(:current_state, \"student\")\n session_update(:uin, @user[0][:uin])\n redirect_to students_show_path\n else\n flash[:warning] = \"The account has not been activated. Please check your email to activate your account!\"\n redirect_to root_path\n end\n else\n flash[:warning] = \"Entered Email and Password didn't match. Try again.\"\n redirect_to root_path\n end\n end\n end\n end", "def save_session()\n @store\n end", "def current_user\n# Look up the current user based on user_id in the session cookie:\n#TIP: The ||= part ensures this helper doesn't hit the database every time a user hits a web page. It will look it up once, then cache it in the @current_user variable.\n#This is called memoization and it helps make our app more efficient and scalable.\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\nend", "def session\n self\n end", "def session\n @session_proxy ||= Class.new do\n attr_reader :session\n\n def initialize session = {}\n @session = session\n end\n\n def [] key\n session[key]\n end\n\n def []= key, val\n return if readonly?\n session[key] = val\n end\n\n def delete key\n return if readonly?\n session.delete key\n end\n\n # makes sessions readonly\n #\n # @example prohibit writing for all actions\n # before do\n # session.readonly!\n # end\n #\n # @example prohibit writing only for :render and :display actions\n # before :render, :display do\n # session.readonly!\n # end\n def readonly!\n @readonly = true\n end\n\n def readonly?\n @readonly\n end\n\n def method_missing *args\n session.send *args\n end\n\n end.new @ctrl.env['rack.session']\n end", "def session_options; end", "def session_options; end", "def current_user\n if session[:user_id]\n @current_user=session[:user_id]\n end\nend", "def ensure_session_token\n self.session_token ||= User.generate_session_token\nend", "def login_from_session\n self.current_user = User.find_by_id(session[:user_id]) if session[:user_id]\n end", "def session\n if Rails.env.test?\n cookies\n else\n super\n end\n end", "def login_from_session\n self.current_<%= singular_name %> = <%= class_name %>.find_authenticated_model_with_id(session[:<%= singular_name %>]) if session[:<%= singular_name %>]\n end", "def user_session\n\t\t@user_session ||= UserSession.new(session)\n\tend", "def current_user_session\n return @current_user_session if defined?(@current_user_session)\n @current_user_session ||= UserSession.active.where(id: session[:user_session_id]).first if session[:user_session_id]\n set_current_user_session_from_remember_token unless @current_user_session\n @current_user_session.access(request, allow_tracking?) if @current_user_session\n session[:user_session_id] = @current_user_session.id if @current_user_session\n session[:time_zone] = @current_user_session.user.time_zone if @current_user_session\n set_time_zone\n\n @current_user_session\n end", "def require_login \n # puts \"#{@@count}\" \n # @@count+=1; \n if !(session[:user_id])\n # puts \"#{@@count} require_login method of application controller found no user logged in: \", session[:user_id]\n redirect_to '/main'\n # else\n # puts \"#{@@count} using require_login private method: Someone is already logged in: \", session[:user_id]\n # current_user = User.find(session[:user_id])\n #return current_user\n end\n end", "def _session\n\t\t\tThread.current[SESSION]\n\t\tend", "def current_user\n @current_user ||= User.find_by(id:session[:user_id])\nend", "def logged_in?\n #session_authenticated?\n session[:logged_in]\n end", "def session\n Session.instance\n end", "def valid_session\n { }\n end", "def extend_session!\n Rails.logger.info('SSO: ApplicationController#extend_session!', sso_logging_info)\n\n @session_object.expire(Session.redis_namespace_ttl)\n @current_user&.identity&.expire(UserIdentity.redis_namespace_ttl)\n @current_user&.expire(User.redis_namespace_ttl)\n set_sso_cookie!\n end", "def valid_session\n { }\n end", "def sessions\n @sessions\n end", "def current_user\n User.find_by_id(session[:user_id]) if session[:user_id] \n end", "def sign_in(user)\n #so, Rails gives us this \"cookies\" utility for free. \n # The \"permanent\" cookie really isn't; it expires 20 years from now (20.years.from_now)\n # NB also that 'cookies' really isn't a hash, since assigning to 'cookies' saves a piece of text on the browser\n cookies.permanent[:remember_token] = user.remember_token\n #This line creates current_user, which is accessible in both controllers and views. \n # I'm not sure at which point in the lifecycle it becomes available, but the 'self' reference makes \n # it globally available, rather than a session variable. \n self.current_user = user\n end", "def current_user\n# if there is a current user rtn that if not then rtn nil\n@current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "def login_from_session\n self.current_<%= file_name %> = <%= class_name %>.find_by_id(session[:<%= file_name %>_id]) if session[:<%= file_name %>_id]\n end", "def sessionize_with(&blk)\n @sessionize = blk if blk\n @sessionize || DEFAULT_SESSIONIZE\n end", "def sign_in\n session[:user_id] = @user.id\n end", "def session\n @session ||= Session.new(@request)\n @session\n end", "def setup\n @current_session = new_session\n end", "def logged_in?\n !!current_<%= file_name %>\n end\n\n # Accesses the current <%= file_name %> from the session.\n # Future calls avoid the database because nil is not equal to false.\n def current_<%= file_name %>\n @current_<%= file_name %> ||= login_from_session unless @current_<%= file_name %> == false\n end\n\n # Store the given <%= file_name %> id in the session.\n def current_<%= file_name %>=(new_<%= file_name %>)\n session[:<%= file_name %>_id] = new_<%= file_name %> ? new_<%= file_name %>.id : nil\n @current_<%= file_name %> = new_<%= file_name %> || false\n end\n\n # Check if the <%= file_name %> is authorized\n #\n # Override this method in your controllers if you want to restrict access\n # to only a few actions or if you want to check if the <%= file_name %>\n # has the correct rights.\n #\n # Example:\n #\n # # only allow nonbobs\n # def authorized?\n # current_<%= file_name %>.login != \"bob\"\n # end\n def authorized?\n logged_in?\n end\n\n # Filter method to enforce a login requirement.\n #\n # To require logins for all actions, use this in your controllers:\n #\n # before_filter :login_required\n #\n # To require logins for specific actions, use this in your controllers:\n #\n # before_filter :login_required, :only => [ :edit, :update ]\n #\n # To skip this in a subclassed controller:\n #\n # skip_before_filter :login_required\n #\n def login_required\n authorized? || access_denied\n end\n\n # Redirect as appropriate when an access request fails.\n #\n # The default action is to redirect to the login screen.\n #\n # Override this method in your controllers if you want to have special\n # behavior in case the <%= file_name %> is not authorized\n # to access the requested action. For example, a popup window might\n # simply close itself.\n def access_denied\n respond_to do |format|\n format.html do\n store_location\n #redirect_to new_<%= sessions_singular_name %>_path\n redirect_to :controller => 'sessions', :action => 'index'\n end\n end\n end\n\n # Store the URI of the current request in the session.\n #\n # We can return to this location by calling #redirect_back_or_default.\n def store_location\n session[:return_to] = request.request_uri\n end\n\n # Redirect to the URI stored by the most recent store_location call or\n # to the passed default.\n def redirect_back_or_default(default)\n redirect_to(session[:return_to] || default)\n session[:return_to] = nil\n end\n\n # Inclusion hook to make #current_<%= file_name %> and #logged_in?\n # available as ActionView helper methods.\n def self.included(base)\n base.send :helper_method, :current_<%= file_name %>, :logged_in?\n end\n\n # Called from #current_<%= file_name %>. First attempt to login by the <%= file_name %> id stored in the session.\n def login_from_session\n self.current_<%= file_name %> = <%= class_name %>.find_by_id(session[:<%= file_name %>_id]) if session[:<%= file_name %>_id]\n end\nend", "def session\n @session ||= Session.new(@request)\n end", "def login_from_basic_auth\n <%= singular_name %>name, passwd = get_auth_data\n self.current_<%= singular_name %> = <%= class_name %>.authenticate(<%= singular_name %>name, passwd) if <%= singular_name %>name && passwd\n end\n\n # Called from #current_<%= singular_name %>. Finaly, attempt to login by an expiring token in the cookie.\n def login_from_cookie \n <%= singular_name %> = cookies[:auth_token] && <%= class_name %>.find_authenticated_model_with_remember_token(cookies[:auth_token])\n if <%= singular_name %> && <%= singular_name %>.remember_token?\n <%= singular_name %>.remember_me\n cookies[:auth_token] = { :value => <%= singular_name %>.remember_token, :expires => <%= singular_name %>.remember_token_expires_at }\n self.current_<%= singular_name %> = <%= singular_name %>\n end\n end\n \n def reset_session\n session.data.each{|k,v| session.data.delete(k)}\n end\n\n private\n @@http_auth_headers = %w(Authorization HTTP_AUTHORIZATION X-HTTP_AUTHORIZATION X_HTTP_AUTHORIZATION REDIRECT_X_HTTP_AUTHORIZATION)\n\n # gets BASIC auth info\n def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end\n end\nend", "def login_from_session\n self.current_user = User.find(session[:user_id]) if session[:user_id]\n end", "def login_user\n session[:user_id] = @user.id\n end", "def set_session\n @session = Session.find(params[:id])\n end", "def set_session\n @session = Session.find(params[:id])\n end", "def set_session\n @session = Session.find(params[:id])\n end", "def set_session\n @session = Session.find(params[:id])\n end", "def session_id\n super\n end", "def session_id\n super\n end", "def current_user\n\n#return this @current user, only if he exists, if not, find him based on the current id stored in session\n@current_user ||= User.find(session[:user_id]) if session[:user_id] #return this user if there is a user id stored in our session hash\n\nend", "def login!(session) \n session[:user_id] = id \n end", "def set_session\n @session = session[:user_id]\n end", "def init_session\n init_language\n set_page_cache_directory\n init_views\n init_votes\n init_cookies\n end", "def populate_session(aPlayer)\n\t\tsession[:email] = @player.email\n\t\tsession[:player_id] = @player.id \n\t\tsession[:admin] = @player.admin\n\t\tsession[:login_time] = Time.now.to_i \n\tend", "def init_session\n before do\n path = defined?(init_session_path) ? init_session_path : '/'\n get(path)\n end\n end", "def get_session\n begin\n if session[:user_id].present? && session[:user_name].present? && current_user.present?\n unless session[:comp_id].present?\n @result = {flag:true , session_id: session[:user_id] , :user_name=> session[:user_name]} \n else\n @result = {flag:true , session_id: session[:user_id] , :user_name=> session[:user_name] , :comp_id=> session[:comp_id]}\n end \n render :json=>@result\n else \n reset_session \n @result = {flag:false}\n render :json=>@result\n end \n rescue Exception=> e\n reset_session \n @result = {flag:false}\n render :json=>@result\n end\n \n end", "def get_session\n return Seasar::Rack::Session.get_session(@env)\n end", "def show\n @session = Session.where(unique_id: params[:id])\n # New round logic here\n\n end" ]
[ "0.7659427", "0.7556875", "0.7556875", "0.7556875", "0.7556875", "0.72970706", "0.7202967", "0.7134648", "0.70918244", "0.7068453", "0.7000629", "0.7000629", "0.7000629", "0.68935806", "0.6826938", "0.67051023", "0.6651854", "0.6599791", "0.6572714", "0.6522088", "0.6511973", "0.6466674", "0.6465714", "0.6451262", "0.6447539", "0.6442969", "0.6429151", "0.63896495", "0.63815564", "0.63767195", "0.63767195", "0.636039", "0.6344996", "0.63168645", "0.6314858", "0.6310234", "0.6301648", "0.62912226", "0.62912226", "0.62864417", "0.6279842", "0.6268821", "0.6265098", "0.6265098", "0.6260737", "0.6259448", "0.6259346", "0.6249425", "0.6242611", "0.6241475", "0.6241181", "0.6236436", "0.6233912", "0.62261", "0.6221564", "0.6218338", "0.6218338", "0.62134534", "0.6203852", "0.62014717", "0.6200212", "0.62001365", "0.61962026", "0.6194552", "0.61883706", "0.6187608", "0.6176549", "0.61753255", "0.6166489", "0.6164998", "0.6158247", "0.6156193", "0.61555994", "0.61511225", "0.6150566", "0.61500084", "0.6149719", "0.6149091", "0.6145466", "0.6143933", "0.61427456", "0.6136358", "0.6133225", "0.61294264", "0.612515", "0.611842", "0.61155117", "0.61155117", "0.61155117", "0.61155117", "0.61146206", "0.61146206", "0.61134624", "0.61127573", "0.61116606", "0.6101369", "0.6099888", "0.6098768", "0.6097319", "0.60967535", "0.6091973" ]
0.0
-1
digits, return a sorted array of all the unique numbers that can be formed with those digits.
def number_shuffle(number) no_of_combinations = number.to_s.size == 3 ? 6 : 24 digits = number.to_s.split(//) combinations = [] combinations << digits.shuffle.join.to_i while combinations.uniq.size!=no_of_combinations combinations.uniq.sort end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unused_digits *integer_array\n remaining_nums = Array(0..9) - integer_array.flatten.join.scan(/\\d/).sort.map(&:to_i)\n remaining_nums.join.to_s\nend", "def unused_digits(*num)\n digits = (0..9)\n arr = *num.join.split('')\n \n unused_digits = digits.select do |num|\n !arr.include?(num.to_s)\n end\n unused_digits.sort.join\nend", "def uniq_digits?(num)\n digits = num.to_s.chars\n digits == digits.uniq\nend", "def digitArray(num)\n\tdigs = []\n\twhile num > 9\n\t\tnum, last_digit = num.divmod(10)\n\t\tdigs << last_digit\n\tend\n\tdigs << num\n\tdigs\nend", "def combinations(num_digits)\n combos = []\n (1..num_digits).each do |len|\n combos += (0...num_digits).to_a.combination(len).to_a\n end\n combos\nend", "def unique(numbers)\r\n output = []\r\n \r\n numbers.each do |num|\r\n if output.include?(num)\r\n\r\n else\r\n output.push(num)\r\n end\r\n end\r\n\r\n return output\r\nend", "def digit_list(num)\n arr = []\n divisor = 10**((num.to_s.length) - 1)\n \n while divisor >= 1\n digit = num/divisor\n arr << (num / divisor)\n num -= digit*divisor\n\n divisor = divisor / 10\n end\n \n arr\nend", "def number_shuffle(number)\n nums = \"#{number}\".split('')\n unique_nums = []\n (1..nums.length).inject(:*).times do\n loop do\n break if !unique_nums.include?(nums.shuffle!.join.to_i)\n end\n unique_nums << nums.join.to_i\n end\n return unique_nums.sort\nend", "def numUnique2 list\n current_num = list[0]\n unique_numbers = [list[0]]\n\n list.each do |num|\n if num != current_num\n current_num = num\n unique_numbers << num\n end\n end\n return \"**#{unique_numbers.length}**\"\nend", "def CheckUniqDigits(n)\n\n h1 = Hash.new\n\n arr = n.digits\n\n for onedig in arr\n\n h1.key?(onedig) ? (return 0) : (h1[onedig] = 1)\n\n end\n\n return 1\n\nend", "def sort_by_numbers(unsorted_list, sorted_digits, options={})\n\n unsorted_map = unsorted_list.inject({}) {|map, v| map[v.number] = v; map }\n\n # First sort the list in the order of the sorted digits\n # leaving nils for empty spaces\n sorted_list = if sorted_digits.length > 1\n sorted = [nil] * sorted_digits.length\n sorted_digits.each_with_index{|n, idx|\n sorted[idx] = unsorted_map[n]\n unsorted_map[n] = :used unless options[:keep_duplicates]\n }\n \n sorted.delete_if{|x| x == :used } unless options[:keep_duplicates]\n sorted\n else\n unsorted_list.any? ? unsorted_list.dup : [nil]\n end\n sorted_list\n end", "def sort(array)\n array.sort_by { |digit| [digit.digits(2).count(1), digit] }\nend", "def delete_digit(n)\n nums = []\n array = n.digits.reverse\n array.each_with_index do |int, index|\n copy = array.clone\n copy.delete_at(index)\n nums << copy.join.to_i\n end\n nums.max\nend", "def digit_array(card_number)\n card_number.to_s.gsub(/ +/, '').reverse.split(//).map{|digit| digit.to_i}\n end", "def repeated_number_ranges(numbers)\n result = []\n sub_arr = []\n i = 0 \n while i < numbers.length \n if sub_arr.length == 0 && numbers[i] == numbers[i+1]\n sub_arr << i\n elsif sub_arr.length == 1 && numbers[i] != numbers[i+1]\n sub_arr << i\n result << sub_arr\n sub_arr = []\n end\n i+=1\n end\n result\nend", "def delete_digit(number)\n deleted = number.digits.reverse.combination(number.digits.length - 1).to_a\n int_to_string = deleted.map do |sub_arr|\n sub_arr.map do |num|\n num.to_s\n sub_arr.join\n end\n end\n \n int_to_string.flatten.sort_by {|a| a.to_i}.last.to_i\nend", "def desc_digits(input)\n\t\tcreate_array(input).sort.join.to_i\n\tend", "def unused_digits(*a)\n numbers = [*a].join.split(\"\")\n digits_left = (0..9).to_a\n\n digits_left.length.times do |num|\n if numbers.include?(num.to_s) == true\n digits_left.delete(num)\n end\n end\n\n return digits_left.join\n\nend", "def digit_list(num)\n int_array = []\n digit_array = num.to_s.split(//)\n digit_array.each do |numb|\n int_array += [numb.to_i]\n end\n int_array\nend", "def uniq_ints()\n []\n end", "def digits(num)\n cs = num.to_s.chars\n [].tap do |o|\n while cs.size > 0\n c = cs.shift\n o << (c + Array.new(cs.length) { |_i| 0 }.join).to_i\n end\n end\nend", "def number_shuffle(number)\n digits = number.to_s.split(//).uniq\n factorial = (1..digits.length).inject(:*) || 1\n\n res = []\n res << digits.shuffle.join.to_i while res.uniq.size != factorial\n\n res.uniq.sort\nend", "def amicable_numbers(n)\r\n numbers = Array.new\r\n 2.upto(n) do |x|\r\n y = d(x)\r\n if !numbers.include?(y)\r\n numbers.push(x,y) if d(y) == x && y != x\r\n end\r\n end\r\n return numbers\r\nend", "def digit_list(num)\n array = []\n \n num.to_s.each_char do |c| \n array.push(c.to_i)\n end\n array\nend", "def num_to_array num\n \n array = []\n div = 100000\n \n while div >= 1\n if (num / div) > 0\n digit = num / div\n array << digit\n num = num - (div * digit)\n end\n div = div / 10\n end\n \n return array\n \nend", "def number_shuffle(number)\n no_of_combinations = number.to_s.size == 3 ? 6 : 24\n digits = number.to_s.split(//)\n combinations = []\n combinations << digits.shuffle.join.to_i while combinations.uniq.size!=no_of_combinations\n combinations.uniq.sort\nend", "def find_mult_3(num)\n nums = num.digits\n i = 1\n array = []\n until i > nums.count\n a = nums.permutation(i).to_a.map{ |num| num.join.to_i }\n b = a.select{|num| num != 0 && num % 3 == 0}\n array << b.uniq\n i += 1\n end\n result = array.flatten.uniq\n return [result.count, result.max]\nend", "def repeated_number_ranges(arr)\n counter = 0\n answer = []\n while counter < arr.length\n temp = []\n while arr[counter] == arr[counter + 1]\n if temp.length == 0\n temp << counter\n end\n counter += 1\n end\n if temp.length == 1\n temp << counter\n answer << temp \n end\n counter += 1\n end\nanswer\nend", "def number_shuffle(number)\n no_of_combinations = number.to_s.size == 3 ? 6 : 24\n digits = number.to_s.split(//)\n combinations = []\n combinations << digits.shuffle.join.to_i while \n combinations.uniq.size!=no_of_combinations\n combinations.uniq.sort\nend", "def break_numbers_into_digits_into_array(number)\n array = number.to_s.split('').collect{|x| x.to_i} #changes string to int another way number.to_s.split('').map(&:to_i)\n return array\n end", "def descending_digits(int)\n nArray = int.to_s.chars.to_a\n nArray.sort{|x,y| y <=> x}\nend", "def cout(n)\n\tw=[0,1,2,3,4,5,6,7,8,9]\n\tx=[]\n\tk=1\n\twhile x!=w do \n\t\tm=n*k\n\t\t\twhile m>0 do\n\t\t\t\tt=m%10\n\t\t\t\tx=x.push(t)\n\t\t\t\tx.sort!\n\t\t\t\tx.uniq!\n\t\t\t\tm=m/10\t\n\t\t\tend\n\t\tk=k+1\n\tend\nreturn (k-1)*n\nend", "def digit_list(num)\n result = []\n\n until num.zero?\n num, remainder = num.divmod(10)\n result.unshift(remainder)\n end\n result\nend", "def available_digits\n @available_digits.to_a\n end", "def repeated_number_ranges(arr)\n\n result = []\n arr.uniq.each do |x|\n temp = []\n arr.each_with_index do |y, i|\n temp << i if x == y\n end\n result << [temp[0], temp[-1]] if temp.length > 1\n end\n\n result\nend", "def combos(num, base)\n\treturn [[]] if num == 0\n\tprev = combos(num - 1, base)\n\tnew_arr = []\n\tnew_num = 0\n\twhile new_num < base\n\t\tprev.each do |el|\n\t\t\tnew_arr << el + [new_num]\n\t\tend\n\t\tnew_num += 1\n\tend\n\n\tnew_arr.map{|el| el.sort}.uniq\nend", "def digit_list(num)\n num.to_s.chars.map(&:to_i)\nend", "def digit_list(num)\n num.to_s.chars.map {|val| val.to_i}\nend", "def digit_list(number)\n digits = []\n\n loop do\n number, rem = number.divmod(10)\n digits.unshift(rem)\n\n break if number == 0\n end\n\n digits\nend", "def find_unique(numbers)\n numbers.reduce(:^)\nend", "def digit_list(number)\n number.to_s.chars.map(&:to_i)\nend", "def digit_list(number)\n number.to_s.chars.map(&:to_i)\nend", "def digit_list(number)\n number.to_s.chars.map(&:to_i)\nend", "def digit_list(number)\n number.to_s.chars.map(&:to_i)\nend", "def digit_list(number)\n number.to_s.chars.map(&:to_i)\nend", "def solution(nums)\n nums.to_a.sort\nend", "def digit_list(num)\n digits = []\n\n loop do\n number, remainder = number.divmod(10)\n digits.unshift(remainder)\n break if number == 0\n end\n\n digits\nend", "def uniq(arr)\n new_array = []\n arr = arr.sort\n arr.each_with_index do |num, idx|\n new_array << num if num != arr[idx + 1]\n end\n new_array\nend", "def all_digits_are_the_same?(digits)\n digits.uniq.length == 1\nend", "def repeated_digit number\n raise \"Wrong type of argument\" if !number.is_a? Numeric\n # array = number.to_s.split(\"\").map(&:to_i)\n # array.count{ |item| item != array.first} == 0\n\n # number.to_s.squeeze.length == 1\n\n number.to_s.chars.uniq.length == 1\nend", "def runs\n @_runs ||=\n begin\n [].tap do |runs|\n prev = nil\n digits.each_cons(2) do |a, b|\n if a == b\n if prev.nil?\n runs << 2\n prev = a\n else\n runs[-1] += 1\n end\n else\n prev = nil\n end\n end\n end\n end\n end", "def to_strings\n digits.inject(['']) do |results, digit|\n combinations(results, digit)\n end\n end", "def integer_pigeonhole_sort(numbers)\n sorted = []\n\n numbers.length.times do |i|\n sorted << i\n end\n\n sorted\nend", "def offbyonenumber(my_number, bash_numbers)\n\tcounter = 0\n\tx = 0\n\tarr1 = []\n\tmy_number.each do |num|\n\t\tbash_numbers.each do |bash|\n\t\t\tnum.length.times do\n\t\t\t\tif bash[x] == num[x]\n\t\t\t\t\t\tcounter += 1\n\t\t\t\t\tif counter == num.length - 1\n\t\t\t\t\t\tarr1<< num\n\t\t\t\t\t\tcounter = 0\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\t\tx += 1\n\t\t\tend\n\t\tend\n\tend\n\tarr1.uniq!\n\tp arr1\n\treturn arr1\nend", "def number_to_digit_array(number, max_size=0)\n array = []\n while number != 0\n array << number % 10\n number /= 10\n end\n (0..((max_size)-(array.length)-1)).each do |x|\n array << 0\n end\n array.reverse\n end", "def digit_list(number)\n digits = number.to_s.split('')\n digits = digits.map { |digit| digit.to_i }\n digits\nend", "def digit_list(number)\r\n digits = []\r\n loop do\r\n number, remainder = number.divmod(10)\r\n digits.unshift(remainder)\r\n break if number == 0\r\n end\r\n digits\r\nend", "def digit_list(number)\n digits = []\n\n until number == 0 do\n digits.unshift(number % 10)\n number /= 10\n end\n\n digits\nend", "def digit_list(n)\n list = n.to_s\n list = list.split('')\n list = list.map do |i|\n i.to_i\n end\n return list\nend", "def ten_digits (num, set)\n\tnum_a = num.to_s.split(\"\")\n\tresult_a = []\n\n\tfor x in num_a.length-11..num_a.length-1\n\t\tresult_a << num_a[x]\n\tend\n\n\treturn result_a.join.to_i\nend", "def single_number(nums)\n uniques = []\n nums.each do |num|\n uniques.include?(num) ? uniques.delete(num) : uniques << num\n end\n uniques\nend", "def digit_list(number)\n digits = []\n\n loop do\n break if number == 0\n\n digit = number % 10\n digits.unshift(digit)\n\n number = number / 10\n end\n\n digits\nend", "def radix_sort(array, base = 10)\n # passes count equals to the number of digits in the longest number\n passes = (Math.log(array.minmax.map(&:abs).max) / Math.log(base)).floor + 1\n passes.times do |i|\n buckets = Array.new(2 * base) { [] }\n base_i = base**i\n\n # elements are added to buckets\n # according to the current place-value digit\n array.each do |j|\n n = (j / base_i) % base\n n += base if j >= 0\n buckets[n] << j\n end\n array = buckets.flatten\n end\n\n array\nend", "def get_pandigitals\n return (0..9).to_a.permutation.map(&:join)\nend", "def digit_list(num)\n num.to_s.split(//).map(&:to_i)\nend", "def digit_list(num)\n num.to_s.split(//).map(&:to_i)\nend", "def repeated_number_ranges(arr)\n ranges = []\n idx = 0\n arr.each do |e|\n if arr.count(e) > 1\n first, last = count_range(arr, e, idx)\n if first != last\n if first <= 1 || first > 1 && arr[first] != arr[first-1]\n ranges.push([first, last])\n end\n end\n end\n idx = idx + 1\n end\n return ranges.uniq\nend", "def digit_list(number)\n number.to_s.chars.map { |char| char.to_i }\nend", "def featured(i) # found digits method but only works > v2.4 so...\n i = i - i % 7\n loop do\n i += 7\n list = []\n x = i\n while x > 0 do\n list.unshift(x % 10)\n x /= 10\n end\n if list.length > 9; return \"There is no possible number that fulfills those requirements\" end\n if list == list.uniq; break end\n end \n i\nend", "def unique(integers)\n integers.to_set.to_a\nend", "def problem_79\n digits = []\n lines = open(\"keylog.txt\").reduce([]) do |a,l|\n a << l.chomp.split(//).map(&:to_i)\n end\n p = lines.transpose\n loop do \n first = (p[0] - p[1]).uniq\n if first.length == 1\n d = first[0]\n digits << d \n puts \"Remove #{d}\"\n # shift off leading 'd' values\n lines.select {|l| l[0] == d}.map {|l| l.shift; l.push nil }\n # Rebuild out first, second, third arrays\n p = lines.transpose\n return digits.map(&:to_s).join if p.flatten.compact.length == 0\n puts \"len = #{p.flatten.compact.length}\"\n else\n raise \"Trouble - 2 candidates : #{first.inspect}, rework algorithm\"\n end\n end\nend", "def compare_num\r\n subtracted = []\r\n\r\n double_digits.each_with_index do |val, index|\r\n if val >= 10\r\n subtracted << val - 9\r\n else\r\n subtracted << val\r\n end\r\n end\r\n subtracted\r\n end", "def check_renban num\n arr = num.abs\n .to_s\n .chars\n .map{|x| x.to_i}\n .sort\n arr == (arr[0]..arr[0] + arr.length - 1).to_a\nend", "def number_shuffle(number)\n number.to_s.chars.map { |c| c.to_i }.\n \n permutation.to_a.map { |set| set.join }.\n \n map { |str| str.to_i }.sort\n #number.to_s.chars.to_a.permutation.map(&:join).map(&:to_i)\nend", "def pandigitals(set)\n array = []\n\n set.permutation.each do |permutation|\n if permutation.first != '0'\n array << permutation.join('')\n end\n end\n\n array\nend", "def digit_list(num)\n str = num.to_s\n nums = str.split(//)\n nums.map{|char| char.to_i}\nend", "def digit_list(int)\r\n int.to_s.chars.map{|x| x.to_i }\r\nend", "def to_digit_array\n self.to_s.each_char.map(&:to_i)\n end", "def makeMcNuggetNumbers(nums)\n mcNuggets = []\n counter = 0\n for i in 0..nums.count()-1\n for j in 0..nums.count()-1\n mcNuggets[counter] = nums[i] + nums[j]\n counter = counter + 1\n end\n end\n # Have to put regular mcNugget numbers back into array\n mcNuggets = mcNuggets + nums\n # Pull out duplicate numbers\n mcNuggets = mcNuggets.uniq\n mcNuggets = mcNuggets.sort\n return mcNuggets\nend", "def generateWinnNumbers()\n\tnumbers = []\n\tnumbers = (0..5).map{rand(0..10)}.uniq\n\treturn numbers\nend", "def three_numbers(str)\n digits = str.split.map { |word| word.scan(/\\d+/).sort_by(&:size) }\n digits.each do |set|\n if set.size == 2 && set.first.size == 1 && set.last.size == 2\n set[1], set[2] = set.last[0], set.last[1]\n end\n set.map!(&:to_i).uniq!\n return false unless set.size == 3\n end\n true\nend", "def trxn_card_digits\n result = Set.new\n bank_transactions.each do |trxn|\n if trxn.card.present?\n result.add(trxn.card.last_four_digits)\n end\n end\n result.to_a\n end", "def find_unique_x(numbers)\n numbers.reduce(:^)\nend", "def digit_list(integer)\n integer.to_s.chars.map(&:to_i)\nend", "def largest_palindrome(digits)\n\tnumbers = []\n\tx = (\"9\"*digits).to_i\n\ty = (\"9\"*digits).to_i\n\tlimit = ((\"9\"*(digits-1)).to_i)\n\twhile x > limit\n\t\ty.downto(limit+1) do |i|\n\t\t\tx*i == (x*i).to_s.reverse.to_i ? numbers << x*i : \"\"\n\t\tend\n\t\tx -= 1\n\tend\n\treturn numbers.sort.last\nend", "def permutations(perms, digits)\n\tcounts = Array.new(digits.size, 0)\n\t\nend", "def digit_list(int)\n int.digits.reverse\nend", "def digit_list(int)\n int.digits.reverse\nend", "def digit_list(int)\n int.to_s.chars.map { |n| n.to_i }\nend", "def digit_list(integer)\n integer.digits.reverse\nend", "def digit_list(num)\n if num < 10\n [num % 10]\n else\n num, digit = num.divmod(10)\n digit_list(num).push(digit)\n end\nend", "def digit_list(num)\n num.digits.reverse\nend", "def digit_list(num)\n num.digits.reverse\nend", "def missing_numbers(input)\n input.sort!\n p (input[0]..input[-1]).to_a - input\nend", "def digit_list(number)\n return number.abs.to_s.split('').map(&:to_i)\nend", "def digit_list(int)\n string_ints = int.to_s\n array_string_ints = string_ints.split(//)\n ints = Array.new\n array_string_ints.each do |string|\n ints << string.to_i\n end\n return ints\nend", "def unique(integers)\n integers.reduce([]) do |collection,integer|\n !(collection.include? integer) ? collection.push(integer) : collection\n end\nend", "def distinct_primes(n)\n 2.step do |i|\n nums = []\n tuples = [] # Each element is a 2-tuple of [prime, factor]\n j = i\n n.times do \n nums << j\n tuples << j.prime_division \n j += 1\n end\n next unless digits_equal(tuples, n)\n return nums if distinct_factors(tuples)\n end\nend", "def digits\n @digits ||= numbers.insert(3, digit(numbers).to_s)\n end", "def list_of_nums(num)\n num.to_s.split('').map! {|n| n.to_i}\nend" ]
[ "0.6878238", "0.6535237", "0.646715", "0.6439634", "0.63603866", "0.6308074", "0.6305041", "0.62460005", "0.6222417", "0.6211685", "0.62086", "0.62052", "0.61830163", "0.6182554", "0.6094582", "0.6073112", "0.6063015", "0.6062575", "0.6060726", "0.60525095", "0.6029725", "0.59957963", "0.599229", "0.59788996", "0.5971449", "0.59621173", "0.5957205", "0.5954178", "0.5951366", "0.5943874", "0.59419703", "0.59277344", "0.5925822", "0.59188557", "0.589369", "0.58908266", "0.5880993", "0.5872625", "0.5860277", "0.58517444", "0.5851415", "0.5851415", "0.5851415", "0.5851415", "0.5851415", "0.58402747", "0.58273596", "0.5818469", "0.581627", "0.5803928", "0.5798522", "0.57971203", "0.57940316", "0.5789298", "0.5787736", "0.5784389", "0.5778891", "0.5775863", "0.5773069", "0.5770294", "0.57625955", "0.5748531", "0.57448494", "0.5741037", "0.57302153", "0.57302153", "0.5723118", "0.5716853", "0.5716193", "0.5701153", "0.5694775", "0.56820935", "0.5676321", "0.5675012", "0.56749374", "0.5667243", "0.56652194", "0.56637615", "0.5660682", "0.56574464", "0.5656761", "0.5649916", "0.56439936", "0.5642946", "0.56412315", "0.564029", "0.56392026", "0.56392026", "0.56382835", "0.56372106", "0.563567", "0.5621127", "0.5621127", "0.5620032", "0.5619828", "0.5612803", "0.5609453", "0.56094426", "0.5607475", "0.5605011" ]
0.5711654
69
Counts the number of quote characters in a line, excluding escaped quotes.
def count_quote_chars(line, quote_char) return 0 if line.nil? || quote_char.nil? count = 0 previous_char = '' line.each_char do |char| count += 1 if char == quote_char && previous_char != '\\' previous_char = char end count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_quote_markers(line)\n\n marker = \">> \"\n count = 0\n\n loop do\n break unless line.starts_with?(marker)\n\n line = line.sub(marker, '')\n count = count + 1\n end\n\n [line, count]\n end", "def count_characters(all_lines_from_file)\n all_lines_from_file.gsub(/\\n+/,\"\").length\nend", "def count_occurances_delimiter(line)\n delimiter_count.keys.each do |key|\n #Count the occurances of delimiter in a line\n total_count_delimiter = line.substr_count(key)\n #count the occurances of delimiter between quotes inside a line to disregard them\n quoted_delimiter_count = getting_contents_of_quoted_values(line).substr_count(key)\n delimiter_count[key] += total_count_delimiter - quoted_delimiter_count\n end\n end", "def lines_count(str)\n i = 0\n str.each_line { i += 1 }\n i\n end", "def line_length(line)\n line.chomp.gsub(/\\e\\[[\\d;]*m/, '').length\n end", "def count(line)\n\t\tpos = 0\n\t\twhile (pos < line.length)\n\t\t\t# if marker, decompress and count length\n\t\t\t# else add 1 to length, for normal character\n\t\t\tif line[pos] == \"(\"\n\t\t\t\t# substring containing only the marker\n\t\t\t\tmarker = line[pos, line[pos, line.length - pos].index(\")\") + 1]\n\t\t\t\tlen = marker[/(?<=\\()\\d+/].to_i\n\t\t\t\trepeat = marker[/\\d+\\)$/].to_i\n\t\t\t\t@length += repeat * len\n\n\t\t\t\t# move pos onto next piece of data\n\t\t\t\tpos += marker.length + len\n\t\t\telse\n\t\t\t\t@length += 1\n\t\t\t\tpos += 1\n\t\t\tend\n\t\tend\n\tend", "def line_length(line)\n line.chomp.gsub(/\\e\\[[\\d;]*m/, '').length\n end", "def countQuotes\n\tFile.foreach('Quotes.csv') {}\n\t$numberofQuotes = $.\n\tputs \"There are currently: #{$numberofQuotes} quotes in the CSV\"\nend", "def count_characters_no_spaces(all_lines_from_file)\n all_lines_from_file.gsub(/\\s+/, \"\").length\nend", "def line_count\n\t\tlines.size\n\tend", "def line_count\n\t\tlines.size\n\tend", "def internal_space(line)\n # For each single quote, if there is an odd number of double quote before\n # we are in a string, but if there is an even number of double quote before\n # we are out of a string.\n double_quote = 0\n previous_char = nil\n output = ''\n i = 0\n line.each_char do |c|\n double_quote += 1 if c == '\"'\n output += c unless previous_char == ' ' && c == ' ' && double_quote.even?\n i += 1\n previous_char = c\n end\n return output\n end", "def count_rows(s)\n return nil if s.nil?\n\n col = 1\n row = 1\n\n s.each_char do |c|\n if c == \"\\n\" or col > TA_COLS then\n col = 1\n row += 1\n next\n end\n\n col += 1\n end\n\n row\n end", "def line_count\n\t\t\treturn @contents.nil? ? 0 : @contents.count\n\t\tend", "def count_escrowed_raw\n return @count_escrowed_raw\n end", "def count_sentences(some_file)\n file_content = open(some_file).read()\n count = 0\n\n file_content.each_char do |c|\n count += 1 if c == \",\" || c == \"?\" || c == \"!\"\n end\n return count\nend", "def getNumLines()\n contents.split(\"\\n\").length - 1\n end", "def count_spaces(str)\n count = 0\n str.split(\"\").each do |char|\n if char == \"\\s\"\n count += 1\n end\n end\n count\n end", "def count_lines(file)\n n = 0\n while file.gets\n n += 1\n end\n n\n end", "def guess_line_ending(filehandle, options)\n counts = {\"\\n\" => 0, \"\\r\" => 0, \"\\r\\n\" => 0}\n quoted_char = false\n\n # count how many of the pre-defined line-endings we find\n # ignoring those contained within quote characters\n last_char = nil\n lines = 0\n filehandle.each_char do |c|\n quoted_char = !quoted_char if c == options[:quote_char]\n next if quoted_char\n\n if last_char == \"\\r\"\n if c == \"\\n\"\n counts[\"\\r\\n\"] += 1\n else\n counts[\"\\r\"] += 1 # \\r are counted after they appeared\n end\n elsif c == \"\\n\"\n counts[\"\\n\"] += 1\n end\n last_char = c\n lines += 1\n break if options[:auto_row_sep_chars] && options[:auto_row_sep_chars] > 0 && lines >= options[:auto_row_sep_chars]\n end\n rewind(filehandle)\n\n counts[\"\\r\"] += 1 if last_char == \"\\r\"\n # find the most frequent key/value pair:\n k, _ = counts.max_by{|_, v| v}\n return k\n end", "def paragraph_count(all_lines_from_file)\n all_lines_from_file.split(/\\n\\n/).length\nend", "def line\n @string[0..@index].split(\"\\n\").count\n end", "def count_lines\n linecount = 0\n\n @output_buffer.each do |line|\n linecount += line.scan(/\\n/).count\n end\n\n linecount - 1\n end", "def line_count(file)\n\t\tf = File.new(file)\n\t\tnum_newlines = 0\n\t\twhile (c = f.getc) != nil\n\t\t\tnum_newlines += 1 if c == $/\n\t\tend\n\t\tnum_newlines\n\tend", "def count_paragraphs(some_file)\n file_content = open(some_file).read()\n count = 0\n file_content_split = file_content.split('')\n\n file_content_split.each_index do |index|\n count += 1 if file_content_split[index] == \"\\n\" && file_content_split[index + 1] == \"\\n\"\n end\n return count\nend", "def count_spaces(str)\n count = 0\n space = \" \"\n str.each_char do |char|\n if char == space\n count += 1\n end\n end\n count\n end", "def count\n Jhead.call(\"-c\", @match, @pattern).split(\"\\n\").size\n end", "def linecount(fname)\n File.open(fname, \"r\") do |f|\n f.readlines.length\n end\nend", "def line_count(file_list)\n file_list.empty? ?\n nil :\n %x{wc -l #{file_list.join(' ')} | awk 'END {print $1}'}.to_i\n end", "def count_spaces(str)\n count = 0\n space = \" \"\n str.each_char do |char|\n if char == space\n count += 1\n end\n end\n count\nend", "def count_spaces(string)\n count = 0\n string.chars { |char| if char === \" \" then count += 1 end}\n return count\nend", "def word_count_a_file(file_path)\n\tfile = File.new(file_path,'r')\n\tfile.read.count(\" \")+1 \nend", "def parseRow(row)\n\tliteralLength = row.length\n\tnewStringLiteralsLength = 0\n\n\tappended = row\n\n\t# replace quotes '\"' with '\\\"'\n\t# but map '\\' to '.' to avoid problems\n\t# further down\n\tif appended.match /\\\"/\n\t\tappended.gsub! /\\\"/, '.\"'\n\tend\n\tif appended.match /\\\\/\n\t\tappended.gsub! /\\\\/, \"\\\\\\\\\\\\\"\n\tend\n\n\tappended = '\"' + appended + '\"'\n\n\treturn literalLength, appended.length\nend", "def count_indent(line)\n line.match(/(\\s+)/)[1].length\nend", "def wc(filename)\n input = File.open(filename, 'r') {|f| f.read() }\n puts(\"%d lines\" % [input.each_line.count])\n puts(\"%d words\" % [input.split(' ').count])\n puts(\"%d chars\" % [input.split('').count])\nend", "def count_spaces string\n count = 0\n space = \" \"\n string.each_char do |char|\n if char == space\n count += 1\n end\n end\n count\nend", "def sentence_count(all_lines_from_file)\n all_lines_from_file.split(/\\.|\\?|\\!/).length\nend", "def test_quote(char, quotes)\n quotes << char\n p quotes\n p quotes.size\n if quotes.size == 1 || quotes.first != quotes.last\n 1\n else\n -1\n end\nend", "def count_lines(all_lines_from_file)\n all_lines_from_file.lines.count\nend", "def line_count\n entries.inject(0) do |count, entry|\n count + (entry.dir? ? 0 : entry.lines.size)\n end\n end", "def total_included_characters\n included_paragraphs_joined.split(/./).size\n end", "def count_spaces(lexed_line, column)\n event_index = lexed_line.event_index(column)\n\n if event_index.nil?\n log 'No lbrace in this line. Moving on...'\n @do_measurement = false\n return\n end\n\n next_event = lexed_line.at(event_index + 1)\n\n if next_event.nil?\n log 'lbrace must be at the end of the line. Moving on.'\n @do_measurement = false\n return 0\n end\n\n if next_event[1] == :on_nl || next_event[1] == :on_ignored_nl\n log \"lbrace is followed by a '#{next_event[1]}'. Moving on.\"\n @do_measurement = false\n return 0\n end\n\n if next_event[1] == :on_rbrace\n log 'lbrace is followed by an rbrace. Moving on.'\n @do_measurement = false\n return 0\n end\n\n second_next_event = lexed_line.at(event_index + 2)\n if second_next_event[1] == :on_comment\n log 'Event + 2 is a comment.'\n @do_measurement = false\n return next_event.last.size\n end\n\n next_event[1] != :on_sp ? 0 : next_event.last.size\n end", "def line_count\n `wc -l public/HelloWorld.txt`.to_i\n end", "def measure(lineno, column)\n @problems << Problem.new('unnecessary_double_quotes', lineno, column,\n \"Unnecessary double quotes at column #{column}, \" +\n 'expected single quotes.', @options[:level])\n end", "def line_at(char)\n return nil unless char\n text[0..char].count(\"\\n\") + 1\n end", "def inline_comment(line)\n # For each single quote, if there is an odd number of double quote before\n # we are in a string, but if there is an even number of double quote before\n # we are out of a string so this is an inline comment and we can remove all\n # that comes after.\n double_quote = 0\n i = 0\n line.each_char do |c|\n double_quote += 1 if c == '\"'\n if c == \"'\" && double_quote.even?\n line = line[...i]\n break\n end\n i += 1\n end\n return line\n end", "def lines_count\n @lines_count ||= lines.count\nend", "def number_of_rows(matrix)\n counter = 1\n matrix.each_char { |symb|\n counter += 1 if symb == \"\\n\"\n }\n counter\nend", "def num_lines() @line_indices.length + 1 end", "def length\n @line.length\n end", "def hash_number(line)\n\n count = 0\n\n line.each_char do |char|\n break if char != \"#\"\n count += 1\n end\n # cases when text starts with #haha instead of # haha\n if count != 0\n if line[count] == ' '\n count\n else\n 0\n end\n else\n count\n end\nend", "def file_line_count(file_name)\n line_count = `wc -l < #{file_name}`.to_i\n LoggerHelper.print_to_log(\"Count of lines in '#{file_name}' is #{line_count}\")\n line_count\n end", "def count_spaces (foo)\n foo.count(\" \")\n end", "def count_spaces(string)\n count = 0\n space = \" \"\n string.each_char do |char|\n if char == space\n count+=1\n end\n end\n count\nend", "def word_count(book_text)\n count = 0\n book_text.split(/[^-a-zA-Z']/).each do |word|\n count += 1 if word.length > 0\n # DEBUG puts count.to_s + ': \"' + word + '\"'\n end\n return count\nend", "def lines_counter\n f = File.open('peliculas.txt', 'r')\n print f.readlines.length\n f.close\nend", "def check_csv(db,tbl)\n csv = \"/opt/tucdocs/MDB/#{db}_#{tbl}.csv\"\n puts \"csv: #{csv}\"\n num_csv = %x! wc -l #{csv} !.chomp.to_s.to_i\nend", "def num_commits(lines)\n numCommits = 0\n lines.each{ |line| numCommits += 1 if line.start_with?(\"commit \") }\n return numCommits\nend", "def count_single_line_comments(buff, comment_regexp)\n a = buff.select { |l|\n not l.match(comment_regexp).nil?\n }.size\n a\n end", "def count_single_line_comments(buff, comment_regexp)\n a = buff.select { |l|\n not l.match(comment_regexp).nil?\n }.size\n a\n end", "def line_items_count\n self.line_items.count\n end", "def count_triple(str)\n str.length - str.gsub(/(.)(?=\\1\\1)/,'').length\nend", "def ansi_length(str)\n str.gsub(/\\e\\[(2J|\\d*(;\\d+)*(m|f|H))/, '').length\nend", "def line\n\t return -1 if @inputStack.empty? # only if initialize() arg is bogus\n\n\t input = @inputStack[0] # not @inputStack.last\n\t str = input.string[0 .. input.pos]\n\t return str.count(\"\\n\") + 1\n\tend", "def comma_count\n text = @file.content\n text.count(\",\")\n end", "def countlines\n file = File.open('peliculas.txt', 'r')\n data = file.readlines\n file.close\n puts data.length\nend", "def line_level line\n line.match(/^[ \\t]*/)[0].gsub(\"\\t\", \" \").split('').length\n end", "def word_count(all_lines_from_file)\n all_lines_from_file.split.length\nend", "def count(string)\n new_string = string.gsub(/[ ]/, '')\n new_string.size\nend", "def line_items_count\n self.line_items.size\n end", "def num_commits(lines)\n i = 0\n\tlines.each{|line| \n\t\tif line.include? \"commit\"\n\t\t\ti += 1\n\t\tend\n\t}\n\treturn i\nend", "def num_commits(lines)\n num = 0 \n lines.each { |line|\n words = line.split\n if words[0] == \"commit\" then num+= 1 end\n }\n num\nend", "def count_for_node(node)\n return 0 unless node.is_a? Nokogiri::XML::Text\n node.inner_text.gsub(/--/, \"—\").gsub(/['’‘-]/, \"\").scan(script_regex).size\n end", "def count_soft_tabs(line)\n line.index(/[^ ]/) ? [line.index(/[^ ]/)/2, line.strip] : []\n end", "def count_code(string) # return the number of times 'co'+any_char+'e' appears\n return string.scan(/co.e/).length #easy way with regex\nend", "def count_chars(str)\n p str.delete(' ').size\nend", "def internal_space_old(line)\n arr = []\n single_quote = line.count('\"')\n # This method won't work when there is two consecutive double quote\n # so we must replace them else they will get removed.\n line.gsub!('\"\"', '☠')\n line.split('\"').each_with_index do |item, i|\n # if odd number of double quote we are in a string else we are out\n # process only if out of a string\n item.gsub!(/ +/, ' ') if i.even?\n arr.push(item)\n end\n output = arr.join('\"')\n output.gsub!('☠', '\"\"')\n output += '\"' unless single_quote == output.count('\"')\n return output\n end", "def line_items_count\n self.line_items.size\n end", "def count\n `wc -l < #{filepath}`.to_i - 1\n end", "def number_of_chars\n text.to_s.number_of_chars\n end", "def char_count(s,c)\n\t\tcont = 0\n\t\ts.length.times do |i|\n\t\t\tif(s[i] == c)\n\t\t\t\tcont += 1\n\t\t\tend\n\t\tend\n\t\tcont\n\tend", "def line_number\n lines_read.length\n end", "def count_trailing_newlines(text)\n if text.end_with? \"\\n\"\n count = 0\n\n text.reverse.chars do |c|\n if c == \"\\n\"\n count += 1\n else\n break\n end\n end\n\n count\n else\n 0\n end\n end", "def productsCount\r\n rows = CSV.parse(open(self.data_file.path).read, :col_sep => separatorChar)\r\n\t\t\t#rows = CSV.parse(open(self.data_file.url).read, :col_sep => \",\", :quote_char => \"'\")\r\n return rows.count\r\n end", "def custom_count(string, search_chars)\n count = 0\n string.each_char { |chr|\n count += 1 if search_chars.include?(chr)\n }\n count\nend", "def character_count(char)\n char.each_codepoint.sum { |codepoint| BASIC_PLANE.include?(codepoint) ? 1 : 2 }\n end", "def character_count\n print \"Please write word or multiple words: \"\n str = gets.chomp\n count = str.count{|char| char != ' '}\n\n puts \"there are #{count} characters in \\\"#{str}\\\".\"\nend", "def num_chars\n @name.split('').count\n end", "def number_of_chars\n html_remove.without_garbage.split(\"\\n\").join.split.join.length\n end", "def number_of_characters\n @text.length\n end", "def word_count_a_file(file_path)\n word_count = 0\n f = File.open(file_path, \"r\")\n f.each_line {|line|\n word_count += line.to_s.split.size\n }\n word_count\nend", "def WordCount(str)\n\n # code goes here\n return str.split(\" \").length # .split.count, split(‘ ’).size\n \nend", "def quote?(c)\n c == '\"' || c == \"'\"\n end", "def count_chars (foo)\n foo.length\n end", "def custom_count(string, search_characters)\n count = 0\n\n # string.each_char do |char|\n # if search_characters.include?(char)\n # count += 1\n # end\n # end\n # count\n \n string.each_char {|char| count += 1 if search_characters.include?(char) }\n count\nend", "def count_escrowed_raw=(value)\n @count_escrowed_raw = value\n end", "def count_consonants\n text.scan(/[bcdfghjklmnpqrstvwxyz]/).length\n end", "def count_spaces(lexed_line, column)\n event_index = lexed_line.event_index(column)\n\n if event_index.nil?\n log 'No lbracket in this line. Moving on...'\n @do_measurement = false\n return\n end\n\n next_event = lexed_line.at(event_index + 1)\n log \"Next event: #{next_event}\"\n\n if next_event.nil?\n log 'lbracket must be at the end of the line.'\n @do_measurement = false\n return 0\n end\n\n [:on_nl, :on_ignored_nl].each do |event|\n if next_event[1] == event\n log \"lbracket is followed by a '#{event}'. Moving on.\"\n @do_measurement = false\n return 0\n end\n end\n\n if next_event[1] == :on_rbracket\n log 'lbracket is followed by a rbracket. Moving on.'\n @do_measurement = false\n return 0\n end\n\n second_next_event = lexed_line.at(event_index + 2)\n log \"Event + 2: #{second_next_event}\"\n\n [:on_comment, :on_lbrace].each do |event|\n if second_next_event[1] == event\n log \"Event + 2 is a #{event}. Moving on.\"\n @do_measurement = false\n return next_event.last.size\n end\n end\n\n next_event[1] != :on_sp ? 0 : next_event.last.size\n end", "def items_count\n counter = 0\n self.line_items.each do |item|\n counter += item.quantity\n end\n counter\n end", "def count_characters_v2(str)\n\tcount = Array.new(26, 0)\n\tstr.each_char do |char|\n\t\tcount[char.ord - \"a\".ord] += 1\n\tend\t\n\t0.upto(count.length-1) do |i|\n\t\tputs \"(\" + (\"a\".ord + i).chr + \"; \" + count[i].to_s + \")\" if count[i] > 0\n\tend\nend" ]
[ "0.637429", "0.63518494", "0.63001055", "0.62423486", "0.62383735", "0.6237805", "0.6217741", "0.61562014", "0.6153911", "0.59262764", "0.59262764", "0.5924019", "0.57923114", "0.57564396", "0.57545006", "0.5729501", "0.57252765", "0.5714425", "0.56468415", "0.5607265", "0.5603966", "0.55897474", "0.5568014", "0.55567056", "0.5541531", "0.5515015", "0.5500469", "0.5490748", "0.54680777", "0.54540974", "0.54526496", "0.5450012", "0.54277176", "0.5427697", "0.5412707", "0.5389831", "0.53840405", "0.53833836", "0.5355874", "0.534971", "0.53494817", "0.5340233", "0.53184325", "0.53118587", "0.53072494", "0.5303824", "0.5296283", "0.5295755", "0.5291466", "0.5270288", "0.5265639", "0.5261847", "0.5241182", "0.52402717", "0.5236481", "0.52284974", "0.52240443", "0.5221297", "0.52006835", "0.52006835", "0.5194433", "0.5189089", "0.51733667", "0.51731974", "0.5172837", "0.51706535", "0.51614994", "0.515943", "0.51588196", "0.51481724", "0.51425576", "0.51045233", "0.50952524", "0.50947523", "0.5083824", "0.5078315", "0.5068247", "0.5066506", "0.5064218", "0.50573856", "0.50415146", "0.5036111", "0.5034986", "0.50276303", "0.5024843", "0.5019686", "0.49994242", "0.49959204", "0.49912718", "0.49899778", "0.49857345", "0.49529642", "0.49520424", "0.49441814", "0.49407312", "0.4938275", "0.49331436", "0.4926366", "0.49262172", "0.492075" ]
0.87860364
0
NOTE: this is not called when "parse" methods are tested by themselves
def default_options { acceleration: true, auto_row_sep_chars: 500, chunk_size: nil, col_sep: :auto, # was: ',', comment_regexp: nil, # was: /\A#/, convert_values_to_numeric: true, downcase_header: true, duplicate_header_suffix: nil, file_encoding: 'utf-8', force_simple_split: false, force_utf8: false, headers_in_file: true, invalid_byte_sequence: '', keep_original_headers: false, key_mapping: nil, quote_char: '"', remove_empty_hashes: true, remove_empty_values: true, remove_unmapped_keys: false, remove_values_matching: nil, remove_zero_values: false, required_headers: nil, required_keys: nil, row_sep: :auto, # was: $/, silence_missing_keys: false, skip_lines: nil, strings_as_keys: false, strip_chars_from_headers: nil, strip_whitespace: true, user_provided_headers: nil, value_converters: nil, verbose: false, with_line_numbers: false, } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse; end", "def parse; end", "def parse; end", "def parse()\n #This is a stub, used for indexing\n end", "def parse\n raise \"absctract method called\"\n end", "def parse\n end", "def parsed; end", "def parsed; end", "def parse\n raise NotImplementedError\n end", "def parse\n raise NotImplementedError.new\n end", "def force_parse; end", "def parser; end", "def parser; end", "def parser; end", "def parser; end", "def parsed\n raise NotImplementedError\n end", "def parse\n fail StandardError.new('parse has not been implemented.')\n end", "def get_parse(s);end", "def parse!\n raise NotImplementedError, \"this class is intended to be a top class, not a useful parser\"\n end", "def after_parse; end", "def after_parse; end", "def pluggable_parser; end", "def parse(data); end", "def parse;\n \"Parsing method\";\n end", "def parse\n @parsed\n end", "def parse(text); end", "def parse(file)\n puts \"Not yet implemented\"\nend", "def after_parse\n end", "def parse_context; end", "def parse_context; end", "def parse \n raise \"This has not been implemented yet. Due to the variability of report format, will need to implement a series of specialized parsers\"\n end", "def parse_response!; end", "def parse(str); end", "def parse(source); end", "def safe_parse\r\n handle_exception { parse }\r\n end", "def process(parser)\n end", "def parse_failure_cause; end", "def parse_list; end", "def parse_list; end", "def parse text\n raise \"No parser defined for #{self.class}\"\n end", "def test_parse\n @parser.meta_def(:parse_line) do |line|\n line.split(/\\s+/)\n end\n\n text = \"one line\\ntwo line\"\n should = [%w{one line}, %w{two line}]\n ret = nil\n assert_nothing_raised do\n ret = @parser.parse(text)\n end\n\n assert_equal(should, ret)\n end", "def liberal_parsing?() @liberal_parsing end", "def parse(response)\n\nend", "def response_parser; end", "def parse(rawdata)\n end", "def parse_values; end", "def configure_parser; end", "def parse( content, baseuri )\n\t\tsuper\n\tend", "def parse_content(content); end", "def parse_parameters; end", "def test_parse\n @user_agent_strings.each_index { |n| @user_agents[n].parse(@user_agent_strings[n])}\n @user_agents.each { |user_agent| assert_kind_of ParseUserAgent, user_agent}\n end", "def parse(params) new(params).parse end", "def test_parser_run\n Yay::PARSER_TESTS.each_pair { |input, expected|\n parser = Yay::Parser.new\n assert_equal expected, parser.parse(input), \"For |#{input}|\"\n }\n end", "def test_parse\n @user_agent_strings.each_index { |n| @user_agents[n].parse(@user_agent_strings[n][:ua])}\n @user_agents.each { |user_agent| assert_kind_of ParseUserAgent, user_agent}\n end", "def parser(content_type); end", "def parser=(_arg0); end", "def test_parse_invalid\r\n array = @g.parse('abc:123', '>')\r\n assert_equal 1, array.size\r\n assert_equal \"abc:123\", array[0]\r\n end", "def parse file_contents\n raise NRSER::AbstractMethodError.new self, __method__ \n end", "def parsed_tree; end", "def parse(thing, &block); end", "def parse(thing, &block); end", "def parslet; end", "def parslet; end", "def parslet; end", "def parslet; end", "def parse()\n merge(rvparse: 'true')\n end", "def parse_value; end", "def parse\n parse_file\n self\n end", "def html_parser; end", "def parse(request)\n raise NotImplementedError\n end", "def parse(xml)\n raise NotImplementedError, \"inheritor should define #{__method__}\"\n end", "def parse(thingy)\n parser.parse(thingy)\n end", "def test_parse_valid\r\n array = @g.parse('abc:123', ':')\r\n assert_equal 2, array.size\r\n assert_equal \"abc\", array[0]\r\n end", "def parse_text(text)\n\n end", "def parse(source_buffer); end", "def parse(source_buffer); end", "def parse(source_buffer); end", "def parse(m)\n false\n end", "def test_parse\n assert_equal 'http://www.google.com/search?ie=UTF-8&sourceid=navclient&gfns=1&q=blah+%22ford+F-150%22', \n Parser.get_url('blah \"ford F-150\"', AppConfig.default_command)\n\n assert_equal 'http://images.google.com/images?q=blah+%22ford+F-150%22', \n Parser.get_url('blah \"ford F-150\"', \"gim\")\n\n assert_equal 'http://images.google.com/images?q=%22porsche+911%22', \n Parser.get_url('gim \"porsche 911\"', AppConfig.default_command)\n\n assert_equal 'http://bar.com?q=%22porsche%20911%22', \n Parser.get_url('bar \"porsche 911\"', AppConfig.default_command)\n end", "def parse(virtual); end", "def parse_input (input_file)\nend", "def parse(parse_info)\r\n result = peek(parse_info)\r\n parse_info.skip if result\r\n result\r\n end", "def parse\n parse_options\n parse_target\n end", "def parslets; end", "def parse_input(input_file); end", "def parse_input(input_file); end", "def parser\n attributes.fetch(:parser)\n end", "def parse\n @meta = parse_meta\n @comments = parse_comments\n @sensors = parse_sensors\n @workout = parse_workout\n @intervals = parse_intervals\n @interval_samples = parse_interval_samples\n end", "def test_it_can_get_instance_of_parser\n parser = Rubasteme.parser\n refute_nil parser\n end", "def initialize parser\n @parser = parser\n end", "def parse_paragraph; end", "def test_custom\n parser = AddressParserCustom.new\n result = parser.parse $address\n assert_equal YAML.dump(result), $parse_custom, \"Custom parse works\"\n end", "def parse(uri); end", "def parse_file(filename); end", "def test_parser_handles_nil_or_empty\n assert_equal expected_response, ApiParser.parse_email\n end", "def parse_response(response)\n raise NotImplementedError\n end", "def test_parser_handles_unsupported_simple_content\n simple_content_assert nil, {}\n simple_content_assert nil, []\n end", "def parse_response(response)\n raise NotImplementedError, '.parse_response should be implemented in subclass'\n end", "def test_parse_valid_xml_returns_hash\n name = \"A name\"\n type = \"A type\"\n xml = \"<data><name>#{name}</name><type>#{type}</type></data>\"\n parser = ChainReactor::Parsers::XmlSimpleParser.new get_logger\n cause = parser.parse(xml,[],false)\n assert_equal name, cause['name'].first\n assert_equal type, cause['type'].first\n end", "def parse str\n self.ss = scanner_class.new str\n self.state ||= nil\n\n do_parse\n end", "def parse str\n self.ss = scanner_class.new str\n self.state ||= nil\n\n do_parse\n end" ]
[ "0.80481535", "0.80481535", "0.80481535", "0.7903929", "0.7823365", "0.78050226", "0.7788776", "0.7788776", "0.7537192", "0.7443186", "0.7382194", "0.737043", "0.737043", "0.737043", "0.737043", "0.73511493", "0.7322105", "0.7306407", "0.7121635", "0.7088825", "0.7088825", "0.6944896", "0.6851874", "0.6846256", "0.67785215", "0.6769963", "0.6761399", "0.6716096", "0.67095983", "0.67095983", "0.67073053", "0.66566753", "0.66475934", "0.66008496", "0.6569433", "0.6548452", "0.6479604", "0.6459199", "0.6459199", "0.6434876", "0.6400387", "0.6340512", "0.6328359", "0.6322194", "0.63155305", "0.6284997", "0.62660235", "0.6263214", "0.6247548", "0.6228933", "0.62053096", "0.620518", "0.61973315", "0.61856896", "0.6171256", "0.61590713", "0.6156771", "0.6141399", "0.61375296", "0.61324155", "0.61324155", "0.61311257", "0.61311257", "0.61311257", "0.61311257", "0.61293405", "0.611421", "0.6099469", "0.60884553", "0.6086422", "0.60725814", "0.6070404", "0.606537", "0.6064965", "0.60551447", "0.60551447", "0.60551447", "0.60380816", "0.6005706", "0.6001184", "0.59974617", "0.5973926", "0.5928187", "0.5923791", "0.59134704", "0.59134704", "0.59026545", "0.5887461", "0.5886052", "0.5868538", "0.58308524", "0.5830138", "0.5800739", "0.5800579", "0.57862115", "0.5780888", "0.57778686", "0.5776023", "0.5766837", "0.57657266", "0.57657266" ]
0.0
-1
Thin wrapper around Cextension
def parse(line, options, header_size = nil) # puts "SmarterCSV.parse OPTIONS: #{options[:acceleration]}" if options[:verbose] if options[:acceleration] && has_acceleration? # :nocov: has_quotes = line =~ /#{options[:quote_char]}/ elements = parse_csv_line_c(line, options[:col_sep], options[:quote_char], header_size) elements.map!{|x| cleanup_quotes(x, options[:quote_char])} if has_quotes return [elements, elements.size] # :nocov: else # puts "WARNING: SmarterCSV is using un-accelerated parsing of lines. Check options[:acceleration]" return parse_csv_line_ruby(line, options, header_size) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extension; end", "def extension; end", "def extension; end", "def extension; end", "def setup_c_extension(extension_name, gem_spec = nil)\n # use the DLEXT for the true extension name\n ext_name = \"#{extension_name}.#{RbConfig::CONFIG['DLEXT']}\"\n\n # we need lib\n directory 'lib'\n\n # verify if the extension is in a folder\n ext_dir = File.join('ext', extension_name)\n unless File.directory?(ext_dir)\n # the extension is in the root of ext.\n ext_dir = 'ext'\n end\n\n # getting this file is part of the compile task\n desc \"Compile Extension for current Ruby (= compile:mri)\"\n task :compile => [ 'compile:mri' ] unless JRUBY\n\n namespace :compile do\n desc 'Compile C Extension for Ruby 1.8 (MRI)'\n task :mri => [:clean, \"rake:compile:lib/#{ext_name}\"]\n\n task \"#{ext_dir}/#{ext_name}\" => FileList[\"#{ext_dir}/Makefile\", \"#{ext_dir}/*.c\", \"#{ext_dir}/*.h\"] do\n # Visual C make utility is named 'nmake', MinGW conforms GCC 'make' standard.\n make_cmd = RUBY_PLATFORM =~ /mswin/ ? 'nmake' : 'make'\n Dir.chdir(ext_dir) do\n sh make_cmd\n end\n end\n\n file \"#{ext_dir}/Makefile\" => \"#{ext_dir}/extconf.rb\" do\n Dir.chdir(ext_dir) do\n ruby 'extconf.rb'\n end\n end\n\n task \"lib/#{ext_name}\" => ['lib', \"#{ext_dir}/#{ext_name}\"] do\n cp \"#{ext_dir}/#{ext_name}\", \"lib/#{ext_name}\"\n end\n end\n\n unless Rake::Task.task_defined?('native')\n if gem_spec\n desc \"Build Extensions into native binaries.\"\n task :native => [:compile] do |t|\n # use CURRENT platform instead of RUBY\n gem_spec.platform = Gem::Platform::CURRENT\n\n # clear the extension (to avoid RubyGems firing the build process)\n gem_spec.extensions.clear\n\n # add the precompiled binaries to the list of files\n # (taken from compile task dependency)\n gem_spec.files += Rake::Task['compile'].prerequisites\n end\n end\n end\nend", "def extension=(_arg0); end", "def extension=(_arg0); end", "def ext(*args, **_arg1, &block); end", "def extensions=(_arg0); end", "def ext; end", "def ext; end", "def callExtension _obj, _args\n \"_obj callExtension _args;\" \n end", "def sub_ext(ext); end", "def target_extension; end", "def util_dummy_extension(spec, name = \"a\")\n extconf = File.join(\"ext\", name, \"extconf.rb\")\n dummy_c = File.join(\"ext\", name, \"dummy.c\")\n\n spec.extensions << extconf\n spec.files << dummy_c\n\n dir = spec.gem_dir\n FileUtils.mkdir_p dir\n\n Dir.chdir dir do\n FileUtils.mkdir_p File.dirname(extconf)\n\n # extconf.rb\n File.open extconf, \"w\" do |f|\n f.write <<~EOF\n require \"mkmf\"\n\n create_makefile(\"#{name}\")\n EOF\n end\n\n # dummy.c\n File.open dummy_c, \"w\" do |f|\n f.write <<~EOF\n #include <ruby.h>\n\n void Init_#{name}(void)\n {\n rb_p(ID2SYM(rb_intern(\"ok\")));\n }\n EOF\n end\n end\n end", "def extended(*) end", "def init_ext()\n \n end", "def extensions; end", "def extensions; end", "def extensions; end", "def enable_extension(name, **)\n end", "def by_extension(ext); end", "def emulate_extension_install\n extension_name = \"utilikilt\"\n File.open('Makefile', 'w') { |f| f.write \"all:\\n\\ninstall:\\n\\n\" }\n File.open('make', 'w') do |f|\n f.write '#!/bin/sh'\n f.chmod f.stat.mode | 0111\n end\n File.open(extension_name + '.so', 'w') {}\n File.open(extension_name + '.dll', 'w') {}\n File.open('nmake.bat', 'w') { |f| }\nend", "def output_ext(_ext); end", "def output_ext(_ext); end", "def batch_extension\n dup.add_extension(BATCH_EXTENSION)\n end", "def compile_extension(extension, platform)\n compiler_options = compiler_options()\n compiler_class = compiler_class(extension)\n\n compiler_options[:platform] = platform\n\n compiler = compiler_class.new(extension, compiler_options)\n\n compiler.compile\n end", "def extensions\n @extensions ||= Protocol.const_get(:\"Version#{version}\")::Extensions.new(context, logger: logger)\n end", "def extensions\n @extensions ||= Protocol.const_get(:\"Version#{version}\")::Extensions.new(context, logger: logger)\n end", "def ext=(_arg0); end", "def ext=(_arg0); end", "def ext=(_arg0); end", "def enable_extension(name)\n end", "def emulate_extension_install(extension_name)\n File.open('Makefile', 'w') { |f| f.write \"all:\\n\\ninstall:\\n\\n\" }\n File.open('make', 'w') do |f|\n f.write '#!/bin/sh'\n f.chmod f.stat.mode | 0111\n end\n File.open(extension_name + '.so', 'w') {}\n File.open(extension_name + '.dll', 'w') {}\n File.open('nmake.bat', 'w') { |f| }\nend", "def add_extension(path, name = T.unsafe(nil)); end", "def greeting\n \"Hello World, from DemoExtension\"\n end", "def output_ext(ext); end", "def extended(a_module)\n end", "def extensions=(extensions); end", "def extensions_for(template_class); end", "def extensions_for(template_class); end", "def executable_extension\n dup.add_extension(EXECUTABLE_EXTENSION)\n end", "def add_extensions(exts)\n if exts.any?\n self.class.wrap(self, extensions + exts.to_a)\n else\n self\n end\n end", "def add_extensions(exts)\n if exts.any?\n self.class.wrap(self, extensions + exts.to_a)\n else\n self\n end\n end", "def register_extension(const)\n return if extension_registered?(const)\n\n validate_extension!(const)\n\n @@extensions << const\n end", "def register_extension(const)\n return if extension_registered?(const)\n\n validate_extension!(const)\n\n @@extensions << const\n end", "def external(cmd, opts={})\n _external(cmd, opts)\nend", "def wrapper; end", "def extended_modules; end", "def extension(*extensions)\n if extensions[0].is_a?(Array)\n @_ext = extensions[0]\n else\n @_ext = extensions\n end\n end", "def add_extend ext\n add_to @extends, ext\n\n ext\n end", "def maybe_convert_extension(ext); end", "def exec(ext_klass, safe_mode)\n new_ext(ext_klass, safe_mode).plug\n end", "def bootstrap(raise_on_fail:false)\n ext = Dir.glob(\"./lib/*/extension.rb\").first\n if ext\n begin\n require(ext)\n rescue =>e\n stack = e.backtrace[0..4].join(\"\\n\")\n raise Thor::Error.new(\"Loading ./lib/*/extension.rb failed with: #{e}\\n#{stack}\")\n end\n Extensions.controlling\n else\n return _maybe_fail(raise_on_fail)\n end\n end", "def add_extends out, extends\n add_extension_modules out, 'Extended by', extends\n end", "def external; end", "def helpers(*extensions, &block)\n instance_eval(&block) if block\n extend(*extensions) if extensions.any?\n end", "def add_extension(path); end", "def extension=(mod)\n mod = Module.new(&mod) if Proc === mod\n @extension = mod\n end", "def ext_obj\n \"ext(#{ext_channel}, #{ext_type}, #{ext_id})\"\n end", "def compile(mod); end", "def get_extension\n scope = ENV[\"TM_SCOPE\"].split[0]\n case scope\n when /source\\.actionscript/ ; \"as\"\n when /source\\.c/, \"source.objc\" ; \"c\"\n when /source\\.c\\+\\+/, \"source.objc++\" ; \"cpp\"\n # common-lisp-mode ; \"el\"\n when /source\\.css/ ; \"css\"\n when /source\\.diff/, \"meta.diff.range\" ; \"diff\"\n # emacs-lisp-mode ; \"el\"\n when /source\\.erlang/ ; \"erl\"\n when /source\\.haskell/, \"text.tex.latex.haskel\" ; \"hs\"\n when /text\\.html\\.markdown/ ; \"md\"\n when /text\\.html/ ; \"html\"\n when /source\\.io/ ; \"io\"\n when /source\\.java/ ; \"java\"\n when /source\\.js/ ; \"js\"\n # jde-mode ; \"java\"\n # js2-mode ; \"js\"\n when /source\\.lua/ ; \"lua\"\n when /source\\.ocaml/ ; \"ml\"\n when /source\\.objc/, \"source.objc++\" ; \"m\"\n when /source\\.perl/ ; \"pl\"\n when /source\\.php/ ; \"php\"\n when /source\\.python/ ; \"sc\"\n when /source\\.ruby/ ; \"rb\" # Emacs bundle uses rbx\n when /text\\.plain/ ; \"txt\"\n when /source\\.sql/ ; \"sql\"\n when /source\\.scheme/ ; \"scm\"\n when /source\\.smalltalk/ ; \"st\"\n when /source\\.shell/ ; \"sh\"\n when /source\\.tcl/, \"text.html.tcl\" ; \"tcl\"\n when /source\\.lex/ ; \"tex\"\n when /text\\.xml/, /text.xml.xsl/, /source.plist/, /text.xml.plist/ ; \"xml\"\n else \"txt\"\n end\n end", "def setup_java_extension(extension_name, gem_spec = nil, opts = {})\n ext_name = \"#{extension_name}.jar\"\n directory 'lib'\n opts = {\n :source_dir => 'ext-java/src/main/java',\n :add_buildr_task => true\n }.merge!(opts)\n\n desc 'Compile Extension for current Ruby (= compile:jruby)'\n task :compile => [ 'compile:jruby' ] if JRUBY\n\n namespace :compile do\n\n desc \"Compile Java Extension for JRuby\"\n task :jruby => [ :clean ] do\n pkg_classes = File.join(*%w(pkg classes))\n mkdir_p pkg_classes\n\n if extension_name == 'do_jdbc_internal'\n classpath_arg = java_classpath_arg\n else\n unless File.exists?('../do_jdbc/lib/do_jdbc_internal.jar')\n # Check for the presence of do_jdbc_internal.jar in the do_jdbc project\n # which we need to compile against.\n print \"\\n\"; 80.times { print '-' }; print \"\\n\"\n puts \"To compile the Java extension, #{extension_name}, you will first need to compile\"\n puts \"common JDBC support for DataObjects, do_jdbc:\"\n puts \"cd ../do_jdbc; jruby -S rake compile\"\n 80.times { print '-' }; print \"\\n\\n\"\n\n raise \"Required file for compilation (do_jdbc_internal.jar) not found.\"\n end\n\n classpath_arg = java_classpath_arg '../do_jdbc/lib/do_jdbc_internal.jar'\n end\n\n # just use the extension directory from the executing java\n # for compilation as well\n extdir = java.lang.System.getProperty('java.ext.dirs')\n extdir_arg = extdir.nil? ? \"\" : \"-extdirs #{extdir}\"\n\n # Check if DO_JAVA_DEBUG env var was set to TRUE\n # TRUE means compile java classes with debug info\n if ENV['DO_JAVA_DEBUG'] && ENV['DO_JAVA_DEBUG'].upcase.eql?(\"TRUE\")\n sh \"javac #{extdir_arg} -target 1.5 -source 1.5 -Xlint:unchecked -g -d pkg/classes #{classpath_arg} #{FileList[\"#{opts[:source_dir]}/**/*.java\"].join(' ')}\"\n else\n sh \"javac #{extdir_arg} -target 1.5 -source 1.5 -Xlint:unchecked -d pkg/classes #{classpath_arg} #{FileList[\"#{opts[:source_dir]}/**/*.java\"].join(' ')}\"\n end\n\n sh \"jar cf lib/#{ext_name} -C #{pkg_classes} .\"\n end\n\n if opts[:add_buildr_task]\n desc \"Compile Java Extension for JRuby (with buildr)\"\n task :jruby_buildr do\n begin\n # gem 'buildr', '~>1.3'\n # FIXME: this is throwing RSpec activation errors, as buildr relies on\n # an older version of Rake.\n\n sh %{#{RUBY} -S buildr package}\n\n buildr_output = extension_name.gsub(/_(ext)$/, '-\\1-java-1.0.jar')\n cp \"ext-java/target/#{buildr_output}\", \"lib/#{ext_name}\"\n rescue LoadError\n puts \"#{spec.name} requires the buildr gem to compile the Java extension\"\n end\n end\n end\n\n end\n file \"lib/#{ext_name}\" => 'compile:jruby'\n\nend", "def build_extensions # :nodoc:\n return if extensions.empty?\n return if default_gem?\n return if File.exist? gem_build_complete_path\n return if !File.writable?(base_dir)\n return if !File.exist?(File.join(base_dir, 'extensions'))\n\n begin\n # We need to require things in $LOAD_PATH without looking for the\n # extension we are about to build.\n unresolved_deps = Gem::Specification.unresolved_deps.dup\n Gem::Specification.unresolved_deps.clear\n\n require_relative 'config_file'\n require_relative 'ext'\n require_relative 'user_interaction'\n\n ui = Gem::SilentUI.new\n Gem::DefaultUserInteraction.use_ui ui do\n builder = Gem::Ext::Builder.new self\n builder.build_extensions\n end\n ensure\n ui.close if ui\n Gem::Specification.unresolved_deps.replace unresolved_deps\n end\n end", "def add_extensions(cert)\n factory = OpenSSL::X509::ExtensionFactory.new\n factory.issuer_certificate = Billy.certificate_authority.cert\n factory.subject_certificate = cert\n extensions.each do |ln_sn, value, critical|\n cert.add_extension(factory.create_extension(ln_sn, value, critical))\n end\n end", "def mkci bc, ctx\n CodeInterpreter.new bc, ctx\nend", "def using *extension_names\n extension_names.each do |extension_name|\n if extension = @@__extensions.find{|ext| ext.__name.to_s == extension_name.to_s }\n extension.extension_used self if extension.respond_to? :extension_used\n self.metaclass.send :define_method, :\"#{extension_name}\" do\n return extension\n end\n else\n raise ExtensionNotFoundError, \"Extension not found: #{extension_name}\"\n end\n end\n end", "def generate_extension(*extension_options)\n first_param = extension_options.first\n # function,priority = begin\n function,priority = case extension_options.size\n #if params is sting or proc\n when 1\n raise InvalidExtensionParam ,\"Invalid extension params\" unless first_param.is_a?(String) || first_param.is_a?(Proc)\n [first_param,Default_Priority]\n #if params are (Object,method_name) or (string,priority) or (proc,priority)\n when 2\n second_param = extension_options[1]\n #if params are (string,priority) or (proc,priority)\n if second_param.is_a?(Integer)\n [first_param,second_param]\n #if params are (Object,method_name) \n elsif second_param.is_a?(String)\n [first_param.method(second_param.to_sym),Default_Priority]\n end\n # if params are (object,method_name,priority) \n when 3\n third_param = extension_options[2]\n raise InvalidExtensionParam,\"Invalid extension params\" unless third_param.is_a?(Integer)\n [first_param.method(extension_options[1].to_sym),third_param]\n end\n # rescue Exception => e\n # raise InvalidextensionParam,\"Invalid extension params\"\n # end\n extension = Extension.new do\n self.function = function\n self.priority = priority\n end \n extension\n end", "def extension\n raw_builder do |xml|\n xml.extension do\n yield(xml)\n end\n end\n end", "def mod\n CheriModule \n end", "def use(mod, opts = { })\n if mod.nil?\n raise RuntimeError, \"No modules were specified\", caller\n end\n\n modnameprovided = mod\n suffix = nil\n if not client.binary_suffix\n suffix = ''\n elsif client.binary_suffix.size > 1\n client.binary_suffix.each { |s|\n if (mod =~ /(.*)\\.#{s}/ )\n mod = $1\n suffix = s\n break\n end\n }\n else\n suffix = client.binary_suffix.first\n end\n\n # Query the remote instance to see if commands for the extension are\n # already loaded\n commands = get_loaded_extension_commands(mod.downcase)\n\n # if there are existing commands for the given extension, then we can use\n # what's already there\n unless commands.length > 0\n image = nil\n path = nil\n # If client.sys isn't setup, it's a Windows meterpreter\n if client.respond_to?(:sys) && !client.sys.config.sysinfo['BuildTuple'].blank?\n # Query the payload gem directly for the extension image\n image = MetasploitPayloads::Mettle.load_extension(client.sys.config.sysinfo['BuildTuple'], mod.downcase, suffix)\n else\n # Get us to the installation root and then into data/meterpreter, where\n # the file is expected to be\n modname = \"ext_server_#{mod.downcase}\"\n path = MetasploitPayloads.meterpreter_path(modname, suffix)\n\n if opts['ExtensionPath']\n path = ::File.expand_path(opts['ExtensionPath'])\n end\n end\n\n if path.nil? and image.nil?\n raise RuntimeError, \"No module of the name #{modnameprovided} found\", caller\n end\n\n # Load the extension DLL\n commands = load_library(\n 'LibraryFilePath' => path,\n 'LibraryFileImage' => image,\n 'UploadLibrary' => true,\n 'Extension' => true,\n 'SaveToDisk' => opts['LoadFromDisk'])\n end\n\n # wire the commands into the client\n client.add_extension(mod, commands)\n\n return true\n end", "def register(template_class, *extensions); end", "def output_ext\n end", "def cp_c\n end", "def extension_whitelist; end", "def util_fake_extension(spec, name = \"a\", script = nil)\n mkrf_conf = File.join(\"ext\", name, \"mkrf_conf.rb\")\n\n spec.extensions << mkrf_conf\n\n dir = spec.gem_dir\n FileUtils.mkdir_p dir\n\n Dir.chdir dir do\n FileUtils.mkdir_p File.dirname(mkrf_conf)\n File.open mkrf_conf, \"w\" do |f|\n if script\n f.write script\n else\n f.write <<-EOF\n File.open 'Rakefile', 'w' do |rf| rf.puts \"task :default\" end\n EOF\n end\n end\n end\n end", "def extension_methods\n @@extension_methods\n end", "def add_extensions(*extensions)\n self.extensions += extensions\n end", "def add_extension_client(mod)\n\t\tpath = \"post/meterpreter/ui/console/command_dispatcher/#{mod}.rb\"\n\n\t\tif ((klass = CommDispatcher.check_hash(path)) == nil)\n\t\t\tclirb = File.join(Rex::Root, path)\n\t\t\told = CommDispatcher.constants\n\n\t\t\tif (require(clirb))\n\t\t\t\tnew = CommDispatcher.constants\n\t\t\t\tdiff = new - old\n\n\t\t\t\tif (diff.empty? == true)\n\t\t\t\t\tprint_error(\"Failed to load client portion of #{mod}.\")\n\t\t\t\t\treturn false\n\t\t\t\tend\n\n\t\t\t\tklass = CommDispatcher.const_get(diff[0])\n\n\t\t\t\tCommDispatcher.set_hash(path, klass)\n\t\t\telse\n\t\t\t\tprint_error(\"Failed to load client script file: #{clirb}\")\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\n\t\t# Enstack the dispatcher\n\t\tself.shell.enstack_dispatcher(klass)\n\n\t\t# Insert the module into the list of extensions\n\t\tself.extensions << mod\n\tend", "def define_extension_tasks\n\t\tENV['RUBY_CC_VERSION'] ||= RUBY_VERSION[ /(\\d+\\.\\d+)/ ]\n\n\t\trequire 'rake/extensiontask'\n\t\tself.extensions.each do |extconf|\n\t\t\tRake::ExtensionTask.new( extconf.pathmap('%{ext/,}d') )\n\t\tend\n\n\t\ttask :spec => :compile\n\n\t\ttask :maint do\n\t\t\tENV['V'] = '1'\n\t\t\tENV['MAINTAINER_MODE'] = 'yes'\n\t\tend\n\tend", "def util_fake_extension(spec, name = \"a\", script = nil)\n mkrf_conf = File.join(\"ext\", name, \"mkrf_conf.rb\")\n\n spec.extensions << mkrf_conf\n\n dir = spec.gem_dir\n FileUtils.mkdir_p dir\n\n Dir.chdir dir do\n FileUtils.mkdir_p File.dirname(mkrf_conf)\n File.open mkrf_conf, \"w\" do |f|\n if script\n f.write script\n else\n f.write <<~EOF\n File.write('Rakefile', \"task :default\")\n EOF\n end\n end\n end\n end", "def extension_black_list; end", "def c\n end", "def output_ext; end", "def output_ext; end", "def output_ext; end", "def hook_simple_run\n Gem::Compiler.class_eval do\n alias_method :orig_simple_run, :simple_run\n remove_method :simple_run\n\n def simple_run(command, command_name)\n say \"#{command_name}: #{command}\"\n end\n end\n end", "def requires_liberty_extensions?\n false\n end", "def requires_liberty_extensions?\n false\n end", "def requires_liberty_extensions?\n false\n end", "def add_extension(mod, options = {})\n self.extend(mod)\n options = mod.send(:prepare_options, options || {}) if mod.respond_to?(:prepare_options)\n extension_options[mod] = options\n self\n end", "def add_extension_client(mod)\n loaded = false\n klass = nil\n self.class.client_extension_search_paths.each do |path|\n path = ::File.join(path, \"#{mod}.rb\")\n klass = CommDispatcher.check_hash(path)\n if klass.nil?\n old = CommDispatcher.constants\n next unless ::File.exist? path\n\n if require(path)\n new = CommDispatcher.constants\n diff = new - old\n\n next if diff.empty?\n\n klass = CommDispatcher.const_get(diff[0])\n\n CommDispatcher.set_hash(path, klass)\n loaded = true\n break\n else\n print_error(\"Failed to load client script file: #{path}\")\n return false\n end\n else\n # the klass is already loaded, from a previous invocation\n loaded = true\n break\n end\n end\n unless loaded\n print_error(\"Failed to load client portion of #{mod}.\")\n return false\n end\n\n # Enstack the dispatcher\n self.shell.enstack_dispatcher(klass)\n\n # Insert the module into the list of extensions\n self.extensions << mod\n end", "def wrappers(*args, &block); end", "def register(*extensions, &block)\n start_registering_extension\n result = super\n stop_registering_extension\n result\n end", "def script_extension\n dup.add_extension(SCRIPT_EXTENSION)\n end", "def extension_methods\n @@extension_methods\n end", "def ext(rule, mod=nil)\n rule = Rule.create(rule)\n mod = Proc.new if block_given?\n rule.extension = mod if mod\n rule\n end", "def template_extensions\n %w(mod dat)\n end", "def modify_model_extension_include(objname, extname)\n passtarget = \"< ActiveRecord::Base\\n\"\n passinsert = \" include Extensions::#{extname}\\n\"\n passpath = \"app/models/#{objname}.rb\"\n insert_into_file passpath, passinsert, :after => passtarget\n end", "def ext(name, config = {}) #:doc:\n comp = Netzke::ExtComponent.new(name, config)\n content_for :netzke_on_ready, raw(\"#{comp.js_component_render}\")\n raw(comp.js_component_html)\n end", "def ext(name, config = {}) #:doc:\n comp = Netzke::ExtComponent.new(name, config)\n content_for :netzke_on_ready, raw(\"#{comp.js_component_render}\")\n raw(comp.js_component_html)\n end" ]
[ "0.6745022", "0.6745022", "0.6745022", "0.6745022", "0.66879165", "0.65144515", "0.65144515", "0.63401794", "0.62707967", "0.6109123", "0.6109123", "0.60617757", "0.6042484", "0.6015097", "0.6014227", "0.5932692", "0.59141135", "0.5900682", "0.5900682", "0.5900682", "0.5863424", "0.58094347", "0.5808078", "0.57527107", "0.57527107", "0.5719729", "0.56965655", "0.5684979", "0.5684979", "0.56801015", "0.56801015", "0.56801015", "0.56633395", "0.55989313", "0.5543462", "0.55260414", "0.5450315", "0.54292506", "0.5423806", "0.53764325", "0.53764325", "0.53561515", "0.5341015", "0.5341015", "0.5302315", "0.5302315", "0.5293683", "0.52816105", "0.5271037", "0.5267998", "0.5250751", "0.5249895", "0.5232231", "0.5231209", "0.51710707", "0.5135497", "0.5133519", "0.5126782", "0.51162916", "0.5112709", "0.5086924", "0.50749165", "0.50634485", "0.50544536", "0.5051824", "0.504692", "0.503278", "0.5027637", "0.50230056", "0.5021093", "0.5020256", "0.5018089", "0.5017769", "0.501096", "0.49971125", "0.49946153", "0.49937558", "0.49869168", "0.49866506", "0.49793482", "0.49780568", "0.49621812", "0.49618554", "0.495614", "0.495614", "0.495614", "0.4955423", "0.49502522", "0.49502522", "0.49502522", "0.49322364", "0.49307874", "0.49303788", "0.49172384", "0.49130496", "0.4910479", "0.4899784", "0.4888664", "0.48876506", "0.48791304", "0.48791304" ]
0.0
-1
Ruby equivalent of the Cextension for parse_line parses a single line: either a CSV header and body line quoting rules compared to RFC4180 are somewhat relaxed we are not assuming that quotes inside a fields need to be doubled we are not assuming that all fields need to be quoted (0 is even) works with multichar col_sep if header_size is given, only up to header_size fields are parsed We use header_size for parsing the body lines to make sure we always match the number of headers in case there are trailing col_sep characters in line Our convention is that empty fields are returned as empty strings, not as nil. the purpose of the max_size parameter is to handle a corner case where CSV lines contain more fields than the header. In which case the remaining fields in the line are ignored
def parse_csv_line_ruby(line, options, header_size = nil) return [] if line.nil? line_size = line.size col_sep = options[:col_sep] col_sep_size = col_sep.size quote = options[:quote_char] quote_count = 0 elements = [] start = 0 i = 0 previous_char = '' while i < line_size if line[i...i+col_sep_size] == col_sep && quote_count.even? break if !header_size.nil? && elements.size >= header_size elements << cleanup_quotes(line[start...i], quote) previous_char = line[i] i += col_sep.size start = i else quote_count += 1 if line[i] == quote && previous_char != '\\' previous_char = line[i] i += 1 end end elements << cleanup_quotes(line[start..-1], quote) if header_size.nil? || elements.size < header_size [elements, elements.size] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(line, options, header_size = nil)\n # puts \"SmarterCSV.parse OPTIONS: #{options[:acceleration]}\" if options[:verbose]\n\n if options[:acceleration] && has_acceleration?\n # :nocov:\n has_quotes = line =~ /#{options[:quote_char]}/\n elements = parse_csv_line_c(line, options[:col_sep], options[:quote_char], header_size)\n elements.map!{|x| cleanup_quotes(x, options[:quote_char])} if has_quotes\n return [elements, elements.size]\n # :nocov:\n else\n # puts \"WARNING: SmarterCSV is using un-accelerated parsing of lines. Check options[:acceleration]\"\n return parse_csv_line_ruby(line, options, header_size)\n end\n end", "def line_parse(validated_line)\n return unless validated_line\n row = validated_line.split(',')\n return unless row.any?\n if @headers.empty?\n @headers = row\n else\n @data_hash.merge!(row_to_hsh(row))\n @valid_rows << @data_hash\n end\n end", "def shift\n #########################################################################\n ### This method is purposefully kept a bit long as simple conditional ###\n ### checks are faster than numerous (expensive) method calls. ###\n #########################################################################\n\n # handle headers not based on document content\n if header_row? and @return_headers and\n [Array, String].include? @use_headers.class\n if @unconverted_fields\n return add_unconverted_fields(parse_headers, Array.new)\n else\n return parse_headers\n end\n end\n\n #\n # it can take multiple calls to <tt>@io.gets()</tt> to get a full line,\n # because of \\r and/or \\n characters embedded in quoted fields\n #\n in_extended_col = false\n csv = Array.new\n\n loop do\n # add another read to the line\n unless parse = @io.gets(@row_sep)\n return nil\n end\n\n if in_extended_col\n @line.concat(parse)\n else\n @line = parse.clone\n end\n\n begin\n parse.sub!(@parsers[:line_end], \"\")\n rescue ArgumentError\n unless parse.valid_encoding?\n message = \"Invalid byte sequence in #{parse.encoding}\"\n raise MalformedCSVError.new(message, lineno + 1)\n end\n raise\n end\n\n if csv.empty?\n #\n # I believe a blank line should be an <tt>Array.new</tt>, not Ruby 1.8\n # HBCSV's <tt>[nil]</tt>\n #\n if parse.empty?\n @lineno += 1\n if @skip_blanks\n next\n elsif @unconverted_fields\n return add_unconverted_fields(Array.new, Array.new)\n elsif @use_headers\n return self.class::Row.new(@headers, Array.new)\n else\n return Array.new\n end\n end\n end\n\n next if @skip_lines and @skip_lines.match parse\n\n parts = parse.split(@col_sep_split_separator, -1)\n if parts.empty?\n if in_extended_col\n csv[-1] << @col_sep # will be replaced with a @row_sep after the parts.each loop\n else\n csv << nil\n end\n end\n\n # This loop is the hot path of csv parsing. Some things may be non-dry\n # for a reason. Make sure to benchmark when refactoring.\n parts.each do |part|\n if in_extended_col\n # If we are continuing a previous column\n if part.end_with?(@quote_char) && part.count(@quote_char) % 2 != 0\n # extended column ends\n csv.last << part[0..-2]\n if csv.last.match?(@parsers[:stray_quote])\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n csv.last.gsub!(@double_quote_char, @quote_char)\n in_extended_col = false\n else\n csv.last << part << @col_sep\n end\n elsif part.start_with?(@quote_char)\n # If we are starting a new quoted column\n if part.count(@quote_char) % 2 != 0\n # start an extended column\n csv << (part[1..-1] << @col_sep)\n in_extended_col = true\n elsif part.end_with?(@quote_char)\n # regular quoted column\n csv << part[1..-2]\n if csv.last.match?(@parsers[:stray_quote])\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n csv.last.gsub!(@double_quote_char, @quote_char)\n elsif @liberal_parsing\n csv << part\n else\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n elsif part.match?(@parsers[:quote_or_nl])\n # Unquoted field with bad characters.\n if part.match?(@parsers[:nl_or_lf])\n message = \"Unquoted fields do not allow \\\\r or \\\\n\"\n raise MalformedCSVError.new(message, lineno + 1)\n else\n if @liberal_parsing\n csv << part\n else\n raise MalformedCSVError.new(\"Illegal quoting\", lineno + 1)\n end\n end\n else\n # Regular ole unquoted field.\n csv << (part.empty? ? nil : part)\n end\n end\n\n # Replace tacked on @col_sep with @row_sep if we are still in an extended\n # column.\n csv[-1][-1] = @row_sep if in_extended_col\n\n if in_extended_col\n # if we're at eof?(), a quoted field wasn't closed...\n if @io.eof?\n raise MalformedCSVError.new(\"Unclosed quoted field\",\n lineno + 1)\n elsif @field_size_limit and csv.last.size >= @field_size_limit\n raise MalformedCSVError.new(\"Field size exceeded\",\n lineno + 1)\n end\n # otherwise, we need to loop and pull some more data to complete the row\n else\n @lineno += 1\n\n # save fields unconverted fields, if needed...\n unconverted = csv.dup if @unconverted_fields\n\n if @use_headers\n # parse out header rows and handle HBCSV::Row conversions...\n csv = parse_headers(csv)\n else\n # convert fields, if needed...\n csv = convert_fields(csv)\n end\n\n # inject unconverted fields and accessor, if requested...\n if @unconverted_fields and not csv.respond_to? :unconverted_fields\n add_unconverted_fields(csv, unconverted)\n end\n\n # return the results\n break csv\n end\n end\n end", "def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end", "def parse(line)\n @io.rewind\n @io.truncate(0)\n @io << line\n @io.rewind\n @csv.shift\n end", "def parse_contents(stream, line = nil)\n # parse_contents will parse one line and apply headers, formats methods and error handle as appropriate\n current_line = line.present? ? line : 1\n all_errors = []\n\n @csv_options[:encoding] = @encoding\n\n begin\n row = LineCSV.parse_line(stream, @csv_options)\n rescue LineCSV::MalformedCSVError => e\n build_exception_messages(e, stream, current_line)\n end\n\n if row\n if current_line <= 1 && @csv_header\n # this conditional should be refactored somewhere\n row = row.reject { |col| col.nil? || col.empty? }\n validate_header(row)\n @col_counts << row.size\n else\n build_formats(row)\n @col_counts << row.reject { |col| col.nil? || col.empty? }.size\n @expected_columns = row.size unless @expected_columns != 0\n build_errors(:blank_rows, :structure, current_line, nil, stream.to_s) if row.reject { |c| c.nil? || c.empty? }.size == 0\n # Builds errors and warnings related to the provided schema file\n if @schema\n @schema.validate_row(row, current_line, all_errors, @source, @validate)\n @errors += @schema.errors\n all_errors += @schema.errors\n @warnings += @schema.warnings\n else\n build_errors(:ragged_rows, :structure, current_line, nil, stream.to_s) if !row.empty? && row.size != @expected_columns\n end\n end\n end\n @data << row\n end", "def prepare_csv\n unparsed_file = File.open(csv.path)\n self.parsed_csv_string = \"\"\n string = unparsed_file.readlines()\n string.each_with_index do |line,i|\n parsed_line = line.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').gsub(/,\\\"\\\"/,'')\n # for some reason the iRacing CSV file is buggy.\n unless parsed_line == \"\\n\"\n if i == 5 or i == 6\n parsed_line = parsed_line.gsub(/\\n/,\"\\r\\n\")\n end\n self.parsed_csv_string << parsed_line\n end\n end\n unparsed_file.close\n end", "def parse_csv\n raise InvalidStateError, \"#{state.inspect} is not a valid Data state for method 'to_csv'\" unless state == :raw\n\n file_options = @options[:file_options]\n parse_options = @options[:parse_options]\n\n begin\n csv = CSVWrapper.parse(@content, parse_options)\n csv = csv.drop(1) if file_options[:has_headers] == true # drop the first row if it is a header\n rescue => e\n Logger.new(@options).print(@path, :parse, e)\n end\n\n @state = :parsed\n Data.new(@path, csv, @state, @options)\n end", "def csv_parse(arg, no_raise: true, no_empty: true, utf8: true, **opt)\n return if arg.nil? || arg.is_a?(Puma::NullIO)\n CSV.parse(arg, **CSV_DEFAULTS, **opt).map { |row|\n row = row.to_h\n next if no_empty && row.values.all?(&:nil?)\n utf8 ? row.transform_values! { |v| force_utf8(v) } : row\n }.compact\n rescue => error\n Log.info { \"#{__method__}: #{error.class}: #{error.message}\" }\n re_raise_if_internal_exception(error)\n raise error unless no_raise\n end", "def parse_csv_line(text_line)\n\tcolumns = text_line.split(\",\")\n\tvalues = []\n\tcolumns.each { |x| values << x.strip}\n\treturn values\nend", "def csvReader(file, headers)\n begin\n csvTable = CSV.read(file, {col_sep:\"\\t\", quote_char:\"\\0\", headers:headers})\n rescue ArgumentError\n puts \"Error: Unsupported encoding, tabulated/CSV file must be in UTF-8 format.\"\n abort\n end\n parsedObj = OpenStruct.new()\n parsedObj.rowArray = []\n parsedObj.belArray = []\n csvTable.each do |row|\n unless row.length == 0\n current = OpenStruct.new()\n current.bel_id = row[0]\n current.bel_id.slice! \"BEL:\"\n current.bel = row[1]\n current.sentence = row[2]\n current.sentence_id = row[3]\n current.sentence_id.slice! \"SEN:\"\n current.pmid = row[4]\n parsedObj.rowArray << current\n parsedObj.belArray << row[1]\n end\n end\n parsedObj.linecount = csvTable.length\n return parsedObj\nend", "def parse_csv\n i=0\n output_matrix = []\n trim_return_carriage(fulltext).each_line do |line|\n 5.times { |i| avoid_commas_in_special_strings(line) }\n output_matrix << trim_line_ends(line).split(delimiter) unless i == 0\n i+=1\n end\n output_matrix.each do |rec|\n temp_hsh = {}\n (0..rec.size-1).each do |i|\n temp_hsh.merge! object_attributes[i] => rec[i]\n end\n @output_table_object << temp_hsh\n end\n\n output_table_object\n end", "def split_by_delimiter(delimiter = self.class.parsing_delimiter)\n return '' if body.nil? || body.empty?\n lines = body.split(\"\\n\")\n delim_line = last_line = found_empty = nil\n \n lines.each_with_index do |line, i|\n next if delim_line\n delim_line = i if line.include?(delimiter)\n end\n \n while !last_line && delim_line.to_i > 0\n delim_line = delim_line - 1\n if found_empty\n last_line = delim_line if lines[delim_line].strip.size > 0\n else\n found_empty = true if lines[delim_line].strip.size.zero?\n end\n end\n \n if last_line\n lines[0..delim_line] * \"\\n\"\n elsif delim_line.nil?\n body.strip\n else\n ''\n end\n end", "def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end", "def parse_csv_line(text_line)\n # Split the text_line by comma\n columns = text_line.split(\",\")\n # But some of the values are padded with spaces\n # And add the cleaned up values to the new array (called values)\n # strip --> predefined string function which trims spaces\n values = []\n columns.each {|x| values << x.strip}\n return values\n\nend", "def test_s_parseAndCreate\n colSize = 8\n csvStr = \"foo,!!!foo!!!,!foo,bar!,!!!!!!,!!,,!\\r!,!\\r\\n!\\nNaHi,!!!Na!!!,!Na,Hi!,!\\r.\\n!,!\\r\\n\\n!,!!!!,!\\n!,!\\r\\n!\".gsub!('!', '\"')\n csvStrTerminated = csvStr + \"\\n\"\n\n myStr = csvStr.dup\n res1 = []; res2 = []\n idx = 0\n col, idx = CSV::parse_row(myStr, 0, res1)\n col, idx = CSV::parse_row(myStr, idx, res2)\n\n buf = ''\n col = CSV::generate_row(res1, colSize, buf)\n col = CSV::generate_row(res2, colSize, buf)\n assert_equal(csvStrTerminated, buf)\n\n parsed = []\n CSV::Reader.parse(csvStrTerminated) do |row|\n parsed << row\n end\n\n buf = ''\n CSV::Writer.generate(buf) do |writer|\n parsed.each do |row|\n\twriter.add_row(row)\n end\n end\n assert_equal(csvStrTerminated, buf)\n\n buf = ''\n CSV::Writer.generate(buf) do |writer|\n parsed.each do |row|\n\twriter << row\n end\n end\n assert_equal(csvStrTerminated, buf)\n end", "def enough_fields?(line)\n ncols = line.split(SPLIT_PATTERN).length\n return true if fmt.include?('T') && ncols >= fmt.length\n return true if ncols == fmt.length\n\n raise(WavefrontCli::Exception::UnparseableInput,\n format('Expected %<expected>s fields, got %<got>s',\n expected: fmt.length,\n got: ncols))\n end", "def parse_blank_line; end", "def read_csv(io)\n quoted = false\n str = ''\n io.each_char do |ch|\n case\n when (ch == COMMA && !quoted) || ch == LF || ch == CR || ch.nil?\n break\n when ch == quote\n quoted = !quoted\n else\n str << ch\n end\n end\n str.empty? ? nil : value_from_s(str)\n end", "def parse(input)\n rownum = 0\n @header = nil if first_line_is_header\n lines = input.each_line.to_a\n lines.each do |line|\n line = line.encode('utf-8')\n rownum += 1\n\n next if rownum <= skip_initial_rows\n next if rownum > lines.size - skip_trailing_rows\n\n values = line.chomp.split(separator)\n\n if first_line_is_header and @header.nil?\n @header = values\n next\n end\n\n begin\n @entries << make_entry(values)\n rescue RuntimeError => e\n raise ParseStreamError.new(\"line #{rownum}: #{e.message}\", e, rownum, line)\n end\n end\n end", "def test_parse_headers\n tmpdbfile = Tempfile.new('tmp.db')\n args = [\"--header\", \n \"--source\", \"header_test.csv\", \n \"--save-to\", tmpdbfile.path, \n \"--ifs=\" \",\",\n \"--table-name\",\"header_test\"]\n Csvql.run(args)\n\n db = SQLite3::Database.new tmpdbfile.path\n headers_from_db = db.execute2('select * from header_test;')[0]\n headers_from_file = File.open('header_test.csv').each_line.first.gsub(/\\n/,'').split(',')\n\n #binding.pry\n assert_equal headers_from_db, headers_from_file\n end", "def body_csv\n body[1..(body.length)]\n end", "def parse_csv\n if self.csv_file.present?\n csv_text = Paperclip.io_adapters.for(self.csv_file).read\n csv = CSV.parse(csv_text, :headers => false)\n\n csv_columns = ['l', 'r', 'units']\n\n csv_to_save = {}\n\n csv.each_with_index do |row, i|\n if i == 0\n csv_to_save['weight'] = row[1].split(':')[1] # string is like Weight:201, only want the number\n csv_to_save['shoe_size'] = row[2].split(':')[1] # string is like Shoe Size:9\n elsif i >= 3\n row.each_with_index do |field, j|\n if j >= 1 and !field.blank?\n csv_to_save[generate_csv_row_key(csv_columns, row, i, j)] = field\n end\n end\n end\n end\n\n # Check to see if any of the fields are nil, then we must have not received the correct file\n is_clean = true\n csv_to_save.each do |key, val|\n if val.nil?\n is_clean = false\n break\n end\n end\n\n CsvFile.create!(csv_to_save) if is_clean\n end\n end", "def from_s(header)\n reset\n\n # ghettoooooo!\n # If we don't have any newlines..., put one there.\n if (header.size > 0 && header !~ /\\r\\n/)\n header << \"\\r\\n\"\n end\n\n # put the non-standard line terminations back to normal\n # gah. not having look behinds suck,\n header.gsub!(/([^\\r])\\n/n,'\\1' + \"\\r\\n\")\n\n # undo folding, kinda ugly but works for now.\n header.gsub!(/:\\s*\\r\\n\\s+/smni,': ')\n\n # Extract the command string\n self.cmd_string = header.slice!(/.+\\r\\n/)\n\n # Extract each header value pair\n header.split(/\\r\\n/mn).each { |str|\n if (md = str.match(/^(.+?)\\s*:\\s*(.+?)\\s*$/))\n if (self[md[1]])\n self[md[1]] << \", \" + md[2]\n else\n self[md[1]] = md[2]\n end\n end\n }\n end", "def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end", "def process_csv_file(filename, no_of_unique,delimiter)\n @arr_unique = Array.new{hash.new}\n @arr_details = Array.new(@no_of_columns){{\"int\" => 0, \"float\" => 0, \"date\" => 0, \"datetime\" => 0, \"string\" => 0, \"max_value\" => 0, \"min_value\" => 0}}\n total_chunks = SmarterCSV.process(filename, {:col_sep => delimiter, :chunk_size => 200, :remove_empty_values => false, :remove_zero_values => false}) do |chunk|\n for i in [email protected]\n arr = chunk.map{|x| x[@headers[i].to_sym]}\n if(@arr_unique[i].to_a.empty?)\n @arr_unique[i] = arr.uniq\n elsif(@arr_unique[i].size < no_of_unique.to_i+2)\n @arr_unique[i] |= arr.uniq\n elsif (arr.uniq.include?(nil) && !@arr_unique[i].include?(nil))\n @arr_unique[i].push(nil)\n elsif (arr.uniq.include?(\"NULL\") && !@arr_unique[i].include?(\"NULL\"))\n @arr_unique[i].push(\"NULL\")\n elsif (arr.uniq.include?(\"\\N\") && !@arr_unique[i].include?(\"\\N\"))\n @arr_unique[i].push(\"\\N\") \n elsif (arr.uniq.include?(\"\") && !@arr_unique[i].include?(\"\"))\n @arr_unique[i].push(\"\")\n elsif (arr.uniq.include?(\" \") && !@arr_unique[i].include?(\" \"))\n @arr_unique[i].push(\" \")\n end \n arr.each do |field|\n field_type = get_datatype(field)\n count = @arr_details[i][field_type]\n @arr_details[i][field_type] = count+1\n if(field != nil)\n begin\n if(@header_datatype[i] == \"int\" || @header_datatype[i] == \"float\") \n if(@arr_details[i][\"max_value\"] < field)\n @arr_details[i][\"max_value\"] = field\n end\n if(@arr_details[i][\"min_value\"] > field || @arr_details[i][\"min_value\"] == 0)\n @arr_details[i][\"min_value\"] = field\n end\n else\n if(@arr_details[i][\"max_value\"] < field.to_s.length)\n @arr_details[i][\"max_value\"] = field.to_s.length\n end\n if(@arr_details[i][\"min_value\"] > field.to_s.length || @arr_details[i][\"min_value\"] == 0)\n @arr_details[i][\"min_value\"] = field.to_s.length\n end\n end\n rescue Exception => e\n end\n end\n end\n end\n end\n end", "def cgi_parse_header(line); end", "def parse_line_to_format(line,file,path_item)\r\n tmp_hash = { message: line, filebot: { format_from: path_item['format'], path_from: file.path, size_from: file.size } }.merge(path_item['fields'] || {})\r\n case path_item['format']\r\n when 'log' then tmp_hash\r\n when 'csv' then\r\n csv_arr = CSV.parse_line(line,path_item['options'].reject { |k,_| k == :headers }) rescue []\r\n if csv_arr.size == 0\r\n tags = [tmp_hash['tags'].to_a]\r\n tags.push('_csvparsefailure')\r\n tmp_hash['tags'] = tags\r\n else\r\n res = []\r\n path_item['options'][:headers].each_with_index { |field_name,i| res << [field_name,csv_arr[i]] }\r\n if res.size < csv_arr.size\r\n res << [ 'tail_csv', csv_arr[res.size..csv_arr.size-1].join(\"\\t\") ]\r\n end\r\n tmp_hash = tmp_hash.merge(res.to_h)\r\n end\r\n tmp_hash\r\n else tmp_hash\r\n end\r\n end", "def csvfield!(str)\r\n ret = \"\"\r\n str.sub!(/^\\s*/,\"\")\r\n if str[0,1]==\"\\\"\"\r\n str[0,1] = \"\"\r\n escaped = false\r\n fieldbytes = 0\r\n str.scan(/./) do |s|\r\n fieldbytes += s.length\r\n break if s==\"\\\"\" && !escaped\r\n if s==\"\\\\\" && !escaped\r\n escaped = true\r\n else\r\n ret += s\r\n escaped = false\r\n end\r\n end\r\n str[0,fieldbytes] = \"\"\r\n if !str[/^\\s*,/] && !str[/^\\s*$/]\r\n raise _INTL(\"Invalid quoted field (in: {1})\\r\\n{2}\",str,FileLineData.linereport)\r\n end\r\n str[0,str.length] = $~.post_match\r\n else\r\n if str[/,/]\r\n str[0,str.length] = $~.post_match\r\n ret = $~.pre_match\r\n else\r\n ret = str.clone\r\n str[0,str.length] = \"\"\r\n end\r\n ret.gsub!(/\\s+$/,\"\")\r\n end\r\n return ret\r\n end", "def proccess_lines(input)\n CSV.foreach(input, headers: true, header_converters: :symbol) do |row|\n line_parser = LineParser.new(row)\n\n if line_parser.valid?\n output_file << line_parser.to_csv\n elsif !line_parser.empty?\n error_file << line_parser.to_csv\n end\n end\n end", "def parse_line(line)\n ln, fn, sex, fav_color, dob = line.split(', ')\n LineParser.to_h(fn, ln, nil, sex, fav_color, parse_dob(dob))\n end", "def parse_header(header_line)\n entries = delete_special_chars(header_line)\n # switch entries for geo coordinates since latitude comes before longitude\n geo_coordinate = Entity::Coordinate.new(entries[6].to_f, entries[5].to_f)\n @grid_data = Entity::GridPoint.new(entries[8].to_f, entries[9].to_f,\n entries[12].to_f, entries[11].to_f)\n # special case for multi word locations\n station_name = entries[0].sub(\"_\", \" \")\n @station = Entity::Station.new(station_name, entries[3], entries[13].to_f,\n geo_coordinate)\n nil\n end", "def parse_line_break; end", "def parse_line(line)\n ln, fn, mi, sex, fav_color, dob = line.split(' | ')\n LineParser.to_h(fn, ln, mi, sex, fav_color, parse_dob(dob))\n end", "def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end", "def parsed_data\n @parsed_data ||= begin\n CSV.read(full_filename, col_sep: col_sep, quote_char: quote_char, encoding: encoding)\n rescue => e #CSV::MalformedCSVError => er\n @parse_error = e.to_s\n rows = []\n #one more attempt. If BOM is present in the file.\n begin\n f = File.open(full_filename, \"rb:bom|utf-8\")\n rows = CSV.parse(f.read.force_encoding(\"ISO-8859-1\"))\n ensure\n return rows\n end\n end\n end", "def read_lines lines, options = {}\n table_apply = TableApply.new(options)\n\n header = table_apply.parse_header(lines[0], options)\n Validator::valid_header?(header, @header) # compare against older header when merging\n column_index,header = table_apply.column_index(header) # we may rewrite the header\n @header = header if not @header\n \n newheader = @header[1..-1]\n # parse the rest\n prev_line = newheader\n (lines[1..-1]).each_with_index do | line, line_num |\n rowname, data_fields = table_apply.parse_row(line_num, line, newheader, column_index, prev_line, options)\n if data_fields\n @rownames << rowname if not options[:with_rownames] # otherwise doubles rownames\n @rows << data_fields if data_fields\n end\n prev_line = data_fields\n end\n return @rownames,@rows\n end", "def parse_header line, samples, options\n header = VcfHeader.new(options[:debug])\n header.add(line)\n print line if not options[:skip_header]\n STDIN.each_line do | headerline |\n if headerline !~ /^#/\n # If no records in VCF, we never get here\n line = headerline\n break # end of header\n end\n header.add(headerline)\n if not options[:skip_header]\n if headerline =~ /^#CHR/\n # The header before actual data contains the sample names, first inject the BioVcf meta information\n print header.tag(options),\"\\n\" if options[:tag] and not options[:skip_header]\n # Then the additional filter(s)\n # ##FILTER=<ID=LowQual,Description=\"Low quality\">\n add_filter = options[:add_filter]\n if add_filter\n print \"##FILTER=<ID=\",add_filter,\",Description=\\\"\",options[:filter],\"\\\">\\n\"\n end\n \n selected = header.column_names\n if samples\n newfields = selected[0..8]\n samples.each do |s|\n newfields << selected[s+9] \n end\n selected = newfields\n end\n print \"#\",selected.join(\"\\t\"),\"\\n\"\n else\n print headerline\n end\n end\n end\n print header.printable_header_line(options[:set_header]),\"\\n\" if options[:set_header]\n VcfRdf::header if options[:rdf]\n if line =~ /^#/\n # We did not read a record\n line = nil\n end\n return header,line\nend", "def parse_csv content, sep\n CSV.parse(content, :col_sep => sep,\n :converters => [:numeric],\n :headers => true,\n :skip_blanks => true).\n map{ |row| row.to_hash }\n end", "def split_line(line)\n line.split(Mergeit::Config::FILE_FORMAT[:delimeter], Mergeit::Config::SUPPORTED_PARTS[:size])\n end", "def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end", "def parse_header\n @snp, @line, @type, @in, @polymorphism, @chromosome, @orientation = self.sequence_id.split(\" \") \n @type = @type.to_sym\n if @in\n @in = @in.to_sym == :exon \n else\n @exon = false\n end\n\n if @polymorphism.to_sym == :homoeologous\n @homoeologous = true\n else\n @homoeologous = false\n end\n @parsed = true\n @orientation = @orientation.to_sym\n end", "def parse_input_string(tsv_string)\n rows = tsv_string.split(/\\r\\n/)\n row_raw_data = rows.map do |row|\n row.gsub!(/\"/, '')\n row.split(\"\\t\")\n end\n\n @header_row = row_raw_data[0]\n @data_rows = row_raw_data[1..-1]\n\n @header_row.each.with_index do |col_key, i|\n if STATIC_KEYS.include?(col_key)\n @header_object[col_key] = i\n else\n date = parse_date(col_key)\n @header_row[i] = date\n end\n end\n\n format_data\n end", "def parse_header(line, opts = {})\n host = opts[:host]\n if host\n line = line.gsub(/^(Host:\\s+).*$/, \"\\\\1#{host}\")\n line = line.gsub(/^(Referer:\\s+https?:\\/\\/)[^\\/]*(.*)$/, \"\\\\1#{host}\\\\2\")\n end\n @headers << line\n line = line.downcase\n if line.start_with? 'content-length: '\n @content_length = line.gsub(/^\\S+\\s+(\\d+)\\s*$/, '\\1').to_i\n elsif line.start_with? 'transfer-encoding: '\n encodings = line.gsub(/^\\S+\\s+(.*)$/, '\\1')\n @transfer_encodings = encodings.split(/\\s*,\\s*/).map {|e| e.strip.to_sym}\n end\n end", "def pbGetCsvRecord(rec,lineno,schema)\r\n record = []\r\n repeat = false\r\n start = 0\r\n if schema[1][0,1]==\"*\"\r\n repeat = true\r\n start = 1\r\n end\r\n begin\r\n for i in start...schema[1].length\r\n chr = schema[1][i,1]\r\n case chr\r\n when \"i\" # Integer\r\n record.push(csvInt!(rec,lineno))\r\n when \"I\" # Optional integer\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif !field[/^\\-?\\d+$/]\r\n raise _INTL(\"Field {1} is not an integer\\r\\n{2}\",field,FileLineData.linereport)\r\n else\r\n record.push(field.to_i)\r\n end\r\n when \"u\" # Positive integer or zero\r\n record.push(csvPosInt!(rec,lineno))\r\n when \"U\" # Optional positive integer or zero\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif !field[/^\\d+$/]\r\n raise _INTL(\"Field '{1}' must be 0 or greater\\r\\n{2}\",field,FileLineData.linereport)\r\n else\r\n record.push(field.to_i)\r\n end\r\n when \"v\" # Positive integer\r\n field = csvPosInt!(rec,lineno)\r\n raise _INTL(\"Field '{1}' must be greater than 0\\r\\n{2}\",field,FileLineData.linereport) if field==0\r\n record.push(field)\r\n when \"V\" # Optional positive integer\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif !field[/^\\d+$/]\r\n raise _INTL(\"Field '{1}' must be greater than 0\\r\\n{2}\",field,FileLineData.linereport)\r\n elsif field.to_i==0\r\n raise _INTL(\"Field '{1}' must be greater than 0\\r\\n{2}\",field,FileLineData.linereport)\r\n else\r\n record.push(field.to_i)\r\n end\r\n when \"x\" # Hexadecimal number\r\n field = csvfield!(rec)\r\n if !field[/^[A-Fa-f0-9]+$/]\r\n raise _INTL(\"Field '{1}' is not a hexadecimal number\\r\\n{2}\",field,FileLineData.linereport)\r\n end\r\n record.push(field.hex)\r\n when \"X\" # Optional hexadecimal number\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif !field[/^[A-Fa-f0-9]+$/]\r\n raise _INTL(\"Field '{1}' is not a hexadecimal number\\r\\n{2}\",field,FileLineData.linereport)\r\n else\r\n record.push(field.hex)\r\n end\r\n when \"f\" # Floating point number\r\n record.push(csvFloat!(rec,lineno))\r\n when \"F\" # Optional floating point number\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif !field[/^\\-?^\\d*\\.?\\d*$/]\r\n raise _INTL(\"Field {1} is not a floating point number\\r\\n{2}\",field,FileLineData.linereport)\r\n else\r\n record.push(field.to_f)\r\n end\r\n when \"b\" # Boolean\r\n record.push(csvBoolean!(rec,lineno))\r\n when \"B\" # Optional Boolean\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif field[/^1|[Tt][Rr][Uu][Ee]|[Yy][Ee][Ss]|[Tt]|[Yy]$/]\r\n record.push(true)\r\n else\r\n record.push(false)\r\n end\r\n when \"n\" # Name\r\n field = csvfield!(rec)\r\n if !field[/^(?![0-9])\\w+$/]\r\n raise _INTL(\"Field '{1}' must contain only letters, digits, and\\r\\nunderscores and can't begin with a number.\\r\\n{2}\",field,FileLineData.linereport)\r\n end\r\n record.push(field)\r\n when \"N\" # Optional name\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif !field[/^(?![0-9])\\w+$/]\r\n raise _INTL(\"Field '{1}' must contain only letters, digits, and\\r\\nunderscores and can't begin with a number.\\r\\n{2}\",field,FileLineData.linereport)\r\n else\r\n record.push(field)\r\n end\r\n when \"s\" # String\r\n record.push(csvfield!(rec))\r\n when \"S\" # Optional string\r\n field = csvfield!(rec)\r\n record.push((nil_or_empty?(field)) ? nil : field)\r\n when \"q\" # Unformatted text\r\n record.push(rec)\r\n rec = \"\"\r\n when \"Q\" # Optional unformatted text\r\n if nil_or_empty?(rec)\r\n record.push(nil)\r\n else\r\n record.push(rec)\r\n rec = \"\"\r\n end\r\n when \"e\" # Enumerable\r\n record.push(csvEnumField!(rec,schema[2+i-start],\"\",FileLineData.linereport))\r\n when \"E\" # Optional enumerable\r\n field = csvfield!(rec)\r\n record.push(checkEnumFieldOrNil(field,schema[2+i-start]))\r\n when \"y\" # Enumerable or integer\r\n field = csvfield!(rec)\r\n record.push(csvEnumFieldOrInt!(field,schema[2+i-start],\"\",FileLineData.linereport))\r\n when \"Y\" # Optional enumerable or integer\r\n field = csvfield!(rec)\r\n if nil_or_empty?(field)\r\n record.push(nil)\r\n elsif field[/^\\-?\\d+$/]\r\n record.push(field.to_i)\r\n else\r\n record.push(checkEnumFieldOrNil(field,schema[2+i-start]))\r\n end\r\n end\r\n end\r\n break if repeat && nil_or_empty?(rec)\r\n end while repeat\r\n return (schema[1].length==1) ? record[0] : record\r\n end", "def process line\n return unless line.gsub!(/^INSERT INTO `\\w+` VALUES \\(/,\"\")\n warn \"bad ending\" unless line.gsub!(/\\);?$/, '')\n line.split(/\\),\\(/).each do |tuple|\n begin\n QUOTED_QUOTE_RE.gsub!(tuple, \"''\")\n emit FasterCSV.parse_line(tuple, :quote_char => \"'\")\n rescue FasterCSV::MalformedCSVError => e\n warn \"#{e}: #{tuple}\"\n end\n \n end\n end", "def parse_line(line)\n catch :line_parsed do\n UNDERSTOOD_ROWS.each do |record_type|\n if line.start_with?(record_type)\n send \"parse_#{record_type.downcase}_line\", line.chomp\n throw :line_parsed\n end\n end\n\n if line[0].eql?('/')\n parse_comment_line line.chomp\n throw :line_parsed\n end\n\n logger.error \"Can't understand line: #{line.chomp.inspect}\"\n end\n end", "def parse_csv_legacy(file)\n\trows = []\n\tlines = File.read(file).split(\"\\n\").map(&:strip).reject { |l| l.empty? }\n\trows = lines.map { |r| r.split(\",\").map(&:strip) }\n\n\theader = rows.shift\n\n\trows.map do |row|\n\t\ti = 0\n\t\trow_hash = {}\n\t\theader.each do |h|\n\t\t\trow_hash[h] = row[i]\n\t\t\ti += 1\n\t\tend\n\t\trow_hash\n\tend\nend", "def parseCSV(csvfile)\n begin\n if csvfile != nil && csvfile != \"\"\n file_ext = File.extname(csvfile.original_filename)\n if file_ext == \".csv\"\n content = File.read(csvfile.tempfile)\n arr_of_arrs = CSV.parse(content)\n return arr_of_arrs, 0\n else\n return nil, 4\n end\n else\n return nil, 1\n end\n rescue ArgumentError\n return nil, 2\n rescue CSV::MalformedCSVError\n return nil, 3\n end\n end", "def csv_parsed\n transform_to_hash(@csv_array, @header)\n end", "def parse_setext_header; end", "def guess_column_separator(filehandle, options)\n skip_lines(filehandle, options)\n\n delimiters = [',', \"\\t\", ';', ':', '|']\n\n line = nil\n has_header = options[:headers_in_file]\n candidates = Hash.new(0)\n count = has_header ? 1 : 5\n count.times do\n line = readline_with_counts(filehandle, options)\n delimiters.each do |d|\n candidates[d] += line.scan(d).count\n end\n rescue EOFError # short files\n break\n end\n rewind(filehandle)\n\n if candidates.values.max == 0\n # if the header only contains\n return ',' if line.chomp(options[:row_sep]) =~ /^\\w+$/\n\n raise SmarterCSV::NoColSepDetected\n end\n\n candidates.key(candidates.values.max)\n end", "def parser_email(line)\n if line.include? MailHeader.from\n fields=line.split(MailHeader.key_separator)\n if fields.length>1\n\t\t\t\tvalue=fields[1].split(\" \")\n if value.length>1\n firstname_lastname=value[0];\n email_address=value[1].gsub(/[<>]/,'')\n company_url=\"www.\"+email_address.split('@')[1];\n # if the email address is not contains the '@',the address is not correct\n unless email_address.include? \"@\"\n mail_header_output.firstname_lastname=MailHeader.unknown\n mail_header_output.flastname=MailHeader.unknown\n end\n mail_header_output.company_url=company_url\n check_firstname_lastname(email_address)\n check_flastname(email_address)\n check_email_name_conflict()\n end #end value.length\n end #end fields.length\n end #end line include\n end", "def parse_first_header(line)\n\n # split the line into: METHOD URI PROTOCOL\n # eg: GET / HTTP/1.1\n parsed = line.split(' ')\n\n # a correct request has three parts\n return bad_parsing unless parsed.size == 3\n\n @http_request_method, uri, @http_protocol = parsed\n\n # optional query string\n @http_request_uri, @http_query_string = uri.split('?')\n end", "def is_valid_csv?(part)\n part =~ /#{Mergeit::Config::CSV_FORMAT[:regex]}/\n end", "def parse(args={})\n csv_args = {:skip_blanks=>true,:col_sep=>\",\"}\n csv_args[:col_sep] = args[:col_sep] if args[:col_sep]\n args[:value_filter] ||= Csv2sql.method :default_value_filter\n i = 0\n CSV.foreach(@filename,csv_args) do |row|\n values = row\n #values_filter is for whole row\n #value_filter is for single value\n values = args[:values_filter].call(row, i) if args[:values_filter]\n if values\n if args[:value_filter]\n j = -1\n values = row.map do |value|\n j += 1\n args[:value_filter].call(value,i,j)\n end\n end\n yield values if values\n end\n i += 1\n end\n end", "def initialize(filename,\n col_sep: \",\",\n comment_starts: false,\n comment_matches: false,\n ignore_empty_lines: true,\n surrounding_space_need_quotes: false,\n quote_char: \"\\\"\",\n default_filter: Jcsv.optional,\n strings_as_keys: false,\n format: :list,\n headers: true,\n custom_headers: nil,\n chunk_size: 0,\n deep_map: false,\n dimensions: nil,\n suppress_warnings: false)\n \n @filename = filename\n @col_sep = col_sep\n @comment_starts = comment_starts\n @comment_matches = comment_matches\n @default_filter = default_filter\n @filters = false\n @strings_as_keys = strings_as_keys\n @headers = headers\n @custom_headers = custom_headers\n @ignore_empty_lines = ignore_empty_lines\n @format = format\n @surrounding_space_need_quotes = surrounding_space_need_quotes\n @quote_char = quote_char\n @chunk_size = (chunk_size == :all)? 1.0/0.0 : chunk_size\n @deep_map = (@format == :list)? false : deep_map\n @dimensions_names = dimensions\n @column_mapping = Mapping.new\n @suppress_warnings = suppress_warnings\n \n prepare_dimensions if dimensions\n\n # set all preferences. To create a new reader we need to have the dimensions already\n # prepared as this information will be sent to supercsv for processing.\n new_reader(set_preferences)\n\n # Dynamic class change without writing subclasses. When headers, extend this class\n # with methods that assume there is a header, when no headers, then extend this class\n # with methods that know there is no header. Could have being done with subclasses,\n # but this would all subclasses to have two subclasses one inheriting from the header\n # class and one inheriting from the headerless classes. In this way we reduce the\n # subclasses need.\n @headers? prepare_headers : (@custom_headers? set_headers(@custom_headers) :\n headerless)\n\n # if there are dimensions, then we need to prepare the mappings accordingly. With\n # dimensions defined, users cannot defined mappings.\n dimensions_mappings if dimensions\n \n end", "def convert\n STDERR.print \"\\nThis may take 10 minutes or more. Lines processed: \"\n line_in_count = 0\n\n # Create an object to store *all* lines of the *output* CSV\n @csv_out_data = FasterCSV.generate(FCSV_OUT_OPTS){|csv_out| \n\n # Iterate thru each *input* line\n FasterCSV.foreach(@in_file, FCSV_IN_OPTS) {|line_in|\n line_in_count += 1\n if line_in_count == 1\n self.class.verify_csv_in_headers(line_in.headers)\n @csv_out_headers = WILL_INCLUDE_INPUT_COLUMNS ? CSV_OUT_COLUMNS + CSV_IN_COLUMNS : CSV_OUT_COLUMNS\n end\n\n # Iterate thru each *output* column\n line_out = []\n @csv_out_headers.each_with_index{|col,i|\n csv_out << @csv_out_headers if line_in_count == 1 && i == 0\t# Header line\n\n case col\n when RmidItem, PrefixColOwner, PrefixColList\n line_out << line_in[col]\n when HdlItem\n line_out << get_handle_for_rmid(line_in[RmidItem])\n when HdlColOwner\n line_out << get_handle_for_collection_prefix(line_in[PrefixColOwner])\n when HdlColList\n if line_in[PrefixColList]\n prefixes = line_in[PrefixColList].split(VALUE_DELIMITER)\n handles = prefixes.inject([]){|a,prefix| a << get_handle_for_collection_prefix(prefix)}\n line_out << handles.join(VALUE_DELIMITER)\n else\n line_out << \"\"\n end\n end\n }\n csv_out << line_out\n STDERR.print \"#{line_in_count} \" if line_in_count % 200 == 0\n }\n }\n STDERR.puts \"; Total lines #{line_in_count} \"\n end", "def consume_header_line(line, column_mappings)\n columns = column_names(column_mappings)\n\n header_guess = line.map { |column| column.to_s.downcase }\n\n # The \"best guess\" is only if/when the header eventually deemed to be\n # invalid - in which case, it builds the informative error message.\n @header_best_guess = header_guess if header_guess.any?(&:present?)\n @header_valid = true if header_guess == columns\n end", "def parse_header_line(header_str)\n @headers = header_str.split(',')\n @headers.map! do |h|\n h.gsub!('\"','')\n h.strip!\n h.underscore.to_sym\n end\n @headers\n end", "def parseCSV(csvfile)\n begin\n if csvfile != nil\n file_ext = File.extname(csvfile.original_filename)\n if file_ext == \".csv\"\n content = File.read(csvfile.tempfile)\n arr_of_arrs = CSV.parse(content)\n return arr_of_arrs, 0\n else\n return nil, 4\n end\n else\n return nil, 1\n end\n rescue ArgumentError\n return nil, 2\n rescue CSV::MalformedCSVError\n return nil, 3\n end\n end", "def read_data(options={})\n orig_data = CSV.read(@filename, :skip_blanks => true)\n num_lines = orig_data.length\n if num_lines % @num_lines_per_linegroup == 0\n num_line_groups = num_lines / @num_lines_per_linegroup\n else\n raise \"ERROR: Invalid number of lines in file!\"\n end\n \n# puts \"Num Lines: #{num_lines}\"\n# puts \"************************\\n\"\n \n # array for final data\n @final_data = []\n \n # go through each line group\n num_line_groups.times do |i|\n \n # init a temp hash\n temp_hashes = []\n @data_columns.each do |col|\n temp_hashes[col] = {}\n end\n \n # grab data per linegroup\n @num_lines_per_linegroup.times do |j|\n line = orig_data[i*@num_lines_per_linegroup + j]\n field_name = @input_data_rows[j]\n # parse columns within a line\n @data_columns.each do |col|\n data = line[col]\n temp_hashes[col][field_name] = data\n # puts \" #{line[col]}\" if !line[col].nil?\n end\n end\n \n # push grabbed data onto master hash array\n temp_hashes.each do |record|\n if !record.nil?\n @final_data << record\n end\n end\n \n end # per line groups\n \nend", "def parse_line row,init=true\n parse_init if init\n dbg[:parse]= false\n @doc_src = read_w2tags(row).split(\"\\n\") << \",/\"\n #@doc_src = row.delete(\"\\r\").split(\"\\n\") << \",/\"\n while (@row= @doc_src.shift) do #;p \"row:#{@row}\"\n parse_row\n end\n @doc_out\n end", "def initialize(max_line_length, line_handler)\n @buf = \"\"\n @max_line_length = max_line_length\n @discard_current = false\n @line_handler = line_handler\n end", "def parse_csv(csvstr)\n\treturn CSV.parse(csvstr)\nend", "def parse_headers!(csv_file)\n csv = CSV.open(csv_file, :headers => true)\n csv.gets\n csv.headers\n end", "def parse_line(line)\n results = LineRegexp.match(line)\n if results \n @elements[:line] = results[-1]\n results[-1] # remaining line \n else\n @elements[:line] = line\n line \n end\n end", "def split_header\n self.fields = raw_source.split(HEADER_SPLIT)\n end", "def parse_line(delim , line)\n temp_array = Array.new #Array to hold data\n index = 0 #Position of array index\n token = \"\" #To hold the string\n grouping = false #Grouping characters flag\n\n #Parse line with delimeter\n line.each_char do |char|\n #Grouping Block \n if char == \"\\\"\" and !grouping\n token += char\n grouping = true\n elsif char == \"\\\"\" and grouping \n token += char\n grouping = false\n elsif char == delim and !grouping \n temp_array.push(clean(token)) \n token = \"\" \n else\n token += char\n end\n end \n \n #Store last token on line\n temp_array.push(clean(token))\n \n return temp_array\nend", "def csv?(csv)\n valid = csv.include?(';')\n valid |= csv.include?(',')\n valid &= csv.include?(\"\\n\")\n valid\n end", "def process\n lines = clean_lines\n\n # Peek ahead to get the headers\n unless @file_content.blank?\n CSV.parse(@file_content, {:headers => true, :skip_blanks => true}) do |row|\n @rows_exist = true\n @headers = row.headers\n break\n end\n end\n\n @rows_exist = @rows_exist and [email protected]?\n end", "def read(string)\n lines = string.split(\"\\n\")\n header = lines[0]\n attributes = header.split(',').map! { |v| v.to_sym }\n # Struct.new('CSVEntry', *attributes)\n ret = []\n lines.drop(1).each do |line|\n values = line.split(',')\n opts = {}\n values.each_with_index do |val, idx|\n opts[attributes[idx]] = val\n end\n ret << Struct::CSVEntry.new(opts)\n end\n\n ret\n end", "def init_parsers(skip_blanks, field_size_limit, liberal_parsing)\n # store the parser behaviors\n @skip_blanks = skip_blanks\n @field_size_limit = field_size_limit\n @liberal_parsing = liberal_parsing\n\n # prebuild Regexps for faster parsing\n esc_row_sep = escape_re(@row_sep)\n esc_quote = escape_re(@quote_char)\n @parsers = {\n # for detecting parse errors\n quote_or_nl: encode_re(\"[\", esc_quote, \"\\r\\n]\"),\n nl_or_lf: encode_re(\"[\\r\\n]\"),\n stray_quote: encode_re( \"[^\", esc_quote, \"]\", esc_quote,\n \"[^\", esc_quote, \"]\" ),\n # safer than chomp!()\n line_end: encode_re(esc_row_sep, \"\\\\z\"),\n # illegal unquoted characters\n return_newline: encode_str(\"\\r\\n\")\n }\n end", "def import_csv_smart\n \n end", "def parse_message\n header_part, body_part = raw_source.lstrip.split(HEADER_SEPARATOR, 2)\n self.header = header_part\n self.body = body_part\n end", "def evaluate_row_from_headers(record_type)\n row_str = \"\\n\"\n #row_str = config.header_fields.collect.map{|fld| eval(\"eval_\" + fld.first.downcase.gsub(/(#|\\(|\\)| )/, \"_\") + fld[2])}.join(@delimiter )\n if record_type == \"plb\"\n plb_field_list = [\"Patient First Name\", \"Patient Last Name\", \n \"Patient Account Number\", \"835 Amount\", \"Xpeditor Document Number\",\n \"Total Charge\", \"Date Of Service\", \"Reject Reason\", \"Statement #\", \n \"Member Id\", \"Patient Date Of Birth\", \"Payer Name\", \"Reason Not Processed\",\n \"837 File Type\", \"PLB\", \"Unique Identifier\", \"Client Code\", \"Payer\", \n \"MRN\", \"Service Provider ID\", \"Transaction Type\"]\n row_str = row_str + config.header_fields.collect.map{|fld|\n if plb_field_list.include?(fld.first)\n eval(\"eval_plb_\" + fld.first.downcase.gsub(/(#|\\(|\\)| |\\/)/, \"_\")) \n else \n eval(\"eval_\" + fld.first.downcase.gsub(/(#|\\(|\\)| |\\/)/, \"_\"))\n end\n }.join(@delimiter) \n elsif record_type == \"extra plb\"\n plb_field_list = [\"Patient First Name\", \"Patient Last Name\",\n \"835 Amount\", \"Xpeditor Document Number\",\n \"Total Charge\", \"Date Of Service\", \"Reject Reason\", \"Statement #\",\n \"Member Id\", \"Patient Date Of Birth\", \"Reason Not Processed\",\n \"837 File Type\", \"PLB\", \"Unique Identifier\", \"Client Code\"]\n row_str = row_str + config.header_fields.collect.map{|fld|\n if plb_field_list.include?(fld.first)\n eval(\"eval_extra_plb_\" + fld.first.downcase.gsub(/(#|\\(|\\)| |\\/)/, \"_\"))\n else\n eval(\"eval_\" + fld.first.downcase.gsub(/(#|\\(|\\)| |\\/)/, \"_\"))\n end\n }.join(@delimiter)\n else\n row_str = row_str + config.header_fields.collect.map{|fld| eval(\"eval_\" + fld.first.downcase.gsub(/(#|\\(|\\)| |\\/)/, \"_\"))}.join(@delimiter)\n end\n row_str = row_str + @delimiter + Array.new(@config.custom_header_fields.size).join(@delimiter) if @config.custom_header_fields.size > 0\n row_str \n end", "def csv_options\n memo = other_options.slice(*PASSTHROUGH_CSV_SETTINGS)\n memo[:skip_blanks] = !keep_blank_rows\n memo[:headers] ||= headers\n memo[:col_sep] ||= delimiter\n memo\n end", "def test_split_join_record_line\n check = proc do |start, record, final|\n # Check parsing first\n result = @parser.parse_line(start)\n [:one, :two].each do |param|\n\n assert_equal(\n record[param], result[param],\n\n \"Did not correctly parse #{start.inspect}\")\n end\n\n # And generating\n assert_equal(final, @parser.to_line(result), \"Did not correctly generate #{final.inspect} from #{record.inspect}\")\n end\n\n # First try it with symmetric characters\n @parser.record_line :symmetric, :fields => %w{one two},\n :separator => \" \"\n\n check.call \"a b\", {:one => \"a\", :two => \"b\"}, \"a b\"\n @parser.clear_records\n\n # Now assymetric but both strings\n @parser.record_line :asymmetric, :fields => %w{one two},\n :separator => \"\\t\", :joiner => \" \"\n\n check.call \"a\\tb\", {:one => \"a\", :two => \"b\"}, \"a b\"\n @parser.clear_records\n\n # And assymmetric with a regex\n @parser.record_line :asymmetric2, :fields => %w{one two},\n :separator => /\\s+/, :joiner => \" \"\n\n check.call \"a\\tb\", {:one => \"a\", :two => \"b\"}, \"a b\"\n check.call \"a b\", {:one => \"a\", :two => \"b\"}, \"a b\"\n end", "def test_parser_handles_single_delim_no_text_email_array\n email_array_assert ['', ''], ApiParser.email_delim\n end", "def valid_header?(header)\n return false if header.empty?\n length = -1\n header.each do |row|\n return false if row.empty?\n length = row.size if length == -1\n return false if row.size != length\n end\n true\n end", "def initialize(line_reader, cleanse_header: true, **args)\n @tabular = IOStreams::Tabular.new(**args)\n @line_reader = line_reader\n @cleanse_header = cleanse_header\n end", "def parse_csv(csv_file)\r\n\t\t\t# Fixed errors due to a Byte-Order-Mark (BOM) at the very beginning of some CSV files\r\n\t\t\t# http://stackoverflow.com/questions/23011713/illegal-quoting-error-with-ruby-csv-parsing\r\n\t\t\tparsed_csv = []\r\n\t\t\tbegin\r\n\t\t \t\tparsed_csv = CSV.read(csv_file, :encoding => 'bom|utf-8')\r\n\t\t\trescue ArgumentError\r\n\t\t \t\tbegin\r\n\t\t \t\tparsed_csv = CSV.read(csv_file, :encoding => 'bom|utf-8:ISO-8859-1')\r\n\t\t \t\trescue ArgumentError\r\n\t\t \t\traise ParserError, \"There was an error in reading the CSV encoding.\"\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\treturn parsed_csv\r\n\t\tend", "def test_optional_fields\n assert_nothing_raised do\n @parser.record_line :record,\n :fields => %w{one two three four},\n :optional => %w{three four},\n :absent => \"*\",\n :separator => \" \" # A single space\n end\n\n { \"a b c d\" => [],\n \"a b * d\" => [:three],\n \"a b * *\" => [:three, :four],\n \"a b c *\" => [:four]\n }.each do |line, absentees|\n record = nil\n assert_nothing_raised do\n record = @parser.parse_line(line)\n end\n\n # Absent field is :absent, not \"*\" inside the record\n absentees.each do |absentee|\n assert_equal(:absent, record[absentee])\n end\n\n # Now regenerate the line\n newline = nil\n assert_nothing_raised do\n newline = @parser.to_line(record)\n end\n\n # And make sure they're equal\n assert_equal(line, newline)\n end\n\n # Now make sure it pukes if we don't provide the required fields\n assert_raise(ArgumentError) do\n @parser.to_line(:record_type => :record, :one => \"yay\")\n end\n end", "def parse_line(line)\n return [] if line.nil? or line.empty?\n line.chomp(\"\\n\").split(\"\\t\")\n end", "def readline(sep=$/) end", "def readline(sep=$/) end", "def define_csv_format(options={})\n \n ###############################\n # QUALITIES OF INPUT CSV FILE\n \n # indicate which columns contain valid data\n # leftmost column is 0\n @data_columns = [0,4,8]\n \n # number of lines per group in input file\n @num_lines_per_linegroup = 5\n \n # indicate what values per row\n # should be 0 to @num_lines_per_linegroup-1\n @input_data_rows = {0 => :name,\n 1 => :elder,\n 2 => :address,\n 3 => :city_state_zip, # occasionally this is more of the address\n 4 => :extra, # occasionally this is the city/state/zip! \n }\n \n # Output data fields\n # Used as data for Google Maps,\n # and used to access data itself via keys\n @output_fields = {:name => \"Name\", # key matches @input_data_rows\n :elder => \"Elder\", # key matches @input_data_rows\n :address => \"Address\", # key matches @input_data_rows\n :city_state_zip => \"City_State_Zip\", # key matches @input_data_rows\n :city => \"City\", # generated from city_state_zip above\n :state => \"State\", # generated from city_state_zip above\n :zip => \"Zip\", # generated from city_state_zip above\n :area => \"Area\", # generated based on zip code\n }\n \n # Hash here used to give warning if someone is assigned to wrong elder!\n # also should match data input -- eventually want this to come from external file?\n @elders = [\"Daniel Hadad\",\n \"Mark De Young\",\n \"Ernie Johnson\",\n \"Joshua Konkle\",\n \"Charles Whitsel\",\n \"Ethan Cruz\",\n \"Ross Davis\",\n \"Don Hilsberg\",\n \"Paul Hunt\",\n \"Gary Jordan\",\n \"Tim Horn\",\n \"Kelly Holligan\",\n \"Steve Hutton\",\n \"John Ritchie\",\n ]\n \n # extra list of names to help find elders themselves in the database (need to use hash above instead...)\n # or break down the name to remove spouse name\n @elders2 = [\"Dan Hadad\",\n ]\n \n # if needing to sub elder in the data\n # format: old_elder => new_elder\n @elder_sub = {\n }\n \n ###############################\n \nend", "def parse path\n\t\theaders, body = path.read.split(\"\\n\\n\", 2) # Two newlines marks end of headers\n\t\t@headers = parse_headers(headers)\n\t\t@body = parse_body(self.content_type, body)\n\tend", "def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end", "def initial_Headers_Split(initial_and_headers)\n\tif initial_and_headers.include?(\"\\r\\n\") # if body exist, a blank line must exist\n\t\tinitial,headers = initial_and_headers.split(\"\\r\\n\",2)\n\telse\n\t\tinitial,headers = initial_and_headers,''\n\tend\nend", "def parse_csv(filename)\n @file=CSV.read(filename)\n # Read order of headers\n headers = @file.shift\n @file.each do |line|\n next if line.length==0 || (line.length==1 && line[0]==nil)\n # Read fields from line based on headers\n value=ReturnValue.new( line[headers.index('label')],\n line[headers.index('name') || headers.index('label')],\n line[headers.index('type')],\n line[headers.index('unit')],\n line[headers.index('per_unit')],\n line[headers.index('default')] )\n @values.push value\n end\n validate\n end", "def recordize line\n line.split(\"\\t\") rescue nil\n end", "def chomp!(sep=$/)\n return nil if sep._equal?(nil)\n my_size = self.__size\n return nil if my_size._equal?(0)\n sep = Maglev::Type.coerce_to(sep, String, :to_str)\n if sep == \"\\n\"\n last_ch = self.__at(-1)\n diminish_by = 0\n if last_ch.eql?( ?\\n )\n diminish_by += 1 if self.__at(-2).eql?( ?\\r ) && my_size > 1\n elsif last_ch.not_eql?( ?\\r )\n return nil\n end\n diminish_by += 1\n self.__size=(my_size - diminish_by)\n else\n separator_sz = sep.__size\n if separator_sz._equal?(0)\n sz = my_size\n while sz > 0 && self.__at(sz-1).eql?( ?\\n )\n if sz > 1 && self.__at(sz-2).eql?( ?\\r )\n sz -= 2\n else\n sz -= 1\n end\n end\n return nil if sz._equal?( my_size )\n self.__size=(sz)\n else\n sep_size = separator_sz\n sz = my_size\n return nil if sep_size > sz\n sep_size = -sep_size\n while sep_size < 0\n return nil if sep.__at(sep_size) != self.__at(sep_size)\n sep_size += 1\n end\n self.__size=(sz - separator_sz)\n end\n end\n self\n end", "def parse_csv(file)\n\t\tdata = []\n\t\t# Break open CSV and go through rows\n\t\tbegin\n\t\t\tdata = CSV.read(file, :headers => true,:skip_blanks => true,:header_converters => :symbol, :encoding => 'UTF-8')\n\t\trescue\n\t\t\t# Convert to UTF-8 if necessary\n\t\t\tdata = CSV.read(file, :headers => true,:skip_blanks => true,:header_converters => :symbol, :encoding => 'Windows-1252:UTF-8')\n\t\tend\n\t\tdata\n\tend", "def upload(file_name_or_io = nil, **args, &block)\n if tabular_input_type == :text\n args[:encoding] = 'UTF-8'\n args[:encode_cleaner] = :printable\n args[:encode_replace] = ''\n end\n\n # If an input header is not required, then we don't extract it'\n return super(file_name_or_io, stream_mode: tabular_input_mode, **args, &block) unless tabular_input.header?\n\n # If the header is already set then it is not expected in the file\n if tabular_input_header.present?\n tabular_input_cleanse_header\n return super(file_name_or_io, stream_mode: tabular_input_mode, **args, &block)\n end\n\n case tabular_input_mode\n when :line\n parse_header = -> (line) do\n tabular_input.parse_header(line)\n tabular_input_cleanse_header\n self.tabular_input_header = tabular_input.header.columns\n end\n super(file_name_or_io, on_first: parse_header, stream_mode: tabular_input_mode, **args, &block)\n when :row\n set_header = -> (row) do\n tabular_input.header.columns = row\n tabular_input_cleanse_header\n self.tabular_input_header = tabular_input.header.columns\n end\n super(file_name_or_io, on_first: set_header, stream_mode: tabular_input_mode, **args, &block)\n when :record\n super(file_name_or_io, stream_mode: tabular_input_mode, **args, &block)\n else\n raise(ArgumentError, \"Invalid tabular_input_mode: #{stream_mode.inspect}\")\n end\n end", "def parse_header(line)\n if (match = line.match(/^(.+?):\\s*(.+)#{@nl}$/))\n key = match[1].downcase\n set_header_special_values(key, match[2])\n parse_normal_header(line, key, match[1], match[2])\n elsif (match = line.match(/^HTTP\\/([\\d\\.]+)\\s+(\\d+)\\s+(.+)$/))\n @response.code = match[2]\n @response.http_version = match[1]\n @http2.on_content_call(@args, line)\n else\n raise \"Could not understand header string: '#{line}'.\"\n end\n end", "def split_header_value(str)\n str.scan(/((?:\"(?:\\\\.|[^\"])+?\"|[^\",]+)+)\n (?:,\\s*|\\Z)/xn).collect{|v| v[0] }\nend", "def fill_hash_record_from_line(column_names, headers, line)\n hash_record = {}\n fields = line.split(@sep)\n\n fields.each_with_index do |field, field_id|\n hash_record[headers[field_id]] = field if column_names.include?(headers[field_id])\n end\n\n hash_record\n end", "def parse_body(line)\n return :break if @length&.zero?\n\n if @transfer_encoding == \"chunked\"\n parse_body_chunked(line)\n else\n puts \"Http2: Adding #{line.to_s.bytesize} to the body.\" if @debug\n @response.body << line\n @http2.on_content_call(@args, line)\n return :break if @response.content_length && @response.body.length >= @response.content_length # rubocop:disable Style/RedundantReturn\n end\n end", "def readTSVline(l, sep=nil)\n\n sep = detectSeperator if sep.nil?\n\n #row = CSV.parse_line(l, :col_sep => seperator).collect{|x|\n row = l.split(sep).collect{|x|\n if ! x.nil?\n x.strip;\n end\n }\n\n ### Pick specify elements of that table\n #name, id, lastVisitDate, lastAttendedDate, meetupsAttended, profileURL, lastDonationAmount, lastDonationDate = readTSVline(seperator)\n [0, 3, 6, 7, 12, 18, 19, 21].map {|i| row[i]}\nend" ]
[ "0.6565621", "0.64743674", "0.585044", "0.57938266", "0.57859784", "0.5755265", "0.5731677", "0.5705156", "0.56596583", "0.559933", "0.5564447", "0.54969245", "0.5446638", "0.5443309", "0.5440782", "0.54093933", "0.53580254", "0.53291667", "0.53099924", "0.52911675", "0.52001786", "0.516806", "0.5167461", "0.51603836", "0.51295567", "0.5123804", "0.5112582", "0.5101164", "0.50909555", "0.5087048", "0.5078313", "0.5065437", "0.50588363", "0.5040423", "0.5021501", "0.50200474", "0.50151557", "0.49827534", "0.49673638", "0.4942201", "0.49384868", "0.49190992", "0.49075943", "0.49033162", "0.48970625", "0.486873", "0.4860094", "0.48582897", "0.48554438", "0.48522183", "0.4850598", "0.48413664", "0.4827203", "0.48266497", "0.48259014", "0.48248205", "0.48184597", "0.4812312", "0.48119217", "0.48089382", "0.48072362", "0.4797588", "0.47888082", "0.47823274", "0.4772657", "0.47719023", "0.4768073", "0.47602335", "0.47499144", "0.4747066", "0.47406948", "0.47401038", "0.47401035", "0.47338173", "0.4688198", "0.4686708", "0.46855602", "0.46850786", "0.46829623", "0.4681617", "0.46767786", "0.4676013", "0.46715084", "0.46704516", "0.46625546", "0.46625546", "0.4654706", "0.4646601", "0.4641918", "0.46413937", "0.46264413", "0.46215516", "0.4620925", "0.46097222", "0.460666", "0.46032113", "0.4603171", "0.4586149", "0.4580712", "0.45791098" ]
0.7201294
0
acts as a roadblock to limit processing when iterating over all k/v pairs of a CSVhash:
def only_or_except_limit_execution(options, option_name, key) if options[option_name].is_a?(Hash) if options[option_name].has_key?(:except) return true if Array(options[option_name][:except]).include?(key) elsif options[option_name].has_key?(:only) return true unless Array(options[option_name][:only]).include?(key) end end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _each\n delete_harmful!\n convert_eol_to_unix!\n transliterate_whole_file_to_utf8!\n skip_rows!\n\n Engine.new(local_copy.encoded_io, csv_options).each do |row|\n\n some_value_present = false\n\n if not headers\n\n # represent the row as an array\n array = row.map do |v|\n v = v.to_s\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n v\n end\n if some_value_present or keep_blank_rows\n yield array\n end\n\n else\n\n # represent the row as a hash\n hash = ::ActiveSupport::OrderedHash.new\n row.each do |k, v|\n next unless k.present?\n v = v.to_s\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n hash[k] = v\n end\n if some_value_present or keep_blank_rows\n yield hash\n end\n\n end\n end\n ensure\n local_copy.cleanup\n end", "def _each\n Engine.new(local_copy.encoded_io, csv_options.merge(headers: headers)).each do |row|\n\n some_value_present = false\n\n if not headers\n\n # represent the row as an array\n array = row.map do |v|\n v = RemoteTable.normalize_whitespace v\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n v\n end\n if some_value_present or keep_blank_rows\n yield array\n end\n\n else\n\n # represent the row as a hash\n hash = ::ActiveSupport::OrderedHash.new\n row.each do |k, v|\n v = RemoteTable.normalize_whitespace v\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n hash[k] = v\n end\n if some_value_present or keep_blank_rows\n yield hash\n end\n\n end\n end\n ensure\n local_copy.cleanup\n end", "def each\n CSV.foreach(@file, @options) do |row|\n yield row.to_hash\n end\n end", "def split!\n return @keys if instance_variable_defined?('@keys')\n ranges = row_chunker.ranges_for(input_csv)\n @keys = ranges.map.with_index do |range, index|\n chunk_key = key_from_index(index, ranges.count)\n contents = csv_from_range(range)\n BulkProcessor.config.file_class.new(chunk_key).write(contents)\n chunk_key\n end\n end", "def each_hash\n if block_given?\n while row = next_hash\n yield row\n end\n else\n self.enum_for(:each_hash)\n end\n end", "def each_key_unsorted\n @records.each {|k,v| yield k}\n end", "def compute_csv_data\n row_count = 0\n csv_row_number = 0\n csv_data = []\n CSV.foreach(self.file.path, headers: true) do |row|\n # Transform row to hash\n row = row.to_hash\n # Normalize it\n row = normalize_row(row)\n # Increment row number\n csv_row_number += 1\n\n # PRECOMPUTE\n row = precompute_row(row, csv_row_number) # row[:csv_row_number] = csv_row_number AND initialize errors and array fields as arrays\n\n # store the valid_row result\n valid_row = valid_row?(row)\n\n # tranform raw row hash into a intermediate (more concise) information OR put in rejected data\n if valid_row\n csv_data << compute_row(row)\n else\n @rejected_user_data << row\n end\n if !self.limit.zero? && valid_row\n row_count += 1\n if row_count >= self.limit\n break\n end\n end\n end\n # Save original CSV data for post-processing report\n @original_csv_data = csv_data\n end", "def each_row\n mappings_csv.each do |row|\n info = CSVMappingInfo.new(row)\n yield(info) if info.valid?\n end\n end", "def parse(args={})\n csv_args = {:skip_blanks=>true,:col_sep=>\",\"}\n csv_args[:col_sep] = args[:col_sep] if args[:col_sep]\n args[:value_filter] ||= Csv2sql.method :default_value_filter\n i = 0\n CSV.foreach(@filename,csv_args) do |row|\n values = row\n #values_filter is for whole row\n #value_filter is for single value\n values = args[:values_filter].call(row, i) if args[:values_filter]\n if values\n if args[:value_filter]\n j = -1\n values = row.map do |value|\n j += 1\n args[:value_filter].call(value,i,j)\n end\n end\n yield values if values\n end\n i += 1\n end\n end", "def import_base\n CSV.foreach(@file.path, encoding: detect_encoding, headers: true) do |row|\n next if row.blank?\n yield ActiveSupport::HashWithIndifferentAccess.new(row)\n end\n end", "def each_key_val(io, &block)\n return to_enum(__method__, io) unless block\n each_line(io) do |line|\n line.chomp!\n (key, val) = line.split('=',2)\n block.call( [key, (val=='' ? nil : val)] )\n end\n end", "def load_data(csv)\n @hash.each do |sentence, count|\n csv << [sentence, count]\n end\n end", "def process_csv_file(filename, no_of_unique,delimiter)\n @arr_unique = Array.new{hash.new}\n @arr_details = Array.new(@no_of_columns){{\"int\" => 0, \"float\" => 0, \"date\" => 0, \"datetime\" => 0, \"string\" => 0, \"max_value\" => 0, \"min_value\" => 0}}\n total_chunks = SmarterCSV.process(filename, {:col_sep => delimiter, :chunk_size => 200, :remove_empty_values => false, :remove_zero_values => false}) do |chunk|\n for i in [email protected]\n arr = chunk.map{|x| x[@headers[i].to_sym]}\n if(@arr_unique[i].to_a.empty?)\n @arr_unique[i] = arr.uniq\n elsif(@arr_unique[i].size < no_of_unique.to_i+2)\n @arr_unique[i] |= arr.uniq\n elsif (arr.uniq.include?(nil) && !@arr_unique[i].include?(nil))\n @arr_unique[i].push(nil)\n elsif (arr.uniq.include?(\"NULL\") && !@arr_unique[i].include?(\"NULL\"))\n @arr_unique[i].push(\"NULL\")\n elsif (arr.uniq.include?(\"\\N\") && !@arr_unique[i].include?(\"\\N\"))\n @arr_unique[i].push(\"\\N\") \n elsif (arr.uniq.include?(\"\") && !@arr_unique[i].include?(\"\"))\n @arr_unique[i].push(\"\")\n elsif (arr.uniq.include?(\" \") && !@arr_unique[i].include?(\" \"))\n @arr_unique[i].push(\" \")\n end \n arr.each do |field|\n field_type = get_datatype(field)\n count = @arr_details[i][field_type]\n @arr_details[i][field_type] = count+1\n if(field != nil)\n begin\n if(@header_datatype[i] == \"int\" || @header_datatype[i] == \"float\") \n if(@arr_details[i][\"max_value\"] < field)\n @arr_details[i][\"max_value\"] = field\n end\n if(@arr_details[i][\"min_value\"] > field || @arr_details[i][\"min_value\"] == 0)\n @arr_details[i][\"min_value\"] = field\n end\n else\n if(@arr_details[i][\"max_value\"] < field.to_s.length)\n @arr_details[i][\"max_value\"] = field.to_s.length\n end\n if(@arr_details[i][\"min_value\"] > field.to_s.length || @arr_details[i][\"min_value\"] == 0)\n @arr_details[i][\"min_value\"] = field.to_s.length\n end\n end\n rescue Exception => e\n end\n end\n end\n end\n end\n end", "def make_testdata_reworked_csv_file\n create_column_headers_index_hash \n create_row_headers_index_hash \n clear_testdata_reworked_file\n CSV.open('testdata_reworked.csv', \"wb\") do |csv|\n CSV.foreach('testdata.csv', {headers: true}) do |row| \n row[0] = @column_hash.key(row[0].to_i)\n row[1] = @row_hash.key(row[1].to_i)\n csv << row\n end\n end\nend", "def each(&block)\n hash.each(&block)\n end", "def each_pair(&_block)\n path = path_to('/')\n\n case result = http_get(path, query:'recurse')\n when String\n result = json_parse(result)\n when 404\n return # no keys!\n end\n\n unless result.is_a?(Array)\n raise CMDB::Error.new(\"Consul 'GET #{path}': expected Array, got #{all.class.name}\")\n end\n\n result.each do |item|\n key = slash_to_dot(item['Key'])\n key.sub(@useless,'')\n next unless item['Value']\n value = json_parse(Base64.decode64(item['Value']))\n validate!(key, value)\n yield(key, value)\n end\n\n result.size\n end", "def index_source\n @lines = {}\n @index = Hash.new{ |h, k| h[k] = [] }\n if @field_names\n index_fields\n include_filter = convert_filter(@include, @field_names)\n exclude_filter = convert_filter(@exclude, @field_names)\n end\n @line_count = 0\n @skip_count = 0\n @dup_count = 0\n line_num = 0\n @data.each do |row|\n line_num += 1\n next if line_num == 1 && @field_names && @ignore_header\n unless @field_names\n if row.class.name == 'CSV::Row'\n @field_names = row.headers.each_with_index.map{ |f, i| f || i.to_s }\n else\n @field_names = row.each_with_index.map{ |f, i| f || i.to_s }\n end\n index_fields\n include_filter = convert_filter(@include, @field_names)\n exclude_filter = convert_filter(@exclude, @field_names)\n next\n end\n field_vals = row\n line = {}\n filter = false\n @field_names.each_with_index do |field, i|\n val = field_vals[i]\n val = val.to_s.strip if val && @trim_whitespace\n line[field] = val\n if include_filter && f = include_filter[i]\n filter = !check_filter(f, line[field])\n end\n if exclude_filter && f = exclude_filter[i]\n filter = check_filter(f, line[field])\n end\n break if filter\n end\n if filter\n @skip_count += 1\n next\n end\n key_values = @key_field_indexes.map{ |kf| @case_sensitive ?\n field_vals[kf].to_s :\n field_vals[kf].to_s.upcase }\n key = key_values.join('~')\n parent_key = key_values[0...(@parent_fields.length)].join('~')\n if @lines[key]\n @warnings << \"Duplicate key '#{key}' encountered at line #{line_num}\"\n @dup_count += 1\n key += \"[#{@dup_count}]\"\n end\n @index[parent_key] << key\n @lines[key] = line\n @line_count += 1\n end\n end", "def each_key(&block); end", "def import_hash hashtree\r\n\t\tLogger.send(\"warn\",\"Start CSV(hash) import\")\r\n\t\t@result[:description] << \"Start CSV(hash) import\"\r\n\t\thashtree.each { |b|\r\n\t\t\timport_bien b.split(\"!#\")\r\n\t\t}\r\n\r\n\t\tLogger.send(\"warn\",\"End CSV import\")\r\n\t\t@result[:description] << \"End CSV import\"\r\n\t\treturn true\r\n\tend", "def import_hash hashtree\r\n\t\tLogger.send(\"warn\",\"Start CSV(hash) import\")\r\n\t\t@result[:description] << \"Start CSV(hash) import\"\r\n\t\thashtree.each { |b|\r\n\t\t\timport_bien b.split(\"!#\")\r\n\t\t}\r\n\r\n\t\tLogger.send(\"warn\",\"End CSV import\")\r\n\t\t@result[:description] << \"End CSV import\"\r\n\t\treturn true\r\n\tend", "def read_in_ownership(csv_file_name, temp_hash = Hash.new)\n\t CSV.foreach(csv_file_name, :headers => true) do |row|\n\t\t song_id, owner_data = row[0], row[1]\n\t \t unless (song_id =~ /#/)\n\t \t \t temp_hash[song_id] = owner_data\n\t \t end\n end\n temp_hash\n\tend", "def read_in_ownership(csv_file_name, temp_hash = Hash.new)\n\t CSV.foreach(csv_file_name, :headers => true) do |row|\n\t\t song_id, owner_data = row[0], row[1]\n\t \t unless (song_id =~ /#/)\n\t \t \t temp_hash[song_id] = owner_data\n\t \t end\n end\n temp_hash\n\tend", "def each_pair(&_block)\n @data.each_pair do |key, value|\n validate!(key, value)\n yield(key, value)\n end\n end", "def each(&block)\n @hash.each(&block)\n end", "def process_csv(file)\n data = CSV.read(file, {encoding: \"UTF-8\", headers: true, header_converters: :symbol, converters: :all})\n hashed_data = data.map { |d| d.to_hash } \n \n puts \"CSV Loaded...\"\n\n return hashed_data\n end", "def each_row(batch = ETL::Batch.new)\n log.debug(\"Reading from CSV input file #{file_name}\")\n @rows_processed = 0\n ::CSV.foreach(file_name, csv_options) do |row_in|\n # Row that maps name => value\n row = {}\n\n # If we weren't given headers then we use what's in the file\n if headers.nil?\n # We have a hash - OK we'll use it\n if row_in.respond_to?(:to_hash)\n row = row_in.to_hash\n # We have an array - use numbers as the keys\n elsif row_in.respond_to?(:to_a)\n ary = row_in.to_a\n ary.each_index do |i|\n row[i] = ary[i]\n end\n # Error out since we don't know how to process this\n else\n raise ETL::InputError, \"Input row class #{row_in.class} needs to be a hash or array\"\n end\n # if we were given the headers to use then we just need to grab the\n # values out of whatever we have\n else\n values = row_in.kind_of?(::CSV::Row) ? row_in.fields : row_in.to_a\n\n if headers.length != values.length\n raise ETL::InputError, \"Must have the same number of headers #{headers.length} \" + \n \"and values #{values.length}\"\n end\n\n # match up headers and values\n (0...headers.length).each do |i|\n row[headers[i]] = values[i]\n end\n end\n\n # now we apply our header map if we have one\n @headers_map.each do |name, new_name|\n if row.has_key?(name)\n # remap old name to new name\n row[new_name] = row[name]\n row.delete(name)\n else\n raise ETL::InputError, \"Input row does not have expected column '#{name}'\"\n end\n end\n\n transform_row!(row)\n yield row\n @rows_processed += 1\n end\n end", "def each\n return if empty?\n\n @record_index = -1\n with_record_stream do |stream|\n mapper = org.codehaus.jackson.map.ObjectMapper.new\n parser = mapper.getJsonFactory.createJsonParser(stream)\n\n while parser.nextToken\n @record_index += 1\n\n if @deleted_entries.get(@record_index)\n # Skip this entry\n parser.skipChildren\n else\n result = parser.readValueAs(java.util.Map.java_class)\n yield result\n end\n\n skip_comma(parser)\n end\n\n unless @count\n @count = @record_index + 1\n end\n end\n end", "def prep_hash_for_csv(data_hash)\n\tbig_array = []\n\tdata_hash.each do |key, ads|\n\t\tad_array = [].push(key)\n\t\tads.each do |ad|\n\t\t\tad_string = ad[0] + \"\\r\" + ad[1] + \"\\r\" + ad[2]\n\t\t\tad_array.push(ad_string)\n\t\tend\n\t\tbig_array.push(ad_array)\n\tend\n\toutput_array = big_array.safe_transpose\n\treturn output_array\nend", "def clean_og(canvas_ex,hash)\n\tCSV.foreach(canvas_ex) do |row|\t\n\t\tif row[2] != nil \n\t\t\tif row[2].include? \"F\" \n\t\t\t\t#assign everyone a 0\n\t\t\t\thash[row[2]] = 0\n\t\t\tend\t\t\t\n\t\tend\n\tend\n\t\n\treturn hash\nend", "def each\n pos = hash_size\n hoff0 = @hashes[0]\n while pos < hoff0\n key, value = *read_entry(pos)\n yield(key,value)\n pos += key.length + value.length + hashref_size\n end\n end", "def process_hash_row(hsh)\n if @headers.any?\n keys_or_values = hsh.values\n @row_id = hsh[:row_id]\n else\n keys_or_values = hsh.keys.map(&:to_s)\n end\n\n file_line = keys_or_values.join(',')\n validated_line = utf_filter(check_utf(file_line))\n res = line_parse(validated_line)\n res\n end", "def process_csv\n @file = @file.tempfile\n CSV.foreach(@file, headers: false) { |row| process_item(row[0].to_i) }\n end", "def each( &block ) # :yield: member, value\n\t\t\[email protected]( &block )\n\t\tend", "def _process_hashed(hashed)\n hashed.each_pair do |key, value|\n if value.equal?(Utils::DeletedMarker)\n hashed.delete(key)\n elsif Utils.hashable?(value)\n _process_hashed(value.to_hash).freeze\n end\n end\n\n hashed\n end", "def each(&blk) data.each{ |k,v| blk.call(k,v) } ; end", "def gather_from_csv\n items = {}\n FasterCSV.foreach(@plucked_out_items_csv, FCSV_OPTS){|line|\n STDERR.puts \"ERROR: RMID not found for item_id #{line[:item_id].chomp} in CSV-file #{@plucked_out_items_csv}\" unless line[:rmid]\n items[ line[:item_id].chomp ] = {\n :handle => line[:item_hdl].chomp,\n :rmid => line[:rmid].chomp,\n #:collection_handle => line[:col_owner_hdl].chomp,\n }\n }\n items\n end", "def each_pair(&block)\n @hash.each_pair(&block)\n end", "def scanCsv(csvFile)\n CSV.foreach(csvFile){|row|\n if(@colList.nil?) then\n scanCsvHeader(row) ;\n else\n scanCsvEntry(row) ;\n end\n }\n end", "def print_hash_to_csv(hash, csv_handler)\n if hash.class == Hash\n hash.each do |key, value|\n csv_handler << [key]\n print_hash_to_csv(value, csv_handler)\n end\n else\n csv_handler << [hash]\n end\n end", "def hvals(key); end", "def hvals(key); end", "def process_csv(path)\n res = {}\n CSV.foreach(path) do |row|\n (tag_str, _, dest_str, val_str) = row\n next unless $tags.has_key? tag_str\n tag, dest, val = $tags[tag_str], dest_str.to_i, val_str.to_i\n res[dest] = {} unless res.has_key?(dest)\n res[dest][tag] = 0 unless res[dest].has_key?(tag)\n res[dest][tag] += val\n end\n res\nend", "def zscan_each(key, **options, &block); end", "def process(report)\n puts \"Code to process csv goes here for #{report}\"\n\n CSV.foreach(report, headers: true) do |row|\n# **** actions here are operated on every row in the csv ****\n puts row['Site Name']\n end\nend", "def csvAccountDataParsing\n\taccounts = {}\n\n\tCSV.foreach(\"accounts.csv\", {headers: true, return_headers: false}) do |row|\n\t\taccountName = row[\"Account\"].chomp.capitalize\n\t\taccounts = set_initial_values(accounts, accountName, row)\n\t\taccounts[accountName].addData(row)\n\tend\n\n\taccounts.each_value do |value|\n\t\tvalue.calculateFinalAmounts\n\tend\n\n\treturn accounts\nend", "def each\n\t\t\t@csv_contents.each { |csv_row| yield CsvRow.new(csv_row, @headers) } \n\t\t\tnil\n\t\tend", "def process_coupom\n @orders_csv.each do |oc|\n coupom = @coupons[oc.coupom_id]\n @orders_hash[oc.id].compute(coupom) if coupom && coupom.valid?\n end\n end", "def each\n return unless @result\n\n @result.each(as: :hash, symbolize_keys: true) do |row|\n next unless row # This sometimes happens when streaming results...\n row = Hash[row.map { |k, v| [k, v.to_s] }] if @type_translation == :string\n yield row\n end\n end", "def each(&block)\n @hash.each {|k,v| block.call k,v }\n end", "def write_to_csv(data_hash)\n\tprint(\"Please enter the name of the csv file to be written: \")\n\t#example: BRCA1_Data\n\tfile = gets.strip.to_s\n\tCSV.open(\"#{file}.csv\", 'wb') do |csv|\n\t\tfor key in data_hash\n\t\tcsv << [key[0], key[1]]\n\t\tend\n\tend\n\tputs \"done!\"\nend", "def get_references\n references_hash = {}\n FasterCSV.foreach(\"#{Source_path}/TbReference.csv\", :quote_char => '\"', :col_sep =>',', :row_sep =>:auto) do |row|\n references_hash[row[0]] = row[6]\n end\n return references_hash\nend", "def each\n @internal_hash.each { |k,_| yield k }\n end", "def create_csv_for_LLR(csv_data)\n\n csv_string = CSV.open(\"#{$basefile}LLR.csv\", \"wb\") do |csv|\n\n csv << csv_data.first.keys\n csv_data.each do |hash|\n csv << hash.values\n end\n end\n end", "def iteration_hash(data_hash = self.data, &block)\n yield data_hash\n cid = data_hash[:__cid__]\n code = Codes[cid]\n code.in.each do |input|\n next if !data_hash[input].is_a?(Hash)\n # -- recursive -- #\n iteration_hash(data_hash[input], &block)\n # -- recursive -- #\n end\n end", "def load_csv()\n f = File.read(INPUT_CSV)\n CSV.parse(f, :headers => true, :col_sep => \",\").map do |row|\n as_hash = row.to_hash\n\n geom = { \n type: \"Point\",\n coordinates: as_hash['coordinates'].split.map { |num| num.to_f }\n }\n\n as_hash.delete('coordinates')\n as_hash['geom'] = geom\n\n if (as_hash['pic_url'].strip.length < 1)\n as_hash.delete('pic_url')\n end\n\n if (as_hash['place_image'].strip.length < 1)\n as_hash.delete('place_image')\n end\n\n as_hash\n end\nend", "def each\n @keydir.each do |key, index|\n entry = @keydir.data_files[index.file_id][index.value_pos, index.value_sz]\n yield [entry.key, entry.value]\n end\n end", "def get_data_by_filters(filters, csv)\r\n\r\n filters_a = filters.to_s.split(',')\r\n csv_tmp = Array.new\r\n csv_tmp = csv\r\n\r\n for i in 0..(filters_a.size - 1)\r\n\r\n filter = filters_a[i].to_s.downcase.strip\r\n filter_data = get_filter_data filter\r\n #The array is cleaned\r\n data_filtered = Array.new\r\n\r\n csv_tmp.each_with_index do |(record), index|\r\n\r\n #Add csv headers\r\n if index == 0\r\n #data_filtered.push(record)\r\n end\r\n\r\n case filter_data[:operador].to_s.strip\r\n when '='\r\n if record[filter_data[:key].to_s.to_sym] == filter_data[:value].to_s\r\n data_filtered.push(record)\r\n end\r\n when '!='\r\n if record[filter_data[:key].to_s.to_sym] != filter_data[:value].to_s\r\n data_filtered.push(record)\r\n end\r\n when '>'\r\n if record[filter_data[:key].to_s.to_sym].to_s.to_f > filter_data[:value].to_s.to_f\r\n data_filtered.push(record)\r\n end\r\n when '>='\r\n if record[filter_data[:key].to_s.to_sym].to_s.to_f >= filter_data[:value].to_s.to_f\r\n data_filtered.push(record)\r\n end\r\n when '<'\r\n if record[filter_data[:key].to_s.to_sym].to_s.to_f < filter_data[:value].to_s.to_f\r\n data_filtered.push(record)\r\n end\r\n when '<='\r\n if record[filter_data[:key].to_s.to_sym].to_s.to_f <= filter_data[:value].to_s.to_f\r\n data_filtered.push(record)\r\n end\r\n when 'contains'\r\n if record[filter_data[:key].to_s.to_sym].to_s.downcase.include? filter_data[:value].to_s.downcase\r\n data_filtered.push(record)\r\n end\r\n end\r\n\r\n end\r\n\r\n #The data of the 1st filter is added to 'csv_tmp' to reduce the filtered records\r\n csv_tmp = data_filtered\r\n\r\n end\r\n\r\n return data_filtered\r\n\r\nend", "def reprocess_csv(file)\n raw = open(file).read.force_encoding(\"UTF-8\")\n csv = CSV.parse(raw, headers: true, header_converters: :symbol)\n csv.each do |row|\n data = row.to_hash.each { |k, v| v = v.to_s.gsub(/[[:space:]]+/, ' ').strip }\n data[:area_id] = data[:area].downcase\n data[:gender] = data[:gender].downcase\n data[:term] = '2013'\n %i(num).each { |i| data.delete i }\n ScraperWiki.save_sqlite([:name, :name, :term], data)\n end\nend", "def each(&block)\n @key_users.each_value(&block)\n end", "def each_slice(&block)\n @csv.each_slice(1000) do |slice|\n yield(slice) if block_given?\n end\n end", "def build_index\n say \"Building index...\"\n\n # Get size in bytes, so we know when we've hit the end.\n file_size = File.size(@filename)\n CSV.open(@filename, :encoding => 'utf-8', :headers => true) do |csvin|\n\n # Get byte offset\n line_start = csvin.tell\n\n # Then read line\n count = 0\n while((line_start = csvin.tell) < file_size) do\n\n # Load the line\n line = csvin.shift()\n\n # Load the key up to the key size only\n key = get_minimal_key(line)\n \n # Save the file offset\n # TODO: ensure random access of the cache is possible\n $stderr.puts \"WARNING: Key at byte #{line_start} of #{@filename} collides with key at byte #{@cache[key]}.\" if @cache[key]\n @cache[key] = line_start\n\n print \"\\rLine: #{count+=1} \"\n end\n end\n print \"\\n\"\n \n say \"Finished building index\"\n end", "def collect_values(name_hash)\n name_hash.collect do |key, value|\n value \n end\nend", "def read_csv(csv_file, data)\n logger.info \"Reading #{data.type} data from '#{csv_file} date column = #{@date_column} data starts at col #{@data_start_column} skipping #{@header_rows} header rows\"\n lines = File.readlines(csv_file)\n (@header_rows...lines.length).each do |i|\n reading = lines[i].split(',')\n begin\n date = Date.parse(reading[@date_column])\n rowdata = reading[@data_start_column, @data_start_column + 47].map(&:to_f)\n data.add(date, rowdata)\n rescue StandardError => e\n logger.warn e.message\n logger.warn e.backtrace.join(\"\\n\")\n logger.warn \"Unable to read data on line #{i} of file #{csv_file} date value #{reading[@date_column]}\"\n end\n end\n logger.info \"Read hash #{data.length} rows\"\n end", "def players(team)\n field= []\n CSV.foreach(\"teams.csv\", headers:true,header_converters: :symbol) do |row|\n if row[:team] == team\n field << row.to_hash\n end\n end\n field\nend", "def initialize(csvfile)\n csv_data = CSV.read(csvfile)\n @headers = csv_data.shift.map {|i| i.to_s }\n string_data = csv_data.map {|row| row.map {|cell| cell.to_s } }\n @array_of_hashes = string_data.map {|row|\n tmparray = @headers.zip(row)\n tmparray.each_index {|i|\n if i > 0 && (tmparray[i-1][0] == tmparray[i][0]) # same header\n tmparray[i][1] = \"#{tmparray[i-1][1]}\\n#{tmparray[i][1]}\"\n elsif i > 1 && (tmparray[i-2][0] == tmparray[i][0]) # same header\n tmparray[i][1] = \"#{tmparray[i-2][1]}\\n#{tmparray[i][1]}\"\n end\n }\n tmparray << [\"priority\", \"minor\"] # since there's no eqvt for priority in pivotal\n Hash[*tmparray.flatten] \n }\n\n @pivotal_to_bitbucket_attribute_map = { \n \"Story\" => \"title\",\n \"Story Type\" => \"kind\",\n \"Owned By\" => \"responsible\",\n \"Description\" => \"content\",\n \"Comment\" => \"content\",\n \"Task\" => \"content\",\n \"Current State\" => \"status\",\n }\n\n @pivotal_to_bitucket_value_map = {\n # story types\n \"chore\" => \"task\",\n \"feature\" => \"enhancement\",\n \"bug\" => \"bug\",\n \"release\" => \"proposal\",\n\n # status\n \"accepted\" => \"resolved\",\n \"started\" => \"open\",\n \"unscheduled\" => \"new\",\n\n # user names\n \"Anirudh Ramachandran\" => \"oakenshield\",\n }\n\n @array_of_hashes.each_index do |i|\n # puts @array_of_hashes[i].inspect\n @array_of_hashes[i].dup.each do |k,v|\n unless @pivotal_to_bitbucket_attribute_map[k].nil? \n next if v.nil?\n\n @array_of_hashes[i][@pivotal_to_bitbucket_attribute_map[k]] = \"\" if \n @array_of_hashes[i][@pivotal_to_bitbucket_attribute_map[k]].nil?\n\n val = unless @pivotal_to_bitucket_value_map[v].nil?\n @pivotal_to_bitucket_value_map[v]\n else\n v\n end\n\n #puts \"adding new k/v #{@pivotal_to_bitbucket_attribute_map[k]} => #{val}\"\n @array_of_hashes[i][@pivotal_to_bitbucket_attribute_map[k]] << \"#{val}\"\n end\n end\n end\n end", "def iterate_through_keys\n upcased_cities = add_a_key_value_pair.map {|key, value| key.upcase}\n upcased_cities.each {|city| puts city}\nend", "def each_column(cassandra, cf, key, opts={})\n start_column = opts[:start] || ''\n prev_column = nil\n while start_column != prev_column\n start_column = prev_column\n adjusted_opts = opts.merge(:start => start_column || opts[:start])\n chunk = cassandra.get(cf, key, adjusted_opts)\n chunk.each do |column, value|\n #raise \"hell\" if (column <=> start_column) < 0\n next if start_column == column\n yield column, value\n prev_column = column\n end\n end\n true\n end", "def recommendation_csv_inputs csv_path\n valid_inputs = []\n\n CSV.foreach(csv_path, {headers: true, header_converters: :symbol}) do |row|\n row = row.to_h\n valid_inputs << row if valid_recommendation_hash?(row)\n end\n\n valid_inputs\n\n rescue => e\n valid_inputs\n end", "def each\n rewind\n return self.enum_for(:each) unless block_given?\n csv.each do |row|\n next unless out = convert_row(row)\n yield(out)\n end\n end", "def each_value(&block)\n self.keys.each{|k| block.call(self[k])}\n self\n end", "def yield_hash_rows(res, cols)\n res.ntuples.times do |recnum|\n converted_rec = {}\n cols.each do |fieldnum, type_proc, fieldsym|\n value = res.getvalue(recnum, fieldnum)\n converted_rec[fieldsym] = (value && type_proc) ? type_proc.call(value) : value\n end\n yield converted_rec\n end\n end", "def yield_hash_rows(res, cols)\n res.ntuples.times do |recnum|\n converted_rec = {}\n cols.each do |fieldnum, type_proc, fieldsym|\n value = res.getvalue(recnum, fieldnum)\n converted_rec[fieldsym] = (value && type_proc) ? type_proc.call(value) : value\n end\n yield converted_rec\n end\n end", "def generate_csv_data\n\n @ethereum_addr_case_data_map.each do |_, data|\n kyc_confirm_date = data[:kyc_confirm_date]\n @case_data_by_date_map[kyc_confirm_date] ||= []\n\n @case_data_by_date_map[kyc_confirm_date] << get_csv_row_element(data)\n end\n\n end", "def load_questions\n CSV.foreach(\"questions.csv\", { :col_sep => ' | ' }) do |row|\n key = row[0]\n value = row[1]\n RESPONSES[key] = value\n end\n puts \"Questions and responses loaded!\"\n puts \"\"\nend", "def each\r\n\t record = @head\r\n\t while record.next && record.next != @tail\r\n\t\t record = record.next\n\t\t record.values.each{|value| yield record.key, value }\r\n\t end\r\n end", "def each_value_for_hash(params, &block)\n case params\n when Hash then params.each { |_k, v| each_value_for_hash(v, &block) }\n when Array then params.each { |v| each_value_for_hash(v, &block) }\n else\n yield params\n end\n end", "def process_CSV_file(file, _total_lines = 0, charset = 'bom|utf-8')\n start_time = Time.now.to_i # setting up time keeping\n ActiveRecord::Base.transaction do\n SmarterCSV.process(file, chunk_size: 10, verbose: true, file_encoding: charset.to_s) do |file_chunk|\n file_chunk.each do |record_row|\n sanitized_row = sanitize_row(record_row)\n process_record_row(sanitized_row, {})\n @counter << sanitized_row # appends in latest record to allow error to report where import failed\n ### CallingActorInUpdater feeding it the this (the current) actor.\n @updater_actor.run(Celluloid::Actor.current) unless @updater_actor.nil?\n @counter\n end\n end\n # finishing up time keeping and reporting:\n total_count = @counter.size\n end_time = Time.now.to_i\n total_count_hash = { total_lines: total_count, time: ((end_time - start_time) / 60).round(2) }\n puts \"\\033[32m#{total_count_hash}\\033[0m\\n\" # green\n @exit_status = 0\n @result = total_count_hash\n end\n ensure\n # on CSV::MalformedCSVError # something gets said\n @updater_actor.terminate unless @updater_actor.nil?\n end", "def each_match(hash)\n line[:type, :all].count.times do |i|\n next unless hash.all? { |k, v| line[k, :all][i] == v }\n yield(\n :type => line[:type, :all][i],\n :ssn => line[:ssn, :all][i],\n :ein => line[:ein, :all][i],\n :amount => line[:amount, :all][i]\n )\n end\n end", "def get_city_names(somehash)\n somehash.each { |k, _v| puts k }\nend", "def load_places_CSV()\n puts \"loading CSV\"\n $places = {}\n File.open('places.csv').each do |line|\n place = line.split(\"\\t\") \n plat,plon,name = place\n if plat.to_f>14.04\n square = get_square(plat.to_f, plon.to_f)\n if $places[square].nil? \n p square\n $places[square] = []\n end\n $places[square] << place \n end\n end\n puts $places.size.to_s + \" places loaded\"\nend", "def prod_to_hash(csv_name)\n\tprod_array = CSV.read(csv_name)\n\tprod_array.each_with_index do |line, index|\n\t\tnext if line[0] == \"Opportunity ID\" \n\t\tbreak if line[0] == nil\n\t\t@current_opp_list[line[0]] = Opportunity.new(line[@prods_opp], line[@prods_prod], line[@prods_access], line[@prods_status], \"unknown\")\n\t\t\n\tend\n\t\nend", "def get_city_names(somehash)\n somehash.each { |k, v| puts k }\nend", "def convert\n STDERR.print \"\\nThis may take 10 minutes or more. Lines processed: \"\n line_in_count = 0\n\n # Create an object to store *all* lines of the *output* CSV\n @csv_out_data = FasterCSV.generate(FCSV_OUT_OPTS){|csv_out| \n\n # Iterate thru each *input* line\n FasterCSV.foreach(@in_file, FCSV_IN_OPTS) {|line_in|\n line_in_count += 1\n if line_in_count == 1\n self.class.verify_csv_in_headers(line_in.headers)\n @csv_out_headers = WILL_INCLUDE_INPUT_COLUMNS ? CSV_OUT_COLUMNS + CSV_IN_COLUMNS : CSV_OUT_COLUMNS\n end\n\n # Iterate thru each *output* column\n line_out = []\n @csv_out_headers.each_with_index{|col,i|\n csv_out << @csv_out_headers if line_in_count == 1 && i == 0\t# Header line\n\n case col\n when RmidItem, PrefixColOwner, PrefixColList\n line_out << line_in[col]\n when HdlItem\n line_out << get_handle_for_rmid(line_in[RmidItem])\n when HdlColOwner\n line_out << get_handle_for_collection_prefix(line_in[PrefixColOwner])\n when HdlColList\n if line_in[PrefixColList]\n prefixes = line_in[PrefixColList].split(VALUE_DELIMITER)\n handles = prefixes.inject([]){|a,prefix| a << get_handle_for_collection_prefix(prefix)}\n line_out << handles.join(VALUE_DELIMITER)\n else\n line_out << \"\"\n end\n end\n }\n csv_out << line_out\n STDERR.print \"#{line_in_count} \" if line_in_count % 200 == 0\n }\n }\n STDERR.puts \"; Total lines #{line_in_count} \"\n end", "def get_city_names(somehash)\n=begin\n somehash.each do |each_dial|\n puts each_dial[0]\n end\n=end\n somehash.keys\nend", "def each_pair\n\t\t\titer = @packet.params.entry_set.iterator\n\t\t\twhile iter.has_next\n\t\t\t\tentry = iter.next\n\t\t\t\tyield entry.key.to_s, entry.value\n\t\t\tend\n\t\tend", "def each_pair(&block)\n @entries.each_pair(&block)\n end", "def process(line)\n parts = line.chomp.split(/\\t/)\n keys = line_key(parts)\n keys.each do |k|\n yield [k, *parts]\n end\n end", "def each_value(&block); end", "def process(csv_data)\n unless csv_data.headers == SOA_CSV_STRUCTURE\n LOGGER.error(\"Structure of #{csv_filename} does not match:\\nExpected: #{SOA_CSV_STRUCTURE.inspect}.\\nActual: #{csv_data.headers.inspect}.\\nContent: #{csv_file}\")\n abort('ABORTED!')\n end\n\n index = 0\n csv_data.delete_if do |row|\n index += 1\n retval = row[:buchungstag].nil? || row[:wertstellung].nil? || row[:umsatzart].nil?\n LOGGER.info(\"- Record nbr. #{index} not processed due to empty field(s): #{row.inspect}\") if retval\n retval\n end\n\n csv_data.sort_by { |row| DateTime.parse(row[:buchungstag]) }\n end", "def process!\n if valid?\n # get the csv rows as an array of hashes\n setup_data\n raw_csv_data = compute_csv_data\n # remove duplicate rows in the csv file (by email or name)\n prefilterted_csv_data = prefilter_csv_data raw_csv_data\n # remove the rows that match emails in the database\n new_data = filter_data_through_db prefilterted_csv_data\n\n # crate a new users\n resolved_data = create_new_user_records new_data\n end\n @rejected_user_data\n end", "def assign_csv_values_to_genericfile(row, generic_file)\n field_mappings = @import.import_field_mappings.where('import_field_mappings.key != ?', 'image_filename')\n field_mappings.each do |field_mapping|\n\n key_column_number_arr = @import.import_field_mappings.where(key: field_mapping.key).first.value.reject!{|a| a.blank? } \n key_column_value_arr = []\n\n # For certain fields the values in the csv are comma delimeted and need to be parsed\n if field_mapping.key == 'subject'\n key_column_number_arr.each do |num|\n key_column_value_arr = key_column_value_arr + (row[num.to_i].try(:split, ',') || [])\n end\n elsif field_mapping.key == 'collection_identifier'\n # it's not a multivalue field so let's just get the first mapping\n key_column_number_arr.each do |num|\n generic_file.collection_identifier = row[num.to_i]\n break\n end\n\n elsif field_mapping.key == 'measurements'\n key_column_number_arr.each do |num|\n measurement_hash = measurement_format_for(row[num.to_i].try(:strip))\n unless measurement_hash.nil?\n #insert field as a measurement object\n measurement = Osul::VRA::Measurement.create(measurement: measurement_hash[:width], measurement_unit: measurement_hash[:unit], measurement_type: \"width\") \n \n generic_file.measurements << measurement\n measurement = Osul::VRA::Measurement.create(measurement: measurement_hash[:height], measurement_unit: measurement_hash[:unit], measurement_type: \"height\") \n generic_file.measurements << measurement\n end\n end\n\n elsif field_mapping.key == 'materials'\n key_column_number_arr.each do |num|\n material_hash = material_format_for(row[num.to_i].try(:strip))\n unless material_hash.nil?\n material = Osul::VRA::Material.create(material_hash)\n generic_file.materials << material\n end\n end\n\n else\n key_column_number_arr.each do |num|\n key_column_value_arr << row[num.to_i]\n end\n end\n\n # materials and measurements are associations so they are updated differently \n unless field_mapping.key == 'materials' or field_mapping.key == 'measurements' or field_mapping.key == 'collection_identifier'\n key_column_value_arr = key_column_value_arr.map.reject{|a| a.blank?}\n generic_file.send(\"#{field_mapping.key}=\".to_sym, key_column_value_arr)\n end\n end\n end", "def process_file(path)\n CSV.open(path, {:headers => true}) do |csv|\n csv.each do |row|\n res = cached_lookup(row['X'].to_f, row['Y'].to_f)\n puts \"#{res[:lng]},#{res[:lat]},#{res[:neighborhood]}\"\n end\n end\n end", "def csv(key)\n @data[key].gsub(\",\", \" \")\n end", "def import_hash hashtree\n\t\tLogger.send(\"warn\",\"Start CSV(hash) import\")\n\t\t@result[:description] << \"Start XML(hash) import\"\n\t\thashtree.each { |b|\n\t\t\timport_bien b.split(\"!#\")\n\t\t}\n\n\t\tLogger.send(\"warn\",\"End CSV import\")\n\t\t@result[:description] << \"End XML import\"\n\t\treturn true\n\tend", "def each(*args, &block)\n @hash.each(*args, &block)\n end", "def parse_painter_csv_file\n csv_data = CSV.read(\"db/painter_seed_data.csv\")\n csv_data.shift\n # iterate over each element and send back a hash \n # need to shift again at the beginning to get rid of id on the row\n painter_object_array = []\n csv_data.each do |painter_row_arr|\n painter_row_arr.shift\n painter_object = {\n :name => painter_row_arr[0],\n :years => painter_row_arr[1],\n :genre => painter_row_arr[2],\n :nationality => painter_row_arr[3],\n :bio => painter_row_arr[4],\n :painting_num => painter_row_arr[6],\n :portrait => painter_row_arr[7]\n }\n painter_object_array.push(painter_object) \n end\n painter_object_array.flatten\nend", "def get_city_names (somehash)\n somehash.each { |k ,v| puts k }\n end", "def iter_hash(hash)\n hash.each do |arr|\n puts arr[0]\n puts arr[1]\n end\n \n hash.each do |key, value|\n puts key\n puts value\n end\nend", "def import_from_csv(file_name)\r\n #implementation goes here\r\n csv_text = File.read(file_name)\r\n csv = CSV.parse(csv_text, headers: true, skip_blanks: true)\r\n # #8 iterate over table rows, create hash for each, then convert to Entry using 'add_entry' method\r\n csv.each do |row|\r\n row_hash = row.to_hash\r\n add_entry(row_hash[\"name\"], row_hash[\"phone_number\"], row_hash[\"email\"])\r\n end #end csv.each loop\r\n end", "def filter_attempt_hash( hash, threshold = 1 )\n keepers = {}\n hash.each do |k,v|\n keepers[k] = v if v.length >= threshold\n end\n keepers\nend", "def get_csv_data(csv_data)\r\n csv_file = nil\r\n\r\n #Get the path and name of the CSV file\r\n if csv_data.to_s.include? '.csv'\r\n csv_file = File.join(File.dirname(__FILE__), \"../venture/config/csv_data/#{csv_data}\")\r\n elsif (\r\n csv_file = File.join(File.dirname(__FILE__), \"../venture/config/csv_data/#{csv_data}.csv\")\r\n )\r\n end\r\n\r\n csv_arr = CSV.read( csv_file, {:headers => true, :header_converters => :symbol, :encoding => 'UTF-8'} )\r\n keys = csv_arr.headers.to_a\r\n # read attribute example => csv[index][:column1]\r\n return csv_arr.to_a.map {|row| Hash[ keys.zip(row) ] }\r\nend" ]
[ "0.6426166", "0.626937", "0.60738885", "0.60609835", "0.5896111", "0.5876972", "0.5785326", "0.57699597", "0.5707463", "0.57027686", "0.5668483", "0.5625261", "0.5621421", "0.5566072", "0.55597955", "0.55592924", "0.55536854", "0.5538221", "0.5513996", "0.5513996", "0.5490846", "0.54701376", "0.54696697", "0.54694366", "0.54648244", "0.5410158", "0.5401736", "0.5391285", "0.53862274", "0.5382817", "0.53654295", "0.5363108", "0.53614813", "0.53446007", "0.53411496", "0.53223115", "0.5318206", "0.53166294", "0.5294132", "0.52748245", "0.52748245", "0.5273868", "0.52705044", "0.5266018", "0.5260976", "0.5258065", "0.52358055", "0.5233728", "0.52235097", "0.52191514", "0.5202227", "0.5177056", "0.5171122", "0.5160667", "0.51597005", "0.51592207", "0.5157664", "0.5155211", "0.5150455", "0.5145809", "0.5145091", "0.5140911", "0.5129596", "0.5124375", "0.51158154", "0.5112056", "0.51110816", "0.51081234", "0.5106995", "0.51014274", "0.5086856", "0.5086856", "0.50861883", "0.50816154", "0.5080528", "0.5076491", "0.50709826", "0.50696176", "0.50653476", "0.50650036", "0.5049412", "0.504836", "0.5033982", "0.5033002", "0.5029533", "0.5015943", "0.500775", "0.5001481", "0.49985692", "0.49939644", "0.49915445", "0.49907842", "0.4990376", "0.49888143", "0.497957", "0.49775562", "0.4976515", "0.49617207", "0.49546465", "0.4953389", "0.49492815" ]
0.0
-1
If file has headers, then guesses column separator from headers. Otherwise guesses column separator from contents. Raises exception if none is found.
def guess_column_separator(filehandle, options) skip_lines(filehandle, options) delimiters = [',', "\t", ';', ':', '|'] line = nil has_header = options[:headers_in_file] candidates = Hash.new(0) count = has_header ? 1 : 5 count.times do line = readline_with_counts(filehandle, options) delimiters.each do |d| candidates[d] += line.scan(d).count end rescue EOFError # short files break end rewind(filehandle) if candidates.values.max == 0 # if the header only contains return ',' if line.chomp(options[:row_sep]) =~ /^\w+$/ raise SmarterCSV::NoColSepDetected end candidates.key(candidates.values.max) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inferred_separator\n SUPPORTED_SEPARATORS.each do |sep|\n return sep if data.scan(sep).length > 0\n end\n\n raise UnknownFormat.new(@path)\n end", "def column_seperator\n self.data.strip.each.first.gsub(/[;,]/).first\n end", "def column_headers(data)\n data.find { |line| line.split(' ').first.downcase == HEADER_INDICATOR }.split(' ')\n end", "def separator(fname)\n f = File.open(fname)\n enum = f.each_char\n c = enum.next\n loop do\n case c[/\\r|\\n/]\n when \"\\n\" then break\n when \"\\r\"\n c << \"\\n\" if enum.peek == \"\\n\"\n break\n end\n c = enum.next\n end\n c[0][/\\r|\\n/] ? c : \"\\n\"\n end", "def get_sep_string file_path\n sep_string = \"\\r\"\n IO.foreach(file_path, sep_string) do |line|\n if line.split(\"\\n\").length > line.split(\"\\r\").length\n sep_string = \"\\n\"\n break\n end\n end\n return sep_string\n end", "def init_separators(col_sep, row_sep, quote_char, force_quotes)\n # store the selected separators\n @col_sep = col_sep.to_s.encode(@encoding)\n if @col_sep == \" \"\n @col_sep_split_separator = Regexp.new(/#{Regexp.escape(@col_sep)}/)\n else\n @col_sep_split_separator = @col_sep\n end\n @row_sep = row_sep # encode after resolving :auto\n @quote_char = quote_char.to_s.encode(@encoding)\n @double_quote_char = @quote_char * 2\n\n if @quote_char.length != 1\n raise ArgumentError, \":quote_char has to be a single character String\"\n end\n\n #\n # automatically discover row separator when requested\n # (not fully encoding safe)\n #\n if @row_sep == :auto\n if [ARGF, STDIN, STDOUT, STDERR].include?(@io) or\n (defined?(Zlib) and @io.class == Zlib::GzipWriter)\n @row_sep = $INPUT_RECORD_SEPARATOR\n else\n begin\n #\n # remember where we were (pos() will raise an exception if @io is pipe\n # or not opened for reading)\n #\n saved_pos = @io.pos\n while @row_sep == :auto\n #\n # if we run out of data, it's probably a single line\n # (ensure will set default value)\n #\n break unless sample = @io.gets(nil, 1024)\n\n cr = encode_str(\"\\r\")\n lf = encode_str(\"\\n\")\n # extend sample if we're unsure of the line ending\n if sample.end_with?(cr)\n sample << (@io.gets(nil, 1) || \"\")\n end\n\n # try to find a standard separator\n sample.each_char.each_cons(2) do |char, next_char|\n case char\n when cr\n if next_char == lf\n @row_sep = encode_str(\"\\r\\n\")\n else\n @row_sep = cr\n end\n break\n when lf\n @row_sep = lf\n break\n end\n end\n end\n\n # tricky seek() clone to work around GzipReader's lack of seek()\n @io.rewind\n # reset back to the remembered position\n while saved_pos > 1024 # avoid loading a lot of data into memory\n @io.read(1024)\n saved_pos -= 1024\n end\n @io.read(saved_pos) if saved_pos.nonzero?\n rescue IOError # not opened for reading\n # do nothing: ensure will set default\n rescue NoMethodError # Zlib::GzipWriter doesn't have some IO methods\n # do nothing: ensure will set default\n rescue SystemCallError # pipe\n # do nothing: ensure will set default\n ensure\n #\n # set default if we failed to detect\n # (stream not opened for reading, a pipe, or a single line of data)\n #\n @row_sep = $INPUT_RECORD_SEPARATOR if @row_sep == :auto\n end\n end\n end\n @row_sep = @row_sep.to_s.encode(@encoding)\n\n # establish quoting rules\n @force_quotes = force_quotes\n do_quote = lambda do |field|\n field = String(field)\n encoded_quote = @quote_char.encode(field.encoding)\n encoded_quote + field.gsub(encoded_quote, encoded_quote * 2) + encoded_quote\n end\n quotable_chars = encode_str(\"\\r\\n\", @col_sep, @quote_char)\n @quote = if @force_quotes\n do_quote\n else\n lambda do |field|\n if field.nil? # represent +nil+ fields as empty unquoted fields\n \"\"\n else\n field = String(field) # Stringify fields\n # represent empty fields as empty quoted fields\n if field.empty? or\n field.count(quotable_chars).nonzero?\n do_quote.call(field)\n else\n field # unquoted field\n end\n end\n end\n end\n end", "def initialize(filepath, col_sep: \"\\t\")\n @filepath = filepath\n @col_sep = col_sep\n @file_handle = File.open(filepath)\n @headers = @file_handle.gets.chomp!.split(col_sep, -1).map(&:downcase).map(&:to_sym)\n end", "def csvColSepChar()\n c = getConf(:csvColSep)\n case(c)\n when :comma, nil ; return \",\" ;\n when :tab ; return \"\\t\" ;\n when :space ; return \" \" ;\n else\n if(c.is_a?(String)) then\n return c ;\n else\n raise \"unknown CSV column separator: '#{c}'\" ;\n end\n end\n end", "def separator\n return @separ if @separ\n str = \"\"\n if @numbering\n str = \"-\"*(rows+1)+@x\n end\n each_column { | c, ix|\n v = c.width\n next if v == 0 ## hidden column\n str << \"-\" * (v+1) + @x \n }\n @separ = str.chop\n end", "def csv_header_to_column(columns, header)\n col = columns.select do |col|\n col.getName == header\n end\n return if col.nil? or col.length <= 0\n\n col[0]\n end", "def determine_encodings!(safe_path)\n # delimiter encoding => # FasterCSV encoding string\n supported_encodings = {\n 'UTF-8' => 'bom|utf-8',\n 'Windows-1252' => 'windows-1252:utf-8'\n }\n\n successful_options = nil\n supported_encodings.each do |delimiter_encoding, csv_encoding|\n begin\n col_sep = @options['col_sep']\n options = {\n :col_sep => (col_sep || ',').force_encoding(delimiter_encoding),\n :encoding => csv_encoding\n }\n\n row_num = 0\n # Iterate through the file; if we reach the end, this encoding worked:\n CSVLibrary.foreach(safe_path, options) { |_line| row_num += 1 }\n rescue ArgumentError => e\n next if e.message =~ /invalid byte sequence/ # This encoding didn't work\n raise(e)\n rescue CSVLibrary::MalformedCSVError => e\n description = (col_sep ? col_sep.inspect + ' delimited' : 'CSV')\n\n raise(CSVLibrary::MalformedCSVError, \"Invalid #{description} format \" \\\n \"on row #{row_num + 1} of #{::File.basename(safe_path)}. Original: #{e.message}\")\n end\n\n # We got this far => encoding choice worked:\n successful_options = options\n break\n end\n\n # We tried them all, and none worked:\n unless successful_options\n fail \"None of the encodings #{supported_encodings.values.inspect} were successful!\"\n end\n\n successful_options\n end", "def skip_headers\n start_of_file? ? (@headers = read_row) : false\n end", "def csv_file_headers\n # Open file\n CSV.foreach(self.file.path, headers: true) do |row|\n # Transform row to hash\n row = row.to_hash\n # Normalize it\n row = normalize_row(row)\n errors.add(:file, \"Invalid CSV headers, please check if #{required_csv_headers.join(', ')} are present.\") unless valid_headers?(row)\n break\n end\n end", "def headers?\n !self.data.strip.each.first.split(column_seperator).any? { |column| Date.parse(column) rescue false }\n end", "def identify_delimiter(filename_or_sample)\n #filename_or_sample input can be either a File or an Array or a string - Return delimiter for File or an Array of strings (if found)\n if filename_or_sample.class == String\n if File::exists?(filename_or_sample)\n current_line_number = 0\n File.foreach(filename_or_sample) do |line|\n count_occurances_delimiter(line)\n current_line_number += 1\n if current_line_number > 3\n break\n end\n end\n else\n # count_occurances_delimiter(filename_or_sample)\n return FileNotFound.new\n end\n return_plausible_delimiter\n elsif filename_or_sample.class == Array\n filename_or_sample.each do |line|\n count_occurances_delimiter(line)\n end\n return_plausible_delimiter\n else\n InvalidInput.new\n end\n end", "def separator\n \"-\" * (COLUMN_NUM * COLUMN_SIZE)\nend", "def shift\n #########################################################################\n ### This method is purposefully kept a bit long as simple conditional ###\n ### checks are faster than numerous (expensive) method calls. ###\n #########################################################################\n\n # handle headers not based on document content\n if header_row? and @return_headers and\n [Array, String].include? @use_headers.class\n if @unconverted_fields\n return add_unconverted_fields(parse_headers, Array.new)\n else\n return parse_headers\n end\n end\n\n #\n # it can take multiple calls to <tt>@io.gets()</tt> to get a full line,\n # because of \\r and/or \\n characters embedded in quoted fields\n #\n in_extended_col = false\n csv = Array.new\n\n loop do\n # add another read to the line\n unless parse = @io.gets(@row_sep)\n return nil\n end\n\n if in_extended_col\n @line.concat(parse)\n else\n @line = parse.clone\n end\n\n begin\n parse.sub!(@parsers[:line_end], \"\")\n rescue ArgumentError\n unless parse.valid_encoding?\n message = \"Invalid byte sequence in #{parse.encoding}\"\n raise MalformedCSVError.new(message, lineno + 1)\n end\n raise\n end\n\n if csv.empty?\n #\n # I believe a blank line should be an <tt>Array.new</tt>, not Ruby 1.8\n # HBCSV's <tt>[nil]</tt>\n #\n if parse.empty?\n @lineno += 1\n if @skip_blanks\n next\n elsif @unconverted_fields\n return add_unconverted_fields(Array.new, Array.new)\n elsif @use_headers\n return self.class::Row.new(@headers, Array.new)\n else\n return Array.new\n end\n end\n end\n\n next if @skip_lines and @skip_lines.match parse\n\n parts = parse.split(@col_sep_split_separator, -1)\n if parts.empty?\n if in_extended_col\n csv[-1] << @col_sep # will be replaced with a @row_sep after the parts.each loop\n else\n csv << nil\n end\n end\n\n # This loop is the hot path of csv parsing. Some things may be non-dry\n # for a reason. Make sure to benchmark when refactoring.\n parts.each do |part|\n if in_extended_col\n # If we are continuing a previous column\n if part.end_with?(@quote_char) && part.count(@quote_char) % 2 != 0\n # extended column ends\n csv.last << part[0..-2]\n if csv.last.match?(@parsers[:stray_quote])\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n csv.last.gsub!(@double_quote_char, @quote_char)\n in_extended_col = false\n else\n csv.last << part << @col_sep\n end\n elsif part.start_with?(@quote_char)\n # If we are starting a new quoted column\n if part.count(@quote_char) % 2 != 0\n # start an extended column\n csv << (part[1..-1] << @col_sep)\n in_extended_col = true\n elsif part.end_with?(@quote_char)\n # regular quoted column\n csv << part[1..-2]\n if csv.last.match?(@parsers[:stray_quote])\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n csv.last.gsub!(@double_quote_char, @quote_char)\n elsif @liberal_parsing\n csv << part\n else\n raise MalformedCSVError.new(\"Missing or stray quote\",\n lineno + 1)\n end\n elsif part.match?(@parsers[:quote_or_nl])\n # Unquoted field with bad characters.\n if part.match?(@parsers[:nl_or_lf])\n message = \"Unquoted fields do not allow \\\\r or \\\\n\"\n raise MalformedCSVError.new(message, lineno + 1)\n else\n if @liberal_parsing\n csv << part\n else\n raise MalformedCSVError.new(\"Illegal quoting\", lineno + 1)\n end\n end\n else\n # Regular ole unquoted field.\n csv << (part.empty? ? nil : part)\n end\n end\n\n # Replace tacked on @col_sep with @row_sep if we are still in an extended\n # column.\n csv[-1][-1] = @row_sep if in_extended_col\n\n if in_extended_col\n # if we're at eof?(), a quoted field wasn't closed...\n if @io.eof?\n raise MalformedCSVError.new(\"Unclosed quoted field\",\n lineno + 1)\n elsif @field_size_limit and csv.last.size >= @field_size_limit\n raise MalformedCSVError.new(\"Field size exceeded\",\n lineno + 1)\n end\n # otherwise, we need to loop and pull some more data to complete the row\n else\n @lineno += 1\n\n # save fields unconverted fields, if needed...\n unconverted = csv.dup if @unconverted_fields\n\n if @use_headers\n # parse out header rows and handle HBCSV::Row conversions...\n csv = parse_headers(csv)\n else\n # convert fields, if needed...\n csv = convert_fields(csv)\n end\n\n # inject unconverted fields and accessor, if requested...\n if @unconverted_fields and not csv.respond_to? :unconverted_fields\n add_unconverted_fields(csv, unconverted)\n end\n\n # return the results\n break csv\n end\n end\n end", "def header_char_for( filename )\n\t\tcase File.extname( filename )\n\t\twhen '.md' then return '#'\n\t\twhen '.rdoc' then return '='\n\t\twhen ''\n\t\t\tif filename == 'Rakefile'\n\t\t\t\treturn '#'\n\t\t\tend\n\t\tend\n\n\t\traise \"Don't know what header character is appropriate for %s\" % [ filename ]\n\tend", "def consume_header_line(line, column_mappings)\n columns = column_names(column_mappings)\n\n header_guess = line.map { |column| column.to_s.downcase }\n\n # The \"best guess\" is only if/when the header eventually deemed to be\n # invalid - in which case, it builds the informative error message.\n @header_best_guess = header_guess if header_guess.any?(&:present?)\n @header_valid = true if header_guess == columns\n end", "def csv_headers\n raise NotImplementedError\n end", "def verify_column_headers\n \n unless (headers = get_spreadsheet.headers)\n # log an error if we can't get the metadata headers\n @verification_errors << BulkOps::Error.new({type: :bad_header, field: column_name}) \n end\n\n headers.each do |column_name|\n next if column_name.blank?\n column_name_redux = column_name.downcase.parameterize.gsub(/[_\\s-]/,\"\")\n # Ignore everything marked as a label\n next if column_name_redux.ends_with? \"label\"\n # Ignore any column names with special meaning in hyrax\n next if BulkOps::SPECIAL_COLUMNS.any?{|col| col.downcase.parameterize.gsub(/[_\\s-]/,\"\") == column_name_redux }\n # Ignore any columns speficied to be ignored in the configuration\n ignored = options[\"ignored headers\"] || []\n next if ignored.any?{|col| col.downcase.parameterize.gsub(/[_\\s-]/,\"\") == column_name_redux }\n # Column names corresponding to work attributes are legit\n next if Work.attribute_names.any?{|col| col.downcase.parameterize.gsub(/[_\\s-]/,\"\") == column_name_redux }\n @verification_errors << BulkOps::Error.new({type: :bad_header, field: column_name})\n end\n end", "def fail_unless_header_complete(column_mappings)\n return unless header_lines > 0 && !header_valid?\n\n expected_names = column_names(column_mappings)\n received_names = @header_best_guess || []\n\n unexpected = received_names - expected_names\n missing = expected_names - received_names\n\n fail header_message_for(missing, unexpected)\n end", "def test_parse_headers\n tmpdbfile = Tempfile.new('tmp.db')\n args = [\"--header\", \n \"--source\", \"header_test.csv\", \n \"--save-to\", tmpdbfile.path, \n \"--ifs=\" \",\",\n \"--table-name\",\"header_test\"]\n Csvql.run(args)\n\n db = SQLite3::Database.new tmpdbfile.path\n headers_from_db = db.execute2('select * from header_test;')[0]\n headers_from_file = File.open('header_test.csv').each_line.first.gsub(/\\n/,'').split(',')\n\n #binding.pry\n assert_equal headers_from_db, headers_from_file\n end", "def separator\n I + columns.collect_with_index do |col, i| \n X * (length_of_column(i) + 2) \n end.join(I) + I \n end", "def read_header_file_name\n std = nil\n if !buffer_empty?\n return nil, std\n end\n\n skip_space!\n p = get_pos(0)\n if next?('\"')\n std = false\n close = '\"'\n elsif next?('<')\n std = true\n close = '>'\n else\n return nil, std\n end\n b = \"\"\n while !next?(close)\n c = readc\n if c.nil? || c == '\\n'\n raise \"#{p}: premature end of header name\"\n # errorp(p, \"premature end of header name\");\n end\n b << c\n end\n if b.size == 0\n raise \"#{p}: header name should not be empty\"\n # errorp(p, \"header name should not be empty\");\n end\n\n return b, std\n end", "def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end", "def parse_csv content, sep\n CSV.parse(content, :col_sep => sep,\n :converters => [:numeric],\n :headers => true,\n :skip_blanks => true).\n map{ |row| row.to_hash }\n end", "def read_headers (col_stop)\r\n\t\t\t# collect header row\r\n\t\t\theaders = (1..col_stop).collect { |j|\r\n\t\t\t\[email protected](1,j)\r\n\t\t\t}\r\n\t\t\t# drop case, strip flanking spaces, replace gaps with underscores\r\n\t\t\treturn headers.collect { |h|\r\n\t\t\t\traw_val = h.strip()\r\n\t\t\t\th_str = clean_col_header (raw_val)\r\n\t\t\t\t@syn_dict.fetch(h_str, raw_val)\r\n\t\t\t}\r\n\t\tend", "def tabular_input_cleanse_header\n ignored_columns = tabular_input.header.cleanse!\n logger.warn('Stripped out invalid columns from custom header', ignored_columns) unless ignored_columns.empty?\n\n self.tabular_input_header = tabular_input.header.columns\n end", "def splitCsvFileByColumn(file)\n lists = Array.new\n \n # csv data: array of array\n csvDatas = readCSV(file)\n \n # Convert the data of each row to column\n newCsvDatas = csvDatas.transpose()\n newCsvDatas.each {|elem|\n # elem is array and data of the new csv file\n filename = File.basename(file, \".*\") + '_' + elem[0] + '.csv'\n filename = filename.gsub(/:+/,'_')\n lists.push(filename)\n File.open(filename, 'w') { |file|\n number = 0\n elem.each {|line|\n if (number == 0)\n str = sprintf(\"number,%s\\n\", line)\n else\n str = sprintf(\"%d,%s\\n\", number, line)\n end\n file.puts(str)\n number += 1\n }\n }\n }\n \n return lists\n end", "def parse_headers!(csv_file)\n csv = CSV.open(csv_file, :headers => true)\n csv.gets\n csv.headers\n end", "def process\n lines = clean_lines\n\n # Peek ahead to get the headers\n unless @file_content.blank?\n CSV.parse(@file_content, {:headers => true, :skip_blanks => true}) do |row|\n @rows_exist = true\n @headers = row.headers\n break\n end\n end\n\n @rows_exist = @rows_exist and [email protected]?\n end", "def non_standardized_header(row)\n @header=row.split(/\\s{2}+/).reject{|a|a.empty?} \n @header[1].insert(8,'--')\n @header[1]=@header[1].split(/--/)\n @header.insert(1,'Incep Date')\n @[email protected]\n end", "def separator\n columns_dashes = @widths.map { |w| '-' * (w + 2) }\n \"+#{columns_dashes.join('+')}+\"\n end", "def default_separator; end", "def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end", "def each(&block)\n file_handle.each do |line|\n yield headers.zip(line.chomp!.split(col_sep, -1)).to_h\n end\n end", "def parse_csv(file)\n\t\tdata = []\n\t\t# Break open CSV and go through rows\n\t\tbegin\n\t\t\tdata = CSV.read(file, :headers => true,:skip_blanks => true,:header_converters => :symbol, :encoding => 'UTF-8')\n\t\trescue\n\t\t\t# Convert to UTF-8 if necessary\n\t\t\tdata = CSV.read(file, :headers => true,:skip_blanks => true,:header_converters => :symbol, :encoding => 'Windows-1252:UTF-8')\n\t\tend\n\t\tdata\n\tend", "def is_csv_file?(file_content_type)\n file_content_type == \"text/plain\"\n end", "def read_headers\n # @return [ActsAsTable::Headers::Array]\n headers = @row_model.to_headers\n\n # @return [Boolean]\n eof = false\n\n # @return [Array<Array<String>, nil>]\n rows = ::Array.new(headers.size) { |index|\n row, eof = *self.read_row\n\n unless row.nil?\n row += ::Array.new(headers[index].size - row.size) { nil }\n end\n\n row\n }\n\n if rows.any?(&:nil?)\n raise ActsAsTable::HeadersNotFound.new(\"#{self.class}#read_headers - must exist\")\n end\n\n unless [headers, rows].transpose.all? { |pair| pair[0] == pair[1] }\n raise ActsAsTable::InvalidHeaders.new(\"#{self.class}#read_headers - invalid\")\n end\n\n [rows, eof]\n end", "def extract_header(content)\n return \"\" if content.blank?\n content.split(/\\r\\n\\r\\n|\\n\\n/).first\n end", "def import_hdr\n if @hdr_reader == nil\n case @file_type\n when \"pfile\" then printraw_summary_import\n when \"scan_archive_h5_json\" then printraw_scan_archive_h5_json\n end\n else\n raise(IndexError, \"No Header Data Available.\") if @hdr_data == nil\n case @hdr_reader\n when \"rubydicom\" then rubydicom_hdr_import\n when \"dicom_hdr\" then dicom_hdr_import\n when \"printraw\" then printraw_import\n when \"rdgehdr\" then rdgehdr_import\n when \"cat\" then printraw_summary_import\n end\n end\n end", "def read_headers (col_stop)\r\n\t\t\t# collect header row\r\n\t\t\theaders = (1..col_stop).collect { |j|\r\n\t\t\t\[email protected](1,j)\r\n\t\t\t}\r\n\t\t\t# drop case, strip flanking spaces, replace gaps with underscores\r\n\t\t\treturn headers.collect { |h|\r\n\t\t\t\th_str = h.downcase.strip.gsub(' ', '_')\r\n\t\t\t\t@syn_dict.fetch(h_str, h_str)\r\n\t\t\t}\r\n\t\tend", "def _prepare_format #:nodoc:\n fmstr = nil\n fmt = []\n each_column { |c, i|\n ## trying a zero for hidden columns\n ## worked but an extra space is added below and the sep\n w = c.width\n case c.align\n when :right\n #fmt << \"%.#{w}s \"\n fmt << \"%#{w}.#{w}s \"\n else\n fmt << \"%-#{w}.#{w}s \"\n end\n }\n ## the next line will put a separator after hidden columns also\n fmstr = fmt.join(@y)\n #puts \"format: #{fmstr} \" # 2011-12-09 23:09:57\n return fmstr\n end", "def delimiter(col)\n gmu(\"# \", col)\n end", "def read_csv(file, header)\n FasterCSV.read(file, {:header_converters => :symbol, :headers => header } )\nend", "def read_csv(file_path)\n CSV.parse(File.read(file_path), headers: true)\nend", "def validate_csv_format\n\tfile = params[:file]\n\theaders = CSV.open(file.path, 'r') { |csv| csv.first }\n\tunless (EXPECTED_HEADER - headers).empty?\n\t\tremoved_columns = EXPECTED_HEADER - headers\n\t\tadded_columns = headers - EXPECTED_HEADER\n\t\tresponse = {msg: \"You have added or removed columns\"}\n\t\t# response = {msg: \"You have removed some columns\"}\n\t\tresponse[:added_column] = added_columns unless added_columns.nil?\n\t\t# response[:removed_columns] = removed_columns unless removed_columns.nil?\n\t\tresponse[:removed_columns] = removed_columns\n\t\trender json: response.to_json, status: \"422\"\n\tend\nend", "def actual_header\n data.lines.first.chomp\n end", "def csv_file_format\n if file.original_filename !~ /.*\\.csv/\n errors.add :file, 'is not a .csv file'\n end\n end", "def column_headers\n use_column_headers ? columns.map(&:heading) : true\n end", "def fix_separators!(separator)\n return self if separator.nil? || separator.empty?\n\n r = Regexp.escape(separator)\n\n # No more than one of the separator in a row.\n substitute!(/#{r}{2,}/, separator)\n\n # Remove leading/trailing separator.\n substitute!(/^#{r}|#{r}$/i, '')\n end", "def monta_header_arquivo\n raise Brcobranca::NaoImplementado, 'Sobreescreva este método na classe referente ao banco que você esta criando'\n end", "def columnheaders_raw\r\n columns = Array(raw_data_sheet.row(0)).compact\r\n columns = columns.collect!{ |col| clean_string(col) } unless columns.nil?\r\n columns\r\n end", "def assert_header(key)\n unless key.is_a?(Numeric) || @headers.nil? || @headers.include?(key)\n fail UnknownCSVCellError.new(self, key)\n end\n end", "def delimiter\n @view_column[:delimiter] || '-'\n end", "def parsed_data\n @parsed_data ||= begin\n CSV.read(full_filename, col_sep: col_sep, quote_char: quote_char, encoding: encoding)\n rescue => e #CSV::MalformedCSVError => er\n @parse_error = e.to_s\n rows = []\n #one more attempt. If BOM is present in the file.\n begin\n f = File.open(full_filename, \"rb:bom|utf-8\")\n rows = CSV.parse(f.read.force_encoding(\"ISO-8859-1\"))\n ensure\n return rows\n end\n end\n end", "def get_csv(myfile, tabbed = false)\n\n raise \"Unable to read from file '#{myfile}'\" if !File.readable?(myfile) \n\n if tabbed\n recs = CSV::parse(File.open(myfile, 'r'){|f| f.read}, :col_sep => \"\\t\") # this doesn't work on Tab seperated quote delimited\n else\n recs = CSV::parse(File.open(myfile, 'r'){|f| f.read})\n end \n recs ||= []\n recs\n end", "def _calculate_column_offsets\n total = 0\n coffsets = []\n ctr = 0\n ## ix will have gaps in between for hidden fields\n each_column { | c, ix|\n v = c.width\n coffsets[ctr] = total\n ctr += 1\n total += v + 2 ## blank space plus separator\n }\n return coffsets\n end", "def export_column_headers(export_type = :addon_address)\n unless self.accepted.include? export_type\n raise ArgumentError, \"Invalid export_type. Try one of these: \\n \\t #{self.accepted.join ' '}\" \n end\n #todo make this private or add check for export_type\n headers = self.parsed_content[0]\n\n case export_type\n when :addon_address then headers += ['NORMALIZED']\n when :just_addresses then headers = ['Normalized Addresses']\n when :seperate_columns \n keys = self.tokenized_addresses.first.to_hash.keys\n headers = keys.map { |key| key.to_s}\n end\n end", "def split_by_delimiter(delimiter = self.class.parsing_delimiter)\n return '' if body.nil? || body.empty?\n lines = body.split(\"\\n\")\n delim_line = last_line = found_empty = nil\n \n lines.each_with_index do |line, i|\n next if delim_line\n delim_line = i if line.include?(delimiter)\n end\n \n while !last_line && delim_line.to_i > 0\n delim_line = delim_line - 1\n if found_empty\n last_line = delim_line if lines[delim_line].strip.size > 0\n else\n found_empty = true if lines[delim_line].strip.size.zero?\n end\n end\n \n if last_line\n lines[0..delim_line] * \"\\n\"\n elsif delim_line.nil?\n body.strip\n else\n ''\n end\n end", "def contains_valid_headers(value)\n split_value = value.split(/\\n/)\n if split_value.size == 0 || split_value[4].nil?\n return false\n else\n if(split_value[0].index('/*').nil? || split_value[4].index('*/').nil?)\n return false\n else\n start_index = value.index('/*')\n return false if start_index.nil?\n end_index = value.index('*/', start_index+2)\n return false if end_index.nil?\n value = value[start_index+2..end_index-1]\n\n type_i = value.index('Type:')\n layer_i = value.index('Layer:')\n variation_i = value.index('Variation:')\n return false if type_i.nil? || layer_i.nil? || variation_i.nil?\n # sets the type, layer, variation as an array\n headers = [value[type_i+5..layer_i-1], value[layer_i+6..variation_i-1], value[variation_i+10..value.size]]\n # return it with each value stripped of nextline characters and extra white space\n return headers.collect { |c| c.gsub(/\\n|\\t/, '').strip }\n end\n end\n end", "def read_to_separator(sep)\n return if @ibuffer.exhausted?\n return read_all unless sep\n\n sep = StringValue sep if sep\n\n if sep.empty?\n sep = \"\\n\\n\"\n skip = ?\\n\n else\n skip = nil\n end\n\n line = nil\n until @ibuffer.exhausted?\n @ibuffer.fill_from self, skip\n\n if count = @ibuffer.find(sep)\n str = @ibuffer.shift(count)\n else\n str = @ibuffer.shift\n end\n\n if line\n line << str\n else\n line = str\n end\n\n break if count\n end\n\n @ibuffer.discard skip if skip\n\n line unless line.empty?\n end", "def csv_file\n if File.size? csv_filename\n CSV.read(csv_filename, headers: true, col_sep: ';', header_converters: :symbol, converters: :all)\n else\n LOGGER.error(\"File not found or empty: #{csv_filename}\")\n abort('ABORTED!')\n end\n end", "def monta_header_arquivo\n header_arquivo = '' # Descrição Posição Tamanho\n header_arquivo << cod_banco # CÓDIGO DO BANCO [1......3] 03(9) 341\n header_arquivo << '0000' # CÓDIGO DO LOTE [4......7] 04(9) 0000\n header_arquivo << '0' # TIPO DE REGISTRO [8......8] 01(9) 0\n header_arquivo << ''.rjust(6, ' ') # BRANCOS [9.....14] 06(X)\n header_arquivo << versao_layout_arquivo # LAYOUT DE ARQUIVO [15....17] 03(9) 081\n header_arquivo << Util::Empresa.new(documento_debitado, false).tipo # TIPO DE INSCRIÇÃO DA EMPRESA DEBITADA [18....18] 01(9) 1 = CPF 2 = CNPJ\n header_arquivo << documento_debitado.to_s.rjust(14, '0') # CNPJ da EMPRESA DEBITADA [19....32] 14(9)\n header_arquivo << ''.rjust(20, ' ') # BRANCOS [33....52] 20(X)\n header_arquivo << agencia.rjust(5, '0') # NÚMERO AGÊNCIA DEBITADA [53....57] 05(9)\n header_arquivo << ''.rjust(1, ' ') # BRANCOS [58....58] 01(X)\n header_arquivo << conta_corrente.rjust(12, '0') # CONTA NÚMERO DEBITADA [59....70] 12(9)\n header_arquivo << ''.rjust(1, ' ') # BRANCOS [71....71] 01(X)\n header_arquivo << digito_conta # DAC DA AGÊNCIA/CONTA DEBITADA [72....72] 01(9)\n header_arquivo << empresa_mae.format_size(30) # NOME DA EMPRESA [73...102] 30(X)\n header_arquivo << nome_banco.format_size(30) # NOME DO BANCO [103..132] 30(X)\n header_arquivo << ''.rjust(10, ' ') # BRANCOS [133..142] 10(X)\n header_arquivo << '1' # CÓDIGO REMESSA/RETORNO [143..143] 01(9) 1=REMESSA\n header_arquivo << data_geracao # DATA DE GERAÇÃO DO ARQUIVO [144..151] 08(9) DDMMAAAA\n header_arquivo << hora_geracao # HORA DE GERAÇÃO DO ARQUIVO [152..157] 06(9) HHMMSS\n header_arquivo << ''.rjust(9, '0') # ZEROS [158..166] 09(9)\n header_arquivo << densidade_gravacao.rjust(5, '0') # DENSIDADE DE GRAVAÇÃO DO ARQUIVO [167..171] 05(9) 0 Padrao | 1600 BPI | # 6250 BPI\n header_arquivo << ''.rjust(69, ' ') # BRANCOS [172..240] 69(X)\n header_arquivo\n end", "def get_column_descriptors\n #skip past header to get to column information\n @data.seek(HEADER_LENGTH)\n \n # column names are the first 128 bytes and column info takes up the last 72 bytes. \n # byte 130 contains a 16-bit column type\n # byte 136 contains a 16-bit length field\n @columns = []\n @column_count.times do\n name, type, length = @data.read(200).unpack('A128 x S x4 S')\n if length > 0\n @columns << Column.new(name.strip, type, length)\n end\n end\n # Reset the column count in case any were skipped\n @column_count = @columns.size\n \n @columns\n end", "def csv_header\n #empty by default\n []\n end", "def csv_header\n #empty by default\n []\n end", "def resolve_ambiguous_headers(models_columns, raw_header)\n return if models_columns.size < 2\n m0_cols = models_columns[0][:allowed_cols] - [\"id\", \"updated_by\", \"created_at\", \"updated_at\"]\n m1_cols = models_columns[1][:allowed_cols] - [\"id\", \"updated_by\", \"created_at\", \"updated_at\"]\n dup_names = []\n m0_cols.each do |n1|\n m1_cols.each do |n2|\n if n1 == n2\n dup_names << n1\n end\n end\n end\n#logger.debug \"resolve_ambiguous_headers found dup_names: #{dup_names}\"\n return if dup_names.empty?\n# normalize all headers\n header = raw_header.map {|h| normalize_header(h) }\n dup_names.each do |dn|\n#logger.debug \"resolve_ambiguous_headers handle dup_name: #{dn}\"\n fi = li = nil\n # find first instance of the dup name in header\n header.each_with_index do |h, i|\n if dn == h\n fi = i\n break\n end\n end\n #logger.debug \"resolve_ambiguous_headers dup_name: #{dn} first index: #{fi}\"\n # next if the dup name is not used in the sheet\n next if fi.nil?\n # find last instance of the dup name in header\n header.reverse_each.with_index do |h, ri|\n if dn == h\n li = (header.size - 1) - ri\n break\n end\n end\n #logger.debug \"resolve_ambiguous_headers dup_name: #{dn} last index: #{li}\"\n if fi == li\n # one instance of dup name\n m1_no_dups = models_columns[1][:allowed_cols] - dup_names\n first_m1_index = nil\n header.each_with_index do |h, i|\n if m1_no_dups.include?(h)\n # we foud the first non-ambiguous header of 2nd model\n first_m1_index = i\n break\n end\n end\n if first_m1_index.nil? || fi < first_m1_index\n # assign to the 1st model\n #logger.debug \"resolve_ambiguous_headers dup_name: #{dn} assign to first\"\n models_columns[0][:dups][dn] = fi\n models_columns[1][:dups][dn] = nil\n else\n # assign to the 2nd model\n #logger.debug \"resolve_ambiguous_headers dup_name: #{dn} assign to second\"\n models_columns[0][:dups][dn] = nil\n models_columns[1][:dups][dn] = fi\n end\n else\n#logger.debug \"resolve_ambiguous_headers assign dup_name: #{dn} first index: #{fi} last index: #{li}\"\n# two instances of dup name\n models_columns[0][:dups][dn] = fi\n models_columns[1][:dups][dn] = li\n end\n end\n end", "def fix_csv(csv_filenames)\n # Read line from file, modify, and write back out\n first_line = true\n new_file_name = \"#{@file_name[0...-3]}csv\"\n # Open final csv for output\n File.open(new_file_name, 'w') do |fo|\n # Iterate over tmp csv files\n csv_filenames.each do |csv|\n # Go through each line of tmp csv\n CSV.foreach(csv, headers: true) do |row|\n if first_line\n headers = @col_num_hash.keys\n fo.puts headers.join(',')\n first_line = false\n else\n fo.puts fix_data(row)\n end\n end\n end\n end\nend", "def default_separator=(separator); end", "def head\n header = ''\n File.open(@file).each_line do |line|\n break if line.chomp.empty?\n header << line\n end\n return header\n end", "def find_delim_filename(delim_type, other_char, suffix = '')\n if delim_type == 'comma'\n filename = params[:model] + params[:id] + suffix + '.csv'\n delimiter = ','\n elsif delim_type == 'space'\n filename = params[:model] + params[:id] + suffix + '.csv'\n delimiter = ' '\n elsif delim_type == 'tab'\n filename = params[:model] + params[:id] + suffix + '.csv'\n delimiter = \"\\t\"\n elsif delim_type == 'other'\n filename = params[:model] + params[:id] + suffix + '.csv'\n delimiter = other_char\n end\n [filename, delimiter]\n end", "def normalize_delimiters!\n @content.each { |item| item[:delimiter] = default_delimiter if item[:type] == :value }\n end", "def filter_data_columns_csv(iterator)\n retval = []\n\n if iterator == nil\n return []\n end\n\n csv = CSV.parse(iterator, :headers => true, :skip_blanks => true)\n \n headers = csv.headers() \n #check for duplicate field names\n #dup_head = headers.detect {|e| headers.rindex(e) != headers.index(e)}\n dup_head = headers.detect do |e|\n if (!e.empty?) #For empty (e == \"\") header fields\n headers.rindex(e) != headers.index(e)\n end\n end\n \n if (headers.empty?)\n message = \"#### Error: header filtering failed.\\n\"\n return [message, nil]\n end\n \n if (dup_head != nil)\n message = \"### Error: document may contain duplicate column names.\\n\"\n message << \"# Source: \" << dup_head << \"\\n\"\n return [message, nil]\n end\n \n csv.each do |row|\n row_hash = (row.to_hash)\n retval << row_hash\n end\n\n return [message, retval]\n end", "def column?(key)\n headers.include?(key.as_sym)\n end", "def read_group_file_headers(line)\n data = strip_and_split(line)\n\n header_cols = Hash.new\n\n data.each_with_index do |header, i|\n if header =~ /group/i\n header_cols[:group] = i\n elsif header =~ /color/i\n header_cols[:color] = i\n elsif header =~ /avg pheno/i\n header_cols[:phenoavg] = i\n elsif header =~ /std dev/i\n header_cols[:stddev] = i\n elsif header =~ /samples/i\n header_cols[:samples] = i\n elsif header =~ /Median/i\n header_cols[:median] = i\n elsif header =~ /25/i\n header_cols[:percent25] = i\n elsif header =~ /75/i\n header_cols[:percent75] = i\n elsif header =~ /Min/i\n header_cols[:min] = i\n elsif header =~ /Max/i\n header_cols[:max] = i\n end\n end\n\n return header_cols\nend", "def skip_column_header=(value)\n @config.set('library.skip_column_header', value)\n end", "def parse_csv_line_ruby(line, options, header_size = nil)\n return [] if line.nil?\n\n line_size = line.size\n col_sep = options[:col_sep]\n col_sep_size = col_sep.size\n quote = options[:quote_char]\n quote_count = 0\n elements = []\n start = 0\n i = 0\n\n previous_char = ''\n while i < line_size\n if line[i...i+col_sep_size] == col_sep && quote_count.even?\n break if !header_size.nil? && elements.size >= header_size\n\n elements << cleanup_quotes(line[start...i], quote)\n previous_char = line[i]\n i += col_sep.size\n start = i\n else\n quote_count += 1 if line[i] == quote && previous_char != '\\\\'\n previous_char = line[i]\n i += 1\n end\n end\n elements << cleanup_quotes(line[start..-1], quote) if header_size.nil? || elements.size < header_size\n [elements, elements.size]\n end", "def read_tsv(path, header = true, nil_values = [''])\n output = Array.new\n content = File.read(path).rstrip.split(/\\n/).map{|r| r.split(/\\t/)}\n if header\n head = content[0]\n content.shift\n else\n head = dummy_header(content[0].length)\n end\n content.each do |c|\n d = head.map.with_index{|h, i| [h, (nil_values.any?(c[i])) ? nil : c[i]]}\n output << d.to_h\n end\n return output\nend", "def read_tsv(path, header = true, nil_values = [''])\n output = Array.new\n content = File.read(path).rstrip.split(/\\n/).map{|r| r.split(/\\t/)}\n if header\n head = content[0]\n content.shift\n else\n head = dummy_header(content[0].length)\n end\n content.each do |c|\n d = head.map.with_index{|h, i| [h, (nil_values.any?(c[i])) ? nil : c[i]]}\n output << d.to_h\n end\n return output\nend", "def default_line_separator\n @def_line_sep ||= infer_line_separator\n end", "def file_contents\n @file_contents ||= extract_file\n rescue CSV::MalformedCSVError => e\n @errors << \"Unable to read file. Is it it plain-text file? (#{e.message})\"\n false\n end", "def process_str_file(file_array)\n column_headings = []\n file_array.each do |f|\n\n #File.open(params[:inputfile],\"r\") do |file|\n # while (f = file.gets)\n next if f =~ /^#/ # ignore lines that start with a hash - comments\n f.strip! # remove any whitespace, linefeeds, etc.\n\n # if this line has the column headings, extract and do the next line\n if f =~ /^Order/\n column_headings = f.split(/\\t/)\n next\n end\n\n # Split the biomart dump file on tabs\n the_data = f.split(/\\t/)\n\n case the_data[2]\n when 'TRAIT'\n load_hjj_trait_data(column_headings,the_data)\n when 'SNP'\n load_hjj_snp_data(column_headings,the_data)\n when 'STR'\n load_hjj_str_data(column_headings,the_data)\n end\n\n #end # end of while loop\n end # of File.open\n \n end", "def csvread (filename)\n File.readlines(filename).each do |line|\n if line && !empty?(line)\n num, code, kind, desc, contenten, contentme = line.split(\"\\t\")\n\n num = num\n code = clean(code)\n kind = clean(kind)\n contenten = clean(contenten)\n contentme = clean(contentme)\n\n yield num, code, kind, desc, contenten, contentme\n end\n end\nend", "def importable_class_headers_ok?\n extra_headers = importable_columns - headers\n if extra_headers.empty?\n @columns_not_found = nil\n return true\n else\n @columns_not_found = extra_headers.join(', ')\n return false\n end\n end", "def comma_file_parser\n @comma_names = File.open(\"text_files/comma.txt\").readlines.each do |line|\n if line.include?(\"\\n\") # removes '\\n' (line breaker)\n line.gsub!(/\\n/, '')\n else\n line\n end\n end\nend", "def arrange_in_columns(cols, widths, border)\n row = \"\"\n idxs = cols.collect{|c| 0 }\n\n while cols.zip(idxs).any?{|col| col[0].length > col[1] }\n cols.each.with_index do |col, idx|\n slice_width = widths[idx]\n\n slice = col.slice(idxs[idx], slice_width) || \"\" # sacamos el pedazo de la columna\n row << slice.ljust(slice_width) # concatenamos a la fila\n idxs[idx] += slice_width # recorremos el indice\n row << \" \" * border # agregamos el border de la derecha\n end\n\n row = row.strip << \"\\n\" # quitamos el ultimo border\n end\n\n return row.strip # quitamos el ultimo salto de linea\n end", "def parse_file\n if @csv_source == \"siteimprove\"\n column_seperator = \"\\t\" \n # If using CharlockHolmes Encoding Detector, uncomment this\n #detection = CharlockHolmes::EncodingDetector.detect(contents)\n #@csv_encoding = detection[:encoding]\n @csv_encoding = \"UTF-16LE\"\n elsif @csv_source == \"google\" \n column_seperator = \",\"\n # If using CharlockHolmes Encoding Detector, uncomment this \n #detection = CharlockHolmes::EncodingDetector.detect(contents)\n #@csv_encoding = detection[:encoding]\n @csv_encoding = \"ISO-8859-1\"\n end\n contents = File.read(@csv_filename)\n output_encoding = @csv_encoding + \":UTF-8\"\n arr_csv_contents = CSV.read(@csv_filename, { :encoding => output_encoding, :headers => true, :col_sep => column_seperator, :skip_blanks => true })\n if @csv_source == \"siteimprove\"\n @site_name = \"Graduate Research\"\n @site_addr = \"http://gradresearch.unimelb.edu.au\"\n arr_csv_contents.each { |row| \n @arr_of_titles << row[0]\n @arr_of_urls << row[1]\n } \n # delete the first two rows of the array\n @arr_of_titles = @arr_of_titles.drop(2)\n @arr_of_urls = @arr_of_urls.drop(2) \n elsif @csv_source == \"google\" \n #@site_name = \"Grainger Museum\"\n @site_name = \"Varied-Sample\"\n @site_addr = \"http://www.unimelb.edu.au/\"\n arr_csv_contents.each { |row| \n @arr_of_titles << row[0]\n @arr_of_urls << row[7] #1 for grainger\n } \n end\n end", "def get_columns!( *headers )\n headers = headers.flatten\n hrow = sheet.header_rows - 1\n ensure_shape\n @data = @data.transpose.select{ |col| col[0..hrow].any?{ |val| headers.include?( val ) } }\n @data = @data.sort_by{ |col| headers.index( col[0..hrow].select { |val| headers.include?( val ) }.first ) || headers.length }.transpose\n calc_dimensions\n end", "def guess_delimiter(string)\n\n # match just on a space delimited line\n if /\\w \\w/.match(string)\n return \" \"\n # match on comma delimited line\n elsif /,\\s*/.match(string)\n return \",\"\n # match on pipe delimited line\n elsif /\\w \\| \\w/.match(string)\n return \"|\"\n end\n end", "def header_fields\n @csv.headers\n end", "def read_headers (col_stop)\r\n\t\t\t# collect header row\r\n\t\t\theaders = (1..col_stop).collect { |j|\r\n\t\t\t\[email protected](1,j)\r\n\t\t\t}\r\n\t\t\t# drop case, strip flanking spaces, replace gaps with underscores\r\n\t\t\tpp @syn_dict\r\n\t\t\treturn headers.collect { |h|\r\n\t\t\t\th_str = h.downcase.strip.gsub(' ', '_').to_sym()\r\n\t\t\t\tpp h_str\r\n\t\t\t\tpp @syn_dict.fetch(h_str, h_str)\r\n\t\t\t\t@syn_dict.fetch(h_str, h_str)\r\n\t\t\t}\r\n\t\tend", "def headers_from_file(fn)\n clear_headers\n headers_from_array(File.read(fn).split(\"\\n\"))\n return \"headers set from #{fn}\"\n end", "def separator\n nil\n end", "def get_column_index(line, col_name)\n line_ar = (line.is_a? Array) ? line : line.split\n line_ar.find_index(col_name)\nend", "def headerName(header)\n begin\n header.split(\" \")[0]\n rescue\n \"\"\n end\nend", "def validate_header(header)\n import_failed(0, t(:header_invalid)) if self.class.csv_header != header\n end", "def table_separation\n line = \"#{TABLE_COLUMN_LINE}|#{TABLE_COLUMN_LINE}\".dup\n line << \"|#{TABLE_COLUMN_LINE}\" if header_line_rate?\n line << \"|#{TABLE_COLUMN_LINE}\" if header_branch_rate?\n line << \"\\n\"\n end", "def parse_csv_legacy(file)\n\trows = []\n\tlines = File.read(file).split(\"\\n\").map(&:strip).reject { |l| l.empty? }\n\trows = lines.map { |r| r.split(\",\").map(&:strip) }\n\n\theader = rows.shift\n\n\trows.map do |row|\n\t\ti = 0\n\t\trow_hash = {}\n\t\theader.each do |h|\n\t\t\trow_hash[h] = row[i]\n\t\t\ti += 1\n\t\tend\n\t\trow_hash\n\tend\nend" ]
[ "0.6036126", "0.5901849", "0.5612929", "0.54666996", "0.5438543", "0.5357109", "0.53222996", "0.5294445", "0.50595534", "0.49793327", "0.4963215", "0.49334764", "0.49233347", "0.4920066", "0.49138913", "0.48828658", "0.48672378", "0.48038948", "0.47681335", "0.47544372", "0.47446752", "0.4733343", "0.4705855", "0.47043502", "0.46981388", "0.46966907", "0.46565905", "0.46097115", "0.45975348", "0.45816937", "0.45630077", "0.4551467", "0.4548281", "0.4541933", "0.45217508", "0.44998592", "0.44994316", "0.44927582", "0.44903862", "0.44798484", "0.4475342", "0.44666043", "0.44526148", "0.44468448", "0.44410875", "0.4436992", "0.44305587", "0.44251224", "0.44222942", "0.4417511", "0.44157112", "0.44143617", "0.4403467", "0.4395246", "0.43892258", "0.43853217", "0.4378059", "0.4374694", "0.43743682", "0.43730903", "0.4358356", "0.43571064", "0.4355393", "0.43533492", "0.43456125", "0.43443245", "0.4343591", "0.4343591", "0.433833", "0.43310276", "0.4328344", "0.43122414", "0.42971855", "0.4297126", "0.4292101", "0.42882764", "0.42879185", "0.42862627", "0.42860055", "0.42843547", "0.42843547", "0.42824066", "0.42755714", "0.42750698", "0.42690524", "0.42550775", "0.42424142", "0.4240617", "0.42354557", "0.42328578", "0.4229157", "0.42236948", "0.4222329", "0.42141017", "0.42132032", "0.42101437", "0.42070892", "0.42055786", "0.42040816", "0.42035398" ]
0.8163416
0
limitation: this currently reads the whole file in before making a decision
def guess_line_ending(filehandle, options) counts = {"\n" => 0, "\r" => 0, "\r\n" => 0} quoted_char = false # count how many of the pre-defined line-endings we find # ignoring those contained within quote characters last_char = nil lines = 0 filehandle.each_char do |c| quoted_char = !quoted_char if c == options[:quote_char] next if quoted_char if last_char == "\r" if c == "\n" counts["\r\n"] += 1 else counts["\r"] += 1 # \r are counted after they appeared end elsif c == "\n" counts["\n"] += 1 end last_char = c lines += 1 break if options[:auto_row_sep_chars] && options[:auto_row_sep_chars] > 0 && lines >= options[:auto_row_sep_chars] end rewind(filehandle) counts["\r"] += 1 if last_char == "\r" # find the most frequent key/value pair: k, _ = counts.max_by{|_, v| v} return k end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(file)\n results = error_basic_inject(\"select CHAR_LENGTH(load_file(#{file.strip.chomp.mysqlhex}))\")\n if results.nil? or results == ''\n print_line(\"\")\n print_caution(\"Unable to determine size of #{file}....\")\n max = 1000\n else\n max = results.to_i\n end\n data = ''\n count = 1\n complete = false\n while not complete \n results = error_basic_inject(\"select mid(load_file(#{file.strip.chomp.mysqlhex}), #{count},50)\")\n count += 50\n if not results.nil? and not results == ''\n data += results.gsub('\\x0A', \"\\n\").gsub('\\x09', \"\\n\")\n else\n results = error_basic_inject(\"select mid(load_file(#{file.strip.chomp.mysqlhex}), #{count},50)\")\n count += 50\n if not results.nil? and not results == ''\n data += results.gsub('\\x0A', \"\\n\").gsub('\\x09', \"\\n\")\n else\n complete = true\n end\n end\n break if count > (max + 100)\n end\n if not data.nil? and not data == ''\n # Log Success for offline review\n logs = RESULTS + $config['INJECTOR']['MYSQL']['URL'].sub('http://', '').sub('https://', '').sub(/\\/$/, '').split(\"/\")[0]\n logdir = logs + '/load_file/'\n logfile = logdir + file.gsub('/', '_').gsub('\\\\', '_').gsub(/[;:'\",.~`!@#$\\%^&*\\(\\)=\\[\\]]/, '_')\n Dir.mkdir(logs) unless File.exists?(logs) and File.directory?(logs)\n Dir.mkdir(logdir) unless File.exists?(logdir) and File.directory?(logdir)\n f = File.open(logfile, 'w+')\n f.puts data\n f.close\n print_good(\"File: #{file}\")\n print_status(\"#########################################################\")\n print_line(\"#{data.chomp}\")\n print_status(\"#########################################################\")\n return true\n else\n print_line(\"\")\n print_error(\"No results for: #{file}\")\n return false\n end\n end", "def potential_lines(filename); end", "def check_read(file, bytes); end", "def check_read(file, bytes); end", "def load1\nf = File.read(@filename)\nf.each_line do |line|\nif line.match('#undone')\n@pending << line\nelse\n@completed << line\nend\nend\nreturn @pending\nend", "def not_test_read_head_part\r\n files_part1 = [\"9-14(15~20略).TXT\", \"33-39(21~32略).TXT\", \"40-43.txt\", \"44-47.txt\", \"48-55.TXT\",\r\n \"56-57概述结束.TXT\", \"58-59.TXT\"]\r\n files_part2 = Array.new\r\n #从60开始,到 471\r\n (60..471).to_a.each{ |i|\r\n files_part2 << i.to_s+\".TXT\"\r\n }\r\n read_from_files(files_part1 + files_part2)\r\n end", "def receive_valid_lines_from_file\n File.readlines(FILE_NAME).select { |line| line.downcase.include?('post') }\nend", "def check_format(file)\n \tbegin\n content = file_content(file)\n content = content.split(\"\\n\").reject { |c| c.empty? }\n read_file(content)\n rescue\n raise_error ERROR_READING_FILE\n end\n end", "def fin; false; end", "def comparative(file_name)\n @scrap_lines = File.readlines(file_name)\n\n @upload_docs.each do |upload_doc_line|\n if @scrap_lines.include?(upload_doc_line)\n if File.file?(\"report.txt\") \n File.open(\"report.txt\" ,\"w\"){ |file| file.write(upload_doc_line)}\n else\n @reportfile = File.new(\"report.txt\",\"w+\")\n File.open(\"report.txt\",\"w\"){ |file| file.write(upload_doc_line)}\n @reportfile.close\n end\n else\n puts \"No instances of plagiarism detected in the application;\"\n end\n end \n end", "def parse_remaining_files; end", "def read_file_fuzz\n print_line(\"\")\n while(true)\n print_caution(\"File to Fuzz with: \")\n file = gets.strip.chomp\n print_line(\"\")\n if File.exists?(file)\n fuzz = File.open(file).readlines\n print_status(\"Loaded #{fuzz.size} fuzzies from #{file}....\")\n print_caution(\"Do you want to Stop at First Success (Y/N)?\")\n answer=gets.chomp\n if answer.upcase == 'Y' or answer.upcase == 'YES'\n stop=true\n else\n stop=false\n end\n break\n else\n print_error(\"Can't find or read provided file!\")\n print_error(\"Check path or permissions and try again...\")\n print_line(\"\")\n end\n end\n print_status(\"Fuzzing Backend Files via load_file()....\")\n if stop\n while(true)\n fuzz.each do |fuzzy|\n break if read_file(fuzzy.chomp)\n end\n break\n end\n else\n fuzz.each { |fuzzy| read_file(fuzzy.chomp) }\n end\n end", "def readFile\r\n\t\tfile = File.open(fileName, \"r\")\r\n\r\n\t\t#Array for partial matches\t\t\r\n\t\t@dictionary = Array.new\r\n\t\tfile.each do |line|\r\n\t\t\tif line != \"\\n\"\r\n\t\t\t\t@dictionary << line.split(/[:;\\n]/)\r\n\t\t\tend\r\n\t\tend\r\n\t\tstartStrategies\r\n\tend", "def read_file_fuzz\n print_line(\"\")\n while(true)\n print_caution(\"File to Fuzz with: \")\n file = gets.strip.chomp\n print_line(\"\")\n if File.exists?(file)\n fuzz = File.open(file).readlines\n print_status(\"Loaded #{fuzz.size} fuzzies from #{file}....\")\n print_caution(\"Do you want to Stop at First Success (Y/N)?\")\n answer = gets.chomp\n if answer.upcase == 'Y' or answer.upcase == 'YES'\n stop = true\n else\n stop = false\n end\n break\n else\n print_error(\"Can't find or read provided file!\")\n print_error(\"Check path or permissions and try again...\")\n print_line(\"\")\n end\n end\n print_status(\"Fuzzing Backend Files via load_file()....\")\n if stop\n while(true)\n fuzz.each do |fuzzy|\n break if read_file(fuzzy.chomp)\n end\n break\n end\n else\n fuzz.each { |fuzzy| read_file(fuzzy.chomp) }\n end\n end", "def read_file\n if @file_lines.empty?\n @file = File.open(@population_file)\n @file_lines = @file.readlines()\n end\n end", "def read_file\n \t@readin = []\n file = File.open(@filename[@file_count], 'r')\n\t @readin = file.each.to_a\n\t # chop off the escaped characters (in this case: \\r\\n)\n @readin.map! {|s| s.chomp}\n # increment the file count\n @file_count += 1\n file.close\n # determine which file was read in\n # the files either have a \"W\" (for power) or \"Wh\" as the first line\n \tif @readin[0] =~ /Wh/\n \t\tparse_energy\n \telse @readin[0] =~ /W/\n \t\tparse_power\n \tend\n end", "def parse_file\n line_count = 0\n @text.each_line do |line|\n if line == nil || line == '' || line.size == 0 || line[0] == '#' || line[0] == \"\\n\"\n next\n end\n elements = line.split(' ')\n if elements.size > 2\n puts 'Waring : '.red + 'in file \"' + @file_name.yellow + '\" ignoring line ' + line_count.to_s.yellow + ' ( it has more than one space and is not a comment )'\n else\n if elements.size == 1\n @ret << Manga_data.new(nil, nil, nil, elements[0], nil)\n else\n @ret << Manga_data.new(nil, elements[0], elements[1], nil, nil)\n end\n end\n line_count += 1\n end\n end", "def read_file(file)\n results = union_basic_inject($config['INJECTOR']['MYSQL']['UNION']['VULN_COLUMN'].to_i, \"load_file(#{file.strip.chomp.mysqlhex})\")\n if not results.nil? and not results == ''\n # Log Success for offline review\n logs = RESULTS + $config['INJECTOR']['MYSQL']['URL'].sub('http://', '').sub('https://', '').sub(/\\/$/, '').split(\"/\")[0]\n logdir = logs + '/load_file/'\n # Try to ensure filenames dont end up jacked up, no guarantees :p\n logfile = logdir + file.gsub('/', '_').gsub('\\\\', '_').gsub(/[;:'\",.~`!@#$\\%^&*\\(\\)=\\[\\]]/, '_')\n Dir.mkdir(logs) unless File.exists?(logs) and File.directory?(logs)\n Dir.mkdir(logdir) unless File.exists?(logdir) and File.directory?(logdir)\n f=File.open(logfile, 'w+')\n f.puts results\n f.close\n print_good(\"File: #{file}\")\n print_status(\"#########################################################\")\n print_line(\"#{results.chomp}\")\n print_status(\"#########################################################\\n\")\n return true\n else\n print_error(\"No results for: #{file}\")\n return false\n end\n end", "def read_contents\n\n #puts \"pofr file #{@file_blob.filename}\"\n\n file_lines=[]\n @file_blob.open do |file|\n File.open(file){|x| file_lines = x.readlines}\n puts file_lines[0]\n puts file_lines.last\n end\n\n if @file_blob.filename.extension == \"out\" # GNOM\n getDataLinesFromGnom(file_lines)\n elsif @file_blob.filename.extension == \"dat\" # scatter\n puts \"reading file @file #{@file_blob.filename}\"\n getDataLinesFromScatter(file_lines)\n end\n\n @dmax = @r_values.last\n @pr_values.each do |y|\n @pr_max = (y[1] > @pr_max) ? y[1] : @pr_max\n @pr_min = (y[1] < @pr_min) ? y[1] : @pr_min\n end\n\n end", "def file_read_opts; end", "def read_txt\n # Open TXT file\n # f = File.open(self.fichero, \"r\")\n # Use TXT file content\n f = self.fichero\n # Loop thru open file lines\n f.each_line do |line|\n cod_reg = line[0,2]\n if cod_reg == '80'\n # Totals line\n amount = line[36,12]\n self.total_bills = line[22,6].to_i\n self.total_amount = (amount[0,10] + '.' + amount[10,2]).to_d\n elsif cod_reg == '02'\n # Header line\n pdate = line[36,6]\n self.nif = line[10,8]\n self.sufijo = line[18,3]\n self.process_date_time = Date.parse(pdate[4,2] + pdate[2,2] + pdate[0,2]) rescue Date.today\n elsif cod_reg == '01' || cod_reg == '90'\n # First or Last line\n else\n # Invoice charged line: Save in array\n amount = line[36,12]\n self.lista_cobros.push(bill_id: line[76,11].to_i,\n amount: (amount[0,10] + '.' + amount[10,2]).to_d,\n date: line[30,6],\n issuer: line[10,8],\n suffix: line[18,3],\n charge_code: line[21,1],\n charge_bank: line[22,4],\n charge_office: line[26,4],\n charge_id: line[48,6],\n iban_head: line[4,4],\n ccc_bank: line[54,4],\n ccc_office: line[58,4],\n ccc_dc: line[62,2],\n ccc_account_no: line[64,10],\n debit_code: line[74,1],\n cancel_code: line[75,1],\n reference: line[76,13])\n end\n end # f.each_line\n # f.close\n end", "def read_file(file, context); end", "def read() end", "def read\n x = nil\n File.open(@filename, 'r') {|f| x = f.readlines }\n x.each do |line|\n\n line = self.class.remove_comments(line)\n\n if line.present?\n @data << self.class.extract_data_from_line(line)\n # puts self.class.extract_data_from_line(line).to_yaml\n end\n end\n end", "def read_file(filename); end", "def words_file(words)\n File.read(words).lines.select do |l|\n (3..9).cover?(l.strip.size)\n end\n end", "def read(files); end", "def read(files); end", "def read_file filename\n\t\tbegin\t \n\t\t\tfile = File.new(filename, \"r\")\n\t\t\tline_number = 1\n\t\t file.each do |line|\t\t \t\n\t\t \tself.read_input_line line, line_number\n\t\t \tline_number += 1\n\t\t end\t \n\t\trescue => err\n\t\t puts \"File not loaded: #{err}\"\n\t\t err\n\t\tensure file.close if file end\n\tend", "def read_auto_clean_up; end", "def handle_inputs_from_file file_path\n File.open(file_path) do |file|\n file.lazy.each_slice(500) do |input_lines|\n input_lines = input_lines.delete_if { |line| line == \"\\n\" } # There can be empty lines\n iterate_over_lines_and_fetch_domain(input_lines)\n end\n end\n end", "def by_line_length\n a = File.readlines(file_name)\n while b = a.shift\n puts b if b.length >= 250\n end\n end", "def read\n $t1 = Time.now # Init procedure timestamp\n person = []\n IO.foreach(\"data_500.txt\") do |line| # Get all patients from file iterate each line\n line.chomp! # Remove trailing whitespace.\n person.push(line.split(\":\")) # Saving data split :\n end\n group(person) # Get blood type\n end", "def reader; end", "def read(file)\n\t\tnline = 0\t\t\t# entero que cuenta el numero de lineas en el archivo\n\t\tcomment = false \t# booleano que indica si se ha encontrado o no un comentario\n\t\tfile.each_line do |line|\n\t\t\tnline +=1\t\t# Para cada linea se imcrementa el contador en 1\n\t\t\tncolumn = 1\t\t# En cada nueva linea se inicializa el contador de columnas del archivo en 1 \n\n\t\t\t# Se chequea que la linea a leer no sea vacia\n\t\t\twhile line != \"\"\t\t\t\t\n\t\t\t\t# Para cada linea, se evaluan distintas expresiones regulares para la creacion del token\n\t\t\t\tcase line\n\n\t\t\t\t# Caso inicio/fin de comentario ( {-,-} )\n\t\t\t\twhen /^(\\{\\-|\\-\\})/\n\t\t\t\t\tword = line[/^(\\{\\-|\\-\\})/]\n\t\t\t\t\tif word == \"\\{\\-\"\n\t\t\t\t\t\tcomment = true \t\t# se encontro el inicio de comentario\n\t\t\t\t\t\t@comment << Token.new(nil,nil,nline,ncolumn)\n\t\t\t\t\telsif word == \"\\-\\}\"\n\t\t\t\t\t\tcomment = false \t# se cerro el comentario\n\t\t\t\t\t\[email protected]\n\t\t\t\t\tend\n\t\t\t\t\t# Para este caso no se crea token, simplemente se corta la linea para continuar \n\t\t\t\t\t# con la evaluacion de los siguientes caracteres/palabras\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso true,false,read,write\n\t\t\t\twhen /^(true|false|read|write)/\n\t\t\t\t\tword = line[/^(true|false|read|write)/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que la palabra no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \"true\" \n\t\t\t\t\t\t\t@tokens << Token.new(:TRUE,true,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"false\" \n\t\t\t\t\t\t\t@tokens << Token.new(:FALSE,false,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"read\"\n\t\t\t\t\t\t\t@tokens << Token.new(:READ,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"write\"\n\t\t\t\t\t\t\t@tokens << Token.new(:WRITE,word,nline,ncolumn)\n\t\t\t\t\t \tend\n\t\t\t\t\t end\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\t ncolumn += word.size()\n\t\t\t\t\t \n\t\t\t\t# Caso cualquier palabra que no sea true,false,read,write (identificadores)\n\t\t\t\twhen /^[a-zA-Z_][a-zA-Z0-9_]*/\n\t\t\t\t\tword = line[/^[a-zA-Z_][a-zA-Z0-9_]*/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el identificador no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\t@tokens << Token.new(:IDENTIFIER,word,nline,ncolumn)\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso para los numeros\n\t\t\t\twhen /^[0-9][0-9]*/\n\t\t\t\t\tword = line[/^[0-9][0-9]*/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el numero no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\t\t@tokens << Token.new(:NUMBER,word.to_i,nline,ncolumn)\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso operadores booleanos (/\\,\\/,^)\n\t\t\t\twhen /^(\\\\\\/|\\/\\\\|\\^)/\n\t\t\t\t\tword = line[/^(\\\\\\/|\\/\\\\|\\^)/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el operador no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \"\\^\" \n\t\t\t\t\t\t\t @tokens << Token.new(:NOT,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"\\\\\\/\" \n\t\t\t\t\t\t\t@tokens << Token.new(:OR,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"\\/\\\\\" \n\t\t\t\t\t\t\t@tokens << Token.new(:AND,word,nline,ncolumn)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\t\t\t\t\t\n\t\t\t\t# Caso lienzos (<|>,<\\>,<->,< >,#)\n\t\t\t\twhen /^(<(\\||\\\\|\\/|\\-|\\_|\\s)>|#)/\n\t\t\t\t\tword = line[/^(<(\\||\\\\|\\/|\\-|\\_|\\s)>|#)/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el lienzo no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \"#\" then \n\t\t\t\t\t\t\t@tokens << Token.new(:EMPTY_CANVAS,[\"\"],nline,ncolumn)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t@tokens << Token.new(:CANVAS,[word[1]],nline,ncolumn)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso <=,>=,/=,>,<,=\n\t\t\t\twhen /^(>=|<=|\\/=|>|<|=)/\n\t\t\t\t\tword = line[/^(>=|<=|\\/=|>|<|=)/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el operador no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \">=\"\n\t\t\t\t\t\t\t@tokens << Token.new(:MORE_EQUAL,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"<=\"\n\t\t\t\t\t\t\t@tokens << Token.new(:LESS_EQUAL,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"\\/=\"\n\t\t\t\t\t\t\t@tokens << Token.new(:INEQUAL,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \">\"\n\t\t\t\t\t\t\t@tokens << Token.new(:MORE,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"<\"\n\t\t\t\t\t\t\t@tokens << Token.new(:LESS,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"=\"\n\t\t\t\t\t\t\t@tokens << Token.new(:EQUAL,word,nline,ncolumn)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso !,%,@\n\t\t\t\twhen /^[!%@]/\n\t\t\t\t\tword = line[/^[!%@]/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el caracter no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \"!\"\n\t\t\t\t\t\t\t@tokens << Token.new(:EXCLAMATION_MARK,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"%\"\n\t\t\t\t\t\t\t@tokens << Token.new(:PERCENT,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"@\"\n\t\t\t\t\t\t\t@tokens << Token.new(:AT,word,nline,ncolumn)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso operadores aritmeticos (+,-,*,/)\n\t\t\t\twhen /^(\\+|-|\\*|\\/)/\n\t\t\t\t\tword = line[/^(\\+|-|\\*|\\/)/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el caracter no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \"\\+\"\n\t\t\t\t\t\t\t@tokens << Token.new(:PLUS,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"-\"\n\t\t\t\t\t\t\t@tokens << Token.new(:MINUS,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"\\*\"\n\t\t\t\t\t\t\t@tokens << Token.new(:MULTIPLY,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"\\/\"\n\t\t\t\t\t\t\t@tokens << Token.new(:DIVISION,word,nline,ncolumn)\n\t\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso :,|,$,',&,~,;\n\t\t\t\twhen /^[:|$'&~]/\n\t\t\t\t\tword = line[/^[:|$'&~]/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el caracter no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \":\"\n\t\t\t\t\t\t\t@tokens << Token.new(:COLON,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"|\"\n\t\t\t\t\t\t\t@tokens << Token.new(:PIPE,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"$\"\n\t\t\t\t\t\t\t@tokens << Token.new(:DOLLAR,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"'\"\n\t\t\t\t\t\t\t@tokens << Token.new(:APOSTROPHE,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"&\"\n\t\t\t\t\t\t\t@tokens << Token.new(:AMPERSAND,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"~\"\n\t\t\t\t\t\t\t@tokens << Token.new(:VIRGUILE,word,nline,ncolumn)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso {,},[,],(,),?,;,..\n\t\t\t\twhen /^(\\{|\\}|\\[|\\]|\\(|\\)|\\?|;|\\.\\.)/\n\t\t\t\t\tword = line[/^(\\{|\\}|\\[|\\]|\\(|\\)|\\?|;|\\.\\.)/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que el caracter no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\tif word == \"{\"\n\t\t\t\t\t\t\t@tokens << Token.new(:LCURLY,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"}\"\n\t\t\t\t\t\t\t@tokens << Token.new(:RCURLY,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"[\"\n\t\t\t\t\t\t\t@tokens << Token.new(:LBRACKET,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"]\"\n\t\t\t\t\t\t\t@tokens << Token.new(:RBRACKET,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"(\"\n\t\t\t\t\t\t\t@tokens << Token.new(:LPARENTHESIS,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \")\"\n\t\t\t\t\t\t\t@tokens << Token.new(:RPARENTHESIS,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"?\"\n\t\t\t\t\t\t\t@tokens << Token.new(:INTERROGATION_MARK,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \";\"\n\t\t\t\t\t\t\t@tokens << Token.new(:SEMI_COLON,word,nline,ncolumn)\n\t\t\t\t\t\telsif word == \"\\.\\.\"\n\t\t\t\t\t\t\t@tokens << Token.new(:DOUBLE_DOT,word,nline,ncolumn)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Caso espacio en blanco\n\t\t\t\twhen /^\\s/\n\t\t\t\t\tline = line.partition(/^\\s/).last\n\t\t\t\t\t# El tamaño de la columna se incrementa en 1, porque este es el tamaño correspondiente a 1 espacio\n\t\t\t\t\tncolumn += 1\n\n\t\t\t\t# Caso simbolo no aceptado por el lenguaje\n\t\t\t\telse\n\t\t\t\t\tword = line[/^[^\\s\\w]/]\n\t\t\t\t\tline = line.partition(word).last\n\t\t\t\t\t# Verifica que no este dentro de un comentario\n\t\t\t\t\tif !comment then\n\t\t\t\t\t\t# Si se cumple la condicion, se crea un nuevo token\n\t\t\t\t\t\t@invalids << InvalidWord.new(word,nline,ncolumn)\n\t\t\t\t\tend\n\t\t\t\t\t# Para saber en que columna se encuentra la siguiente palabra/caracter, en \n\t\t\t\t\t# lugar de incrementarlo en 1 se le incrementa en el tamaño de la palabra que se haya encontrado\n\t\t\t\t\tncolumn += word.size()\n\n\t\t\t\t# Cierra case\n\t\t\t\tend\n\t\t\t# Cierra while\n\t\t\tend\n\t\t# Cierra do\n\t\tend\t\n\t# Cierra procedimiento read\n\tend", "def return_lines\n arr = IO.readlines(@filepath)\n arr.each do |x|\n @@worth_processing[@@i] = x if x.include? \"PROFILER:132\" \n @@i += 1\n end\n @@worth_processing\n end", "def write\n people = File.open('people.in').read\n people.gsub!(/\\r\\n?/, \"\\n\")\n\n good_people = []\n people.each_line do |line|\n person = line.split(\"|\")\n\n if ['vice president', 'whatever'].any? person[3]\n good_people.push(person[0])\n end\n end\n\n File.write('output.in', good_people.first(100))\n end", "def read_lines(file)\r\n\t\t\tbegin\r\n\t\t\t\tofile = File.new(file, \"r\")\r\n\t\t\t\twhile (line = ofile.gets)\r\n\t\t\t\t\t@lines += 1\r\n\t\t\t\t\tif line.strip == \"\"\r\n\t\t\t\t\t\t@blank_lines += 1\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\t\tofile.close\r\n\t\t\trescue => err\r\n\t\t\t\tputs \"Could not access #{err}\"\r\n\t\t\tend\r\n\t\tend", "def in_file(filename); end", "def parse_input(input_file); end", "def parse_input(input_file); end", "def read(file) \n @file = Nokogiri::XML(file){ |cfg| cfg.noblanks } \n end", "def read_word_file(file)\n\t\tFile.foreach(file) do |line|\n\t\t\tif(@@word.legal?(line.chomp)) # Check if current line/word is legal\n\t\t\t\tLEGAL_WORDS << line.chomp # Add line/word to array of legal words\n\t\t\tend\n end\n LEGAL_WORDS.freeze # Freeze LEGAL_WORDS to make it immutable\n\tend", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read; end", "def read_problems_csv(book)\n if problems_csv_has_been_read then fatal_error(\"read_problems_csv appears to have been called more than once\") end\n file = find_problems_csv(book)\n n_good_lines = 0\n File.readlines(file).each { |line|\n if line=~/(.*),(.*),(.*),(.*),(.*)/ then\n n_good_lines = n_good_lines+1\n b,ch,num,label,soln = [$1,$2.to_i,$3,$4,$5.to_i] # note num is string, since \"number\" can be like \"g7\"\n split_problem_number_into_letter_and_number(num) # dies with fatal error if syntax is wrong\n if b==book && label!=\"deleted\" then\n if !($label_to_num[label].nil?) then \n fatal_error(\"label #{label} is multiply defined in file #{file} for book #{book}\")\n end\n $label_to_num[label] = [ch,num]\n if !($num_to_label[[ch,num]].nil?) then\n fatal_error(\"problem #{ch}-#{num} has two labels defined, #{$num_to_label[[ch,num]]} and #{label}, both for book #{book}\")\n end\n $num_to_label[[ch,num]] = label\n $has_solution[[ch,num]] = (soln==1)\n end\n end\n }\n if n_good_lines==0 then fatal_error(\"in read_problems_csv(#{book}), reading file #{file}, no good lines read\") end\nend", "def process_input_file \n File.open(@file, 'r') do |f|\n f.each_line do |line|\n parse_line(line)\n end\n end\n end", "def read file\n File.open file\n end", "def file2items(file, marking, eliding=/^\\s*$/)\n items = []\n File.open(file, \"r\") do |f|\n item = []\n f.each do |line|\n if marking.match(line)\n items << item unless item.empty?\n item = []\n #p line\n end\n item << line unless eliding.match(line)\n end\n items << item \n end\n end", "def parse_user_file\n @data = []\n @data = CSV.read(@configuration[:user_file])\n if @configuration[:blacklist]\n datasize = @data.count\n @blacklist = []\n @blacklist = CSV.read(@configuration[:blacklist])\n @data = @data - @blacklist\n puts \"Blacklist applied. Removed #{datasize - @data.count} out of #{@blacklist.count} entries.\"\n end\n puts \"I successfully parsed #{@data.count} lines of data. Here's the first one: \\n#{@data[0]}\\n\\n\"\n @data\n end", "def filter\n read = []\n @file.each do |line|\n line = line.strip\n if !line[0].nil? && (line[0] != '/') # if line is not comment or blank append to output\n line = line.split(' ')[0] # removes inline comments\n read.append(line)\n end\n end\n read\n end", "def read_kuni (file,kuni)\n if can_see_this kuni\n erubis file \n end\n end", "def find_valid_data filename\n start = 0\n dbfile = File.new(filename)\n s = dbfile.gets\n while s[0] == ?# or s[0]==?\\n\n start+= s.size\n s = dbfile.gets\n end\n dbfile.seek(-128, File::SEEK_END)\n s = dbfile.read(128).chomp;\n last = s.rindex(\"\\n\");\n dbfile.close\n return [start-1,File.size(filename) - last]\nend", "def doing_raw_file_to_verified_unique_researches # adjustable line length filter\n consumer = Fiber.new do |producer, queue|\n a = File.read(\"../../Documents/20111224-research.txt\")\n\t new = a.to_textual\n#TODO finishe\t \n @megadata = a.sort do |x,y|\n x.downcase <=> y.downcase\n end\n @megadata_unique = @megadata.uniq\n f = open(\"./tmp/database_doings/doing_uniques/uniques_done.txt\", \"a\") do |f| \n loop do\n queue = producer.transfer(consumer, queue)\n puts f << queue\n queue.clear\n end\n raise StopIteration\n end\n end\n producer = Fiber.new do |consumer, queue|\n #IO.foreach(\"./tmp/database_doings/doing_uniques/uniques_todo.txt\") do |line|\n queue = \"\"\n puts queue\n @megadata_unique.each do |line|\n sequence_text = line.to_textual.de_comma\n if sequence_text.length < 50 # adjustable\n puts \"line ignored due to length\"\n elsif Sequence.find_by_sequence_text(sequence_text)\n puts \"line ignored as it is already in database : \" + \"#{sequence_text}\"\n else\n sequence_creation = sequence_text.de_space unless nil\n sequence_complete = sequence_text.split(//).sort.join('').strip unless nil\n sequence_lexigram = lexigram_sequencer(sequence_text) unless nil\n sequence_singular = sequence_complete.squeeze unless nil\n description = \"research\"\n reference = \"literoti\"\n anagram = 0\n name = 0\n phrase = 0\n research = 1\n external = 0\n internal = 0\n created_at = \"2011-12-21 12:12:00\"\n #line = \"#{sequence_text}\\n\"\n line = \"#{sequence_text}\\t#{sequence_creation}\\t#{sequence_complete}\\t#{sequence_lexigram}\\t#{sequence_singular}\\t#{description}\\t#{reference}\\t#{anagram}\\t#{name}\\t#{phrase}\\t#{research}\\t#{external}\\t#{internal}\\t#{created_at}\\n\"\n queue << line\n break unless line\n consumer.transfer queue\n queue.clear\n end\n end\n end\n raise StopIteration\n end", "def read_from_file(filename) # Input existing file\n IO.readlines(filename).each do |line|\n status, *description = line.split(':')\n status = status.upcase.include?('X')\n add(Task.new(description.join(':').strip, status))\n puts line\n end # End of input, output\n end", "def read_file\n match_file = File.new(\"matches.txt\", \"r\")\n no_of_match = match_file.gets\n if no_of_match != nil\n for i in 0..no_of_match.to_i - 1\n match_result = match_file.gets\n @matchesarr << match_result\n end\n end\n match_file.close\n end", "def parse_file\n filename = full_path_from_edict_file(@config[\"filename\"])\n ### Get all the line into memory\n file_obj = File.new(filename, \"r\")\n file_obj.each do |line|\n @added_lines.push line\n end\n end", "def parse_file\n #needs begin rescue exception handling \n \tbegin \n \t\traise FileNotFoundException.new(\"File not Found\") unless File.exists?(@file_path)\n\t\n \t\tFile.open(@file_path).slice_before(@delimiter).each do |chunk|\n \t\t\tchunk.reject! {|item| item =~ @delimiter }\n \t\ttitle = chunk.shift\n \t\tif @title_hash.has_key?(title)\n \t\t\t@title_hash[title] = @title_hash[title] << chunk \n \t\telse\n \t\t p chunk\n \t\t\t@title_hash[title] = chunk\n \t\tend \t\t\n \t\tend\n \t\t\n \trescue FileNotFoundException => e\n \t\tp e.message\n \tend\n\t\n end", "def scan_file (file_name)\n #for each line\n File.open(file_name).each do |line|\n parsed_line = parse_line line\n raise \"Invalid spec format:\\n\" + line if parsed_line.class == InvalidLine\n update_on_new_line parsed_line\n end \n @test_suite.add_test_case current_test_case if current_test_case && @state.class == AddingTestCases\n @test_suite\n end", "def ReadFromFile()\n wordArray = Array.new\n File.open(\"mastermindWordList.txt\", \"r\") do |file| # Uncomment this to have a larger list (466000+ words)\n # Note: Only use if in original repository that contains words.txt\n # File.open(\"mastermindWordList.txt\", \"r\") do |file| # Comment this if previous line is uncommented\n file.each_line do |word|\n if CheckValidWord(word) == true\n wordArray.push(word.chomp.downcase)\n end\n end\n end\n return wordArray\nend", "def iterate_several_file file_path\n #Iterate file line by line\n result_lines_in_file = []\n reg = /.*#{@phrase_we_have_now}.*/\n file = File.open(file_path, \"r\") do |f|\n f.each_line do |line|\n if line.match?(reg)\n result_lines_in_file << line\n end\n end\n end\n result_lines_in_file\n end", "def file_mode\n\t\tinput_file = File.open(input_path, 'r')\n\t\t\n\t\tinput_file.each_line do |line|\n\t\t\t@input = line\n\t\t\tparse_user_input\n\t\tend\n\tend", "def check_log_file\n size = File.size(@auth_log.file)\n size > @auth_log.size ? parse_chunk(size-@auth_log.size) : parse_file\n analyze_block unless @block.lines.empty?\n @auth_log.size = size\n end", "def process_reading\n begin\n open_and_read_file\n @read_flag = true\n puts 'Success. Check instance fields'.colorize(:green)\n rescue StandardError => e\n puts e.message\n end\n end", "def read\n\t\t@file_content = File.open(\"/home/calin/football/football.dat\",\"r\")\n\tend", "def carve in_file, out_file, metadata\n\t\t\t\tfalse\n\t\t\tend", "def check_line(filename, line_number, line_content)\n\t\tend", "def read_file pn\n pn.readlines.map(&:chomp)\n .each do |line|\n @entries.add line, pn\n end\n end", "def parse_input (input_file)\nend", "def eof; @file.eof; end", "def read_data(filename)\n count = 0\n fd = File.open(filename)\n while not fd.eof?\n line = fd.readline\n line.chomp!\n count += 1\n fields = []\n line.split('^').each do |f|\n datum = f.gsub('~~','').gsub(/^~/,'').gsub(/~$/,'')\n fields.push(datum.empty? ? nil : datum)\n end\n yield fields\n end\nrescue => e\n STDERR.puts \"error '#{e}' file '#{filename}' line #{count}\"\n exit\nensure\n fd.close\nend", "def process(orig_file)\n end", "def read(_file)\n fail \"Fetcher #{self} does not implement `read(...)`. This is required.\"\n end", "def necessary_file\n @necessary_file ||= (\n file = File.join(directory, 'lexicon', \"{N,n}ecessary.txt\")\n Dir.glob(file).first\n )\n end", "def scan_file(file_name)\n \n #init variables\n seq_name = '';\n seq_fasta = '';\n seq_found = false;\n \n \n # for each line of the file\n File.open(file_name).each do |line|\n \n line.chomp!;\n # if line is name\n if line =~ /^>/\n \n #process previous sequence\n if seq_found\n on_process_sequence(seq_name,seq_fasta);\n end\n \n #get only name\n seq_name = line.gsub('>','');\n seq_fasta='';\n seq_found = true;\n \n else\n #add line to fasta of seq\n seq_fasta+=line;\n end\n \n end\n \n # when found EOF, process last sequence\n if seq_found\n on_process_sequence(seq_name,seq_fasta);\n end\n \n end", "def use_file(file_arg, line)\n read = true\n file_arg.each do |file|\n f = check_file(file)\n exit 5 unless f\n f.each_line do |num|\n line += 1\n work_prompt(num, line, read)\n end\n f.close\n end\n end", "def get_range_in_file( file_name, line_a=1, line_b=-1 )\n\t\t@data_source = File.open( file_name, \"r\" )\n\t\tinitial_load_range( line_a, line_b )\n\tend", "def split_data_into_files(datafile)\n\n datafiles = []\n output = NIL\n File.open(Rails.root.join(datafile)) do |file| \n counter = 0\n something_was_written = FALSE\n while line = file.gets \n # parse lines and break into different files at #\n if( line.match( /^\\s*\\#+/ ) )\n if (something_was_written && output) \n output.close\n output = NIL\n end\n something_was_written = FALSE\n else \n if (!something_was_written) \n outputfile_name = datafile.gsub(/input/,\"input\" +\n counter.to_s)\n counter +=1\n output = File.open(Rails.root.join(outputfile_name), \"w\") \n datafiles.push((Rails.root.join(outputfile_name)).to_s)\n #datafiles.push( \"../\" + outputfile_name)\n #datafiles.push(Dir.getwd + \"/\" + outputfile_name)\n end\n # check if line matches @n_nodes digits\n nodes_minus_one = (@job.nodes - 1).to_s\n if (line.match( /^\\s*(\\.?\\d+\\.?\\d*\\s+){#{nodes_minus_one}}\\.?\\d+\\.?\\d*\\s*$/ ) ) \n output.puts line\n logger.info \"write line\" + line\n something_was_written = TRUE\n else\n @error_message = \"The data you entered is invalid. This :#{line.chop!}: is not a correct line.\"\n logger.warn \"Error: Input data not correct. This :#{line}: is not a correct line.\"\n return NIL\n end\n end\n end \n file.close\n if (output) \n output.close\n end\n end\n return datafiles\n end", "def quotationfileprocess path \n File.open(path, 'r') do |file|\n file.each_line do |line|\n cols = line.force_encoding('gb2312').split(\"\\t\")\n if /\\d{6}/ =~ cols[0][2..7].strip\n\t\t\t\t\t#added new quotation\n q = Quotation.new\n q.marketdate = tradedate\n \n q.code = cols[0][2..7].strip\n q.name = cols[1].strip\n q.cqstatus = 'chuquan' unless q.name[0..1] != 'XD'\n q.plate = cols[18].strip\n\n if cols[11].strip == '--'\n preq = Quotation.find_by(marketdate: pretradedate, code: q.code) \n q.open = 0 \n q.high = 0 \n q.low = 0 \n q.close = cols[14].strip\n\t\t\t\t\t q.dprofit = 0 \n\n q.tpstatus = 'tingpai' \n else\n q.open = cols[11].strip\n q.high = cols[12].strip\n q.low = cols[13].strip\n q.close = cols[3].strip\n\n\t\t\t\t\t q.dprofit = cols[2].strip\n end\n\t\t\t\t\t\n q.save\n end\n end\n end\n\tend", "def process \n return false if @file == false\n\t\t\n\t\ttime = File.mtime(@file)\n\n\t\tRDF::NQuads::Writer.open(@outfile) do |writer|\n\t\t\n\t\trecord = RDF::URI.new(\"http://bio2rdf.org/sider\")\n\n File.open(@file,\"r\").each do |line|\n row = line.strip.chomp.split(\"\\t\")\n \n # convert the STICH id to pubchem (see NOTES)\n pubchem = @pubchem_compound[row[1].to_i.abs.to_s]\n writer << [pubchem,RDF.type,@sider_vocabulary['Drug'],record]\n writer << [pubchem,DC.title,row[3],record]\n writer << [pubchem,DC.identifier,\"pubchem:#{row[1].to_i.abs.to_s}\",record]\n \n # these identifiers should in the future be linked \n # with proper ontology URIS retrieved from NCBO bioportal.\n side_effect = @umls[row[2]]\n writer << [side_effect,RDF.type,@sider_vocabulary['Side_Effect'],record]\n writer << [side_effect,DC.identifier,\"ulms:#{row[2]}\",record]\n writer << [side_effect,DC.title,row[4],record]\n writer << [pubchem,@sider_vocabulary['side_effect'],side_effect,record]\n end\n end\n end", "def read_text(filename); end", "def read\n \n end", "def post_analyze!\n contents = File.open(self.name, 'r').readlines\n exelines = 0\n contents.each_with_index do |line, num|\n sline = line.strip\n \n case sline\n when '', /^#/\n lines << num + 1\n when /^\\s*(?:end|\\})\\s*(?:#.*)?$/, /^(public|private|protected)/,\n /^(?:begin\\s*(?:#.*)?|ensure\\s*(?:#.*)?|else\\s*(?:#.*)?)$/,\n /^(?:rescue)/, /^case\\s*(?:#.*)?$/, /^(\\)|\\]|\\})(?:#.*)?$/\n lines << num + 1\n exelines += 1\n else\n exelines += 1\n end\n \n end\n \n @coverage_percent = (exelines.to_f / contents.size) * 100.0\n end", "def safe_readlines(filename)\n unless File.exists?(filename)\n puts \"File #{filename} not found\"\n return\n end\n\n # assume files are not huge as their comparison makes no sense in this case\n File.readlines(filename).map{|line| line.strip}\nend", "def test_read_with_a_length_specified\r\n contents = File.read('data.txt', 15)\r\n assert_equal 'Bradman 99.94 5', contents\r\n end", "def select_valid_lines\n File.readlines(FILE_NAME).select { |l| l.downcase.include?('calling core') }\nend", "def file_read_opts(context); end", "def read_contents\n\t\treturn File.open(self.file_name).read.lines.map(&:chomp) if self.file_name\n\tend", "def vulnerability_check(file_mode: false)\n file_to_read = file_mode ? FILE_FLAG_FILE_PATH : SITES_TO_CHECK_PATH # Check which file to read\n FORMAT.info(\"Reading from #{file_to_read}\")\n FORMAT.info('Forcing encoding to UTF-8') unless file_mode\n IO.read(\"#{file_to_read}\").each_line do |vuln|\n begin\n FORMAT.info(\"Parsing page for SQL syntax error: #{vuln.chomp}\")\n Timeout::timeout(10) do\n begin\n if SETTINGS.parse(\"#{vuln.chomp}'\", 'html', 0) =~ SQL_VULN_REGEX # If it has the vuln regex error\n SQL_ERROR[vuln.chomp] = SETTINGS.parse(\"#{vuln.chomp}'\", 'html', 0).to_s\n FORMAT.site_found(vuln.chomp)\n File.open(\"#{TEMP_VULN_LOG}\", \"a+\") { |vulnerable| vulnerable.puts(vuln) }\n sleep(0.5)\n else\n FORMAT.warning(\"#{vuln.chomp} is not vulnerable, dumped to non_exploitable.txt\")\n File.open(\"#{NON_EXPLOITABLE_PATH}\", \"a+\") { |non_exploit| non_exploit.puts(vuln) }\n sleep(0.5)\n end\n rescue Timeout::Error, OpenSSL::SSL::SSLError # Timeout or SSL errors\n FORMAT.warning(\"Site: #{vuln.chomp} failed to load, dumped to non_exploitable.txt\")\n File.open(\"#{NON_EXPLOITABLE_PATH}\", \"a+\") { |timeout| timeout.puts(vuln) }\n sleep(0.5)\n next\n end\n end\n rescue *LOADING_ERRORS\n FORMAT.err(\"#{vuln.chomp} failed due to an error while connecting, URL dumped to non_exploitable.txt\")\n File.open(\"#{NON_EXPLOITABLE_PATH}\", \"a+\") { |error| error.puts(vuln) }\n next\n end\n end\n end", "def parse\n\t\tfile = File.new(@filename, \"r\")\n\t\tline = file.gets.chomp\n\t\twhile !line.nil?\n\t\t\tif line =~ /(Underflow|Overflow)/ #if exception\n\t\t\t\tline =~ /Overflow/ ? overflow = true : overflow = false\n\t\t\t\tidentifier = line[/[0-9][0-9]*/] #get exception identifier\n\t\t\t\tline = file.gets.chomp\t\t\t\t\t\n\t\t\t\tline = file.gets.chomp if line =~ /The constraints are unsat/\t\t\t\t\n\t\t\t\tline = file.gets.chomp if line =~ /KLEE: WARNING:/\t\t\t\t\n\t\t\t\t# For a given identifier, there can me multiple warnings of a potential \n\t\t\t\t# overflow/underflow, store only the last one.\n\t\t\t\t# By creating a new array, previous values are overwritten\n\t\t\t\tvalues = []\n\t\t\t\twhile line =~ /^arr[0-9]/\t#if arr value\n\t\t\t\t\tline = file.gets.chomp\n\t\t\t\t\t#~ puts \"#{identifier}: #{line}\"\t#debugging\n\t\t\t\t\tvalues.push line #store value as sring with no regard to type (rational, float, integer)\t\t\t\t\t\n\t\t\t\t\tline = file.gets.chomp\n\t\t\t\tend\n\t\t\t\tif not values.empty? #if some arr values were found, store them\t\t\t\t\t\n\t\t\t\t\toverflow ? @overflow[\"#{identifier}\"] = values : @underflow[\"#{identifier}\"] = values\n\t\t\t\tend\n\t\t\telse \n\t\t\t\tline = file.gets #if not exception warning\n\t\t\tend\n\t\tend #iterate over lines in file\n\tend", "def get_info_loop file\n loop do\n line = file.gets\n if line == nil then break end\n words = line.scan(/\\S+/)\n words.each{ |word|\n case word\n when /DONE/\n return\n else\n get_info(word)\n end\n }\n end\nend", "def read_par\n cnt = []\n judge_conflict = 0\n judge_net = 0\n $PAR_FILE = $PRJ_NAME + \".par\"\n f = open($PAR_FILE,\"r\")\n while line = f.gets\n if /Conflict/ =~ line\n judge_conflict = 1\n end\n if judge_conflict <= 2\n if /Net/ =~ line\n judge_conflict += 1\n judge_net = 1\n end\n end\n if ( judge_conflict == 3 ) && ( judge_net == 1)\n judge_conflict = 0\n judge_net = 0\n /Net:(\\S*)\\s*/ =~ line\n $RM_LIST << $1\n end\n end\n $RM_LIST.compact!\n f.close\nend", "def missed_lines; end", "def missed_lines; end", "def load\n input(@infile)\n true\n end", "def ignore_bad_chunking; end" ]
[ "0.64510834", "0.6363693", "0.5981454", "0.5981454", "0.59514344", "0.58437526", "0.58272374", "0.58261335", "0.578718", "0.5766728", "0.5748342", "0.5745426", "0.573911", "0.57380366", "0.5734192", "0.56975883", "0.5693876", "0.56885296", "0.567609", "0.56263334", "0.55839443", "0.55752915", "0.55554384", "0.5532721", "0.55285203", "0.55208504", "0.55151296", "0.55151296", "0.5512063", "0.5498055", "0.5483832", "0.5482614", "0.54801595", "0.5478793", "0.54699856", "0.54627854", "0.5446754", "0.54284847", "0.54217964", "0.5419602", "0.5419602", "0.5412801", "0.5402464", "0.53984", "0.53984", "0.53984", "0.53984", "0.53984", "0.53984", "0.53984", "0.5397395", "0.53972137", "0.5373218", "0.53676474", "0.53633416", "0.5361712", "0.5355453", "0.5349001", "0.5343408", "0.53384477", "0.5335898", "0.53315765", "0.5325631", "0.531923", "0.5317581", "0.5316805", "0.53066987", "0.5294216", "0.52804565", "0.5279786", "0.5279686", "0.5278968", "0.5278763", "0.52763224", "0.52742374", "0.5270908", "0.5269655", "0.5266893", "0.52610755", "0.5258092", "0.5257679", "0.52556247", "0.5250015", "0.5249027", "0.5241061", "0.5238637", "0.52381784", "0.5233005", "0.5230174", "0.52301586", "0.5227686", "0.52272", "0.522295", "0.5220802", "0.52207875", "0.52176195", "0.52171195", "0.5216261", "0.5216261", "0.5213002", "0.52076906" ]
0.0
-1
GET /litigantes GET /litigantes.json
def index @litigantes = Litigante.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @litra = Litra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @litra }\n end\n end", "def show\n @lieu = Lieu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lieu }\n end\n end", "def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end", "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "def show\n @lei = Lei.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lei }\n end\n end", "def index\n @lophs = Loph.all\n respond_to do |format|\n format.html\n format.json { render json: @lophs}\n end\n end", "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "def show\n @core_termo_lacre = Core::TermoLacre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_termo_lacre }\n end\n end", "def index\n @lugars = Lugar.all\n\n render json: @lugars\n end", "def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end", "def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @livro }\n end\n end", "def show\n\tadd_breadcrumb \"Datos de la librería\", :librerias_path\n @libreria = Libreria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @libreria }\n end\n end", "def index\n @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end", "def index\n @territorios = Territorio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @territorios }\n end\n end", "def show\n @lede = Lede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lede }\n end\n end", "def show\n @lent = Lent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lent }\n end\n end", "def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end", "def new\n @lieu = Lieu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lieu }\n end\n end", "def index\n render json: Loan.all\n end", "def index\n code = :ok\n currentUser = {\n id: current_user.utilisateur.id,\n fullName: current_user.utilisateur.prenom_nom,\n }\n result = {\n signedIn: user_signed_in?,\n currentUser: currentUser,\n locations: Lieu.all\n }\n render json: result, status: code \n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end", "def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end", "def show\n @laundromat = Laundromat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laundromat }\n end\n end", "def show\n @litter = Litter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @litter }\n end\n end", "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", "def show\n @lugar = Lugar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lugar }\n end\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def show\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n \n @categorias = Category.all\n @centrosdecusto = Centrodecusto.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lancamentorapido }\n end\n end", "def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end", "def show\n @lore = Lore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lore }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end", "def index \n @lancamentorapido = Lancamentorapido.new \n @lancamentorapidos = Lancamentorapido.all\n \n @categorias = Category.all\n @centrosdecusto = Centrodecusto.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lancamentorapidos }\n end\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def show\n render json: @lugar\n end", "def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end", "def show\n @lector = Lector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lector }\n end\n end", "def show\n @liste = Liste.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liste }\n end\n end", "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end", "def new\n if signed_in?\n @litra = Litra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @litra }\n end\n end\nend", "def index\n @laws = Law.ordered_roots\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end", "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n seleccionarMenu(:rondas)\n @rondas = Ronda.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rondas }\n end\n end", "def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html\n format.json do\n render json: @tutorials\n end\n end\nend", "def show\n @kennel_litter = KennelLitter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kennel_litter }\n end\n end", "def tout\n #propriétaire\n \n # Block execution if there is no current user\n if(current_user.blank?)\n return render json:{\n errors: \"true\",\n message: \"User not connected\"\n }, status: 401\n end\n\n user = current_user\n logements = Logement.where(user_id: user)\n tarif = []\n #================ propriétaire =====================\n logements.each do |logement|\n tarif << {logement:logement,tarif:logement.calendrier,photo:\"#{logement.photos.first.photo}\",promotion:logement.promotions}\n end\n \n #================= cogestion ============\n logcngestions = Logement.all\n logcngestions.each do |logcogestion|\n if logcogestion.user != user && logcogestion.cogestion.present?\n if logcogestion.cogestion.include?(user.id)\n tarif << {logement:logcogestion,tarif:logcogestion.calendrier,photo:\"#{logcogestion.photos.first.photo}\",promotion:logcogestion.promotions}\n end\n end\n end\n \n render json:{\n tarif:tarif\n } \n end", "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "def index\n @turmas = Turma.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @turmas }\n end\n end", "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", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end", "def show\n @territorio = Territorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @territorio }\n end\n end", "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "def show\n @guille = Guille.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guille }\n end\n end", "def index\n @losts = Lost.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @losts }\n end\n end", "def show\n @detalle = Detalle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detalle }\n end\n end", "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def index\n @lents = if params[:all]\n #Lent.order(\"updated_at DESC\")\n Lent.order(\"lent_on DESC\")\n else\n Lent.where(:condition => Lent::Lent).order(:car_id)\n end\n @today = Date.today\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lents }\n end\n end", "def index\n @diciplinas = Diciplina.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diciplinas }\n end\n end", "def index\n render json: { \"Exercice Technique\" => \"Transporter Organizations Colisweb backend developer exercise\", \"Poste visé\" => \"Développeur Back Ruby, Alternance\", \"Candidat\" => \"Gressier Jimmy\"}\n end", "def show\n render json: @tutorado, status: :ok\n end", "def show\n @core_liberar_nota = Core::LiberarNota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_liberar_nota }\n end\n end", "def index\n @laboratories = Laboratory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laboratories }\n end\n end", "def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end", "def index\n @german_go_leagues = GermanGoLeague.all\n\t\t@title = \"Bundesliga Spiele\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @german_go_leagues }\n end\n end", "def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end", "def index\n @articulos = Articulo.where(\"tipo = 'articulo'\").order(\"created_at desc\") \n @noticias = Articulo.where(\"tipo = 'noticia' and mostrar_carrusel='1'\").order(\"created_at desc\").limit(3)\n @articulos = @articulos.page(params[:page]).per_page(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articulos }\n end\n end", "def index\n @listes = Liste.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listes }\n end\n end", "def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end", "def show\n @local_deportivo = LocalDeportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @local_deportivo }\n end\n end", "def index\n @ordens = Orden.all\n render json: @ordens\n end", "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", "def index\n @lancamentos = Lancamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lancamentos }\n end\n end", "def show\n @kolegij = Kolegij.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kolegij }\n end\n end", "def show\n\tadd_breadcrumb \"Datos del libro\", :libro_path\n @libro = Libro.find(params[:id])\n\t\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @libro }\n end\n end", "def index\n @lids = Lid.order(\"lower(name) ASC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lids }\n end\n end", "def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end", "def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end", "def index\n @localities = Locality.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @localities }\n end\n end", "def index\n @attris = Attri.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @attris }\n end\n end", "def new\n @core_termo_lacre = Core::TermoLacre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_termo_lacre }\n end\n end", "def show\n @local_desportivo = LocalDesportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @local_desportivo }\n end\n end", "def index\n @leagues = League.all\n render json: @leagues, status: :ok\n end", "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "def index\n @lieus = Lieu.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lieus }\n end\n end", "def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end", "def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end", "def index\n @plan_de_venta = PlanDeVentum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_de_venta }\n end\n end", "def index\n @dteors = Dteor.all\n @thems = get_tem\n respond_to do |format|\n if get_tem\n format.html # index.html.erb\n format.json { render json: @dteors } \n else\n format.html { redirect_to new_student_path, notice: t(:vvedit_dani)}\n end\n \n end\n end", "def new\n @lei = Lei.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lei }\n end\n end", "def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end", "def index\n @trabalhos = current_user.trabalhos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trabalhos }\n end\n end", "def index\n @familia = Familium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @familia }\n end\n end", "def index\n @laws = Law.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def show\n \n respond_to do |format|\n format.html\n #format.json {render json: @jiras}\n\n end\n end", "def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end" ]
[ "0.6840143", "0.6735118", "0.67135036", "0.66299325", "0.6515038", "0.64215463", "0.63972616", "0.6362224", "0.63478523", "0.63315403", "0.6283525", "0.62643254", "0.6225559", "0.62150204", "0.6206708", "0.6193282", "0.61909634", "0.6187592", "0.61722666", "0.6141094", "0.6132167", "0.6125767", "0.610932", "0.6104307", "0.61006886", "0.6084259", "0.60428125", "0.60362816", "0.6033692", "0.60280555", "0.6024093", "0.6021128", "0.6015835", "0.60154265", "0.60144305", "0.5997342", "0.5995986", "0.5989125", "0.5986411", "0.5981745", "0.5975686", "0.5973846", "0.5967116", "0.59575593", "0.59575593", "0.5956579", "0.595002", "0.5945347", "0.5925689", "0.59211767", "0.59196824", "0.5918544", "0.59156847", "0.59152937", "0.5914342", "0.5908931", "0.58941305", "0.589231", "0.5882693", "0.5877176", "0.5875571", "0.5872071", "0.5869211", "0.5869091", "0.58649987", "0.58643365", "0.5858598", "0.58582395", "0.5855471", "0.5850527", "0.58491063", "0.58483887", "0.58458227", "0.5842178", "0.5839585", "0.58249843", "0.5823709", "0.58167934", "0.5814547", "0.5812026", "0.5811873", "0.5808925", "0.58066154", "0.58057016", "0.5805193", "0.5804268", "0.5800233", "0.579802", "0.57942426", "0.57899404", "0.5789889", "0.578693", "0.5785565", "0.57832736", "0.5782984", "0.5781074", "0.5778348", "0.5778123", "0.57778406", "0.57769006" ]
0.6933273
0
GET /litigantes/1 GET /litigantes/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end", "def show\n @lieu = Lieu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lieu }\n end\n end", "def show\n @litra = Litra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @litra }\n end\n end", "def show\n @lei = Lei.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lei }\n end\n end", "def show\n @core_termo_lacre = Core::TermoLacre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_termo_lacre }\n end\n end", "def index\n @litigantes = Litigante.all\n end", "def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @livro }\n end\n end", "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "def show\n\tadd_breadcrumb \"Datos de la librería\", :librerias_path\n @libreria = Libreria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @libreria }\n end\n end", "def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end", "def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end", "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end", "def show\n @lede = Lede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lede }\n end\n end", "def new\n @lieu = Lieu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lieu }\n end\n end", "def index\n @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end", "def show\n @lore = Lore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lore }\n end\n end", "def index\n @lophs = Loph.all\n respond_to do |format|\n format.html\n format.json { render json: @lophs}\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end", "def show\n @liste = Liste.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liste }\n end\n end", "def show\n @lugar = Lugar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lugar }\n end\n end", "def show\n @laundromat = Laundromat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laundromat }\n end\n end", "def index\n @territorios = Territorio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @territorios }\n end\n end", "def show\n @lent = Lent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lent }\n end\n end", "def show\n @detalle = Detalle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detalle }\n end\n end", "def show\n @territorio = Territorio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @territorio }\n end\n end", "def index\n @lugars = Lugar.all\n\n render json: @lugars\n end", "def show\n @guille = Guille.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guille }\n end\n end", "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def show\n @litter = Litter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @litter }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end", "def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end", "def show\n\tadd_breadcrumb \"Datos del libro\", :libro_path\n @libro = Libro.find(params[:id])\n\t\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @libro }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end", "def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end", "def show\n @kolegij = Kolegij.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kolegij }\n end\n end", "def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end", "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end", "def show\n @lector = Lector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lector }\n end\n end", "def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end", "def show\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format| \n format.json { render json: @giang_vien }\n end\n end", "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end", "def show\n render json: @lugar\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def show\n @trabalho = Trabalho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trabalho }\n end\n end", "def show\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronia }\n end\n end", "def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end", "def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end", "def show\n @local_deportivo = LocalDeportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @local_deportivo }\n end\n end", "def show\n @core_liberar_nota = Core::LiberarNota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_liberar_nota }\n end\n end", "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", "def show\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n \n @categorias = Category.all\n @centrosdecusto = Centrodecusto.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lancamentorapido }\n end\n end", "def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end", "def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end", "def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end", "def index\n render json: Loan.all\n end", "def show\n @local_desportivo = LocalDesportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @local_desportivo }\n end\n end", "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def show\n @integrante = Integrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @integrante }\n end\n end", "def show\n @relogio = Relogio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @relogio }\n end\n end", "def show\n @lista_contato = ListaContato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lista_contato }\n end\n end", "def show\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etudiant }\n end\n end", "def show\n @itineraire = Itineraire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @itineraire }\n end\n end", "def show\n @sezione = Sezione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sezione }\n end\n end", "def show\n @lista = Lista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lista }\n end\n end", "def index\n @articulos = Articulo.where(\"tipo = 'articulo'\").order(\"created_at desc\") \n @noticias = Articulo.where(\"tipo = 'noticia' and mostrar_carrusel='1'\").order(\"created_at desc\").limit(3)\n @articulos = @articulos.page(params[:page]).per_page(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articulos }\n end\n end", "def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end", "def index \n @lancamentorapido = Lancamentorapido.new \n @lancamentorapidos = Lancamentorapido.all\n \n @categorias = Category.all\n @centrosdecusto = Centrodecusto.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lancamentorapidos }\n end\n end", "def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end", "def show\n @humanidades1 = Humanidades1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @humanidades1 }\n end\n end", "def index\n code = :ok\n currentUser = {\n id: current_user.utilisateur.id,\n fullName: current_user.utilisateur.prenom_nom,\n }\n result = {\n signedIn: user_signed_in?,\n currentUser: currentUser,\n locations: Lieu.all\n }\n render json: result, status: code \n end", "def index\n seleccionarMenu(:rondas)\n @rondas = Ronda.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rondas }\n end\n end", "def show\n @bilhete = Bilhete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bilhete }\n end\n end", "def index\n @familia = Familium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @familia }\n end\n end", "def show\n seleccionarMenu(:rondas)\n @ronda = Ronda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ronda }\n end\n end", "def show\n render json: @tutorado, status: :ok\n end", "def show\r\n @antenne = Antenne.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @antenne }\r\n end\r\n end", "def show\n @lich_su_binh_bau = LichSuBinhBau.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lich_su_binh_bau }\n end\n end", "def show\n @objet = Objet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @objet }\n end\n end", "def show\n @tipomedalla = Tipomedalla.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipomedalla }\n end\n end", "def show\n @humanidades3 = Humanidades3.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @humanidades3 }\n end\n end", "def show\n @receipe = Receipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @receipe }\n end\n end", "def show\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegiatura }\n end\n end", "def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end", "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "def show\n @requerimiento ||= Requerimiento.where(:numero => params[:id]).first\n @areas = Area.where(\" nombre like '%DIT%' \")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @requerimiento }\n end\n end", "def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html\n format.json do\n render json: @tutorials\n end\n end\nend", "def show\n @clonet = Clonet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clonet }\n end\n end", "def new\n @core_termo_lacre = Core::TermoLacre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_termo_lacre }\n end\n end", "def show\n @webling = Webling.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @webling }\n end\n end", "def new\n @lei = Lei.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lei }\n end\n end", "def show\n \n respond_to do |format|\n format.html\n #format.json {render json: @jiras}\n\n end\n end", "def show\n @programa_de_intere = ProgramaDeIntere.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa_de_intere }\n end\n end", "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end" ]
[ "0.71055126", "0.7098314", "0.7021023", "0.68522185", "0.67774117", "0.67612505", "0.66655535", "0.6528839", "0.65203226", "0.64979935", "0.6490209", "0.64629066", "0.64213794", "0.6416448", "0.6416448", "0.6415562", "0.64139843", "0.64106244", "0.63818747", "0.63815", "0.63712543", "0.6357181", "0.63510495", "0.633594", "0.63228995", "0.63197726", "0.63192135", "0.631281", "0.6302864", "0.62994504", "0.6298306", "0.628062", "0.62698597", "0.6264054", "0.6253492", "0.6249631", "0.62353367", "0.62345856", "0.62340105", "0.6232046", "0.6219462", "0.6216967", "0.6213664", "0.6211125", "0.6208598", "0.62046856", "0.62041146", "0.6198647", "0.61939585", "0.61911094", "0.6166812", "0.6166745", "0.61631125", "0.6161752", "0.61573184", "0.61566544", "0.6156003", "0.6153837", "0.6153661", "0.6150592", "0.61412996", "0.6136019", "0.61351043", "0.6132664", "0.61303926", "0.61292017", "0.61256534", "0.61214566", "0.6114726", "0.61134094", "0.6108106", "0.61041623", "0.60994846", "0.6097289", "0.60935926", "0.60931814", "0.60924584", "0.6088181", "0.60880053", "0.6084462", "0.60833186", "0.6074055", "0.60732096", "0.6073071", "0.6071229", "0.6070088", "0.60665727", "0.6065668", "0.60632294", "0.60615766", "0.6054648", "0.6050074", "0.60495317", "0.60354364", "0.60350823", "0.60327244", "0.60322493", "0.6032023", "0.60315454", "0.6026606", "0.6024414" ]
0.0
-1
POST /litigantes POST /litigantes.json
def create @litigante = Litigante.new(litigante_params) respond_to do |format| if @litigante.save format.html { redirect_to @litigante, notice: 'Litigante was successfully created.' } format.json { render :show, status: :created, location: @litigante } else format.html { render :new } format.json { render json: @litigante.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @leito = Leito.new(params[:leito])\n\n respond_to do |format|\n if @leito.save\n format.html { redirect_to @leito, notice: 'Leito was successfully created.' }\n format.json { render json: @leito, status: :created, location: @leito }\n else\n format.html { render action: \"new\" }\n format.json { render json: @leito.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lieu = Lieu.new(params[:lieu])\n\n respond_to do |format|\n if @lieu.save\n format.html { redirect_to @lieu, notice: 'Lieu was successfully created.' }\n format.json { render json: @lieu, status: :created, location: @lieu }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lieu.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params.permit(:intitule, :estObligatoire, :nombreDeCaractere, :ordre, :sondage_id)\n ajout = QuestionOuverteService.instance.creerQuestionOuverte(params[:intitule], params[:estObligatoire], params[:nombreDeCaractere], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end", "def create\n @lei = Lei.new(params[:lei])\n\n respond_to do |format|\n if @lei.save\n format.html { redirect_to @lei, notice: 'Lei was successfully created.' }\n format.json { render json: @lei, status: :created, location: @lei }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lei.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create \n @lancamentorapido = Lancamentorapido.new(params[:lancamentorapido])\n \n #Validações padrão\n @lancamentorapido.tipo = :receita if @lancamentorapido.tipo.blank?\n @lancamentorapido.valor = 0 if @lancamentorapido.valor.blank? \n \n respond_to do |format|\n if @lancamentorapido.save\n format.html { redirect_to lancamentorapidos_path, notice: 'Lancamento was successfully created.' } \n# format.html { redirect_to '/lancamentorapidos'}\n format.json { render json: lancamentorapidos_path, status: :created, location: @lancamentorapido }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lancamentorapido.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @etnia = Etnia.new(params[:etnia])\n\n respond_to do |format|\n if @etnia.save\n format.html { redirect_to @etnia, notice: 'Etnia was successfully created.' }\n format.json { render json: @etnia, status: :created, location: @etnia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lutein = Lutein.new(lutein_params)\n\n respond_to do |format|\n if @lutein.save\n format.html { redirect_to @lutein, notice: 'Lutein was successfully created.' }\n format.json { render :show, status: :created, location: @lutein }\n else\n format.html { render :new }\n format.json { render json: @lutein.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @itineraire = Itineraire.new(params[:itineraire])\n\n respond_to do |format|\n if @itineraire.save\n format.html { redirect_to @itineraire, :notice => 'L\\'itinéraire a bien été créé' }\n format.json { render :json => @itineraire, :status => :created, :location => @itineraire }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @itineraire.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @tale = Tale.new(tale_params)\n\n respond_to do |format|\n if @tale.save\n format.html { redirect_to '/all', notice: 'Tale was successfully created.' }\n format.json { render :show, status: :created, location: @tale }\n else\n format.html { render :new }\n format.json { render json: @tale.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @iglesia = Iglesia.new(iglesia_params)\n\n respond_to do |format|\n if @iglesia.save\n format.html { redirect_to iglesias_path, notice: \"La iglesia #{@iglesia.nombre} ha sido creada.\" }\n format.json { render action: 'show', status: :created, location: @iglesia }\n else\n format.html { render action: 'new' }\n format.json { render json: @iglesia.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @platillo = Platillo.new(platillo_params)\n @ingredients = platillo_params[:ingredients_attributes]\n debug @ingredients\n\n @platilloIngrendiente = Ingredient.new(@ingredients)\n @platilloIngrendiente.save\n respond_to do |format|\n if @platillo.save\n format.html { redirect_to @platillo, notice: 'Platillo creado exitosamente' }\n format.json { render :show, status: :created, location: @platillo }\n else\n format.html { render :new }\n format.json { render json: @platillo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @detalle = Detalle.new(params[:detalle])\n\n respond_to do |format|\n if @detalle.save\n format.html { redirect_to @detalle, notice: 'Detalle was successfully created.' }\n format.json { render json: @detalle, status: :created, location: @detalle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if signed_in?\n @litra = Litra.new(params[:litra])\n\n respond_to do |format|\n if @litra.save\n format.html { redirect_to @litra, notice: 'Litra was successfully created.' }\n format.json { render json: @litra, status: :created, location: @litra }\n else\n format.html { render action: \"new\" }\n format.json { render json: @litra.errors, status: :unprocessable_entity }\n end\n end\n end\nend", "def create\n @loja = Loja.new(params[:loja])\n\n respond_to do |format|\n if @loja.save\n format.html { redirect_to @loja, notice: 'Loja criada com sucesso' }\n format.json { render json: @loja, status: :created, location: @loja }\n else\n format.html { render action: \"new\" }\n format.json { render json: @loja.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tenni = Tenni.new(params[:tenni])\n\n respond_to do |format|\n if @tenni.save\n format.html { redirect_to @tenni, notice: 'Tenni was successfully created.' }\n format.json { render json: @tenni, status: :created, location: @tenni }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tenni.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @livro = Livro.new(livro_params)\n\n respond_to do |format|\n if @livro.save\n format.html { redirect_to @livro, notice: 'Livro cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @livro }\n else\n format.html { render :new }\n format.json { render json: @livro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lugar = Lugar.new(lugar_params)\n\n if @lugar.save\n render json: @lugar, status: :created, location: @lugar\n else\n render json: @lugar.errors, status: :unprocessable_entity\n end\n end", "def create\n @core_termo_lacre = Core::TermoLacre.new(params[:core_termo_lacre])\n\n respond_to do |format|\n if @core_termo_lacre.save\n format.html { redirect_to @core_termo_lacre, notice: 'Termo lacre was successfully created.' }\n format.json { render json: @core_termo_lacre, status: :created, location: @core_termo_lacre }\n else\n format.html { render action: \"new\" }\n format.json { render json: @core_termo_lacre.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @territorio = Territorio.new(params[:territorio])\n\n respond_to do |format|\n if @territorio.save\n format.html { redirect_to @territorio, notice: 'Territorio was successfully created.' }\n format.json { render json: @territorio, status: :created, location: @territorio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @territorio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @userlitt = Userlitt.new(user_id: session[:user_id], oeuvre_id: params['oeuvre_id'])\n\n respond_to do |format|\n if @userlitt.save\n format.html { redirect_to formation_module_path(:formation => params['oeuvre_id']), notice: 'Ce cours est maintenant dans votre espace!' }\n format.json { render :show, status: :created, location: @userlitt }\n else\n format.html { redirect_to formation_module_path(:formation => params['oeuvre_id']), notice: 'Ce cours est déjà dans votre espace!' }\n format.json { render json: @userlitt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sitio_entrega = SitioEntrega.new(params[:sitio_entrega])\n\n respond_to do |format|\n if @sitio_entrega.save\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully created.' }\n format.json { render json: @sitio_entrega, status: :created, location: @sitio_entrega }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @utensil = Utensil.new(utensil_params)\n\n respond_to do |format|\n if @utensil.save\n format.html { redirect_to @utensil, notice: 'Utensil was successfully created.' }\n format.json { render :show, status: :created, location: @utensil }\n else\n format.html { render :new }\n format.json { render json: @utensil.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Tecnico criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "def create\n @tiendas_juego = TiendasJuego.new(tiendas_juego_params)\n\n respond_to do |format|\n if @tiendas_juego.save\n format.html { redirect_to @tiendas_juego, notice: 'Tiendas juego was successfully created.' }\n format.json { render :show, status: :created, location: @tiendas_juego }\n else\n format.html { render :new }\n format.json { render json: @tiendas_juego.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @laboratorio = Laboratorio.new(laboratorio_params)\n get_responsavel\n puts \"O responsavel é: #{@laboratorio.responsavel_id}\"\n if (@responsavel != \"sem_responsavel\")\n @laboratorio.docentes << Docente.find(@laboratorio.responsavel_id)\n puts \"Add relação entre #{@laboratorio.nome} e #{Docente.find(@laboratorio.responsavel_id).user.nome}\"\n end\n respond_to do |format|\n if @laboratorio.save\n format.html { redirect_to @laboratorio, notice: 'Laboratorio was successfully created.' }\n format.json { render :show, status: :created, location: @laboratorio }\n else\n format.html { render :new }\n format.json { render json: @laboratorio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lokasis = Rute.select(\"id_jalan\").uniq\n @jalan = Jalan.new(jalan_params)\n\n respond_to do |format|\n if @jalan.save\n format.html { redirect_to @jalan, notice: \"Jalan was successfully created.\" }\n format.json { render :show, status: :created, location: @jalan }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @jalan.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lede = Lede.new(params[:lede])\n\n respond_to do |format|\n if @lede.save\n format.html { redirect_to @lede, notice: 'Lede was successfully created.' }\n format.json { render json: @lede, status: :created, location: @lede }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lede.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params.permit(:intituleSondage, :descriptionSondage, :categorie_id, :administrateur_id)\n ajout = SondageService.instance.creerNouveauSondage(params[:intituleSondage], params[:descriptionSondage], params[:categorie_id], params[:administrateur_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\nend", "def create\n @turma = Turma.new(params[:turma])\n\n respond_to do |format|\n if @turma.save\n format.html { redirect_to @turma, notice: 'Turma criada com sucesso.' }\n format.json { render json: @turma, status: :created, location: @turma }\n else\n format.html { render action: \"new\" }\n format.json { render json: @turma.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lancamento = Lancamento.new(lancamento_params)\n\n respond_to do |format|\n if @lancamento.save\n if @lancamento.tipo == \"Credito\"\n addlog(\"Criado um lançamento de crédito\")\n elsif @lancamento.tipo == \"Debito\"\n addlog(\"Criado um lançamento de débito\")\n end\n format.html { redirect_to @lancamento, notice: 'Lançamento criado com sucesso.' }\n format.json { render :show, status: :created, location: @lancamento }\n else\n format.html { render :new }\n format.json { render json: @lancamento.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @titulacion = Titulacion.new(titulacion_params)\n\n respond_to do |format|\n if @titulacion.save\n format.html { redirect_to @titulacion, notice: 'Titulacion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @titulacion }\n else\n format.html { render action: 'new' }\n format.json { render json: @titulacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @traslado = Traslado.new(traslado_params)\n\n respond_to do |format|\n if @traslado.save\n format.html { redirect_to @traslado, notice: 'Traslado was successfully created.' }\n format.json { render :show, status: :created, location: @traslado }\n else\n format.html { render :new }\n format.json { render json: @traslado.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pasien = Pasien.new(pasien_params)\n\n respond_to do |format|\n if @pasien.save\n format.html { redirect_to @pasien, notice: 'Pasien was successfully created.' }\n format.json { render :show, status: :created, location: @pasien }\n else\n format.html { render :new }\n format.json { render json: @pasien.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @livro = Livro.new(params[:livro])\n\n respond_to do |format|\n if @livro.save\n format.html { redirect_to @livro, :notice => 'Livro was successfully created.' }\n format.json { render :json => @livro, :status => :created, :location => @livro }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @livro.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @topes_legale = TopesLegale.new(topes_legale_params)\n\n respond_to do |format|\n if @topes_legale.save\n format.html { redirect_to @topes_legale, notice: 'Tope legal creado exitosamente.' }\n format.json { render :show, status: :created, location: @topes_legale }\n else\n format.html { render :new }\n format.json { render json: @topes_legale.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @kolegij = Kolegij.new(params[:kolegij])\n\n respond_to do |format|\n if @kolegij.save\n format.html { redirect_to @kolegij, notice: 'Kolegij was successfully created.' }\n format.json { render json: @kolegij, status: :created, location: @kolegij }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kolegij.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lensa = Lensa.new(lensa_params)\n\n respond_to do |format|\n if @lensa.save\n format.html { redirect_to @lensa, notice: 'Lensa was successfully created.' }\n format.json { render :show, status: :created, location: @lensa }\n else\n format.html { render :new }\n format.json { render json: @lensa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@pasien = Pasien.find(params[:pasien_id])\n #@hasil = @pasien.hasils.create(params[:hasil])\n #redirect_to pasien_path(@post)\n @hasil = Hasil.create(params[:hasil])\n\n respond_to do |format|\n if @hasil.save\n format.html { redirect_to @hasil, notice: 'Hasil was successfully created.' }\n format.json { render json: @hasil, status: :created, location: @hasil }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hasil.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @neela = Neela.new(neela_params)\n\n respond_to do |format|\n if @neela.save\n format.html { redirect_to @neela, notice: 'Neela was successfully created.' }\n format.json { render :show, status: :created, location: @neela }\n else\n format.html { render :new }\n format.json { render json: @neela.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @laboratorio = Laboratorio.new(laboratorio_params)\n\n respond_to do |format|\n if @laboratorio.save\n format.html { redirect_to \"/laboratorios/new\", notice: 'Laboratorio creado con éxito.' }\n else\n format.html { render :new }\n format.json { render json: @laboratorio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @guille = Guille.new(params[:guille])\n\n respond_to do |format|\n if @guille.save\n format.html { redirect_to @guille, notice: 'Guille was successfully created.' }\n format.json { render json: @guille, status: :created, location: @guille }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guille.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @turma = Turma.new(turma_params)\n @turma.usuario = current_usuario\n @turma.turma_ativa = true\n\n respond_to do |format|\n if @turma.save\n format.html { redirect_to turmas_path, notice: 'Turma salva com sucesso.' }\n format.json { render :show, status: :created, location: @turma }\n else\n format.html { render :new }\n format.json { render json: @turma.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @laundromat = Laundromat.new(params[:laundromat])\n\n respond_to do |format|\n if @laundromat.save\n format.html { redirect_to @laundromat, notice: 'Laundromat was successfully created.' }\n format.json { render json: @laundromat, status: :created, location: @laundromat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @laundromat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tare = Tare.new(params[:tare])\n\n respond_to do |format|\n if @tare.save\n format.html { redirect_to @tare, notice: 'Tare créée avec succès.' }\n format.json { render json: @tare, status: :created, location: @tare }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tare.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @lieu = Lieu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lieu }\n end\n end", "def create\n @lode = Lode.new(lode_params)\n respond_to do |format|\n if @lode.save\n format.html { redirect_to new_lode_path(resource: @lode.resource), notice: 'Lode was successfully created.' }\n format.json { render :show, status: :created, location: resources_path(@lode.resource) }\n else\n format.html { render :new }\n format.json { render json: @lode.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipomedalla = Tipomedalla.new(params[:tipomedalla])\n\n respond_to do |format|\n if @tipomedalla.save\n format.html { redirect_to @tipomedalla, notice: 'Tipomedalla was successfully created.' }\n format.json { render json: @tipomedalla, status: :created, location: @tipomedalla }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipomedalla.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tangazo = Tangazo.new(tangazo_params)\n\n respond_to do |format|\n if @tangazo.save\n format.html { redirect_to @tangazo, notice: 'Tangazo was successfully created.' }\n format.json { render :show, status: :created, location: @tangazo }\n else\n format.html { render :new }\n format.json { render json: @tangazo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @localidad = Localidad.new(localidad_params)\n\n respond_to do |format|\n if @localidad.save\n format.html { redirect_to @localidad, notice: 'Localidad was successfully created.' }\n format.json { render :show, status: :created, location: @localidad }\n else\n format.html { render :new }\n format.json { render json: @localidad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lembrete = Lembrete.new(lembrete_params)\n\n respond_to do |format|\n if @lembrete.save\n flash[:success] = 'lembrete criado com sucesso.'\n format.html { redirect_to @lembrete }\n format.json { render :show, status: :created, location: @lembrete }\n else\n flash[:danger] = 'problemas criando o registro(save).'\n format.html { render :new }\n format.json { render json: @lembrete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enquete = Enquete.new(enquete_params)\n\n respond_to do |format|\n if @enquete.save\n format.html { redirect_to @enquete, notice: 'Enquete was successfully created.' }\n format.json { render :show, status: :created, location: @enquete }\n else\n format.html { render :new }\n format.json { render json: @enquete.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @linhkien = Linhkien.new(linhkien_params)\n\n respond_to do |format|\n if @linhkien.save\n format.html { redirect_to @linhkien, notice: 'Linhkien was successfully created.' }\n format.json { render :show, status: :created, location: @linhkien }\n else\n format.html { render :new }\n format.json { render json: @linhkien.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n authorize! :create, Tipo\n @tipo = Tipo.new(tipo_params)\n log(\"Se ha creado la nomina #{@lt}\", 0)\n\n respond_to do |format|\n if @tipo.save\n format.html { redirect_to tipos_path, notice: 'La nómina fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @tipo }\n else\n format.html { render :new }\n format.json { render json: @tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @serie_detalle = SerieDetalle.new(serie_detalle_params)\n\n respond_to do |format|\n if @serie_detalle.save\n format.html { redirect_to @serie_detalle, notice: 'Serie detalle was successfully created.' }\n format.json { render :show, status: :created, location: @serie_detalle }\n else\n format.html { render :new }\n format.json { render json: @serie_detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end", "def create\n @etudiant = Etudiant.new(params[:etudiant])\n\n respond_to do |format|\n if @etudiant.save\n format.html { redirect_to @etudiant, notice: 'Etudiant was successfully created.' }\n format.json { render json: @etudiant, status: :created, location: @etudiant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etudiant.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @asiento = Asiento.new(params[:asiento])\n\n respond_to do |format|\n if @asiento.save\n format.html { redirect_to @asiento, :notice => 'El apunte fue creado.' }\n format.json { render :json => @asiento, :status => :created, :location => @asiento }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @detalle = Detalle.new(detalle_params)\n\n respond_to do |format|\n if @detalle.save\n format.html { redirect_to @detalle, notice: 'Detalle was successfully created.' }\n format.json { render :show, status: :created, location: @detalle }\n else\n format.html { render :new }\n format.json { render json: @detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @puntaje = Puntaje.new(params[:puntaje])\n\n respond_to do |format|\n if @puntaje.save\n format.html { redirect_to @puntaje, notice: 'Puntaje was successfully created.' }\n format.json { render json: @puntaje, status: :created, location: @puntaje }\n else\n atributos\n format.html { render action: \"new\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def creacion\n fiesta = Fiesta.new (params[:id])\n if Fiesta.save\n puts \"su fiesta a sido registrada\"\n else \n puts \"su fiesta no a sido registrada\"\n end\n render = json: fiesta \n end", "def create\n @etude = Etude.new(etude_params)\n\n respond_to do |format|\n if @etude.save\n format.html { redirect_to @etude, notice: 'Etude was successfully created.' }\n format.json { render :show, status: :created, location: @etude }\n else\n format.html { render :new }\n format.json { render json: @etude.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @reuniao = Reuniao.new(reuniao_params)\n @pautum=Pautum.new\n @reuniao.pautum =@pautum\n @reuniao.atum=Atum.new\n @reuniao.status=\"Preparação\"\n @pautum.status=\"Preparação\"\n \n respond_to do |format|\n if @reuniao.save\n @[email protected]\n @pautum.save\n format.html { redirect_to @reuniao, notice: 'Reuniao was successfully created.' }\n format.json { render :show, status: :created, location: @reuniao }\n else\n format.html { render :new }\n format.json { render json: @reuniao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'Tarea was successfully created.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sotrudniki = Sotrudniki.new(params[:sotrudniki])\n\n respond_to do |format|\n if @sotrudniki.save\n format.html { redirect_to @sotrudniki, notice: 'Sotrudniki was successfully created.' }\n format.json { render json: @sotrudniki, status: :created, location: @sotrudniki }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sotrudniki.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @palabra = Palabra.new(params[:palabra])\n @palabra.significados = params[:significados] \n respond_to do |format|\n if @palabra.save\n format.html { redirect_to @palabra, notice: 'La palabra fue guardada correctamente.' }\n format.json { render json: @palabra, status: :created, location: @palabra }\n else\n format.html { render action: \"new\" }\n format.json { render json: @palabra.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "def create\n @tuiguang = Tuiguang.new(tuiguang_params)\n\n respond_to do |format|\n if @tuiguang.save\n format.html { redirect_to @tuiguang, notice: 'Tuiguang was successfully created.' }\n format.json { render :show, status: :created, location: @tuiguang }\n else\n format.html { render :new }\n format.json { render json: @tuiguang.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipo_de_imovel = TipoDeImovel.new(tipo_de_imovel_params)\n\n respond_to do |format|\n if @tipo_de_imovel.save\n format.html { redirect_to @tipo_de_imovel, notice: 'Tipo de imovel was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_de_imovel }\n else\n format.html { render :new }\n format.json { render json: @tipo_de_imovel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @titulacao = Titulacao.new(titulacao_params)\n\n respond_to do |format|\n if @titulacao.save\n format.html { redirect_to titulacaos_path, notice: 'Titulo criado com successo.' }\n format.json { render :index, status: :created, location: titulacaos_path }\n else\n format.html { render :new }\n format.json { render json: @titulacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @aluguel = Aluguel.new(aluguel_params)\n\n respond_to do |format|\n if @aluguel.save\n format.html { redirect_to @aluguel, notice: 'Aluguel was successfully created.' }\n format.json { render :show, status: :created, location: @aluguel }\n else\n format.html { render :new }\n format.json { render json: @aluguel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ton_giao = TonGiao.new(ton_giao_params)\n\n respond_to do |format|\n if @ton_giao.save\n format.html { redirect_to @ton_giao, notice: 'Ton giao was successfully created.' }\n format.json { render :show, status: :created, location: @ton_giao }\n else\n format.html { render :new }\n format.json { render json: @ton_giao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sugerencia = Sugerencia.new(params[:sugerencia])\n\n respond_to do |format|\n if @sugerencia.save\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully created.' }\n format.json { render :json => @sugerencia, :status => :created, :location => @sugerencia }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @local_desportivo = LocalDesportivo.new(params[:local_desportivo])\n\n respond_to do |format|\n if @local_desportivo.save\n format.html { redirect_to @local_desportivo, notice: 'Local desportivo was successfully created.' }\n format.json { render json: @local_desportivo, status: :created, location: @local_desportivo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @local_desportivo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lomein = Lomein.new(lomein_params)\n\n respond_to do |format|\n if @lomein.save\n format.html { redirect_to @lomein, notice: 'Lomein was successfully created.' }\n format.json { render :show, status: :created, location: @lomein }\n else\n format.html { render :new }\n format.json { render json: @lomein.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @leccion_hiragana = LeccionHiragana.new(leccion_hiragana_params)\n\n respond_to do |format|\n if @leccion_hiragana.save\n format.html { redirect_to @leccion_hiragana, notice: 'Leccion hiragana was successfully created.' }\n format.json { render :show, status: :created, location: @leccion_hiragana }\n else\n format.html { render :new }\n format.json { render json: @leccion_hiragana.errors, status: :unprocessable_entity }\n end\n end\n end", "def tout\n #propriétaire\n \n # Block execution if there is no current user\n if(current_user.blank?)\n return render json:{\n errors: \"true\",\n message: \"User not connected\"\n }, status: 401\n end\n\n user = current_user\n logements = Logement.where(user_id: user)\n tarif = []\n #================ propriétaire =====================\n logements.each do |logement|\n tarif << {logement:logement,tarif:logement.calendrier,photo:\"#{logement.photos.first.photo}\",promotion:logement.promotions}\n end\n \n #================= cogestion ============\n logcngestions = Logement.all\n logcngestions.each do |logcogestion|\n if logcogestion.user != user && logcogestion.cogestion.present?\n if logcogestion.cogestion.include?(user.id)\n tarif << {logement:logcogestion,tarif:logcogestion.calendrier,photo:\"#{logcogestion.photos.first.photo}\",promotion:logcogestion.promotions}\n end\n end\n end\n \n render json:{\n tarif:tarif\n } \n end", "def create\n @lugar = Lugar.new(params[:lugar])\n\n respond_to do |format|\n if @lugar.save\n format.html { redirect_to @lugar, notice: 'Lugar was successfully created.' }\n format.json { render json: @lugar, status: :created, location: @lugar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lugar.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lector = Lector.new(lector_params)\n\n respond_to do |format|\n if @lector.save\n format.html { redirect_to lectors_path, notice: 'El lector fue creado con éxito.' }\n format.json { render :show, status: :created, location: @lector }\n else\n format.html { render :new }\n format.json { render json: @lector.errors, status: :unprocessable_entity }\n end\n end\n end", "def litigante_params\n params.require(:litigante).permit(:case_id, :participante, :rut, :persona, :nombre)\n end", "def create\n @turma = @disciplina.turmas.new(turma_params)\n\n respond_to do |format|\n if @turma.save\n format.html { redirect_to @turma, notice: 'A Turma foi criada com sucesso.' }\n format.json { render action: 'show', status: :created, location: @turma }\n else\n format.html { render action: 'new' }\n format.json { render json: @turma.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tyre = Tyre.new(tyre_params)\n respond_to do |format|\n if @tyre.save\n format.html { redirect_to (:back), notice: 'Treno pneumatici inserito.' }\n format.json { render json: @tyre, status: :created, location: @tyre, content_type: 'text/json' }\n else\n format.html { render action: 'new' }\n format.json { render json: @tyre.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_notadebito = @notadedebito.renglon_notadebitos.create(params[:renglon_notadebito])\n\n respond_to do |format|\n if @renglon_notadebito.save\n format.html { redirect_to @notadebito, notice: 'Renglon notadebito was successfully created.' }\n format.json { render json: @renglon_notadebito}\n else\n format.html { render action: \"new\" }\n format.json { render json: @renglon_notadebito.errors}\n end\n end\n end", "def create\n @tipo_pregunta = TipoPregunta.new(params[:tipo_pregunta])\n\n if @tipo_pregunta.save\n render json: @tipo_pregunta, status: :created, location: @tipo_pregunta\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end", "def create\n\n puts request.body.string\n\n if request.body.string.include? %q[\"id\"]\n render json: %q[{\"error\": \"No se puede crear usuario con id\"}], status: 400\n else\n @usuario = Usuario.new(usuario_params)\n #Tuve que hacerlo asi, pq por alguna razon no me dejaba de la forma tradicional!\n #@usuario = Usuario.new\n #@usuario.usuario = params[:usuario]\n #@usuario.nombre = params[:nombre]\n #@usuario.apellido = params[:apellido]\n #@usuario.twitter = params[:twitter]\n\n\n respond_to do |format|\n if @usuario.save\n #format.html { redirect_to @usuario, notice: 'Usuario was successfully created.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n #format.html { render :new }\n format.json { render json: @usuario.errors, status: 404}# status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @lieu = Lieu.new(params[:lieu])\n\n respond_to do |format|\n if @lieu.save\n format.html { redirect_to(@lieu, :notice => 'Lieu was successfully created.') }\n format.xml { render :xml => @lieu, :status => :created, :location => @lieu }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lieu.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @diet = Diet.new(diet_params)\n @diet.user = @current_user\n\n if @diet.save\n render json: @diet, status: 201, location: @diet, root: true\n else\n render json: @diet.errors, status: 422\n end\n end", "def create\n @status_de_la_inscripcion = StatusDeLaInscripcion.new(params[:status_de_la_inscripcion])\n\n respond_to do |format|\n if @status_de_la_inscripcion.save\n format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully created.' }\n format.json { render json: @status_de_la_inscripcion, status: :created, location: @status_de_la_inscripcion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @klienci_jaskula = KlienciJaskula.new(klienci_jaskula_params)\n\n respond_to do |format|\n if @klienci_jaskula.save\n format.html { redirect_to @klienci_jaskula, notice: 'Klienci jaskula was successfully created.' }\n format.json { render :show, status: :created, location: @klienci_jaskula }\n else\n format.html { render :new }\n format.json { render json: @klienci_jaskula.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @telefononegocio = Telefononegocio.new(params[:telefononegocio])\n\n respond_to do |format|\n if @telefononegocio.save\n format.html { redirect_to @telefononegocio, notice: 'Telefononegocio was successfully created.' }\n format.json { render json: @telefononegocio, status: :created, location: @telefononegocio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @telefononegocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tropa = Tropa.new(tropa_params)\n\n respond_to do |format|\n if @tropa.save\n format.html { redirect_to @tropa, notice: 'Tropa was successfully created.' }\n format.json { render :show, status: :created, location: @tropa }\n else\n format.html { render :new }\n format.json { render json: @tropa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ayuda_localidad = AyudaLocalidad.new(ayuda_localidad_params)\n\n respond_to do |format|\n if @ayuda_localidad.save\n format.html { redirect_to @ayuda_localidad, notice: 'Ayuda localidad was successfully created.' }\n format.json { render :show, status: :created, location: @ayuda_localidad }\n else\n format.html { render :new }\n format.json { render json: @ayuda_localidad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @poligono = Poligono.new(poligono_params)\n\n respond_to do |format|\n if @poligono.save\n format.html { redirect_to @poligono, notice: 'Poligono was successfully created.' }\n format.json { render action: 'show', status: :created, location: @poligono }\n else\n format.html { render action: 'new' }\n format.json { render json: @poligono.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @nepal = Nepal.new(nepal_params)\n\n if @nepal.save\n render json: @nepal, status: :created, location: @nepal\n else\n render json: @nepal.errors, status: :unprocessable_entity\n end\n end", "def create\n @lancamento = Lancamento.new(lancamento_params)\n\n @data = @lancamento.data\n @parcela = (@lancamento.parcela - 1)\n @n = 1\n\n\n respond_to do |format|\n\n if @lancamento.save\n\n if @parcela > 1\n for i in 1..@parcela\n lancamento = @lancamento.dup\n lancamento.data = (@data += 1.month)\n lancamento.parcela = (@n += 1)\n lancamento.save!\n end\n end\n\n\n format.html { redirect_to @lancamento, notice: 'Lancamento was successfully created.' }\n format.json { render :show, status: :created, location: @lancamento }\n format.js\n else\n format.html { render :new }\n format.json { render json: @lancamento.errors, status: :unprocessable_entity }\n format.js\n end\n end\n \n end", "def create\n @panneau = Panneau.new(panneau_params)\n\n respond_to do |format|\n if @panneau.save\n format.html { redirect_to @panneau, notice: 'Panneau was successfully created.' }\n format.json { render :show, status: :created, location: @panneau }\n else\n format.html { render :new }\n format.json { render json: @panneau.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params.permit(:id_groupe, :id_question)\n ajout = GroupeService.instance.ajouterQuestion(params[:id_groupe], params[:id_question])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end", "def create\n @diemtrentuyen = Diemtrentuyen.new(params[:diemtrentuyen])\n\n respond_to do |format|\n if @diemtrentuyen.save\n format.html { redirect_to @diemtrentuyen, notice: 'Diemtrentuyen was successfully created.' }\n format.json { render json: @diemtrentuyen, status: :created, location: @diemtrentuyen }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diemtrentuyen.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6765753", "0.6617363", "0.64101124", "0.63843805", "0.6254881", "0.6250767", "0.6247321", "0.62227625", "0.6202175", "0.61843634", "0.6178186", "0.6176066", "0.61421204", "0.6141438", "0.6125902", "0.6119125", "0.6104647", "0.6095952", "0.60938144", "0.6085084", "0.60792387", "0.6074845", "0.60690516", "0.60509384", "0.60437596", "0.6042857", "0.60402185", "0.60354084", "0.6032524", "0.60316575", "0.60277027", "0.60247743", "0.6020228", "0.6019925", "0.60163826", "0.60108477", "0.6010263", "0.60083425", "0.60039717", "0.60033983", "0.5995839", "0.5987671", "0.5971432", "0.5970146", "0.596594", "0.5964885", "0.59606", "0.5955128", "0.5952904", "0.59477", "0.5944259", "0.59277004", "0.59266394", "0.59229416", "0.5922156", "0.5915603", "0.5905858", "0.590562", "0.59042037", "0.5903781", "0.5901374", "0.58994186", "0.58985186", "0.5896797", "0.58938646", "0.5892707", "0.5884767", "0.5883187", "0.5883187", "0.5880395", "0.58770436", "0.5875255", "0.5872869", "0.5872709", "0.58701265", "0.58685255", "0.5867402", "0.58650637", "0.5860164", "0.5860079", "0.5858745", "0.5844829", "0.58447826", "0.5843102", "0.58414817", "0.5837303", "0.58230466", "0.5815673", "0.58113503", "0.58108157", "0.58086365", "0.58077174", "0.58062583", "0.580399", "0.58014494", "0.58007944", "0.57989943", "0.57952356", "0.57942206", "0.579232" ]
0.6908584
0
PATCH/PUT /litigantes/1 PATCH/PUT /litigantes/1.json
def update respond_to do |format| if @litigante.update(litigante_params) format.html { redirect_to @litigante, notice: 'Litigante was successfully updated.' } format.json { render :show, status: :ok, location: @litigante } else format.html { render :edit } format.json { render json: @litigante.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch!\n request! :patch\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @lieu = Lieu.find(params[:id])\n\n respond_to do |format|\n if @lieu.update_attributes(params[:lieu])\n format.html { redirect_to @lieu, notice: 'Lieu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lieu.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n if @leito.update_attributes(params[:leito])\n format.html { redirect_to @leito, notice: 'Leito was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @leito.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @core_termo_lacre = Core::TermoLacre.find(params[:id])\n\n respond_to do |format|\n if @core_termo_lacre.update_attributes(params[:core_termo_lacre])\n format.html { redirect_to @core_termo_lacre, notice: 'Termo lacre was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @core_termo_lacre.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n if @livro.update_attributes(params[:livro])\n format.html { redirect_to @livro, :notice => 'Livro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @livro.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @loja = Loja.find(params[:id])\n\n respond_to do |format|\n if @loja.update_attributes(params[:loja])\n format.html { redirect_to @loja, notice: 'Loja actualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @loja.errors, status: :unprocessable_entity }\n end\n end\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def update\n if signed_in?\n @litra = Litra.find(params[:id])\n\n respond_to do |format|\n if @litra.update_attributes(params[:litra])\n format.html { redirect_to @litra, notice: 'Litra was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @litra.errors, status: :unprocessable_entity }\n end\n end\n end\nend", "def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def update\n authorize! :update, Tipo\n respond_to do |format|\n if @tipo.update(tipo_params)\n log(\"Se ha editado la nomina #{@lt}\", 1)\n format.html { redirect_to tipos_path, notice: 'Los datos de la nómina fueron actualizados exitosamente.' }\n format.json { head :no_content }\n end\n end\n end", "def update\n @kolegij = Kolegij.find(params[:id])\n\n respond_to do |format|\n if @kolegij.update_attributes(params[:kolegij])\n format.html { redirect_to @kolegij, notice: 'Kolegij was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kolegij.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @itineraire = Itineraire.find(params[:id])\n\n respond_to do |format|\n if @itineraire.update_attributes(params[:itineraire])\n format.html { redirect_to @itineraire, :notice => 'L\\'itinéraire a bien été modifié' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @itineraire.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n \n @lancamentorapido = Lancamentorapido.find(params[:id]) \n \n #Validações padrão\n @lancamentorapido.tipo = :receita if @lancamentorapido.tipo.blank?\n @lancamentorapido.valor = 0 if @lancamentorapido.valor.blank? \n \n\n respond_to do |format|\n if @lancamentorapido.update_attributes(params[:lancamentorapido])\n format.html { redirect_to lancamentorapidos_path, notice: 'Lancamento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lancamentorapido.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n if @tecnico.update_attributes(params[:tecnico])\n format.html { redirect_to @tecnico, notice: 'Tecnico atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @parola.update(parola_params)\n format.html { redirect_to parolas_url, notice: 'Parola was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @parola.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @detalle = Detalle.find(params[:id])\n\n respond_to do |format|\n if @detalle.update_attributes(params[:detalle])\n format.html { redirect_to @detalle, notice: 'Detalle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @objet = Objet.find(params[:id])\n\n respond_to do |format|\n if @objet.update_attributes(params[:objet])\n format.html { redirect_to @objet, notice: 'The found item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @poligono.update(poligono_params)\n format.html { redirect_to @poligono, notice: 'Poligono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @poligono.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @titulacion.update(titulacion_params)\n format.html { redirect_to @titulacion, notice: 'Titulacion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @titulacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @livro.update(livro_params)\n format.html { redirect_to @livro, notice: 'Livro atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @livro }\n else\n format.html { render :edit }\n format.json { render json: @livro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipomedalla = Tipomedalla.find(params[:id])\n\n respond_to do |format|\n if @tipomedalla.update_attributes(params[:tipomedalla])\n format.html { redirect_to @tipomedalla, notice: 'Tipomedalla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipomedalla.errors, status: :unprocessable_entity }\n end\n end\n end", "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end", "def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @plato = Plato.find(params[:id])\n\n if @plato.update(plato_params)\n head :no_content\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end", "def update\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n if @colegio.update_attributes(params[:colegio])\n format.html { redirect_to @colegio, notice: 'El Colegio fue actualizado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bla = Bla.find(params[:id])\n\n respond_to do |format|\n if @bla.update_attributes(params[:bla])\n format.html { redirect_to @bla, :notice => 'Bla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bla.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @nota_tecnica.update(nota_tecnica_params)\n format.html { redirect_to @nota_tecnica, notice: 'Nota tecnica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nota_tecnica.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @sivic_celula.update(sivic_celula_params)\r\n format.html { redirect_to @sivic_celula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_celula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end", "def update\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n if @sitio_entrega.update_attributes(params[:sitio_entrega])\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tiposveiculo.update(tiposveiculo_params)\n format.html { redirect_to tiposveiculos_url, notice: 'Tipo de Veículo editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tiposveiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tare = Tare.find(params[:id])\n\n respond_to do |format|\n if @tare.update_attributes(params[:tare])\n format.html { redirect_to @tare, notice: 'Tare modifiée avec succès.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tare.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @celulare.update(celulare_params)\n format.html { redirect_to @celulare, notice: 'Celulare was successfully updated.' }\n format.json { render :show, status: :ok, location: @celulare }\n else\n format.html { render :edit }\n format.json { render json: @celulare.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @iglesia.update(iglesia_params)\n format.html { redirect_to @iglesia, notice: 'La iglesia #{@iglesia.nombre} ha sido actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @iglesia.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lei = Lei.find(params[:id])\n\n respond_to do |format|\n if @lei.update_attributes(params[:lei])\n format.html { redirect_to @lei, notice: 'Lei was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lei.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:producto][:activo]\n id = params[:id]\n Producto.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n respond_to do |format|\n if @livro.update(livro_params)\n format.html { redirect_to @livro, alert: t('.update', default: t('helpers.messages.update')) }\n format.json { render :show, status: :ok, location: @livro }\n else\n format.html { render :edit }\n format.json { render json: @livro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objet.update(objet_params)\n format.html { redirect_to @objet, notice: 'Objet was successfully updated.' }\n format.json { render :show, status: :ok, location: @objet }\n else\n format.html { render :edit }\n format.json { render json: @objet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n if @puntaje.update_attributes(params[:puntaje])\n format.html { redirect_to @puntaje, notice: 'Puntaje was successfully updated.' }\n format.json { head :no_content }\n else\n atributos\n format.html { render action: \"edit\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @personaje = Personaje.find(params[:id])\n\n respond_to do |format|\n if @personaje.update_attributes(params[:personaje])\n format.html { redirect_to @personaje, notice: 'Personaje was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @telefono.update(telefono_params)\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { render :show, status: :ok, location: @telefono }\n else\n format.html { render :edit }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lieu = Lieu.find(params[:id])\n\n respond_to do |format|\n if @lieu.update_attributes(params[:lieu])\n format.html { redirect_to(@lieu, :notice => 'Lieu was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lieu.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n if @respuesta.update_attributes(params[:respuesta])\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(etiqueta_params)\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n if @etnia.update_attributes(params[:etnia])\n format.html { redirect_to @etnia, notice: 'Etnia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @lectura.update(lectura_params)\n format.html { redirect_to lecturas_path, notice: 'La lectura fue actualizada.' }\n format.json { render :show, status: :ok, location: @lectura }\n else\n format.html { render :edit }\n format.json { render json: @lectura.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @peticion_servicio_ti = Peticion::ServicioTi.find(params[:id])\n\n respond_to do |format|\n if @peticion_servicio_ti.update_attributes(params[:peticion_servicio_ti])\n format.html { redirect_to edit_peticion_servicio_ti_path(@peticion_servicio_ti), notice: 'Actualizado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peticion_servicio_ti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tapioca.update(tapioca_params)\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lugar = Lugar.find(params[:id])\n\n respond_to do |format|\n if @lugar.update_attributes(params[:lugar])\n format.html { redirect_to @lugar, notice: 'Lugar was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lugar.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @platoon.update(platoon_params)\n format.html { redirect_to @platoon, notice: 'Platoon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platoon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kela.update(kela_params)\n format.html { redirect_to @kela, notice: 'Kela was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kela.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n @karteikarte = Karteikarte.find(params[:id])\n\n respond_to do |format|\n if @karteikarte.update_attributes(params[:karteikarte])\n format.html { redirect_to @karteikarte, notice: 'Karteikarte was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @karteikarte.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @voluntario.update(voluntario_params) and @voluntario.update_attributes(:modificador => current_user.id)\n format.html { redirect_to @voluntario, notice: 'Voluntario was successfully updated.' }\n format.json { render :show, status: :ok, location: @voluntario }\n else\n format.html { render :edit }\n format.json { render json: @voluntario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @telefon = Telefon.find(params[:id])\n @telefon.update_attributes(params[:telefon])\n respond_with(@telefon)\n end", "def update\n @objet = Objet.find(params[:id])\n # @objet.user_id = @user.id\n load_ressources\n respond_to do |format|\n if @objet.update_attributes(params[:objet])\n format.html { redirect_to @objet, notice: 'Objet a été édité avec succès.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objet.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "def update\n @core_liberar_nota = Core::LiberarNota.find(params[:id])\n\n respond_to do |format|\n if @core_liberar_nota.update_attributes(params[:core_liberar_nota])\n format.html { redirect_to @core_liberar_nota, notice: 'Liberar nota was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @core_liberar_nota.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @comentariu_licenta.update(comentariu_licenta_params)\n format.html { redirect_to @comentariu_licenta, notice: 'Comentariu licenta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comentariu_licenta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tale.update(tale_params)\n format.html { redirect_to @tale, notice: 'Tale was successfully updated.' }\n format.json { render :show, status: :ok, location: @tale }\n else\n format.html { render :edit }\n format.json { render json: @tale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enquete.update(enquete_params)\n format.html { redirect_to @enquete, notice: 'Enquete editada com sucesso!' }\n format.json { render :show, status: :ok, location: @enquete }\n else\n format.html { render :edit }\n format.json { render json: @enquete.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n \n respond_to do |format|\n if @conta.update(nome: conta_params[:nome], status: conta_params[:status], pai: pai) \n #format.json { render :show, status: :ok, location: @conta }\n format.json { render json: @conta.to_json, status: :ok }\n else \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @protocolo.update(protocolo_params)\n addlog(\"Protocolo alterado\")\n format.html { redirect_to @protocolo, notice: 'Protocolo foi atualizado.' }\n format.json { render :show, status: :ok, location: @protocolo }\n else\n format.html { render :edit }\n format.json { render json: @protocolo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lector = Lector.find(params[:id])\n\n respond_to do |format|\n if @lector.update_attributes(params[:lector])\n format.html { redirect_to @lector, notice: 'Las modificaciones al Lector se han guardado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lector.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rotina.update(rotina_params)\n format.html { redirect_to rotinas_path, notice: 'Rotina atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rotina.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @laboratorio.update(laboratorio_params)\n format.html { redirect_to \"/laboratorios\", notice: 'Laboratorio actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @laboratorio }\n else\n format.html { render :edit }\n format.json { render json: @laboratorio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @koti = Koti.find(params[:id])\n\n respond_to do |format|\n if @koti.update_attributes(params[:koti])\n format.html { redirect_to @koti, notice: 'Koti was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @koti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format|\n if @giang_vien.update_attributes(params[:giang_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @giang_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sintoma.update(sintoma_params)\n format.html { redirect_to @sintoma, notice: 'Sintoma was successfully updated.' }\n format.json { render :show, status: :ok, location: @sintoma }\n else\n format.html { render :edit }\n format.json { render json: @sintoma.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #parametros_autocomplete!(params[:estudiante][:persona])\n @estudiante = Estudiante.find(params[:id])\n \n begin\n @estudiante.persona_id = params[:persona][:id]\n rescue\n end\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to @estudiante, notice: 'Estudiante actualizado' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estudiante.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @titulacao.update(titulacao_params)\n format.html { redirect_to titulacaos_path, notice: 'Titulo atualizado com successo.' }\n format.json { render titulacaos_path, status: :ok, location: titulacaos_path }\n else\n format.html { render :edit }\n format.json { render json: @titulacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recurso = Recurso.find(params[:id])\n\n respond_to do |format|\n if @recurso.update_attributes(params[:recurso])\n format.html { redirect_to @recurso, notice: 'O recurso de auto de infração foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recurso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @noto = Noto.find(params[:id])\n\n respond_to do |format|\n if @noto.update_attributes(params[:noto])\n format.html { redirect_to @noto, :notice => 'Noto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @noto.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def patch(path, **args); end", "def update\n respond_to do |format|\n if @lectura.update(lectura_params)\n format.html { redirect_to @lectura, notice: 'La lectura fue actualizada.' }\n format.json { render :show, status: :ok, location: @lectura }\n else\n format.html { render :edit }\n format.json { render json: @lectura.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objetivo.update(objetivo_params)\n format.html { redirect_to [@mision, @objetivo], notice: 'Objetivo was successfully updated.' }\n format.json { render :show, status: :ok, location: [@mision, @objetivo] }\n else\n format.html { render :edit }\n format.json { render json: [@mision, @objetivo].errors, status: :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @lancamento.update(lancamento_params)\n format.html { redirect_to @lancamento, notice: 'Lancamento was successfully updated.' }\n format.json { render :show, status: :ok, location: @lancamento }\n format.js #{ redirect_to lancamentos_path, notice: \"Atualizado com Sucesso\" }\n else\n format.html { render :edit }\n format.json { render json: @lancamento.errors, status: :unprocessable_entity }\n format.js #{ render :edit }\n end\n end\n end", "def update\n respond_to do |format|\n if @itinerario_realizado.update(itinerario_realizado_params)\n format.html { redirect_to @itinerario_realizado, notice: 'Itinerario realizado was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @itinerario_realizado.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n @updaterete = Updaterete.find(params[:id])\n\n respond_to do |format|\n if @updaterete.update_attributes(params[:updaterete])\n format.html { redirect_to @updaterete, notice: 'Updaterete was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @updaterete.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @entrega.update(entrega_params)\n format.html { redirect_to @entrega, notice: 'Entrega editada con éxito.' }\n format.json { render :show, status: :ok, location: @entrega }\n else\n format.html { render :edit }\n format.json { render json: @entrega.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.67894596", "0.667066", "0.6593973", "0.6529157", "0.6450816", "0.6448251", "0.6413122", "0.6404869", "0.6365288", "0.6345258", "0.6335578", "0.6335578", "0.6323793", "0.6323017", "0.63147813", "0.63147813", "0.6313628", "0.63045555", "0.6301771", "0.6301771", "0.62926155", "0.6257948", "0.6256965", "0.62202007", "0.6220129", "0.6213121", "0.62077147", "0.6192833", "0.6176677", "0.6164048", "0.61605746", "0.61587316", "0.6155128", "0.61543524", "0.6152384", "0.6139747", "0.6134244", "0.6131742", "0.6131179", "0.61288416", "0.61252946", "0.61191404", "0.6111831", "0.610801", "0.6105365", "0.6103245", "0.6102872", "0.61020964", "0.610157", "0.6100706", "0.60941947", "0.60922444", "0.6085371", "0.6083551", "0.6078901", "0.60743934", "0.60667527", "0.6061264", "0.60589916", "0.6057131", "0.6055564", "0.60535717", "0.60504586", "0.60503364", "0.60498893", "0.60498697", "0.60482097", "0.60338414", "0.6032223", "0.6032133", "0.60319054", "0.60312873", "0.6030517", "0.6029024", "0.6028823", "0.6028786", "0.60234284", "0.6023416", "0.60163283", "0.60133", "0.601149", "0.60094434", "0.6007754", "0.60071737", "0.6004959", "0.6003248", "0.5995991", "0.5995848", "0.59958124", "0.59877026", "0.5987141", "0.5986599", "0.5983642", "0.598303", "0.59829974", "0.5980977", "0.5979624", "0.5974312", "0.5972087", "0.5970393" ]
0.6799611
0
DELETE /litigantes/1 DELETE /litigantes/1.json
def destroy @litigante.destroy respond_to do |format| format.html { redirect_to litigantes_url, notice: 'Litigante was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @leito = Leito.find(params[:id])\n @leito.destroy\n\n respond_to do |format|\n format.html { redirect_to leitos_url }\n format.json { head :ok }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @lieu = Lieu.find(params[:id])\n @lieu.destroy\n\n respond_to do |format|\n format.html { redirect_to lieus_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end", "def destroy\n @detalle = Detalle.find(params[:id])\n @detalle.destroy\n\n respond_to do |format|\n format.html { redirect_to detalles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n @lancamentorapido.destroy \n\n respond_to do |format|\n format.html { redirect_to lancamentorapidos_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @etiquetum.destroy\n respond_to do |format|\n format.html { redirect_to etiqueta_url, notice: 'Etiqueta borrada!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @datosgenerale.destroy\n respond_to do |format|\n format.html { redirect_to datosgenerales_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nota_tecnica.destroy\n respond_to do |format|\n format.html { redirect_to nota_tecnicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to datos_url }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @chaine = Chaine.find(params[:id])\n @chaine.destroy\n\n respond_to do |format|\n format.html { redirect_to chaines_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cantante.destroy\n respond_to do |format|\n format.html { redirect_to cantantes_url, notice: 'Cantante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @visitante.destroy\n respond_to do |format|\n format.html { redirect_to visitantes_url, notice: 'Visitante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lixotodo.destroy\n respond_to do |format|\n format.html {redirect_to lixotodos_url, notice: 'Registro excluído com sucesso.'}\n format.json {head :no_content}\n end\n end", "def destroy\n @livro.destroy\n respond_to do |format|\n format.html { redirect_to livros_url, notice: 'Livro apagado com sucesso.' }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @ficha = Ficha.find(params[:id])\n @ficha.destroy\n\n respond_to do |format|\n format.html { redirect_to fichas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lei = Lei.find(params[:id])\n @lei.destroy\n\n respond_to do |format|\n format.html { redirect_to leis_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lectura.destroy\n respond_to do |format|\n format.html { redirect_to lecturas_url, notice: 'La lectura fue eliminada.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lectura.destroy\n respond_to do |format|\n format.html { redirect_to lecturas_url, notice: 'La lectura fue eliminada.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @loja = Loja.find(params[:id])\n @loja.destroy\n\n respond_to do |format|\n format.html { redirect_to lojas_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @titulacion.destroy\n respond_to do |format|\n format.html { redirect_to titulaciones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @detalle.destroy\n respond_to do |format|\n format.html { redirect_to detalles_url, notice: 'Detalle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @livro = Livro.find(params[:id])\n @livro.destroy\n\n respond_to do |format|\n format.html { redirect_to livros_url }\n format.json { head :no_content }\n end\n end", "def borrar \n\n fiesta.destroy\n render json: fiesta \n end", "def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tecnico = Tecnico.find(params[:id])\n @tecnico.destroy\n\n respond_to do |format|\n format.html { redirect_to tecnicos_url }\n format.json { head :no_content }\n end\n end", "def delete!\n request! :delete\n end", "def destroy\n @donante.destroy\n respond_to do |format|\n format.html { redirect_to donantes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @estatuto = Estatuto.find(params[:id])\n @estatuto.destroy\n\n respond_to do |format|\n format.html { redirect_to estatutos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @giang_vien = GiangVien.find(params[:id])\n @giang_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @asiento = Asiento.find(params[:id])\n @asiento.destroy\n\n respond_to do |format|\n format.html { redirect_to asientos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @objet = Objet.find(params[:id])\n @objet.destroy\n\n respond_to do |format|\n format.html { redirect_to objets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_termo_lacre = Core::TermoLacre.find(params[:id])\n @core_termo_lacre.destroy\n\n respond_to do |format|\n format.html { redirect_to core_termo_lacres_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lancamento.destroy\n respond_to do |format|\n format.html { redirect_to lancamentos_url, notice: 'Lançamento apagado com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @etnia = Etnia.find(params[:id])\n @etnia.destroy\n\n respond_to do |format|\n format.html { redirect_to etnias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sitio_entrega = SitioEntrega.find(params[:id])\n @sitio_entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to sitio_entregas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @objet = Objet.find(params[:id])\n @objet.destroy\n respond_to do |format|\n format.html { redirect_to objets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dynamique = Dynamique.find(params[:id])\n @dynamique.destroy\n\n respond_to do |format|\n format.html { redirect_to dynamiques_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_unidad.destroy\n respond_to do |format|\n format.html { redirect_to tipo_unidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end", "def destroy\n @iglesia.destroy\n respond_to do |format|\n format.html { redirect_to iglesias_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def delete(path)\n\t\trequest(path, :delete)\n\tend", "def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @substancia.destroy\n respond_to do |format|\n format.html { redirect_to substancias_url, notice: 'Substancia was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n unless possui_acesso?()\n return\n end\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n\n respond_to do |format|\n format.html { redirect_to avisos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @detalle_orden_trabajo.destroy\n respond_to do |format|\n format.html { redirect_to @orden_trabajo, notice: 'Detalle fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @alumno.destroy\n respond_to do |format|\n format.html { redirect_to grupos_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aluno.destroy\n respond_to do |format|\n format.html { redirect_to alunos_url }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def destroy\n @seguidore = Seguidore.find(params[:id])\n @seguidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seguidores_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trabalho = Trabalho.find(params[:id])\n @trabalho.destroy\n\n respond_to do |format|\n format.html { redirect_to trabalhos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n string = \"DELETE FROM notes WHERE famille_id = #{@famille.id}\"\n connection = Demande.connection\n connection.delete(string)\n @famille.destroy\n respond_to do |format|\n format.html { redirect_to familles_url, notice: 'Famille was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @escola = Escola.find(params[:id])\n @escola.destroy\n\n respond_to do |format|\n format.html { redirect_to escolas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lore = Lore.find(params[:id])\n @lore.destroy\n\n respond_to do |format|\n format.html { redirect_to lores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @etudiant = Etudiant.find(params[:id])\n @etudiant.destroy\n\n respond_to do |format|\n format.html { redirect_to etudiants_url }\n format.json { head :ok }\n end\n end", "def destroy\n @servico_pacote.destroy\n respond_to do |format|\n format.html { redirect_to servico_pacotes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipoveiculo.destroy\n respond_to do |format|\n format.html { redirect_to tipoveiculos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n @diemtrentuyen.destroy\n\n respond_to do |format|\n format.html { redirect_to diemtrentuyens_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @itinerario_realizado.destroy\n respond_to do |format|\n format.html { redirect_to itinerario_realizados_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tangazo.destroy\n respond_to do |format|\n format.html { redirect_to tangazos_url, notice: 'Tangazo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lector = Lector.find(params[:id])\n @lector.destroy\n\n respond_to do |format|\n format.html { redirect_to lectores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nominee.destroy\n respond_to do |format|\n format.html { redirect_to nominees_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @odontologia1 = Odontologia1.find(params[:id])\n @odontologia1.destroy\n\n respond_to do |format|\n format.html { redirect_to odontologia1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @datos_estudiante.destroy\n respond_to do |format|\n format.html { redirect_to datos_estudiantes_url, notice: 'Datos estudiante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conta.destroy\n params[:id] = nil\n respond_to do |format|\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end", "def destroy\n @comentariu_licenta.destroy\n respond_to do |format|\n format.html { redirect_to comentariu_licentas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @antropo.destroy\n respond_to do |format|\n format.html { redirect_to antropos_url }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @oficio.destroy\n respond_to do |format|\n format.html { redirect_to oficios_url, notice: 'Oficio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipoapreensao.destroy\n respond_to do |format|\n format.html { redirect_to tipoapreensoes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @treinamento_ti.destroy\n respond_to do |format|\n format.html { redirect_to treinamentos_ti_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7220753", "0.7054459", "0.69733346", "0.6945899", "0.69382465", "0.6909284", "0.6870737", "0.6869344", "0.6866321", "0.68574893", "0.6827508", "0.68133086", "0.6772821", "0.6765886", "0.67650384", "0.6762594", "0.6761315", "0.67601734", "0.67503726", "0.674974", "0.67434865", "0.6740899", "0.67407197", "0.6730865", "0.67238665", "0.67205673", "0.6716932", "0.67165124", "0.67165124", "0.6716454", "0.67155784", "0.6715295", "0.6713132", "0.67130923", "0.67101306", "0.6708618", "0.67085683", "0.67085683", "0.67085683", "0.6706632", "0.6705756", "0.67040986", "0.67016864", "0.6696442", "0.6695641", "0.6694647", "0.6690229", "0.6687898", "0.66848904", "0.6684379", "0.66834635", "0.66792226", "0.66776246", "0.66758263", "0.66719395", "0.66719395", "0.6670173", "0.6664659", "0.6661484", "0.6659098", "0.66542375", "0.66518724", "0.66456115", "0.6643021", "0.66415274", "0.6638527", "0.66384315", "0.66378504", "0.6635573", "0.66336524", "0.6627346", "0.6625733", "0.66253227", "0.66238815", "0.6623067", "0.6620528", "0.6619102", "0.66187924", "0.6617815", "0.6613214", "0.6612157", "0.66107476", "0.66106707", "0.6605735", "0.6604482", "0.66035575", "0.65993035", "0.6597232", "0.65951586", "0.6591571", "0.6590943", "0.6588946", "0.6588946", "0.6588946", "0.6588946", "0.6588662", "0.658846", "0.6588357", "0.65881866", "0.6587256" ]
0.70145524
2
Use callbacks to share common setup or constraints between actions.
def set_litigante @litigante = Litigante.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def litigante_params params.require(:litigante).permit(:case_id, :participante, :rut, :persona, :nombre) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Destroys the like tied to this user on this likeable model
def unliked_by(user) self.send(self.class.like_label.tableize.to_sym).find_by_user_id(user.id).destroy rescue false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n like = Like.find(params[:id])\n if like.user == current_user\n Like.destroy(params[:id])\n end\n redirect_to root_url\n end", "def destroy_like\n @like = Like.where(likeable_id: params[:comment_id], likeable_type: \"Comment\", user_id: current_user.id).first\n @like.destroy\n render 'api/likes/destroy_like.json.jbuilder'\n end", "def destroy\n @like = Like.find(params[:id])\n @like.destroy\n end", "def destroy\n @user_like = UserLike.find(params[:id])\n @user_like.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_user_likes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @user_like = UserLike.find(params[:id])\n @user_like.destroy\n\n respond_to do |format|\n format.html { redirect_to user_likes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@like = Like.find(params[:id])\n\t\[email protected]\n\t\tflash[:danger] = \"Unliked Successfully\"\n\t\tredirect_to :back\n\tend", "def destroy\n @todo_like.destroy\n end", "def destroy\n @user_post_like.destroy\n respond_to do |format|\n format.html { redirect_to user_post_likes_url, notice: 'User post like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like = Like.find(params[:id])\n @like.destroy\n redirect_to root_url, notice: 'Like was successfully destroyed.'\n end", "def destroy\n current_user.likes.find(params[:id]).destroy\n redirect_to posts_path\n end", "def remove_movie_from_likes\n @user = User.find(params[:user_id])\n binding.pry\n @user.likes.delete(params[:id])\n @user.save\n redirect_to user_path(@user)\n end", "def destroy\n destroyed = Like.dislike(current_user, @resource)\n p 'the like was not destroyed' unless destroyed\n redirect_to root_url\n end", "def destroy\n @user.likes.each do |like|\n @contribution = like.contribution\n @contribution.points -= 1\n @contribution.save\n end\n @user.likes.destroy_all\n @user.contributions.destroy_all\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url}\n format.json { head :no_content }\n end\n end", "def destroy\n @like.destroy\n redirect_to listings_path\n end", "def destroy\n find_like\n @like.destroy\n redirect_to gosssip_path(@gossip.id)\n \n end", "def delete_likes\n # Delete user's own likes.\n Like.where(user_id: user.id).delete_all\n # Delete likes on user's posts.\n Like.where('post_id IN (SELECT id FROM posts WHERE user_id = ?)', user.id).delete_all\n end", "def destroy_post_owner_notification_of_like(like)\n self.notifications.find_by_key(post_like_notification_key(like)).destroy rescue true\n end", "def destroy\n\t\t@like = Like.find(params[:id])\n\t\t@likable = @like.likable\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.json { head :no_content }\n\t\t\tformat.js\n\t\tend\n\tend", "def destroy\n @like = Like.find(like_params[:id])\n\n @like.destroy\n respond_to do |format|\n format.html{ redirect_to @like.likable }\n format.json{ head :no_content }\n end\n end", "def destroy\n @current_user = current_user()\n Like.find_by(user: @current_user, gossip: Gossip.find(params[:format])).destroy\n end", "def destroy\n @like = Like.find(params[:id])\n @like.destroy\n\n respond_to do |format|\n format.html { redirect_to likes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authenticate!\n if Dislike.find(params[:id]).user_id == current_user.id\n Dislike.destroy(params[:id])\n render json: { message: 'Item deleted' }\n else\n render:json => { :msg => \"Dislike deletion failed..\" }, :status => :bad_request\n end\n end", "def destroy\n @user_trick.destroy\n end", "def destroy\n @like_system_like = LikeSystem::Like.find(params[:id])\n @like_system_like.destroy\n\n respond_to do |format|\n format.html { redirect_to like_system_likes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @post_like = PostLike.find(params[:id])\n @post_like.destroy\n\n respond_to do |format|\n format.html { redirect_to post_likes_url }\n format.json { head :no_content }\n end\n end", "def delete_likes\n end", "def delete_likes\n end", "def delete_likes\n end", "def destroy\n @like.destroy\n respond_to do |format|\n format.html { redirect_to likes_url, notice: 'Like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like.destroy\n respond_to do |format|\n format.html { redirect_to likes_url, notice: 'Like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like = Like::Like.in_conference(current_conference).\n where(:user_id => current_user.id).find(params[:id])\n @presentation = @like.presentation\n \n set_flash @like.destroy, :success => \"Like was successfully removed.\",\n :fail => \"Failed to remove Like.\"\n\n respond_with @presentation, :success_action => 'presentations/social_box'\n end", "def destroy\n @user = current_user\n @review_like = ReviewLike.find(params[:id]).delete\n render json: { msg: \"Delete Successful\" }\n end", "def remove_like\n session[:return_to] = request.referrer\n movie = Movie.find(params[:movie_id])\n movie.likes -= 1\n movie.save\n current_user.rating_movies.find_by_movie_id(params[:movie_id]).destroy\n redirect_to session.delete(:return_to), :notice => \"You do not like the movie any more!\"\n end", "def destroy\n #since there is only one unique like record per @user, we can find it without passing the like.id from params\n @like = Like.where(:user_id => @user.id, :video_id => @video.id).first\n begin\n @like.destroy\n respond_to do |format|\n format.html { redirect_to(client_video_likes_path(@video)) }\n format.xml { head :ok }\n format.json { render :json => {:deleted => true}, :status => :ok}\n end\n rescue => e\n respond_to do |format|\n format.json { render :json => {:errors => e.to_s}, :status => :unprocessable_entity}\n end\n\n end\n end", "def destroy\n #@like_id = params[:id]\n #@like_array = @like_id.pluck(:id)\n #@like_record = Like.where(:likeable_id => @bloc, :user_id => current_user.id)\n #@like_array = @like_record.pluck(:id)\n #@like_id = @like_array[0]\n @bloc = Bloc.find(params[:bloc_id])\n @like = @bloc.likes.find_by(user_id: current_user)\n if @like.destroy\n render :toggle, locals: {bloc: @bloc}\n end\n\n # if @like.destroy\n # if params[:whendone] == \"index\"\n # redirect_to blocs_path\n # else\n # redirect_to @bloc\n # end\n # end \n\n end", "def destroy\n @user_thing.destroy\n end", "def destroy\n id = @comment.micropost_id\n likes = Like.find_by_sql(['SELECT \"likes\".* FROM \"likes\" WHERE \"likes\".\"comment_id\" = ?', @comment.id])\n likes.each do |like|\n like_id = ActiveRecord::Base.sanitize(like.id)\n execute_statement(\"DELETE FROM likes WHERE id = #{like_id}\")\n end\n comment_id = ActiveRecord::Base.sanitize(@comment.id)\n execute_statement(\"DELETE FROM comments WHERE id = #{comment_id}\")\n redirect_to micropost_path(id)\n end", "def destroy\n @post_like.destroy\n respond_to do |format|\n format.html { redirect_to post_likes_url, notice: 'Post like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n respond_to do |f|\n if !(already_liked?)\n f.html {redirect_to :back, notice: \"Already unliked.\"}\n else\n @like.destroy\n end\n f.html {redirect_to :back}\n end\n end", "def destroy\n @hitcher_like.destroy\n respond_to do |format|\n format.html { redirect_to hitcher_likes_url, notice: 'Hitcher like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @look_a_like.destroy\n respond_to do |format|\n format.html { redirect_to look_a_likes_url, notice: \"Look a like was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n user = current_user\n item_id = Sneaker.find(params[:id])\n Wishlist.where(sneaker_id: params[:id]).destroy_all\n item_id.destroy\n redirect_to user_path(user)\n end", "def destroy\n @like.destroy\n respond_to do |format|\n flash[:success] = 'link deletado com Sucesso.'\n format.html { redirect_to new_like_path }\n format.json { head :no_content }\n end\n end", "def destroy_like(group_id, message_id)\n post(\"/messages/#{group_id}/#{message_id}/unlike\").status == 200\n end", "def delete_like(id, options = {}, &block)\n # Unlikes a given object for the logged-in user\n raise AuthenticationError.new(nil, nil, \"Unliking requires an access token\") unless access_token\n graph_call(\"#{id}/likes\", {}, \"delete\", options, &block)\n end", "def unlike\n giver_id = current_user.id\n kudo_id = params.require(:kudo_id)\n\n unless (kudo = Kudo.find_by(id: kudo_id))\n return render json: { errors: \"kudo with id #{kudo_id.inspect} could not be found\" }, status: :not_found\n end\n\n unless (like = Like.find_by(kudo_id: kudo_id, giver_id: giver_id))\n return render json: { errors: \"this like doesn't exist\" }, status: :conflict\n end\n\n like.destroy\n \n render json: { deleted: true }, status: :accepted\n end", "def unlike_picture\n @pic = Picture.find(params[:id])\n @like = Like.find(:last,:conditions=>[\"user_id=? and likable_id=? and likable_type=?\",@login_user.id,params[:id],\"Picture\"])\n if @like.destroy\n respond_to do |format|\n format.js\n end\n else\n render :text=>\"Fail\"\n end\n end", "def destroy\n @c_like = CLike.find_by(user_id: current_user.id, comment_id: params[:comment_id])\n @c_like.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Like was successfully destroyed.' }\n format.json { render json: {status: 'success', like: @c_like, counts: CLike.where(comment_id: params[:comment_id]).count}, liked: false }\n end\n end", "def unlike_picture\n @pic = Image.find(params[:id])\n @like = Like.where([\"user_id=? AND likable_id=? AND likable_type=?\", @login_user.id, params[:id], \"Image\"])\n if @like.destroy\n respond_to do |format|\n format.js\n end\n else\n render :text=>\"Fail\"\n end\n end", "def destroy\n @idea_like.destroy\n respond_to do |format|\n format.html { redirect_to idea_likes_url, notice: 'Idea like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @like_button = LikeButton.find(params[:id])\n @like_button.destroy\n\n respond_to do |format|\n format.html { redirect_to(like_buttons_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @like = Like.find(params[:id])\n @likes = Like.where(\"photo_id = ?\", @like.photo_id)\n @photo = @like.photo\n @like.destroy\n\n respond_to do |format|\n format.html { redirect_to likes_url }\n format.js { render action: \"create\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @question_like.destroy\n respond_to do |format|\n format.html { redirect_to question_question_likes_path(@question) }\n format.json { head :no_content }\n end\n end", "def destroy\n @liked_item = LikedItem.find(params[:id])\n @liked_item.destroy\n\n respond_to do |format|\n format.html { redirect_to liked_items_url }\n format.json { head :no_content }\n end\n end", "def unlike\n @dream = Dream.find(params[:id])\n @user = User.find_by_id(session[:remember_token])\n @dream.rank -=1\n if(@dream.save!)\n @like = @user.likes.find_by_dream_id(params[:id])\n @like.destroy\n redirect_to :action=>'show'\n else\n flash.now[:error] = \"illegal input!\"\n end\n end", "def destroy\n @trans_like.destroy\n respond_to do |format|\n format.html { redirect_to trans_likes_url, notice: \"Trans like was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @dislike.destroy\n respond_to do |format|\n format.html { redirect_to dislikes_url }\n format.json { head :no_content }\n end\n end", "def delete_social\n\t\tcheck_if_myself(params[:user_id])\n\t\tSocialUser.find(params[:social_user_id]).delete\n\t\tredirect_to current_user\n\tend", "def destroy\n current_user.author.unset(:image_url)\n redirect_to edit_user_path(current_user)\n end", "def destroy\n @like = Like.find(params[:id]) \n @dog = Dog.find(@like.dog_id)\n @like.destroy\n\n respond_to do |format|\n format.html { redirect_to @dog } \n end\n end", "def destroy\n @like_list.destroy\n respond_to do |format|\n format.html { redirect_to like_lists_url, notice: 'Like list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def like\n @pointless = Pointless.find(params[:pointless_id])\n iorn = true\n @pointless.pluids.each do |p|\n puts p.user_id\n if current_user.id == p.user_id\n p.destroy\n iorn = false\n break\n end\n end\n if iorn == true\n @pluid = Pluid.new(user_id: current_user.id, pointless_id: @pointless.id)\n @pluid.save\n @pointless.like = @pointless.like + 1\n else\n @pointless.like = @pointless.like - 1\n end\n @pointless.save\n redirect_to :back\n\n end", "def unlike(model)\n if self.id != model.id && self.likes?(model)\n\n # this is necessary to handle mongodb caching on collection if unlike is following a like\n model.reload\n self.reload\n\n model.before_unliked_by(self) if model.respond_to?('before_unliked_by')\n model.likers_assoc.where(:like_type => self.class.name, :like_id => self.id).destroy\n model.inc(:liked_count_field, -1)\n model.after_unliked_by(self) if model.respond_to?('after_unliked_by')\n\n self.before_unlike(model) if self.respond_to?('before_unlike')\n self.likes_assoc.where(:like_type => model.class.name, :like_id => model.id).destroy\n self.inc(:likes_count_field, -1)\n self.after_unlike(model) if self.respond_to?('after_unlike')\n\n return true\n else\n return false\n end\n end", "def like_toggle\n like = Like.find_by(user: current_user, drink_id: params[:id])\n if like.nil?\n Like.create!(user: current_user, drink_id: params[:id])\n else\n like.destroy\n end\n redirect_to drink_url(params[:id])\n end", "def destroy\n @wish_list = WishList.find(params[:wish_list_id])\n @item = @wish_list.items.find(params[:item_id])\n\n if @item.purchased_by == current_user\n @item.purchased_by = nil\n @item.save\n else\n flash[:alert] = \"You do not have permission to unpurchase this Item.\"\n end\n head 200\n end", "def unrate( user_to_be_unrated )\n id_user_who_did_the_rating = self.id\n id_user_who_was_rated = user_to_be_unrated.id\n current_rating = Rate.find_by( rater_id: id_user_who_did_the_rating, rateable_id: id_user_who_was_rated )\n\n if current_rating\n current_rating.destroy\n end\n end", "def change_like\n user = User.find(params[:id])\n if current_user.likes?(user)\n msg = \"I <span>like</span> this profile\"\n Like.delay.delete_all([\"user_id = ? and likeable_id = ? and likeable_type = ?\", current_user.id, user.id, \"User\"])\n NetworkUpdate.removeLikedUpdate(current_user.id, user.id)\n else\n current_user.like!(user)\n msg = \"Remove <span>like</span>\"\n NetworkUpdate.delay.createLikedUpdate(current_user.id, user.id)\n SneakPeekMailer.delay.like_email(current_user, user)\n end\n render :text => msg\n end", "def destroy\n @like_log.destroy\n respond_to do |format|\n format.html { redirect_to like_logs_url, notice: \"Like log was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def unfollow_user(user)\n following.delete(user)\n end", "def destroy\n if @wish.user_id == current_user.id\n @wish = Wish.find(params[:id])\n @wish.destroy\n render json: {}, status: :no_content\n end\n end", "def destroy\n\t\[email protected]\n\tend", "def destroy\n @liked_post.destroy\n respond_to do |format|\n format.html { redirect_to liked_posts_url, notice: 'Liked post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_user\n delete_reviews(self)\n self.destroy\n end", "def unlike(object)\n if likes.where(:likeable_id => object.id, :likeable_type => object.class.to_s).first.try(:destroy)\n Resque.enqueue RecommendationRefresher, self.id, object.send(:rates_by)\n true\n end\n end", "def destroy\n @script_like.destroy\n respond_to do |format|\n format.html { redirect_to script_likes_url, notice: 'Script like was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n user = Relationship.find(params[:id]).followed\n @current_user.unfollow(user)\n redirect_to user\n end", "def destroy\n @user_info.destroy\n end", "def unlike(meal)\n like = self.customer_meals.find_by_meal_id(meal.id)\n like.destroy!\n end", "def destroy\n\t\t@ignore = Friend.where(:user_id => params[:id])\n\t\[email protected]\n\t\tredirect_to @user\n\tend", "def unshare!( user )\n save if unshare( user )\n end", "def delete\r\n Marketplace::Database.instance.call_users(self)\r\n Marketplace::Database.instance.delete_user(self)\r\n ImageUploader.delete_image(self.picture, settings.root) if self.picture != nil\r\n items = Marketplace::Database.instance.items_by_user(self)\r\n items.each{ |item| item.delete }\r\n end", "def trigger_after_unlike\n likeable.fire_after_unlike(self) if likeable.respond_to?(:fire_after_unlike)\n user.fire_after_unlike(self) if user.respond_to?(:fire_after_unlike)\n end", "def destroy\n @song_like = SongLike.find(params[:id])\n @song_like.destroy\n\n respond_to do |format|\n format.html { redirect_to song_likes_url }\n format.json { head :no_content }\n end\n end", "def unfollow(other_user)\n active_follows.find_by(followed_id: other_user.id).destroy\n end", "def unfollow(other_user)\n \tactive_relationships.find_by(followed_id: other_user.id).destroy\n \tend", "def undislike(object)\n if dislikes.where(:dislikeable_id => object.id, :dislikeable_type => object.class.to_s).first.try(:destroy)\n Resque.enqueue RecommendationRefresher, self.id, object.send(:rates_by)\n true\n end\n end", "def unfollow!(user)\n relationships.find_by_followed_id(user).destroy\n end", "def destroy\n @wish.destroy\n redirect_to wishlist_path(@wish.wishlist_id)\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @user.destroy\n end", "def destroy\n @prompt.promptlikes.destroy_all\n @prompt.destroy\n end", "def unlike\n @id = params[:id]\n if photo_service.unlike(@id)\n Like.where(user_id: session[:uid], photo_id: @id).delete_all\n end\n respond_to do |format|\n format.html { redirect_to root_path }\n format.js {}\n end\n end" ]
[ "0.7908806", "0.7688841", "0.76653564", "0.7583854", "0.75662553", "0.7433691", "0.74025714", "0.7395852", "0.73752505", "0.73436856", "0.73384136", "0.730955", "0.72346383", "0.72338724", "0.7202475", "0.71232116", "0.70947874", "0.7093496", "0.70547974", "0.7019187", "0.6954529", "0.6923854", "0.68799376", "0.68565285", "0.6839348", "0.6814173", "0.6814173", "0.6814173", "0.67844987", "0.67844987", "0.6760528", "0.6738063", "0.6737829", "0.6723479", "0.67107826", "0.6688513", "0.6679591", "0.6677158", "0.6657432", "0.6583868", "0.6561416", "0.65581506", "0.6535275", "0.6515643", "0.65050316", "0.6486225", "0.64712405", "0.64572346", "0.6455007", "0.6451428", "0.6441462", "0.64409506", "0.64215255", "0.6420657", "0.6411692", "0.6387818", "0.6384276", "0.6366846", "0.63378495", "0.63127744", "0.63012403", "0.63001156", "0.626761", "0.6266833", "0.6209584", "0.6205997", "0.6189168", "0.61650735", "0.6155586", "0.61415374", "0.61335796", "0.6113644", "0.6108791", "0.61041784", "0.6082639", "0.6082517", "0.60809946", "0.6078639", "0.6074969", "0.6073534", "0.60727143", "0.6065621", "0.60655713", "0.6061346", "0.6058356", "0.60534286", "0.6045177", "0.6042047", "0.60415703", "0.60408056", "0.60408056", "0.60408056", "0.60408056", "0.60408056", "0.60408056", "0.60408056", "0.60408056", "0.60408056", "0.6037049", "0.60327005" ]
0.7718917
1
matches `[PERCENTAGE] of [NUM]` and `[PERCENTAGE] (off|on) [NUM]`
def parse_percentage_expression regex = /(?<percentage>-?[\d.]+)% (?<operator>(off?|on)) (?<expr>.*$)/ match = @expression.match(regex) if match operator = match.named_captures["operator"] percentage = match.named_captures["percentage"] expr = match.named_captures["expr"] percentage_expr = "#{expr} * #{percentage.to_f/100}" case operator when 'of' @expression = percentage_expr when 'off' @expression = "#{expr} - (#{percentage_expr})" when 'on' @expression = "#{expr} + (#{percentage_expr})" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percent!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n type = PERCENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 163:11: '%'\n match( 0x25 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 29 )\n\n end", "def percent_satisfied(content)\n if ['yes', 'extremely likely', 'very satisfied'].include?(content)\n 100\n elsif ['somewhat likely', 'satisfied'].include?(content)\n 80\n elsif ['neutral'].include?(content)\n 60\n elsif ['not very likely', 'dissatisfied'].include?(content)\n 40\n elsif ['not at all likely', 'very dissatisfied'].include?(content)\n 20\n elsif ['no'].include?(content)\n 0\n else\n 0\n end\n end", "def match_percentage?(instance)\n percentage = percentage_flags.where(\"flaggable_type = ?\", instance.class.to_s).first.try(:percentage)\n instance.id % 10 < (percentage || 0) / 10\n end", "def validate_format_percentage(name, value)\n DataTypeValidator.validate name, Float, value, ->(arg) { arg >= 0.0 && arg <= 1.0 }\n end", "def calculate_match_probability\n # two heuristics: \n # 1 is are their multiple words in term_text? if so, mark as probable\n # if not, does it match the anchor regexp? if so, mark as probable\n # else, mark as improbable\n \n # multiple words?\n anchor_regexp = \"(featuring|plus|the|presents|with|plus|and|\\,|\\&|[()]|\\/|\\:|\\-|^|$)\"\n nix_regexp = \"parking|\\svs\\.?\\s\" \n if artist_name=~/#{nix_regexp}/i\n self.match_probability=\"unlikely\"\n return nil\n end\n text=term_text.strip\n if text[\" \"]\n self.match_probability=\"likely\"\n return \"multpl\"\n end\n if artist_name=~/#{anchor_regexp}\\s*#{text}\\s*#{anchor_regexp}/i\n self.match_probability=\"likely\"\n return \"regexp\"\n end\n# if artist_name=~/#{anchor_regexp}\\s+?#{text}\\s+?#{anchor_regexp}/i\n# match_probability=\"likely\"\n# return \"regexp\"\n# end\n self.match_probability=\"unlikely\"\n return nil\n end", "def allow_percent_symbols(*args)\n # This assumes you are storing percents as whole numbers 50.0 = 50% \n # rather than .5 = 50% \n add_equal_method PERCENTAGE_CHARS, args\n end", "def check_apr_percentage(num)\n loop do\n if !PERCENT.match(num)\n message(MC['num_prompt_percent'])\n num = Kernel.gets().chomp()\n else\n break\n end\n end\n num\nend", "def percent_off=(val, no_dirty = false)\n attribute_set(:percent_off, val, no_dirty)\n attribute_set(:amount_off, \"\", no_dirty)\n end", "def valid_percent_of_small\n 10.percent_of(20)\n end", "def percentage_no\n return 0 if no_count == 0\n\n 100 - percentage_yes\n end", "def percentage_no\n return 0 if no_count == 0\n\n 100 - percentage_yes\n end", "def matches\n @matches = @question.match(/(-?\\d+) (plus|minus|divided by|multiplied by) (-?\\d+)/)\n puts \"@matches = #{@matches[1]}, #{@matches[2]}, #{@matches[3]}\"\n end", "def percentage; end", "def percent_passes; end", "def percent_passes; end", "def covered_percentages; end", "def percentages_values\n return if skills_percentage.nil? || objectives_percentage.nil? || attendance_percentage.nil?\n if skills_percentage + objectives_percentage + attendance_percentage != 100\n errors.add(:skills_percentage, 'A soma dos Objectivos, Competências e Assiduidade deve ser 100%')\n errors.add(:objectives_percentage, 'A soma dos Objectivos, Competências e Assiduidade deve ser 100%')\n errors.add(:attendance_percentage, 'A soma dos Objectivos, Competências e Assiduidade deve ser 100%')\n end\n end", "def parse_quantifier\n current = current_token()\n first = (current == \"ALL\" or current == \"THE\" or current == \"MY\")\n current = advance() if first\n \n integer = parse_integer()\n \n return false unless (first or integer)\n \n if current == \"OF\"\n current = advance()\n end\n if (current == \"THE\" or current == \"MY\")\n advance()\n end\n return true\n end", "def percentage_off\n\t\t(you_save > 0) ? (you_save/100).round(2) : 0\n\tend", "def formatPercentageValue(input)\n output = input.gsub(/\\(/, \"\")\n output.gsub!(/%\\)$/, \"\")\n return output\n end", "def percentage=(_arg0); end", "def validate_percentage_params\n params[:validate_percentage]\n end", "def meter_text_is_visible?(value_text, percent)\n unless (6..9).cover?(value_text.length)\n # new answer type/format?\n raise(%(can not interpret \"#{value_text}\"))\n end\n\n min_percent = MAGIC_CONSTANT * value_text.length\n percent >= min_percent\n end", "def percent\n self.scan(/./).join('%')\n end", "def parse_troop_escape_ratio_formula\n @escape_ratio_formula = TH::Troop_Escape_Ratio::Global_Ratio\n @pages[0].list.each do |cmd|\n if cmd.code == 108 && cmd.parameters[0] =~ TH::Troop_Escape_Ratio::Regex\n @escape_ratio_formula = $1\n end\n end\n end", "def calculate_percentage_completion\n result = {}\n result[:pc] = ideal_completion[:pc]\n if %w(green amber).include?(status)\n result[:pve] = ideal_completion[:pve]\n # elsif status == \"red\"\n # result[:pve] = 20\n end\n result[:pdl] = ideal_completion[:pdl] if !documents.empty? || !personal_links.empty?\n return result\n end", "def number_percent number\n\t\tnumber_to_percentage(number, precision: 0)\n\tend", "def percent_against\n (votes_against.to_f * 100 / (self.votes.size + 0.0001)).round\n end", "def scrub_percentage percentage\n p = percentage.to_i\n return p if (0..100).to_a.include?(p)\n p > 100 ? 100 : 0\n end", "def match_modulo?(number)\n return false unless ordinal?\n\n case attributes.match\n when 'last-two-digits'\n ordinal == number % 100\n when 'last-digit'\n ordinal == number % 10\n when 'whole-number'\n ordinal == number\n else\n true\n end\n end", "def percentages\n @_percentages ||= words.each_with_object({}) do |word_count, hash|\n hash[word_count.first] = percentage(word_count.last)\n end\n end", "def calculate_percent(str, criteria)\n size = str.size.to_f\n percent = str.count(criteria)/size * 100\n percent.round(2)\nend", "def match(p0) end", "def match(p0) end", "def delegate_to_search_pattern\n /(?:_equals|_contains|_gte|_lte)\\z/\n end", "def get_percentage_score(val, to_base)\n return (1.0 - val[:score] / to_base[:score])*100 * (@greater_is_better ? -1.0 : 1.0)\nend", "def test_discount_percent_should_fail_1\n assert_equal(\"1%\", Stub.new.calculate_discount_percent(12))\n end", "def pick_percentage\n self.score.to_f / Matchup.amount_finished.to_f\n end", "def percentage_of_passives\n calculator.percentage_of_passives\n end", "def metric_ton? = unit == 'metric-ton'", "def determine_percent_complete(log_string)\n message = log_string[/.*PerfAnal_CECNRes.-.(.*)$/, 1].chomp\n update_percent_complete(5, message)\n\n # find where we are\n states = [\n {/initializing ruleset/i => 0.5},\n {/loading sdd model/i => 2},\n {/back from loading sdd model/i => 2},\n {/defaulting model/i => 2},\n {/defaulting model/i => 5},\n {/writing user input to analysis results xml/i => 5},\n {/checking sdd model/i => 5},\n {/preparing model zb/i => 5},\n {/calling perfsim_e. for zb model/i => 5},\n {/back from perfsim_e. (zb model, 0 return value)/i => 35},\n {/exporting zb model details to results xml/i => 35},\n {/preparing model ap/i => 40},\n {/calling perfsim_e. for ap model/i => 40},\n {/back from perfsim_e. (ap model, 0 return value)/i => 40},\n {/preparing model ab/i => 40},\n {/calling perfsim_e. for ab model/i => 40},\n {/back from perfsim_e. (ab model, 0 return value)/i => 100},\n {/umlh check on ab model/i => 100},\n {/exporting ab model details to results xml/i => 100}\n ]\n\n states.reverse.each do |s|\n if log_string =~ s.keys.first\n update_percent_complete(s.values.first, message)\n break\n end\n end\n end", "def scanning_error_rate()\n\t\[email protected] do |v| \n\t\t\tnot is_value_compatible_with_at_least_one_rule?(v)\n\t\tend.reduce(:+) || 0\n\tend", "def criteria?(frac)\n n, d = frac.split('/')\n n.length > d.length\nend", "def percent_complete\n propinteger 'PERCENT-COMPLETE'\n end", "def match?(instance)\n match_id?(instance) || match_percentage?(instance) || match_groups?(instance)\n end", "def percent_skips; end", "def conditions()\n {:+ => :plus, :- => :minus, :/ => :divide, :* => :times}\n end", "def percentage_of_detractors\n calculator.percentage_of_detractors\n end", "def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] < 120\n end\n end", "def revolution_per_meter? = unit == 'revolution-per-meter'", "def klass_matcher\n super do |d|\n (d[0] & STATUS_MASK) == STATUS && d[1] >= 120\n end\n end", "def event_percentage_for(type, round_percentage=false)\n @sc ||= host_stats\n if %W(high medium low tcp udp icmp all).include?(type)\n calc = ((@sc[:\"#{type}\"].to_f / (@sc[:all].to_f)) * 100)\n if round_percentage\n return \"#{calc.round}\"\n else\n return \"#{calc}\"\n end\n else\n raise \"Error: #{type} is not an acceptable severity. Possible options include: all, tdp, udp, icmp, high, medium and low.\"\n end\n end", "def covered_percent; end", "def covered_percent; end", "def vote_percentage \n if self.filed? || self.finished? # Makes sure the threshold hasn't already been hit. \n return 100 # Return 100, meaning 100% goal. \n elsif self.pending? # PEtition is pending still \n petition_votes = self.votes_for.count\n petition_votes.to_f\n percentage = petition_votes / 500.00 # Finds percentage of the vote goal \n percentage *= 100 # Turns the float percentage into a whole number percentage.\n return percentage.round(1) \n else \n puts \"Something is wrong with this petition.\"\n end \n end", "def check_split\n (meal + ((meal * tip) / 100)) / group\n end", "def regex_divisible_by(n)\n return '^(0|1)*$' if n == 1\n fsm = FinitStateMachine.new(n)\n fsm.find_regexp\nend", "def pre_match() end", "def percent_80c\n total = widths.select{|line| line > 80}.count\n total / widths.size.to_f\n end", "def special_number?(literal)\n literal.is_a?(Sass::Script::Value::String) && literal.value =~ /(calc|var)\\(/\n end", "def percent_skipps; end", "def percent_skipps; end", "def macro_percentages\n \n if self.total_calories!=nil and self.protein_grams != nil and self.carbohydrate_grams!=nil and self.fat_grams!=nil\n return {:protein=>protein_grams.to_f/total_calories, :carbohydrate => carbohydrate_grams.to_f/total_calories, :fat=> fat_grams.to_f/total_calories}\n end\n\n return nil\n end", "def parse_price(price)\n /~(?:(?:gb)|b)\\/o ([-+]?[0-9]*\\.?[0-9]+) (?:#{orbs_regexp})/.match(price).to_a.compact[1..-1]\n end", "def has_more_operations?\n expression.match(/\\D/)\n end", "def matches_specs(text)\n text = text.downcase\n matches = false\n\n # some of Terri's terms were redundant so I removed them\n matches = true if text =~ /\\bsid|pakistan[.]* rendition|apartheid|apart[.]* regime|apart[.]* state|palestin[.]*/\n matches = true if text =~ /israel/ and text =~ /human rights violations/\n\n matches\nend", "def pennies_for(amount)\n return nil if amount == \"\"\n int, fraction = amount.scan(/\\d+/)\n i = (fraction.to_s.strip =~ /[1-9]/) ? \"#{int}#{fraction[0,2]}\".to_i : int.to_i * 100\n amount =~ /^\\s*-\\s*\\d+/ ? -i : i\n end", "def validate_discount_range_values\n curr_val = curr_per = 0\n first = true\n discount_values.each do |val, per|\n if per > 100\n self.errors.add(:discount, I18n.t(\"activerecord.errors.messages.invalid_range_percentage\"))\n break\n end\n unless first\n if val <= curr_val or per <= curr_per\n self.errors.add(:discount, I18n.t(\"activerecord.errors.messages.invalid_range_secuence\"))\n break\n end\n end\n first = false\n curr_val, curr_per = val, per\n end\n end", "def check_amount\n if (mode == 'percentage' and percentage == 0) or (mode == 'fixed' and money.zero?)\n errors.add(:amount, 'a discount cannot be zero')\n end\n end", "def completion_percentage\n fields = %w(first_name last_name address postal_code city country birthday phone_number avatar.present? )\n sum_add = 100.0 / fields.count\n fields.inject(0) { |sum, field| sum + (field.split('.').inject(self) { |us, o| us.send(o) }.blank? ? 0 : sum_add) }.round.to_i\n end", "def passed?\n config.threshold.nil? ||\n (config.threshold_must_match && percent == config.threshold) ||\n percent >= config.threshold\n end", "def percentage(number, precision = 2)\n return if number.to_s.empty?\n\n ret = \"%02.#{ precision }f%\" % number\n ret.gsub(/\\.0*%$/, '%')\n end", "def policy2(label, content)\n in_range = lambda {|value, min, max| value >= min && value <= max}\n\n case label\n when \"byr\"\n return in_range.call(content.to_i, 1920, 2002)\n when \"iyr\"\n return in_range.call(content.to_i, 2010, 2020)\n when \"eyr\"\n return in_range.call(content.to_i, 2020, 2030)\n when \"hgt\"\n units = content[-2..-1]\n value = content[0..-3].to_i\n\n case units\n when \"cm\"\n return in_range.call(value, 150, 193)\n when \"in\"\n return in_range.call(value, 59, 76)\n end\n when \"hcl\"\n return content =~ /^#(\\d|[a-f]){6}$/\n when \"ecl\"\n return content =~ /^(amb|blu|brn|gry|grn|hzl|oth)$/\n when \"pid\"\n return content =~ /^\\d{9}$/\n end\nend", "def get_hidratos\n \"#{@hidratos}%\" \n end", "def letter_percentages(str)\n hsh = { lowercase: 0, uppercase: 0, neither: 0 }\n\n str.chars.each do |elem|\n if elem =~ /[a-z]/\n hsh[:lowercase] += 1\n elsif elem =~ /[A-Z]/\n hsh[:uppercase] += 1\n else\n hsh[:neither] += 1\n end\n end\n hsh.transform_values! { |v| format('%.1f', v.fdiv(str.length) * 100).to_f }\nend", "def amount_off=(val, no_dirty = false)\n attribute_set(:amount_off, val, no_dirty)\n attribute_set(:percent_off, \"\", no_dirty)\n end", "def partial_mirror_percent=(partial_mirror_percent)\n pattern = Regexp.new(/^(\\d\\.\\d{1,2}|[1-4]\\d\\.\\d{1,2}|50\\.[0]{1,2})$|^(platform-default)$/)\n if !partial_mirror_percent.nil? && partial_mirror_percent !~ pattern\n fail ArgumentError, \"invalid value for \\\"partial_mirror_percent\\\", must conform to the pattern #{pattern}.\"\n end\n\n @partial_mirror_percent = partial_mirror_percent\n end", "def get_percentage_of_open_suggestions(meeting)\n not_voted = all = 0\n meeting.suggestions.each do |suggestion|\n suggestion.votes.each do |vote|\n all += 1\n if vote.decision == Vote::DONTKNOW\n not_voted += 1\n end\n end\n end\n if all == 0\n percent_voted = 0\n else\n percent_voted = 100 * (all - not_voted) / all\n end\n return percent_voted.round\n end", "def progress_bar_percentage(recipe, user = current_user)\n num_of_ingredients_matched = (recipe.ingredients & get_active_ingredients(user)).length\n percent_of_ingredients_matched = num_of_ingredients_matched.fdiv(recipe.ingredients.length) * 100\n case percent_of_ingredients_matched\n when 0..25\n return \"rgba(255,0,0,0.7)\"\n when 25..50\n return \"rgba(255,165,0,0.7)\"\n when 50..75\n return \"rgba(255,255,0,0.7)\"\n else\n return \"rgba(0,100,0,0.7)\"\n end\n end", "def routing_fraction_to_percentage(fraction)\n \"#{(fraction * 100).to_i}%\"\n end", "def nutty_parse(thresh, want, got, v, element)\n retval = 'FAIL'\n\n # if there is a non-numeric character we have to deal with that\n # got < want\n if want =~ /^(\\d+):$/ then\n if got.to_i < $1.to_i then\n retval = '%s is below threshold value %s (%s)' % [element, $1, got]\n else\n retval = 'OK'\n end\n end\n\n # got > want\n if want =~ /^~:(\\d+)$/ then\n if got.to_i > $1.to_i then\n retval = '%s is above threshold value %s (%s)' % [element, $1, got]\n else\n retval = 'OK'\n end\n end\n\n # outside specific range\n if want =~ /^(\\d+):(\\d+)$/ then\n if got.to_i < $1.to_i or got.to_i > $2.to_i then\n retval = '%s is outside expected range [%s:%s] (%s)' % [element, $1, $2, got]\n else\n retval = 'OK'\n end\n end\n\n # inside specific range\n if want =~ /^@(\\d+):(\\d+)$/ then\n if got.to_i >= $1.to_i and got.to_i <= $2.to_i then\n retval = '%s is in value range [%s:%s] (%s)' % [element, $1, $2, got]\n else\n retval = 'OK'\n end\n end\n\n # otherwise general range\n if not want =~ /\\D/ then\n if got.to_i > want.to_i then\n retval = '%s is above threshold value %s (%s)' % [element, want, got]\n elsif got.to_i < 0 then\n retval = '%s is below 0 (%s)' % [element, got]\n else\n retval = 'OK'\n end\n end\n\n if retval == 'OK' then\n say(v, '%s threshold not exceeded.' % [thresh])\n elsif retval == 'KO' then\n say(v, '%s threshold exceeded.' % [thresh])\n else\n say(v, '\"%s\" is a strange and confusing %s value.' % [want, thresh])\n end\n\n return retval\nend", "def csr_as_percent\n\t\terrors.add(:csr_percent, \"value must be between 0 and 1\") unless (0 <= csr_percent && csr_percent <= 1)\n end", "def percentage_params\n params.require(:percentage).permit(:val_fact_1, :val_fact_2, :percent_fact, :val_inv_1, :val_inv_2, :percent_inv, :group_id, :pharmacy_id)\n end", "def two_30_two_31\n page.has_text?('30', count: 2) && page.has_text?('31', count: 2)\nend", "def case_evaluation(num)\n case\n when num <0 then \"Less than 0\"\n when num >=0 && num <50 then \"Between 0 and 50\"\n when num >=50 && num <100 then \"Between 50 and 100\"\n else \"100+\"\n end\nend", "def percentage_yes\n return 0 if yes_count == 0\n \n ((yes_count.to_f / replies_count) * 100).to_i\n end", "def letter_percentages(string)\n low, up, non = [0, 0, 0]\n\n string.each_char do |chr|\n case chr\n when /[a-z]/ then low += 1\n when /[A-Z]/ then up += 1\n else non += 1\n end\n end\n\n convert = 100 / string.size.to_f\n low *= convert\n up *= convert\n non *= convert\n\n percentages = { lowercase: low, uppercase: up, neither: non}\nend", "def match_captures; end", "def percentage_yes\n return 0 if yes_count == 0\n\n ((yes_count.to_f / replies_count) * 100).to_i\n end", "def is_range?\n self =~ /\\A(([\\d]+)|(['\"][\\w]{1}['\"]))\\.\\.\\.?(([\\d]+)|(['\"][\\w]{1}['\"]))\\z/i\n end", "def processing_times\n total = ab_output.match(/Total:\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)/)\n ninety = ab_output.match(/ 90%\\s+([0-9.]+)/)\n ninetyfive = ab_output.match(/ 95%\\s+([0-9.]+)/)\n [total[1], total[2], total[4], ninety[1], ninetyfive[1], total[5]]\n end", "def methods_matching(re); end", "def scan_for_and(token); end", "def percent_answered\n percent_answered_int.to_s + \"%\"\n end", "def allow_value_matcher; end", "def calculate_total_percent(result, out_of)\n total = result.total_mark\n\n percent = BLANK_MARK\n\n # Check for NA mark or division by 0\n unless total.nil? || out_of == 0\n percent = (total / out_of) * 100\n end\n percent\n end", "def calculate_total_percent(result, out_of)\n total = result.total_mark\n\n percent = BLANK_MARK\n\n # Check for NA mark or division by 0\n unless total.nil? || out_of == 0\n percent = (total / out_of) * 100\n end\n percent\n end", "def match_rating\n @match_rating ||= area.to_f / ratio\n end", "def two_pt_pct\n return 0.0 if two_pt.zero? || two_pt_a.zero?\n\n (two_pt.to_f/two_pt_a).round(3)\n end", "def amount\n case mode\n when 'set', 'fixed' then money\n when 'percentage' then percentage\n end\n end" ]
[ "0.55788255", "0.55465823", "0.5396152", "0.50461864", "0.49546033", "0.48955175", "0.48949093", "0.4863768", "0.4861592", "0.48227188", "0.48227188", "0.47872362", "0.47347498", "0.47109276", "0.47109276", "0.4707554", "0.47000086", "0.46835592", "0.4656993", "0.46562716", "0.46526095", "0.46519998", "0.4651474", "0.4627845", "0.46235618", "0.46198514", "0.46168268", "0.46065703", "0.4601818", "0.4601652", "0.45944035", "0.45787707", "0.4570405", "0.4570405", "0.45515516", "0.45493448", "0.45412278", "0.4541038", "0.45377403", "0.45347145", "0.45279756", "0.45039356", "0.4503842", "0.44947544", "0.4486541", "0.44816592", "0.4478558", "0.44577527", "0.445043", "0.4447972", "0.4439844", "0.4439509", "0.44380856", "0.44380856", "0.44183227", "0.44073486", "0.44040418", "0.44028324", "0.44023246", "0.43922237", "0.43738988", "0.43738988", "0.43665507", "0.43578905", "0.43514398", "0.43467095", "0.4343068", "0.43319136", "0.43290251", "0.43177724", "0.43121034", "0.43055147", "0.43016723", "0.43010163", "0.43004063", "0.43003508", "0.42992252", "0.42976528", "0.42933613", "0.42893684", "0.42881012", "0.42795533", "0.4274522", "0.42745006", "0.42645997", "0.42628214", "0.42588183", "0.4248582", "0.42366645", "0.42355788", "0.4229513", "0.4229339", "0.4223779", "0.4217001", "0.4215923", "0.42157727", "0.42157727", "0.42141294", "0.42120612", "0.42074165" ]
0.67594284
0
reformat any mathmatical functions from lowercase to upper e.g. avg(1,2) > AVG(1,2)
def reformat_math_functions funcs = %w(min max sum avg count round rounddown roundup sin cos tan) regex = /\b(?<func>#{funcs}.join('|'))\((?<expr>[^()]+)\)/ match = @expression.match(regex) if match func = match.named_captures["func"] expr = match.named_captures["expr"] @expression = "#{func.upcase}(#{expr})" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_function_lower(scope, ast)\n scope, str = apply_ast(scope, ast.children.first)\n return scope, \"lower(#{str})\"\n end", "def shout (maj)\n maj.upcase\nend", "def underscorize!\n self.replace(self.scan(/[A-Z][a-z]*/).join(\"_\").downcase)\n end", "def apply_function_upper(scope, ast)\n scope, str = apply_ast(scope, ast.children.first)\n return scope, \"upper(#{str})\"\n end", "def xyzzy(a_value)\n a_value.upcase\nend", "def question5(str) # Modify str, returning a lowercased version\n\n end", "def ar_to_fb_case(column_name)\n column_name =~ /[[:upper:]]/ ? column_name : column_name.upcase\n end", "def toLower _args\n \"toLower _args;\" \n end", "def alphabetize\n\nend", "def upcase!() end", "def shout(a)\n return a.upcase\nend", "def normalize\n input.upcase\n end", "def fb_to_ar_case(column_name)\n column_name =~ /[[:lower:]]/ ? column_name : column_name.downcase\n end", "def bar(s)\n s.upcase\nend", "def puts_upcase(a)\r\n puts \"upcase: #{a.upcase}\"\r\nend", "def upcase(input); end", "def snakify\n return downcase if match(/\\A[A-Z]+\\z/)\n gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2').\n gsub(/([a-z])([A-Z])/, '\\1_\\2').\n downcase\n end", "def mixed_case(name)\n name.downcase.gsub(/\\b\\w/, &:upcase)\nend", "def mixed_case_2(name)\n\tname.downcase.gsub(/\\b\\w/, &:upcase)\nend", "def humanize\n\t\tself.gsub('_',' ').titlecase\n\tend", "def fb_to_ar_case(column_name)\n column_name =~ /[[:lower:]]/ ? column_name : column_name.downcase\n end", "def upcase() end", "def ar_to_fb_case(column_name)\n column_name =~ /[[:upper:]]/ ? column_name : column_name.upcase\n end", "def do_magic(str)\n str.gsub!(/[^A-Z]/, '').to_s #delete small leters and uprinted sumbols\n str.downcase.to_s #make all leters small\nend", "def reformatInput(word)\n return String.downcase(String.chars.sort(&:casecmp).join)\n end", "def upcase; end", "def solve s\n s.chars.map{|letter| letter.upcase == letter ? 'upper' : 'lower'}.count('upper') > 0.5*s.length ? s.upcase : s.downcase\nend", "def caps_phrase(user_phrase)\n puts user_phrase.upcase\nend", "def fupcase\n upcase.cupcase\n end", "def shout(input)\n \"#{input.upcase}\"\nend", "def abbrev\n letter = case @function \n when :pawn then 'p' \n when :knight then 'n'\n else @function.to_s[0,1]\n end\n return letter.send( @side==:white ? :upcase : :downcase )\n end", "def norm_vcal(ics)\n ics.gsub(/\\n /, \"\").upcase\nend", "def yeller(s)\n puts s.map(&:upcase).join\n end", "def shout (s)\n s.upcase\nend", "def capitalize!() end", "def humanize(lower_case_and_underscored_word)\n result = lower_case_and_underscored_word.to_s.dup\n result.gsub!(/_id$/, \"\")\n result.gsub(/(_)?([a-z\\d]*)/i){ \"#{ $1 && ' ' }#{ $2.downcase}\" }.gsub(/^\\w/){ $&.upcase }\n end", "def make_upper_case(str)\n str.upcase\nend", "def camerize(tablename)\n tablename.split(\"_\").map {|word| word.capitalize }.join(\"\")\n end", "def clean_method_name(name)\n dict = {\n \"?\" => \"__Q\", \"!\" => \"__X\", \n \"[]\" => \"__NDX\", \"==\" => \"__eq\", \n \">=\" => \"__ge\", \"<=\" => \"__le\", \n \"<\" => \"__lt\", \">\" => \"__gt\",\n \"/\" => \"__div\", \"*\" => \"__mul\",\n \"+\" => \"__plus\", \"-\" => \"__minus\"}\n\n cleaned = name.to_s.gsub(Regexp.new('>=|<=|==|[\\?!<>+\\-\\/\\*]')) do |match|\n dict[match.to_s]\n end\n\n cleaned = cleaned.split(Regexp.new('')).collect do |c|\n if c.match(Regexp.new('[a-zA-Z0-9_]'))\n c\n else\n \"__#{c[0].ord.to_s(16)}\"\n end\n end.join\n return cleaned\n end", "def normalize(str) return str.upcase end", "def downcase!() end", "def humanize(lower_case_and_underscored_word)\n result = lower_case_and_underscored_word.to_s.dup\n result.gsub!(/_id$/, \"\")\n result.tr!('_', ' ')\n result.gsub(/([a-z\\d]*)/i) { |match| \"#{match.downcase}\" }.gsub(/^\\w/) { $&.upcase }\n end", "def camelcase(s)\n\n\nend", "def titlecase\n gsub(/\\b\\w/){ $`[-1,1] == \"'\" ? $& : $&.upcase }\n end", "def shout(str); str.upcase end", "def shout(word)\n upper_case = word.upcase\nend", "def toonify(accent,sentence)\n\n if accent == 'daffy'\n sentence.tr('s','th')\n elsif accent == 'elmer'\n sentence.tr('r','w')\n else\n return sentence\nend\nend", "def shout(str)\n str.upcase\nend", "def conversion(word)\n if word.length > 10\n word.upcase\n else\n word\n end\n\nend", "def pretty_title!\n str = self\n str.downcase!\n str = str.split(\" \").map { |word| word.capitalize! }.join(\" \")\n str.gsub! /\\sVs/, ' vs'\n str.gsub! /\\sMd/, ' MD'\n str.gsub! /\\sVersus/, ' versus'\n str.gsub! /\\sLlc/, ' LLC'\n str.gsub! /\\sPc/, ' PC'\n str.gsub! /\\sPa/, ' PA'\n\n # I can't get this to work.. I want Mcfoo to be McFoo but for some reason this wont work -- it does work in rails console\n #str.gsub! /(\\sMc)(.)/, \"#{$1}#{$2.upcase}\"\n str\n end", "def partially_downcased_summary\n self.sanitized_summary.gsub(/(?:^|(?:\\.\\s))(\\w+)/) {|s| s.downcase }\n end", "def shout(str)\n return str.upcase\nend", "def genability_method_name_converter(method_name)\n method_name.to_s.gsub(/(?:^|_)(.)/){ $1.upcase }.gsub(/^[A-Z]/){ $&.downcase }.to_sym\n end", "def mixture (fname, lname)\n mix_firstname = vowel_adv(fname)\n mix_firstname = const_adv(mix_firstname)\n \n mix_lastname = vowel_adv(lname)\n mix_lastname = const_adv(mix_lastname)\n \n mix_firstname = mix_firstname.capitalize\n mix_lastname = mix_lastname.capitalize\n \n tmp = mix_firstname\n mix_firstname = mix_lastname\n mix_lastname = tmp\n return \"#{mix_firstname} #{mix_lastname}\"\n \nend", "def downcase\n `return self.toLowerCase();`\n end", "def downcase\n `return self.toLowerCase();`\n end", "def format_name(first, last)\n(First[0]+last).downcase\nend", "def lower_to_upper\n doubles = [\n [',', '<'],\n ['.', '>'],\n ['/', '?'],\n [';', ':'],\n [\"'\", '\"'],\n ['[', '{'],\n [']', '}'],\n ['\\\\', '|'],\n ## Inconsistently, Apple doesn't use upper keys with numbers\n # ['1', '!'],\n # ['2', '@'],\n # ['3', '#'],\n # ['4', '$'],\n # ['5', '%'],\n # ['6', '^'],\n # ['7', '&'],\n # ['8', '*'],\n # ['9', '('],\n # ['0', ')'],\n ['-', '_'],\n ['=', '+']\n ]\n\n lowers = []\n uppers = []\n doubles.each do |dbl|\n lowers.push(dbl[0])\n uppers.push(dbl[1])\n end\n\n lowers.include?(self) ? uppers[lowers.index(self)] : self\n end", "def camelize_methodname\n self.titleize.gsub(' ', '').camelize(:lower)\n end", "def downcase(input); end", "def humanize(lower_case_and_underscored_word)\n lower_case_and_underscored_word.to_s.gsub(/_id$/, \"\").gsub(/_/, \" \").capitalize\n end", "def shout(text)\n text.upcase\nend", "def sanitize_case(value, kase)\n return value if value.nil?\n\n if kase == :camelcase\n value.camelcase(:lower)\n elsif kase == :pascalcase\n value.camelcase(:upper)\n else\n value.send(kase)\n end\n end", "def normalize\n self.strip_accents.upcase.gsub(/[']+/, '').gsub(/[^A-Z0-9\\s]+/, ' ').gsub(/\\s+/, ' ').strip.to_s\n end", "def titlecase(input)\n input.titlecase\n end", "def orginize_equation\n gsub!(' ','')\n ##TODO:: orginaize \n end", "def standardize\n ς = self.dup\n \",.;\".each_char { |c| ς.gsub! c, \" \" }\n ς.stripn\n .squeeze(\" \")\n .underscore_spaces\n end", "def toonify |accent, sentence|\n\n\nend", "def letter_grade(average)\n if average >= 90\n 'A'\n elsif average >= 80\n 'B'\n elsif average >= 70\n 'C'\n elsif average >= 60\n 'D'\n else\n 'F'\n end\nend", "def standardize\n strip_and_squeeze.\n ampersands_into_text.\n into_ampersand_if_second_to_last.\n remove_indian_languages.\n remove_screening_details.\n replace_non_film_prefix.\n remove_newlines.\n remove_dates.\n title_case\n to_s\n end", "def downcase() end", "def normalize(code); end", "def tenderize(text)\n return text if @preserve_case\n if /[a-z]/ =~ text\n text\n else\n text.downcase.gsub(/\\b\\w/) { $&.upcase }\n end\n end", "def downcase; end", "def calculate\n avg_scores = ((@scores.inject(0){|sum,x| sum + x }) / @scores.length)\n if avg_scores >= 90 && avg_scores <= 100\n return 'O'\n elsif avg_scores >= 80 && avg_scores < 90\n return 'E'\n elsif avg_scores >= 70 && avg_scores < 80\n return 'A'\n elsif avg_scores >= 55 && avg_scores < 70\n return 'P'\n elsif avg_scores >= 40 && avg_scores < 55\n return 'D'\n elsif avg_scores < 40\n return 'T'\n end\n end", "def normalize_formatting_rules(rules); end", "def caps(string)\n return string.upcase\nend", "def caps(string)\n return string.upcase\nend", "def shout(phrase)\n return \"#{phrase.upcase} !!!!\"\n #return \"#{phrase}!!!!\".upcase\nend", "def titleize\n#\t\thumanize(underscore(self)).gsub(/\\b('?[a-z])/) { $1.capitalize }\n#\t\thumanize(self.underscore).gsub(/\\b('?[a-z])/) { $1.capitalize }\n\t\tself.underscore.humanize.gsub(/\\b('?[a-z])/) { $1.capitalize }\n\tend", "def normalize(ugly)\n ugly.downcase.chars.sort\n end", "def transform(a)\n a.map(&:capitalize)\n \n end", "def staggered_case_include_non_alpha(string, upcase_or_downcase=\"upcase\")\n # new_array = []\n # string.chars.each_with_index do |char, index|\n # new_array[index] = index.even? ? char.upcase : char.downcase\n # end\n # new_array.join\n result = ''\n need_upper = upcase_or_downcase == \"upcase\"\n string.chars.each do |char|\n result += if need_upper\n char.upcase\n else\n char.downcase\n end\n need_upper = !need_upper\n end\n result\nend", "def uglify\n self.gsub(' ', '_').downcase\n end", "def variablize(original)\n return original.downcase if original =~ /[A-Z]+/ && original !~ /_/\n return original[0].downcase + original[1..-1] if original !~ /_/\n camelized = original.split('_').map { |e| e.capitalize }.join\n camelized[0].downcase + camelized[1..-1]\n end", "def tr_s(p0, p1) end", "def humanize(lower_case_and_underscored_word)\n lower_case_and_underscored_word.to_s.gsub(/_id$/, '').tr('_', ' ').capitalize\n end", "def cond_upper_case(string)\n if string.length > 10\n string.upcase\n else\n string\n end\nend", "def staggered_case(string)\n need_upper = true\n string.split('').map do |char| \n if char =~ /[a-zA-z]/\n transformed_char = need_upper ? char.upcase : char.downcase\n need_upper = !need_upper\n transformed_char\n else\n char\n end\n end.join\nend", "def normalize\n self.clean_extra_spaces.split.map{|w| w.size>2 ? w.capitalize : w.downcase}.join(' ')\n end", "def under_attack\n puts \"THE world is in danger due to the evil taking over!!!\".upcase\nend", "def to_lower_case(s)\n s.dup.downcase\nend", "def grade(average)\n case\n when average > 90 \n return 'A'\n when average > 80\n return 'B'\n when average > 70\n return 'C'\n when average > 60\n return 'D'\n else\n return 'F'\n end\nend", "def normalized; end", "def norm(s)\n s.gsub(/ /, '-').underscore\nend", "def capitalize(input); end", "def alphabetized(s)\n s.scan(/[a-z]/i).sort_by(&:downcase).join\nend", "def staggered_case2(str, start_with = 'upper')\n new_str = ''\n to_upcase = case start_with\n when 'u', 'upper' then true\n when 'l', 'lower' then false\n else\n puts \"start_with option #{start_with} is not recognized.\"\n puts \"Choose 'upper' ('u') or 'lower' ('l').\"\n return\n end\n str.chars.each do |chr|\n if chr =~ /[a-zA-Z]/\n new_str << (to_upcase ? chr.upcase : chr.downcase)\n to_upcase = !to_upcase\n else\n new_str << chr\n end\n end\n new_str\nend", "def string_in_all_caps(the_string)\n puts 'your string in all caps is ' + the_string.upcase\nend", "def camel_case(str); end" ]
[ "0.6066712", "0.58529526", "0.58274436", "0.5823314", "0.5795221", "0.57646775", "0.5761234", "0.57603145", "0.5735932", "0.5728774", "0.5704479", "0.5695553", "0.5692357", "0.56736153", "0.5672991", "0.5668631", "0.56610185", "0.56388676", "0.56373316", "0.5620427", "0.5600008", "0.55977434", "0.55869585", "0.55862105", "0.5579851", "0.557219", "0.55558145", "0.5525842", "0.54531974", "0.54503334", "0.54274714", "0.54238176", "0.5423341", "0.5417447", "0.5406705", "0.5402611", "0.54024196", "0.5402198", "0.5367229", "0.53661144", "0.53571045", "0.5355405", "0.5353895", "0.5350712", "0.53488624", "0.534694", "0.5346121", "0.5344111", "0.5313123", "0.531233", "0.5310009", "0.5306862", "0.53064483", "0.5306299", "0.52991563", "0.52991563", "0.5295511", "0.5290006", "0.5287862", "0.52849704", "0.52802604", "0.5279168", "0.5277071", "0.52721846", "0.52627647", "0.5261283", "0.52585655", "0.5257047", "0.52556247", "0.5253172", "0.52527654", "0.52416193", "0.5238017", "0.5236393", "0.5234004", "0.52302843", "0.5227449", "0.5227449", "0.5222006", "0.52215207", "0.5210035", "0.5208978", "0.52083206", "0.5207905", "0.5204206", "0.52030665", "0.5199104", "0.5186999", "0.5184012", "0.51783836", "0.51782507", "0.51740384", "0.5172081", "0.5171455", "0.51678765", "0.5159028", "0.5157969", "0.5156609", "0.5152754", "0.5149268" ]
0.74625003
0
comments resemble cstyle, singleline statements `//[...]` when commented out, the processed expression will be blank
def detect_comments if @input =~ %r{^\s*[/]{2}} @mode = :comment @expression = '' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lex_comment line\n # do nothing\n end", "def consume_comments; end", "def single_line_comment\n # //\n if @codes[@pos] == 0x2f and @codes[@pos + 1] == 0x2f\n @pos += 2\n pos0 = @pos\n while (code = @codes[@pos]) and !line_terminator?(code)\n @pos += 1\n end\n return ECMA262::SingleLineComment.new(@codes[pos0...@pos].pack(\"U*\"))\n else\n nil\n end\n end", "def multi_line_comment\n # /*\n if @codes[@pos] == 0x2f and @codes[@pos + 1] == 0x2a\n @pos += 2\n pos0 = @pos\n # */\n while (code = @codes[@pos] != 0x2a) or @codes[@pos + 1] != 0x2f\n raise ParseError.new(\"no `*/' at end of comment\", self) if code.nil?\n @pos += 1\n end\n @pos +=2\n return ECMA262::MultiLineComment.new(@codes[pos0...(@pos-2)].pack(\"U*\"))\n else\n nil\n end\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 148:3: ( ( '#' | '//' ) (~ '\\\\n' )* | '/*' ( . )* '*/' )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == ?#) \n alt_10 = 1\n elsif (look_10_0 == ?/) \n look_10_2 = @input.peek(2)\n\n if (look_10_2 == ?/) \n alt_10 = 1\n elsif (look_10_2 == ?*) \n alt_10 = 2\n else\n nvae = NoViableAlternative(\"\", 10, 2)\n raise nvae\n end\n else\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 148:5: ( '#' | '//' ) (~ '\\\\n' )*\n # at line 148:5: ( '#' | '//' )\n alt_7 = 2\n look_7_0 = @input.peek(1)\n\n if (look_7_0 == ?#) \n alt_7 = 1\n elsif (look_7_0 == ?/) \n alt_7 = 2\n else\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 148:7: '#'\n match(?#)\n\n when 2\n # at line 148:13: '//'\n match(\"//\")\n\n end\n # at line 148:20: (~ '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0.between?(0x0000, ?\\t) || look_8_0.between?(0x000B, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 148:20: ~ '\\\\n'\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n when 2\n # at line 149:5: '/*' ( . )* '*/'\n match(\"/*\")\n # at line 149:10: ( . )*\n while true # decision 9\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == ?*) \n look_9_1 = @input.peek(2)\n\n if (look_9_1 == ?/) \n alt_9 = 2\n elsif (look_9_1.between?(0x0000, ?.) || look_9_1.between?(?0, 0xFFFF)) \n alt_9 = 1\n\n end\n elsif (look_9_0.between?(0x0000, ?)) || look_9_0.between?(?+, 0xFFFF)) \n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 149:10: .\n match_any\n\n else\n break # out of loop for decision 9\n end\n end # loop for decision 9\n match(\"*/\")\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n skip \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "def line_comments_option; end", "def multiline_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n\n\n type = MULTILINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 229:21: '/*' ( . )* '*/'\n match( \"/*\" )\n\n # at line 229:26: ( . )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0x2a )\n look_7_1 = @input.peek( 2 )\n\n if ( look_7_1 == 0x2f )\n alt_7 = 2\n elsif ( look_7_1.between?( 0x0, 0x2e ) || look_7_1.between?( 0x30, 0xffff ) )\n alt_7 = 1\n\n end\n elsif ( look_7_0.between?( 0x0, 0x29 ) || look_7_0.between?( 0x2b, 0xffff ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line 229:26: .\n match_any\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n\n\n match( \"*/\" )\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 50 )\n\n\n end", "def comments(*args)\n args.push(lambda{|*x| yield(*x) }) if block_given?\n args.push GAP if args.empty?\n args.push \"\\n\"\n comment(\"\\n\", *args)\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def is_comment?(line)\n line =~ /^\\s*#/\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end", "def comment(*args)\n #:stopdoc:\n args.push(lambda{|*x| yield(*x) }) if block_given?\n args.push GAP if args.empty?\n jig = (Cache[:comment] ||= new(\"<!-- \".freeze, GAP, \" -->\\n\".freeze).freeze)\n jig.plug(GAP, *args)\n #:startdoc:\n end", "def ml_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 40)\n\n type = ML_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 478:4: '/*' ( . )* '*/'\n match(\"/*\")\n # --> action\n if @input.peek(1) == ?* then type = DOC_COMMENT else channel = HIDDEN end \n # <-- action\n # at line 478:88: ( . )*\n loop do #loop 4\n alt_4 = 2\n look_4_0 = @input.peek(1)\n\n if (look_4_0 == ?*) \n look_4_1 = @input.peek(2)\n\n if (look_4_1 == ?/) \n alt_4 = 2\n elsif (look_4_1.between?(0x0000, ?.) || look_4_1.between?(?0, 0xFFFF)) \n alt_4 = 1\n\n end\n elsif (look_4_0.between?(0x0000, ?)) || look_4_0.between?(?+, 0xFFFF)) \n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 478:88: .\n match_any\n\n else\n break #loop 4\n end\n end\n match(\"*/\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 40)\n\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "def parse_with_comments(source_buffer); end", "def parse_with_comments(source_buffer); end", "def parse_with_comments(source_buffer); end", "def comment(text)\n @out << \"<!-- #{text} -->\"\n nil\n end", "def default_allows_comments?; true; end", "def _comment\n\n _save = self.pos\n begin # sequence\n _tmp = match_string(\"#\")\n break unless _tmp\n while true # kleene\n\n _save1 = self.pos\n begin # sequence\n _save2 = self.pos\n _tmp = apply(:_eol)\n _tmp = !_tmp\n self.pos = _save2\n break unless _tmp\n _tmp = match_dot\n end while false\n unless _tmp\n self.pos = _save1\n end # end sequence\n\n break unless _tmp\n end\n _tmp = true # end kleene\n break unless _tmp\n _tmp = apply(:_eol)\n end while false\n unless _tmp\n self.pos = _save\n end # end sequence\n\n set_failed_rule :_comment unless _tmp\n return _tmp\n end", "def comment( text = nil, &block )\n make_indent if @indent > 0\n \n @serial = @serial + 1\n @buffer << \"<!-- \"\n \n if text then \n @buffer << encode(text)\n elsif !block.nil? then\n capture(&block)\n end\n \n @buffer << \" -->\"\n end", "def comment\n multi_line_comment || single_line_comment\n end", "def _comment\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"#\")\n unless _tmp\n self.pos = _save\n break\n end\n while true\n\n _save2 = self.pos\n while true # sequence\n _save3 = self.pos\n _tmp = apply(:_eol)\n _tmp = _tmp ? nil : true\n self.pos = _save3\n unless _tmp\n self.pos = _save2\n break\n end\n _tmp = get_byte\n unless _tmp\n self.pos = _save2\n end\n break\n end # end sequence\n\n break unless _tmp\n end\n _tmp = true\n unless _tmp\n self.pos = _save\n break\n end\n _tmp = apply(:_eol)\n unless _tmp\n self.pos = _save\n end\n break\n end # end sequence\n\n set_failed_rule :_comment unless _tmp\n return _tmp\n end", "def process_initial_comment(tk)\n if @statement.empty? && (@comments_last_line || 0) < tk.line_no - 2\n @comments = nil\n end\n\n return unless tk.class == TkCOMMENT\n\n case tk.text\n when Parser::SourceParser::SHEBANG_LINE\n if !@last_ns_tk && !@encoding_line\n @shebang_line = tk.text\n return\n end\n when Parser::SourceParser::ENCODING_LINE\n if (@last_ns_tk.class == TkCOMMENT && @last_ns_tk.text == @shebang_line) ||\n !@last_ns_tk\n @encoding_line = tk.text\n return\n end\n end\n\n return if [email protected]? && @comments\n return if @first_line && tk.line_no > @first_line\n\n if @comments_last_line && @comments_last_line < tk.line_no - 1\n if @comments && @statement.empty?\n @tokens.unshift(tk)\n return @done = true\n end\n @comments = nil\n end\n @comments_line = tk.line_no unless @comments\n\n # Remove the \"#\" and up to 1 space before the text\n # Since, of course, the convention is to have \"# text\"\n # and not \"#text\", which I deem ugly (you heard it here first)\n @comments ||= []\n if tk.text.start_with?('=begin')\n lines = tk.text.count(\"\\n\")\n @comments += tk.text.gsub(/\\A=begin.*\\r?\\n|\\r?\\n=end.*\\r?\\n?\\Z/, '').split(/\\r?\\n/)\n @comments_last_line = tk.line_no + lines\n else\n @comments << tk.text.gsub(/^(#+)\\s{0,1}/, '')\n @comments_hash_flag = $1 == '##' if @comments_hash_flag.nil?\n @comments_last_line = tk.line_no\n end\n @comments.pop if @comments.size == 1 && @comments.first =~ /^\\s*$/\n true\n end", "def comment _args\n \"comment _args;\" \n end", "def has_comment?(line)\n line =~ /#[^{]/\n end", "def parse_with_comments(source); end", "def f_slash_comment\n emit_comment(parse(\"\\n\"))\nend", "def comment(contents='', &block)\n contents = build(:blank, Context, &block) if block\n '<!-- %s -->' % indent(contents)\n end", "def comment_code\n block_match = /\\{([^\\{\\}]*)\\}/\n matches = @code.scan(block_match)\n return if matches.size != 1\n \n block = matches[0][0].to_s\n @code.gsub!(block_match, \"{\\n#{comment_struct_list(block)}#{@indent}}\")\n end", "def mark_commented_lines\n [].tap do |reg|\n in_block_comment = false\n line_no = 0\n start_block = 0\n end_block = 0\n @source.each_line do |line|\n line_no = line_no+1\n\n start_block = line_no if !in_block_comment and line =~ @start_block_comment_regex\n end_block = line_no if start_block < line_no and line =~ @end_block_comment_regex\n end_block = line_no if line =~ @oneline_block_comment_regex\n\n in_block_comment = end_block < start_block\n\n reg << line_no if in_block_comment or end_block == line_no or line =~ @comment_regex\n end\n end\n end", "def consume_comments\n if @s.peek(2) == '/*'\n @s.consume\n @s.consume\n\n if text = @s.scan_until(RE_COMMENT_CLOSE)\n text.slice!(-2, 2)\n else\n # Parse error.\n text = @s.consume_rest\n end\n\n return create_token(:comment, :value => text)\n end\n\n nil\n end", "def comment?; end", "def comment?; end", "def getComment(var)\n return \"/* \" << var.text << \" */\\n\"\n end", "def render_comment(line)\n conditional, line = balance(line, ?[, ?]) if line[0] == ?[\n line.strip!\n conditional << \">\" if conditional\n\n if block_opened? && !line.empty?\n raise SyntaxError.new('Illegal nesting: nesting within a tag that already has content is illegal.', @next_line.index)\n end\n\n open = \"<!--#{conditional}\"\n\n # Render it statically if possible\n unless line.empty?\n return push_text(\"#{open} #{line} #{conditional ? \"<![endif]-->\" : \"-->\"}\")\n end\n\n push_text(open, 1)\n @output_tabs += 1\n push_and_tabulate([:comment, !conditional.nil?])\n unless line.empty?\n push_text(line)\n close\n end\n end", "def comment_block( *lines )\n self.blank_line\n self << %[#]\n self.indent( \"# \" ) do\n lines.each do |line|\n self << line unless line.nil?\n end\n\n yield( self ) if block_given?\n end\n self.blank_line\n end", "def verify_comment(line) \n end", "def ensure_comments_section\n if self.body.match(/^\\* COMMENT Comments$/)\n self.body[$~.end(0)..-1] = self.body[$~.end(0)..-1].gsub(/^\\* COMMENT Comments/, '')\n else\n self.body << \"\\n* COMMENT Comments\\n\"\n end\n end", "def comment(text)\n@out << \"<!-- #{text} -->\"\nnil\nend", "def comment!(str)\n if str.include? \"\\n\"\n text! \"<!--\\n#{str}\\n-->\\n\"\n else\n text! \"<!-- #{str} -->\\n\"\n end\n end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def is_comment?(line)\n true if line =~ /^\\#.*$/\n end", "def consume_comments\n c = comments\n discard_comments\n c\n end", "def comment_line?(line_source); end", "def comment_line?(line_source); end", "def remove_commented_out_lines\n @content = @content.gsub(%r%//.*rb_define_%, '//')\n end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comment?\n return @assigned_paragraph_type == :comment if @assigned_paragraph_type\n return block_type.casecmp(\"COMMENT\") if begin_block? or end_block?\n return @line =~ /^[ \\t]*?#[ \\t]/\n end", "def _comment\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"#\")\n unless _tmp\n self.pos = _save\n break\n end\n while true\n\n _save2 = self.pos\n while true # sequence\n _save3 = self.pos\n _tmp = apply(:_end_hyphen_of_hyphen_line)\n _tmp = _tmp ? nil : true\n self.pos = _save3\n unless _tmp\n self.pos = _save2\n break\n end\n _tmp = apply(:_utf8)\n unless _tmp\n self.pos = _save2\n end\n break\n end # end sequence\n\n break unless _tmp\n end\n _tmp = true\n unless _tmp\n self.pos = _save\n end\n break\n end # end sequence\n\n set_failed_rule :_comment unless _tmp\n return _tmp\n end", "def parse_comment\n s0 = @scanner.pos\n if match_str('*') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_nonls\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = s2.join\n end\n end\n if s0 == :failed\n s0 = @scanner.pos\n s1 = match_str('&')\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_nonls\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = '&' + s2.join\n end\n end\n end\n s0\n end", "def _comment\n\n _save = self.pos\n while true # choice\n _tmp = scan(/\\A(?-mix:--.*?$)/)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_multi_comment)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_comment unless _tmp\n return _tmp\n end", "def render_comment(line)\n conditional, content = line.scan(COMMENT_REGEX)[0]\n content.strip!\n\n if @block_opened && !content.empty?\n raise SyntaxError.new('Illegal Nesting: Nesting within a tag that already has content is illegal.')\n end\n\n try_one_line = !content.empty?\n push_silent \"_hamlout.open_comment(#{try_one_line}, #{conditional.inspect}, #{@output_tabs})\"\n @output_tabs += 1\n push_and_tabulate([:comment, !conditional.nil?])\n if try_one_line\n push_text content\n close\n end\n end", "def comment_lines(path, flag, *args)\n flag = flag.respond_to?(:source) ? flag.source : flag\n\n gsub_file(path, /^(\\s*)([^#|\\n]*#{flag})/, '\\1# \\2', *args)\n end", "def lex_en_line_comment; end", "def lex_en_line_comment; end", "def lex_en_line_comment; end", "def line_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n\n\n type = LINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 608:8: '#' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( 0x23 )\n # at line 608:12: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( 0x0, 0x9 ) || look_25_0.between?( 0xb, 0xc ) || look_25_0.between?( 0xe, 0xffff ) )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xffff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n # at line 608:26: ( '\\\\r' )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == 0xd )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 608:26: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n # --> action\n channel=HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 78 )\n\n\n end", "def comment_line?(line_source)\n /^\\s*#/.match?(line_source)\n end", "def parse_comment\n return false unless @lexer.get and @lexer.get.type == :comment_start\n @lexer.next!\n\n buf = ''\n while token = @lexer.get\n break if token.type == :comment_end\n buf << token.value\n @lexer.next!\n end\n\n found :comment, buf\n @lexer.next!\n true\n end", "def new_comment comment, line_no = nil\n c = RDoc::Comment.new comment, @top_level, :ruby\n c.line = line_no\n c.format = @markup\n c\n end", "def visit_comment(node)\n line = @original_haml_lines[node.line - 1]\n indent = line.index(/\\S/)\n @ruby_chunks << PlaceholderMarkerChunk.new(node, 'comment', indent: indent)\n end", "def parse_with_comments(source_buffer)\n @lexer.comments = []\n\n [ parse(source_buffer), @lexer.comments ]\n ensure\n @lexer.comments = nil\n end", "def uses_legacy_comments?\n end", "def emit_comments_before(source_part = :expression)\n comments_before = comments.take_before(node, source_part)\n return if comments_before.empty?\n\n emit_comments(comments_before)\n buffer.nl\n end", "def comment\n comment = buffer.options.comment_line.to_s\n indent = nil\n lines = []\n\n each_line do |line, fc, tc|\n line_fc = \"#{line}.#{fc}\"\n line_tc = \"#{line}.#{tc}\"\n\n next if buffer.at_end == line_tc\n\n lines << line\n\n next if indent == 0 # can't get lower\n\n line = buffer.get(\"#{line}.#{fc}\", \"#{line}.#{tc}\")\n\n next unless start = line =~ /\\S/\n\n indent ||= start\n indent = start if start < indent\n end\n\n indent ||= 0\n\n buffer.undo_record do |record|\n lines.each do |line|\n record.insert(\"#{line}.#{indent}\", comment)\n end\n end\n end", "def add_comment comment\n \"\\n###### #{comment} ######\\n\" \n end", "def comment(string)\n case string.strip # strip leading and trailing whitespaces\n when /^body=\"start\"/ # match starting comment\n @interesting = true\n when /^body=\"end\"/\n @interesting = false # match closing comment\n end\n end", "def comment(string)\n case string.strip # strip leading and trailing whitespaces\n when /^body=\"start\"/ # match starting comment\n @interesting = true\n when /^body=\"end\"/\n @interesting = false # match closing comment\n end\n end", "def pbCompilerEachCommentedLine(filename)\r\n File.open(filename,\"rb\") { |f|\r\n FileLineData.file = filename\r\n lineno = 1\r\n f.each_line { |line|\r\n if lineno==1 && line[0].ord==0xEF && line[1].ord==0xBB && line[2].ord==0xBF\r\n line = line[3,line.length-3]\r\n end\r\n line.force_encoding(Encoding::UTF_8)\r\n if !line[/^\\#/] && !line[/^\\s*$/]\r\n FileLineData.setLine(line,lineno)\r\n yield line, lineno\r\n end\r\n lineno += 1\r\n }\r\n }\r\n end", "def remove_config_comment_lines\n # NOTE: (2016-02-09) jonk => don't want this\n end", "def process_comments\n source_path = configuration['comments']['source_path']\n ignored_paths = configuration['comments']['ignored_paths']\n ignored_methods = configuration['comments']['ignored_methods']\n\n find_files_without(source_path, ignored_paths).each do |path|\n comments = []\n temp_file = Tempfile.new(SecureRandom.hex)\n\n begin\n File.open(path).each_with_index do |line, index|\n if line.strip.start_with?('#')\n comments.push(line)\n else\n if line.strip.start_with?('def ')\n method_name = extract_method_name_without_arguments(line)\n\n condition_0 = comments.none?\n condition_1 = !ignored_methods.include?(method_name)\n\n data = (condition_0 && condition_1) ? process_line(line, index) : comments.join\n temp_file.print(data)\n else\n temp_file.print(comments.join)\n end\n\n comments = []\n temp_file.write line\n end\n end\n\n temp_file.print(comments.join)\n temp_file.close\n FileUtils.mv(temp_file.path, path)\n ensure\n temp_file.close\n temp_file.unlink\n end\n end\n end", "def extract_magic_comments(processed_source); end", "def adjust_comments\n scan_tokens do |prev, token, post, i|\n next 1 unless token[0] == :COMMENT\n before, after = @tokens[i - 2], @tokens[i + 2]\n if before && after &&\n ((before[0] == :INDENT && after[0] == :OUTDENT) ||\n (before[0] == :OUTDENT && after[0] == :INDENT)) &&\n before[1] == after[1]\n @tokens.delete_at(i + 2)\n @tokens.delete_at(i - 2)\n next 0\n elsif prev[0] == \"\\n\" && [:INDENT].include?(after[0])\n @tokens.delete_at(i + 2)\n @tokens[i - 1] = after\n next 1\n elsif ![\"\\n\", :INDENT, :OUTDENT].include?(prev[0])\n @tokens.insert(i, [\"\\n\", Value.new(\"\\n\", token[1].line)])\n next 2\n else\n next 1\n end\n end\n end", "def remove_comments(source)\n for_outstrings_of(source) do |str|\n str.gsub! /\\/\\*.*?\\*\\//im, ''\n str.gsub! /\\/\\/.*?$/, ''\n str\n end\n end", "def consume_comment(input)\n while not input.eof? do\n case input.look_ahead\n when \"\\\\\" : \n # In comments, only escaped backslashes and line endings matter\n if [\"\\n\", \"\\\\\"].include? input.look_ahead(1)\n input.consume\n end\n when \"\\n\" : input.consume; break \n end\n input.consume\n end\n end", "def strip_comments(code)\n code.gsub(%r(\\s*/\\*.*?\\*/)m, '').\n gsub(%r(^\\s*//.*?\\n), '').\n gsub(%r([ \\t]*//[^\\n]*), '')\n end", "def with_comments(rule_name, properties, comment_type)\n puts properties.inspect\n props = Array(properties) + [\"$END$\"]\n case comment_type\n when :side # first line gets the comment appended to it\n props[0] += \" /* #{short_comment(rule_name)} */\"\n when :top # comment is added as first line\n props.unshift \"/* #{short_comment(name, rule_name)} */\"\n else # mostly :none\n # noop\n end\n props.join(\"\\n\")\n end", "def remove_commented_out_lines\n @body.gsub!(%r{//.*rb_define_}, '//')\n end", "def spaceFirstComment(theLines)\n\n\ttheLines.each_with_index do |theLine, theIndex|\n\n\t\t# Two blank lines between brace and leading comment\n\t\tif (theLine[:text] == \"{\" && theLine[:comment].empty?)\n\t\t\n\t\t\tnextLine = theLines[theIndex + 1];\n\n\t\t\tif (nextLine[:text] =~ /^\\s*$/ && !nextLine[:comment].empty?)\n\t\t\t\ttheLines.insert(theIndex + 1, EMPTY_LINE);\n\t\t\t\ttheLines.insert(theIndex + 1, EMPTY_LINE);\n\t\t\t\tbreak;\n\t\t\tend\n\t\tend\n\n\tend\n\nend", "def comment?\n @kind == :line_comment || @kind == :block_comment\n end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end" ]
[ "0.7427642", "0.7419718", "0.72615504", "0.7205587", "0.7187588", "0.7085778", "0.70835793", "0.69837433", "0.6953066", "0.6921879", "0.6921879", "0.6921879", "0.6921879", "0.69048876", "0.6899584", "0.6897714", "0.6876154", "0.68521494", "0.6847973", "0.6847973", "0.6847973", "0.6831406", "0.6815431", "0.68107593", "0.68050325", "0.6781407", "0.6780379", "0.6777268", "0.6776364", "0.67743045", "0.6773952", "0.67722523", "0.67417467", "0.671902", "0.66536725", "0.6652181", "0.6648315", "0.6648315", "0.6625862", "0.6622296", "0.6614906", "0.6610264", "0.66070414", "0.65967053", "0.6548695", "0.65419745", "0.65419745", "0.65419745", "0.6541378", "0.653055", "0.6526894", "0.6526894", "0.65218747", "0.6496739", "0.6496739", "0.6496739", "0.6496739", "0.64864624", "0.64864624", "0.64864624", "0.64864624", "0.64864624", "0.6480907", "0.6478577", "0.64757526", "0.6466764", "0.64493394", "0.64455247", "0.64370835", "0.64370835", "0.64370835", "0.6435123", "0.6434276", "0.6429581", "0.6425961", "0.6419533", "0.6416541", "0.6416002", "0.6404517", "0.6388672", "0.63885164", "0.6365713", "0.6365713", "0.6358149", "0.6355219", "0.6353607", "0.6342395", "0.6333737", "0.6330223", "0.6329049", "0.6328378", "0.63240236", "0.6312678", "0.6305057", "0.63009596", "0.6252082", "0.6252082", "0.6252082", "0.6252082", "0.6252082" ]
0.7622495
0
if input matches `[VAR] = [EXPRESSION]` extract variable name and expression
def process_variable_assignment regex = %r{(?<name>\w+)( = )(?<expression>.*$)} match = @input.match(regex) if match @name = match.named_captures["name"] @expression = match.named_captures["expression"] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_exp(input, variable, expression); end", "def expand_variables\n # self.tokens = self\n\n # var_regex = /^[\\w]+$/\n # var_regex = /([\\s\\b])[\\w]+([\\s\\b])/\n\n # expanded = []\n # self.tokens.each do |token|\n # expanded << expand_token(token)\n # end\n # @expression = expanded.join(' ')\n\n @expression = self.tokens.map do |token|\n expand_token(token)\n end.join(' ')\n\n # @expression = @expression.split(' ').map do |token|\n # if !valid_var_name?(token)\n # return token\n # elsif is_var?(token)\n # return get_var(token)\n # else\n # @mode = :invalid\n # @errors << {message: \"invalid variable name\", info: token}\n # return token\n # end\n # end.join(' ')\n end", "def variable_regex\n /\n \\$ # start tag\n ([a-zA-Z_][\\w_]*) # our variables are starting with $ and are followed by\n # upcase letters or _. We want to match the \n # variable name\n /xm\n end", "def variable_name_expr; end", "def extract_variables_from_string(string)\n string.split(/ /).map do |defintion|\n match = defintion.match STRING_REG_EX\n next nil unless match\n\n { match[1] => match[2] }\n end.reject(&:nil?)\n end", "def where_exp(input, variable, expression); end", "def do_expression(expr, vars)\n parse_expression(expr).each do |k|\n expr = expr.gsub(\"$(#{k})\", vars[k])\n end\n expr\nend", "def parse_variable(input)\n if '{' == input.look_ahead(1)\n parse_braced_variable(input)\n else\n parse_normal_variable(input)\n end\n end", "def parse_and_resolve_variable(input)\n @stack[-1].get_variable(parse_variable(input))\n end", "def variable_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n return_value = VariableStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n string_literal38 = nil\n variable_declaration39 = nil\n\n tree_for_string_literal38 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 70:5: ^( 'var' ( variable_declaration )+ )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n string_literal38 = match( VAR, TOKENS_FOLLOWING_VAR_IN_variable_statement_326 )\n\n tree_for_string_literal38 = @adaptor.copy_node( string_literal38 )\n\n root_1 = @adaptor.become_root( tree_for_string_literal38, root_1 )\n\n\n\n match( DOWN, nil )\n # at file 70:14: ( variable_declaration )+\n match_count_8 = 0\n while true\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == ASGN || look_8_0 == ID )\n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 70:14: variable_declaration\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_variable_declaration_IN_variable_statement_328 )\n variable_declaration39 = variable_declaration\n @state.following.pop\n\n @adaptor.add_child( root_1, variable_declaration39.tree )\n\n\n else\n match_count_8 > 0 and break\n eee = EarlyExit(8)\n\n\n raise eee\n end\n match_count_8 += 1\n end\n\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end\n \n return return_value\n end", "def extract_variables\n postfix_notation.select{|node| node.kind_of? String}.inject({}){|h, v| h[v] = nil; h}\n end", "def look_up_variable(name, expr)\n distance = @locals[expr]\n if distance.nil?\n @globals[name]\n else\n @environment.get_at distance, name.lexeme\n end\n end", "def extract_expr(string)\n result = {}\n first_parenthesis = string.index('(')\n expr_str = string\n unless first_parenthesis.nil?\n expr_str = string[0...first_parenthesis]\n params_str = string[first_parenthesis+1...-1]\n params_array = []\n params_hash = {}\n params_str.split(',').each do |param|\n if param.include?('=>')\n entry = param.split('=>')\n params_hash[entry[0]] = entry[1]\n else\n params_array << param\n end\n end\n if params_hash.size > 0\n result[:params] = params_hash\n else\n result[:params] = params_array\n end\n end\n result[:expression] = Expression.find_by_key(expr_str)\n raise ArgumentError, \"'#{expr_str}' is not defined as an expression\" if result[:expression].nil?\n result\n end", "def get_variables(str)\n retArray = Array.new\n unless str.nil? || str.empty?\n retArray = str.scan(/\\${\\w+}/).map! { |element| \n element.gsub(/\\$|\\{|\\}/, '')\n }\n end\n return retArray\n end", "def group_by_exp(input, variable, expression); end", "def extract_expression(text)\n if text =~ /^\\s*(?:if|elsif|unless)\\s+/\n text.gsub!(/^\\s*(?:if|elsif|unless)\\s+/,'')\n text.gsub!(/\\s+then\\s*$/, '')\n elsif text =~ /^\\s*(?:until|while)\\s+/\n text.gsub!(/^\\s*(?:until|while)\\s+/,'')\n text.gsub!(/\\s+do\\s*$/, '')\n elsif text =~ /^\\s*return\\s+/\n # EXPRESION in: return EXPRESSION\n text.gsub!(/^\\s*return\\s+/,'')\n elsif text =~ /^\\s*case\\s+/\n # EXPRESSION in: case EXPESSION\n text.gsub!(/^\\s*case\\s*/,'')\n elsif text =~ /^\\s*def\\s*.*\\(.+\\)/\n text.gsub!(/^\\s*def\\s*.*\\((.*)\\)/,'[\\1]')\n elsif text =~ /^\\s*[A-Za-z_][A-Za-z0-9_\\[\\]]*\\s*=[^=>]/\n # RHS of an assignment statement.\n text.gsub!(/^\\s*[A-Za-z_][A-Za-z0-9_\\[\\]]*\\s*=/,'')\n end\n return text\n end", "def find_variable_ref(s)\n m = @var_re.match(s)\n if m.nil?\n nil\n else\n Variable.new(m.begin(0), m.end(0), m[1], nil)\n end\n end", "def parse_expression\n if current?(:ident) && peek?(:assign)\n token = expect(:ident)\n vardef = Node.new(:vardef, name: token.input)\n expect(:assign)\n Node.new(:assign, lhs: vardef, rhs: parse_expression)\n else\n parse_equality\n end\n end", "def lex_en_expr_variable; end", "def lex_en_expr_variable; end", "def lex_en_expr_variable; end", "def get_make_var flag\n m = match Regexp.new(\"^#{flag}[ \\\\t]*=[ \\\\t]*(.*)$\")\n return m[1] if m\n return nil\n end", "def get_make_var flag\n m = match Regexp.new(\"^#{flag}[ \\\\t]*=[ \\\\t]*(.*)$\")\n return m[1] if m\n return nil\n end", "def find_variable_ref(s)\n\n def handle_long_match(m)\n name = m[1]\n if m[2].nil?\n default = nil\n else\n # Pull off the \"?\"\n default = m[2][1..-1]\n end\n\n Variable.new(m.begin(0), m.end(0), name, default)\n end\n\n def handle_no_long_match(s)\n m = @short_var_regexp.match(s)\n if m.nil?\n nil\n else\n Variable.new(m.begin(0), m.end(0), m[1], nil)\n end\n end\n\n m = @long_var_regexp.match(s)\n if m.nil?\n handle_no_long_match(s)\n else\n handle_long_match(m)\n end\n end", "def variable_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n return_value = VariableStatementReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal62 = nil\n variable_declaration_list63 = nil\n statement_end64 = nil\n\n tree_for_string_literal62 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 379:5: 'var' variable_declaration_list statement_end\n string_literal62 = match( VAR, TOKENS_FOLLOWING_VAR_IN_variable_statement_2484 )\n if @state.backtracking == 0\n\n tree_for_string_literal62 = @adaptor.create_with_payload( string_literal62 )\n root_0 = @adaptor.become_root( tree_for_string_literal62, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_variable_declaration_list_IN_variable_statement_2487 )\n variable_declaration_list63 = variable_declaration_list\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_declaration_list63.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_end_IN_variable_statement_2489 )\n statement_end64 = statement_end\n @state.following.pop\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 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__, 18 )\n\n end\n \n return return_value\n end", "def parse_vars(args)\n vars = {}\n \n # Condition format of input user variables\n args.each{|arg| \n if arg =~ /(.*)=(.*)/\n # Split key=value pairs\n symbol = $1\n value = $2\n # Prefix all variables with an @\n sym = if symbol.to_s =~ /^@.*/\n symbol.to_sym\n else\n (\"@\" + symbol.to_s).to_sym\n end\n \n # Cast value to Float if applicable\n val = if value =~ /^(\\d+\\.*\\d*)$/\n $1.to_f\n elsif value =~ /\"(.*)\"/ or value =~ /'(.*)'/\n $1\n else\n value\n end\n \n # Set the variable in the Vars hash\n vars[sym] = val\n end\n }\n vars\nend", "def extract_hash(str, pat, *matchvars)\n rc = {}\n\n # get the possibilities from the pattern\n namemap = pat.named_captures\n\n pat.match(str) do |m|\n matchvars.each { |var| rc[var] = m.values_at(namemap[var]) if namemap.key? var }\n end\n\n rc\n end", "def test_variables_can_also_be_used_to_access_captures\n assert_equal 'Gray, James', \"Name: Gray, James\"[/(\\w+), (\\w+)/]\n assert_equal 'Gray', $1\n assert_equal 'James', $2\n end", "def get(x)\n if x.is_a?(String)\n x\n elsif x.is_a?(Identifier)\n raise \"Variable not bound #{x}\" unless @vars.key?(x.name)\n @vars[x.name]\n elsif x.is_a?(Str)\n x.contents.map{|e| get(e) }.join('')\n else\n raise \"Invalid Type\"\n end\n end", "def capture_variables(line)\n noncomment, _ = line.split(\"#\", 2)\n noncomment.scan(/ENV(?:\\[|\\.fetch\\()['\"]([^'\"]+)['\"]/).flatten\n end", "def get_variable(word)\n word = word.split(\" \").first if word.split(\" \").count > 1\n quote = @db.get_first_value(\"SELECT value FROM variables WHERE key = ? LIMIT 1;\",word.downcase)\n return quote\n end", "def parse_normal_variable(input)\n input.consume # skip $\n array_name = \"\"\n while not input.eof? do\n c = input.look_ahead\n case c\n when /\\w|\\d|[_:]/ :\n array_name << c\n input.consume\n when '('\n return array_name + parse_array_index(input)\n else\n return array_name\n end\n end\n end", "def extract_variables(variable)\n return [variable] if variable.is_a? Hash\n return extract_variables_from_string(variable) if variable.is_a? String\n\n []\n end", "def var_exp\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n\n return_value = VarExpReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __TIPO247__ = nil\n __COMA248__ = nil\n __K_VISIBILIDAD249__ = nil\n __COMA250__ = nil\n __K_MODIFICADOR251__ = nil\n __COMA252__ = nil\n __RPAR254__ = nil\n valor253 = nil\n\n\n tree_for_TIPO247 = nil\n tree_for_COMA248 = nil\n tree_for_K_VISIBILIDAD249 = nil\n tree_for_COMA250 = nil\n tree_for_K_MODIFICADOR251 = nil\n tree_for_COMA252 = nil\n tree_for_RPAR254 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 220:4: TIPO COMA K_VISIBILIDAD COMA ( K_MODIFICADOR )? COMA ( valor )? RPAR\n __TIPO247__ = match( TIPO, TOKENS_FOLLOWING_TIPO_IN_var_exp_1067 )\n if @state.backtracking == 0\n tree_for_TIPO247 = @adaptor.create_with_payload( __TIPO247__ )\n @adaptor.add_child( root_0, tree_for_TIPO247 )\n\n end\n\n __COMA248__ = match( COMA, TOKENS_FOLLOWING_COMA_IN_var_exp_1069 )\n if @state.backtracking == 0\n tree_for_COMA248 = @adaptor.create_with_payload( __COMA248__ )\n @adaptor.add_child( root_0, tree_for_COMA248 )\n\n end\n\n __K_VISIBILIDAD249__ = match( K_VISIBILIDAD, TOKENS_FOLLOWING_K_VISIBILIDAD_IN_var_exp_1071 )\n if @state.backtracking == 0\n tree_for_K_VISIBILIDAD249 = @adaptor.create_with_payload( __K_VISIBILIDAD249__ )\n @adaptor.add_child( root_0, tree_for_K_VISIBILIDAD249 )\n\n end\n\n __COMA250__ = match( COMA, TOKENS_FOLLOWING_COMA_IN_var_exp_1073 )\n if @state.backtracking == 0\n tree_for_COMA250 = @adaptor.create_with_payload( __COMA250__ )\n @adaptor.add_child( root_0, tree_for_COMA250 )\n\n end\n\n # at line 220:33: ( K_MODIFICADOR )?\n alt_34 = 2\n look_34_0 = @input.peek( 1 )\n\n if ( look_34_0 == K_MODIFICADOR )\n alt_34 = 1\n end\n case alt_34\n when 1\n # at line 220:33: K_MODIFICADOR\n __K_MODIFICADOR251__ = match( K_MODIFICADOR, TOKENS_FOLLOWING_K_MODIFICADOR_IN_var_exp_1075 )\n if @state.backtracking == 0\n tree_for_K_MODIFICADOR251 = @adaptor.create_with_payload( __K_MODIFICADOR251__ )\n @adaptor.add_child( root_0, tree_for_K_MODIFICADOR251 )\n\n end\n\n\n end\n __COMA252__ = match( COMA, TOKENS_FOLLOWING_COMA_IN_var_exp_1078 )\n if @state.backtracking == 0\n tree_for_COMA252 = @adaptor.create_with_payload( __COMA252__ )\n @adaptor.add_child( root_0, tree_for_COMA252 )\n\n end\n\n # at line 220:53: ( valor )?\n alt_35 = 2\n look_35_0 = @input.peek( 1 )\n\n if ( look_35_0 == COMILLA || look_35_0.between?( DOUBLEDOT, DecimalLiteral ) || look_35_0 == Identificador || look_35_0.between?( T__81, T__82 ) )\n alt_35 = 1\n end\n case alt_35\n when 1\n # at line 220:53: valor\n @state.following.push( TOKENS_FOLLOWING_valor_IN_var_exp_1080 )\n valor253 = valor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, valor253.tree )\n end\n\n\n end\n __RPAR254__ = match( RPAR, TOKENS_FOLLOWING_RPAR_IN_var_exp_1083 )\n if @state.backtracking == 0\n tree_for_RPAR254 = @adaptor.create_with_payload( __RPAR254__ )\n @adaptor.add_child( root_0, tree_for_RPAR254 )\n\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\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\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\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 47 )\n\n\n end\n\n return return_value\n end", "def process_dvar(exp)\n dvar = exp.shift\n dvar_name = @model.encode_local_variable(dvar)\n raise \"dynamic variable not available\" unless @current_iter_dvars.include?(dvar_name)\n\n resultify(\"#{dvar_name}\")\n end", "def vars_in(string)\n rest = string\n vars = []\n while /<(?<var>\\w+)>/ =~ rest\n vars << var\n rest = $~.post_match\n end\n vars\n end", "def translate_assignment(token)\n case token.assigned.type\n when T::SEQUENCE\n regex = translate_sequence token.assigned\n @var_table[token.value['variable_name']] = regex\n return regex\n\n when T::SEQUENCE_COMBINATION\n regex = translate_combination token.assigned\n @var_table[token.value['variable_name']] = regex\n return regex\n\n when T::RANGE\n raise 'Not implemented'\n end\n end", "def extract_variable(args)\n raise \":name is required\" unless args.has_key?(:name)\n \n ast = RubyParser.new.parse(@code)\n line_finder = LineFinder.new(ast)\n \n method_lines = line_finder.method_lines(args[:line])\n \n new_code = \"\"\n added = false\n identation = 0\n \n @code.each_with_index do |line, n|\n line_number = n + 1 # not 0-based\n if line_number == method_lines.first\n identation = extract_identation_level_from line\n end\n if line_number == method_lines.first + 1\n new_code << \"#{identation} #{args[:name]} = #{args[:text]}\\n\"\n end\n if method_lines.include? line_number\n new_line = line.gsub(args[:text], args[:name])\n new_code << new_line\n else\n new_code << line\n end\n end\n new_code\n end", "def set_variable\n var_name=EvalBlock.lasgn(expression)\n self.variable=var_name.present? ? Variable.find_or_create_by(game: game, name: var_name) : nil\n end", "def get_variables(input)\n variables = []\n input.each do |token|\n variables.push(token) if check_variables([token])\n end\n variables\n end", "def variable_assignment_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n\n value = nil\n\n\n a = nil\n type = nil\n b = nil\n\n\n begin\n # at line 97:6: a= function_call_statement type= assignment_type b= expression\n @state.following.push( TOKENS_FOLLOWING_function_call_statement_IN_variable_assignment_statement_747 )\n a = function_call_statement\n @state.following.pop\n @state.following.push( TOKENS_FOLLOWING_assignment_type_IN_variable_assignment_statement_751 )\n type = assignment_type\n @state.following.pop\n @state.following.push( TOKENS_FOLLOWING_expression_IN_variable_assignment_statement_755 )\n b = expression\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = VariableAssignmentStatementEval.new(a, b, type) \n # <-- action\n end\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n\n end\n\n return value\n end", "def variables\n format.scan(/(%\\w+)/).flatten.map {|v| v[1..v.length] }\n end", "def process_var(match, block, type_table)\n ident = match[1]\n type = match[2]\n\n var_list = block.var_list\n if var_list.has_ident?(ident)\n raise \"Redeclared variable '#{ident}'\"\n end\n\n type = process_typestr(type, type_table) \n if type.is_a?(ArrayType)\n raise \"Array declaration not currently supported\"\n end\n\n var = Variable.new(type, ident)\n block.add_variable(var)\n\n return true\nend", "def var!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 75 )\n\n type = VAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 196:7: 'var'\n match( \"var\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 75 )\n\n end", "def parse_expression(expr); end", "def variable_name\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 83 )\n return_value = VariableNameReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __ID425__ = nil\n t = nil\n\n tree_for_ID425 = nil\n\n begin\n # at line 821:3: ( ID | t= pseudokeyword )\n alt_107 = 2\n look_107_0 = @input.peek( 1 )\n\n if ( look_107_0 == ID )\n alt_107 = 1\n elsif ( look_107_0 == GET || look_107_0 == SET || look_107_0 == MACRO || look_107_0 == EACH || look_107_0.between?( DEF, OBJECT_DEF ) || look_107_0.between?( T__148, T__150 ) )\n alt_107 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 107, 0 )\n end\n case alt_107\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 821:5: ID\n __ID425__ = match( ID, TOKENS_FOLLOWING_ID_IN_variable_name_5838 )\n if @state.backtracking == 0\n\n tree_for_ID425 = @adaptor.create_with_payload( __ID425__ )\n @adaptor.add_child( root_0, tree_for_ID425 )\n\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 822:5: t= pseudokeyword\n @state.following.push( TOKENS_FOLLOWING_pseudokeyword_IN_variable_name_5846 )\n t = pseudokeyword\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, t.tree )\n end\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n t.tree.token.type = ID \n # <-- action\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n 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__, 83 )\n\n end\n \n return return_value\n end", "def variable!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = VARIABLE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 38:5: '$' ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '-' | '_' )+\n match( 0x24 )\n # at file 38:9: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '-' | '_' )+\n match_count_11 = 0\n while true\n alt_11 = 2\n look_11_0 = @input.peek( 1 )\n\n if ( look_11_0 == 0x2d || look_11_0.between?( 0x30, 0x39 ) || look_11_0.between?( 0x41, 0x5a ) || look_11_0 == 0x5f || look_11_0.between?( 0x61, 0x7a ) )\n alt_11 = 1\n\n end\n case alt_11\n when 1\n # at line \n if @input.peek(1) == 0x2d || @input.peek( 1 ).between?( 0x30, 0x39 ) || @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n match_count_11 > 0 and break\n eee = EarlyExit(11)\n\n\n raise eee\n end\n match_count_11 += 1\n end\n\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "def lex_en_expr_variable=(_arg0); end", "def lex_en_expr_variable=(_arg0); end", "def lex_en_expr_variable=(_arg0); end", "def parameter\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 75 )\n return_value = ParameterReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal358 = nil\n char_literal361 = nil\n variable_name359 = nil\n variable_name360 = nil\n expression362 = nil\n\n tree_for_char_literal358 = nil\n tree_for_char_literal361 = nil\n stream_STAR = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token STAR\" )\n stream_ASGN = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token ASGN\" )\n stream_expression = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule expression\" )\n stream_variable_name = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule variable_name\" )\n begin\n # at line 746:3: ( '*' variable_name -> ^( SPLAT['*'] variable_name ) | variable_name ( '=' expression -> ^( '=' variable_name expression ) | -> variable_name ) )\n alt_93 = 2\n look_93_0 = @input.peek( 1 )\n\n if ( look_93_0 == STAR )\n alt_93 = 1\n elsif ( look_93_0 == GET || look_93_0 == SET || look_93_0 == MACRO || look_93_0 == EACH || look_93_0.between?( DEF, OBJECT_DEF ) || look_93_0 == ID || look_93_0.between?( T__148, T__150 ) )\n alt_93 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 93, 0 )\n end\n case alt_93\n when 1\n # at line 746:5: '*' variable_name\n char_literal358 = match( STAR, TOKENS_FOLLOWING_STAR_IN_parameter_5277 )\n if @state.backtracking == 0\n stream_STAR.add( char_literal358 )\n end\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_parameter_5279 )\n variable_name359 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n stream_variable_name.add( variable_name359.tree )\n end\n # AST Rewrite\n # elements: variable_name\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 746:24: -> ^( SPLAT['*'] variable_name )\n # at line 746:27: ^( SPLAT['*'] variable_name )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create( SPLAT, '*' ), root_1 )\n\n @adaptor.add_child( root_1, stream_variable_name.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 747:5: variable_name ( '=' expression -> ^( '=' variable_name expression ) | -> variable_name )\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_parameter_5297 )\n variable_name360 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n stream_variable_name.add( variable_name360.tree )\n end\n # at line 748:5: ( '=' expression -> ^( '=' variable_name expression ) | -> variable_name )\n alt_92 = 2\n look_92_0 = @input.peek( 1 )\n\n if ( look_92_0 == ASGN )\n alt_92 = 1\n elsif ( look_92_0 == RPAREN || look_92_0 == COMMA || look_92_0 == PIPE )\n alt_92 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 92, 0 )\n end\n case alt_92\n when 1\n # at line 748:7: '=' expression\n char_literal361 = match( ASGN, TOKENS_FOLLOWING_ASGN_IN_parameter_5305 )\n if @state.backtracking == 0\n stream_ASGN.add( char_literal361 )\n end\n @state.following.push( TOKENS_FOLLOWING_expression_IN_parameter_5307 )\n expression362 = expression\n @state.following.pop\n if @state.backtracking == 0\n stream_expression.add( expression362.tree )\n end\n # AST Rewrite\n # elements: ASGN, expression, variable_name\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 748:22: -> ^( '=' variable_name expression )\n # at line 748:25: ^( '=' variable_name expression )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_ASGN.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_variable_name.next_tree )\n @adaptor.add_child( root_1, stream_expression.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end\n when 2\n # at line 749:22: \n # AST Rewrite\n # elements: variable_name\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 749:22: -> variable_name\n @adaptor.add_child( root_0, stream_variable_name.next_tree )\n\n\n\n return_value.tree = root_0\n\n end\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n 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__, 75 )\n\n end\n \n return return_value\n end", "def apply_variable(scope, ast)\n case ast.name\n when 'PI'\n return scope, \"pi()\"\n when 'E'\n return scope, \"exp(1.0)\"\n end\n end", "def literal_sub(s, fexp, wi)\n\n case s\n when /^\\$(?:variable|var|v):([^{}\\s\\$]+)$/\n fexp.lookup_variable($~[1])\n when /^\\$([^{}:\\s\\$]+)$/, /^\\$(?:field|fld|f):([^{}\\s\\$]+)$/\n Ruote.lookup(wi['fields'], $~[1])\n else\n s\n end\n end", "def find_variable_by_name(name)\n v = @variables.find { |v| v[:argument][:name] == name }\n\n v\n end", "def include_variable?\n @expr.include_variable?\n end", "def intro_to_variables\n expression = \"Ruby is Elegant.\" #Local Varible\n puts expression\nend", "def getVar( name )\n\t\t\t\tArgTest::type( \"name\", name, String )\n\t\t\t\tname.strip!()\n\t\t\t\tArgTest::stringLength( \"name\", name, 1 )\n\t\t\t\treturn @vars[ name ]\n\t\t\tend", "def eval_ex(e)\n case e\n when Symbol\n value = @var_tables.reverse_each.find{|var| break var[e] if var[e] }\n raise \"undefined variable: #{e}\" if value.nil?\n return value\n when Array\n method = e.first\n case method\n when :if0\n if0(e[1], e[2], e[3])\n when :fold\n fold(e[1], e[2], e[3])\n when *OP1\n send(method, e[1])\n when *OP2\n send(method, e[1], e[2])\n else\n raise \"unexpected expression method: #{method.inspect}\"\n end\n when Numeric\n e\n else\n raise \"unexpected expression: #{e.inspect}\"\n end\n end", "def [](variable_name)\n variables.find { |c| c.name == variable_name }\n end", "def _get_var(name)\n\t\treturn @replace_vars[name]\n\tend", "def var_assign_from_args(source, table)\n matches = source.match(/do \\|(.*)\\|/)\n return '' unless matches\n matches[1].scan(/\\w+/).map.with_index { |var_name, i|\n arg = step_arguments[i]\n if arg.nil? && table\n type = 'table'\n value = table\n else\n type = arg.instance_variable_get(:@parameter_type).type rescue (STDOUT.puts $!.inspect; nil)\n value = args[i]\n end\n value =\n case type\n when 'int', 'float'\n value\n when 'table'\n value.rows_hash.pretty_inspect.strip rescue (STDOUT.puts $!.inspect; nil)\n else\n value.inspect\n end\n \"#{var_name} = #{value}\"\n }.join(\"\\n\")\n end", "def parse_expression(expression)\n expression.scan(/\\$\\((\\w+)\\)/).map{|c,*_|c}.uniq\nend", "def variable_declaration\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n return_value = VariableDeclarationReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal77 = nil\n declaration_target76 = nil\n expression78 = nil\n\n tree_for_char_literal77 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 395:5: declaration_target ( '=' expression )?\n @state.following.push( TOKENS_FOLLOWING_declaration_target_IN_variable_declaration_2569 )\n declaration_target76 = declaration_target\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, declaration_target76.tree )\n end\n # at line 395:24: ( '=' expression )?\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0 == ASGN )\n alt_13 = 1\n end\n case alt_13\n when 1\n # at line 395:26: '=' expression\n char_literal77 = match( ASGN, TOKENS_FOLLOWING_ASGN_IN_variable_declaration_2573 )\n if @state.backtracking == 0\n\n tree_for_char_literal77 = @adaptor.create_with_payload( char_literal77 )\n root_0 = @adaptor.become_root( tree_for_char_literal77, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_expression_IN_variable_declaration_2577 )\n expression78 = expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, expression78.tree )\n end\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n 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__, 22 )\n\n end\n \n return return_value\n end", "def insert_variables\n # match all variables, every variable begins with an at (@).\n # variables can also end with a semicolon to have a safe declaration.\n @output = @output.gsub(/\\[{3}(\\w+)\\]{3}/) {\n match = Regexp.last_match[1]\n @variables[match] || \"\"\n }\n end", "def process_lvar(exp)\n lvar = exp.shift\n\n lvar_name = @model.encode_local_variable(lvar)\n raise \"variable not available\" unless @local_variables.include?(lvar_name)\n\n resultify(\"#{lvar_name}\")\n end", "def get_vars( command = nil )\n\t\t# Remove command and split by space.\n\t\tif command.is_a? NilClass\n\t\t\t# No command, so just split\n\t\t\tvars = self.value.split ' '\n\t\telse\n\t\t\tvars = self.value.sub( /#{command} ?/, '' ).split ' '\n\t\tend\n\n\t\tvars.map! do |element|\n\t\t\t# Replace underscores\n\t\t\telement.gsub!('_', ' ')\n\t\t\n\t\t\t# Parse true/false values\n\t\t\tif element.include? 'yes' or element.include? 'true'\n\t\t\t\telement = true\n\t\t\telsif element.include? 'no' or element.include? 'false'\n\t\t\t\telement = false\n\t\t\tend\n\t\t\t# Return to map\n\t\t\telement\n\t\tend\n\t\t\n\t\t# Return element if only 1 exists, else the array\n\t\tvars = vars.length == 1 ? vars.first : vars\n\n\tend", "def variable_declaration\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n return_value = VariableDeclarationReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n\n _last = _first_0 = nil\n char_literal40 = nil\n __ID43__ = nil\n declaration_target41 = nil\n expression42 = nil\n\n tree_for_char_literal40 = nil\n tree_for_ID43 = nil\n\n begin\n # at line 75:3: ( ^( '=' declaration_target expression ) | ID )\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == ASGN )\n alt_9 = 1\n elsif ( look_9_0 == ID )\n alt_9 = 2\n else\n raise NoViableAlternative( \"\", 9, 0 )\n end\n case alt_9\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 75:5: ^( '=' declaration_target expression )\n _save_last_1 = _last = @input.look\n _first_1 = nil\n root_1 = @adaptor.create_flat_list\n _last = @input.look\n char_literal40 = match( ASGN, TOKENS_FOLLOWING_ASGN_IN_variable_declaration_347 )\n\n tree_for_char_literal40 = @adaptor.copy_node( char_literal40 )\n\n root_1 = @adaptor.become_root( tree_for_char_literal40, root_1 )\n\n\n\n match( DOWN, nil )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_declaration_target_IN_variable_declaration_349 )\n declaration_target41 = declaration_target\n @state.following.pop\n\n @adaptor.add_child( root_1, declaration_target41.tree )\n _last = @input.look\n @state.following.push( TOKENS_FOLLOWING_expression_IN_variable_declaration_351 )\n expression42 = expression\n @state.following.pop\n\n @adaptor.add_child( root_1, expression42.tree )\n\n match( UP, nil )\n @adaptor.add_child( root_0, root_1 )\n _last = _save_last_1\n\n\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 76:5: ID\n _last = @input.look\n __ID43__ = match( ID, TOKENS_FOLLOWING_ID_IN_variable_declaration_359 )\n\n tree_for_ID43 = @adaptor.copy_node( __ID43__ )\n\n @adaptor.add_child( root_0, tree_for_ID43 )\n\n\n\n end\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n end\n \n return return_value\n end", "def find what = :var, path = []\n path.inject(self) do |branch, k| \n if what == :var && k == path.last\n branch[:variables][ k ]\n else\n branch = branch[ k ] or raise PathError, path.join(' > ')\n end\n end\n end", "def process_cvar(exp)\n # TODO: we should treat these as globals and have them in the top scope\n name = exp.shift\n return name.to_s\n end", "def extract_route_vars(route_spec)\n return route_spec, [] if route_spec.is_a?(Regexp)\n\n unless route_spec[0,1] == ':' || route_spec.index('/:')\n return route_spec, []\n end\n\n vars = []\n position_counter = 1\n regex_route = route_spec\n route_spec.split('/').each_with_index do |segment, i|\n if segment.include?(':')\n vars << { :position => position_counter, :var => segment.gsub(':', '') }\n position_counter += 2\n regex_route = regex_route.gsub(segment, '(((?!\\bnew\\b).)*)')\n end\n end\n\n reg = Regexp.new(\"^#{regex_route}$\")\n\n return reg, vars\n end", "def variable_by_name(name)\n @var_set[name]\n end", "def process_dvar(exp)\n var = exp.shift\n @env.add var.to_sym, exp.c_type\n return var.to_s\n end", "def interpolate_variables(raw_command)\n raw_command.scan(/[^\\\\]\\$[-_a-zA-Z]+\\$/).each do |match|\n match = match[0..0] == \"$\" ? match : match[1..(match.size - 1)]\n match.strip!\n raw_command.gsub!(match, matched_variable(match))\n end\n raw_command.gsub(\"\\\\$\", \"$\")\n end", "def eval_prog env\n\t\tresults = env.select { |pair| pair[0] == @s }\n\t\tif results.length > 0\n=begin\n for i in 0..results.length-1\n puts results[i][0]\n puts results[i][1]\n puts \"\\n\"\n end\n=end\n results[0][1]\n\t\telse\n\t\t\traise (\"var not found: \" + @s)\n\t\tend\n\tend", "def get(match, expr, value, attr)\n retval = false\n match.each do |m|\n if attr and attr.length > 0\n retval = evaluate_expression(m.attributes[attr], expr, value)\n else\n retval = evaluate_expression(m.text, expr, value)\n end\n break if retval\n end\n return retval\n end", "def test_variable_scope\n @bool_var.eval\n Variable.new_scope 5\n @int_var.eval\n var1 = GetVariableEval.new(\"test\").eval\n var2 = GetVariableEval.new(\"test2\").eval\n assert_equal \"[Y+9]\", var1.value\n assert_equal \"[Y+4]\", var2.value\n end", "def regexp_variables\n return @regexp_variables if @regexp_variables\n @regexp_variables = Array.new\n @base_theme.scan(VARIABLE_MATCHER) { @regexp_variables << $2 }\n @regexp_variables\n end", "def expression\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n value = nil\n\n\n a = nil\n b = nil\n\n\n begin\n # at line 9:28: a= mul ( ADD b= mul | SUB b= mul )*\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_44 )\n a = mul\n @state.following.pop\n # at line 9:33: ( ADD b= mul | SUB b= mul )*\n while true # decision 1\n alt_1 = 3\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0 == ADD )\n alt_1 = 1\n elsif ( look_1_0 == SUB )\n alt_1 = 2\n\n end\n case alt_1\n when 1\n # at line 10:5: ADD b= mul\n match( ADD, TOKENS_FOLLOWING_ADD_IN_expression_51 )\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_55 )\n b = mul\n @state.following.pop\n\n # --> action\n a += b \n # <-- action\n\n\n when 2\n # at line 11:5: SUB b= mul\n match( SUB, TOKENS_FOLLOWING_SUB_IN_expression_63 )\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_67 )\n b = mul\n @state.following.pop\n\n # --> action\n a -= b \n # <-- action\n\n\n else\n break # out of loop for decision 1\n end\n end # loop for decision 1\n\n\n # --> action\n value = a \n # <-- action\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n\n end\n\n return value\n end", "def var name\n Symbolic.check_name name\n var = VarExpr.new(name)\n meta_def name do\n var\n end\n var\n end", "def fetch_expression (exp)\n\n fetch(exp)[0]\n end", "def k_var!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n\n\n type = K_VAR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 357:4: 'var'\n match( \"var\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n\n end", "def lookup_variable(key)\n\n fexp.lookup_variable(key)\n end", "def var_list(variable_name)\n [\"${split(\\\",\\\",var.#{variable_name})}\"]\n end", "def process_gvar(exp)\n gvar = exp.shift\n\n res = \n case gvar.to_s\n when \"$!\"\n # this is a special variable which holds the current exception \n exception_name() \n else\n gvar_name = @model.encode_global_variable(gvar)\n \"(typeof(#{gvar_name})=='undefined'?#{@model.encode_nil}:#{gvar_name})\"\n end\n\n resultify(res)\n end", "def variable_name(method)\n \t_IDENTIFIER12 = nil\n\n\n\n\n \t name = \"\"\n\n\n # 238:7: ( 'this' '.' )? IDENTIFIER\n # 238:7: ( 'this' '.' )?\n alt33 = 2\n # 238:7: ( 'this' '.' )?\n look_ahead33_0 = look_ahead(1)\n\n if look_ahead33_0 == :T58 \n alt33 = 1\n end\n case alt33\n when 1\n # 238:9: 'this' '.'\n match(:T58)\n match(:DOT)\n name << \"this.\"\n end\n _IDENTIFIER12 = @input.look_ahead(1)\n match(:IDENTIFIER)\n\n name << _IDENTIFIER12.text\n method.add_use_of(name, _IDENTIFIER12.line)\n \n\n\n\n end", "def parse_variable_declaration\n type = parse_type_keyword\n name = parse_variable\n\n value = nil\n\n if peek?(:OP_ASSIGNMENT)\n expect(:OP_ASSIGNMENT)\n value = parse_expression\n end\n\n StmtVarDecl.new(type, name, value)\n end", "def eval\n if string_interpolation?\n variables = @value.scan(VARIABLE_NAME).flatten\n values = variables.inject({}) do |hash, var|\n hash[\"@{#{var}}\".to_sym] = @env.lookup(\"@#{var}\").to_s\n hash\n end\n values.each { |k,v| @value.gsub!(k.to_s, v) }\n end\n self\n end", "def process_dasgn(exp)\n dvar = exp.shift\n value = exp.shift\n dvar_name = @model.encode_local_variable(dvar)\n raise \"dynamic variable not available\" unless @current_iter_dvars.include?(dvar_name)\n\n str = without_result do\n want_expression do\n \"#{dvar_name}=#{process(value)}\"\n end\n end\n\n resultify(str)\n end", "def run expr\n result = Matcher.new(expr[\"const\"], expr[\"quant\"]).match\n\n puts \"Match( #{expr[\"const\"]}\"\n puts \"\\t#{expr[\"quant\"]} )\"\n puts\n if result.empty?\n puts \"No valid matches were found.\"\n else\n puts \"Is true with:\"\n result.each do |r|\n puts r.keys.map { |k| \"#{k.to_s} = #{r[k]}\" }.join(\", \")\n end\n end\n puts; puts\nend", "def get_variable(name)\n @variables[name]\n end", "def interpolate_variables(raw_command)\n raw_command.scan(/[^\\\\]\\$[-_a-zA-Z]+\\$/).each do |match|\n match.strip!\n raw_command.gsub!(match, matched_variable(match))\n end\n raw_command.gsub(\"\\\\$\", \"$\")\n end", "def _expression\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_assignment)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_value)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_expression unless _tmp\n return _tmp\n end", "def var!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = VAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 38:7: ( 'a' .. 'z' )+\n # at file 38:7: ( 'a' .. 'z' )+\n match_count_2 = 0\n while true\n alt_2 = 2\n look_2_0 = @input.peek( 1 )\n\n if ( look_2_0.between?( 0x61, 0x7a ) )\n alt_2 = 1\n\n end\n case alt_2\n when 1\n # at line 38:8: 'a' .. 'z'\n match_range( 0x61, 0x7a )\n\n else\n match_count_2 > 0 and break\n eee = EarlyExit(2)\n\n\n raise eee\n end\n match_count_2 += 1\n end\n\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "def gather_vars(executor, tconf, message)\n\n # try to return before a potentially costly call to executor.vars(nid)\n\n return nil if (tconf.keys & %w[ include_vars exclude_vars ]).empty?\n # default behaviour, don't pass variables to taskers\n\n iv = expand_filter(tconf['include_vars'])\n return nil if iv == false\n\n ev = expand_filter(tconf['exclude_vars'])\n return {} if ev == true\n\n vars = executor.vars(message['nid'])\n\n return vars if iv == true\n\n vars = vars.select { |k, v| var_match(k, iv) } if iv\n vars = vars.reject { |k, v| var_match(k, ev) } if ev\n\n vars\n end", "def gen_get_variable(code_array, name)\n if name.kind_of?(JSValue)\n assert(name.type == :identifier)\n name = name.value\n end\n\n res = resolve_variable(name)\n if res\n type, link, idx = res\n if link == 0\n code_array.push(type == :formal ? :INSN_GETFORMAL : :INSN_GETLVAR)\n code_array.push(idx)\n else\n code_array.push(type == :formal ? :INSN_GETFORMALEX : :INSN_GETLVAREX)\n code_array.push(link)\n code_array.push(idx)\n end\n else\n # global variable\n code_array.push(:INSN_GETGLOBAL)\n code_array.push(:INSN_CONST)\n code_array.push(JSValue.new_string(name))\n code_array.push(:INSN_GETPROP)\n end\n end", "def format_variable(v)\n\t if v.kind_of?(Gerber::ApertureMacro::Variable)\n\t\tindex = modifiers.index(v)\n\t\tindex ? \"$#{index}\" : nil\n\t else\n\t\tv.to_s\n\t end\n\tend", "def variable_process(token, evaluation, line, file_read)\n stored_value = variable_checker(token)\n if variable_checker(token).nil?\n error_eval(1, line, token, file_read)\n return false\n else\n evaluation.push(stored_value)\n end\n end", "def all_variables\n\n return nil if @expressions.empty?\n\n @expressions.each_with_object({}) { |exp, h|\n h[exp.fei] = exp.variables if exp.variables\n }\n end", "def extract_template_vars\n return self.command.scan(/{{([a-z0-9\\-_]+?)}}/i).flatten\n end", "def extract_information_for_specific_variable\n reference = @entry.at_xpath('./*/cda:outboundRelationship/cda:criteriaReference',\n HQMF2::Document::NAMESPACES)\n if reference\n ref_id = strip_tokens(\n \"#{HQMF2::Utilities.attr_val(reference, 'cda:id/@extension')}_#{HQMF2::Utilities.attr_val(reference, 'cda:id/@root')}\")\n end\n reference_criteria = @data_criteria_references[ref_id] if ref_id\n # if the reference is derived, pull from the original variable\n if reference_criteria && reference_criteria.definition == 'derived'\n reference_criteria = @data_criteria_references[\"GROUP_#{ref_id}\"]\n end\n return unless reference_criteria\n handle_specific_variable_ref(reference_criteria)\n end" ]
[ "0.69910884", "0.6536794", "0.64713204", "0.6470084", "0.63306314", "0.6091931", "0.605322", "0.5949441", "0.593646", "0.580148", "0.5785296", "0.5775926", "0.5753371", "0.5744721", "0.57291156", "0.56937635", "0.56901443", "0.5671195", "0.56445926", "0.56445926", "0.56445926", "0.5640716", "0.5640716", "0.56370914", "0.56356424", "0.5632843", "0.5622146", "0.56042314", "0.56009793", "0.5598488", "0.5566408", "0.55630296", "0.5558373", "0.55541724", "0.5539342", "0.5524656", "0.552209", "0.550929", "0.55038726", "0.54605496", "0.5433696", "0.5427849", "0.5425631", "0.5421277", "0.5393846", "0.5387755", "0.5375745", "0.53722066", "0.53722066", "0.53722066", "0.5371114", "0.5366187", "0.5357556", "0.5341829", "0.5336951", "0.5336102", "0.5335816", "0.5335558", "0.533189", "0.5305028", "0.52921695", "0.52911407", "0.52756065", "0.5275444", "0.5263301", "0.5249404", "0.5241175", "0.52240235", "0.51958126", "0.51851714", "0.51843935", "0.5172938", "0.51532614", "0.5153052", "0.5144646", "0.5141411", "0.51342887", "0.5124617", "0.5122336", "0.5117631", "0.5107915", "0.510416", "0.5101482", "0.5098566", "0.50953776", "0.5080432", "0.50615853", "0.5057087", "0.50550866", "0.50522894", "0.50511485", "0.5043816", "0.5023994", "0.5023432", "0.5021404", "0.50199807", "0.5018765", "0.5016079", "0.5012731", "0.5011155" ]
0.7523549
0
currently variables are only expanded when surrounded by whitespace or ends of line
def expand_variables # self.tokens = self # var_regex = /^[\w]+$/ # var_regex = /([\s\b])[\w]+([\s\b])/ # expanded = [] # self.tokens.each do |token| # expanded << expand_token(token) # end # @expression = expanded.join(' ') @expression = self.tokens.map do |token| expand_token(token) end.join(' ') # @expression = @expression.split(' ').map do |token| # if !valid_var_name?(token) # return token # elsif is_var?(token) # return get_var(token) # else # @mode = :invalid # @errors << {message: "invalid variable name", info: token} # return token # end # end.join(' ') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_variables() end", "def capture_variables(line)\n noncomment, _ = line.split(\"#\", 2)\n noncomment.scan(/ENV(?:\\[|\\.fetch\\()['\"]([^'\"]+)['\"]/).flatten\n end", "def external_vars(opts={})\n if opts\n opts.each do |k,v|\n if v.include? \",\"\n if v.split(\",\")[0] == \"char\"\n ## default is 40 characters\n if v.split(\",\")[2]\n $external_vars << \"#{v.split(\",\")[0]}* #{k}[#{v.split(\",\")[2].lstrip}];\"\n else\n $external_vars << \"#{v.split(\",\")[0]} #{k}[40] = \\\"#{v.split(\",\")[1].lstrip}\\\";\"\n end\n else\n $external_vars << \"#{v.split(\",\")[0]} #{k} =#{v.split(\",\")[1]};\"\n end\n else\n if v.split(\",\")[0] == \"char\"\n $external_vars << \"#{v.split(\",\")[0]} #{k}[40];\"\n else\n\n $external_vars << \"#{v.split(\",\")[0]} #{k};\"\n end\n end\n # check chars work here\n $external_var_identifiers << k\n end\n end\n end", "def prep_variables\n end", "def assemble\n # var a, b, c;\n \"var \" + @locals.join(\", \") + \";\\n\" +\n @code.join\n end", "def build_vars\n\n end", "def intro_to_variables\n expression = \"Ruby is Elegant.\" #Local Varible\n puts expression\nend", "def expand(str)\n str = str.gsub(/\\$\\{([^}]+)\\}/, '#{\\1}') # ${..} => #{..}\n eval \"\\\"#{str}\\\"\", @placeholders.instance_eval { binding }\n end", "def sub_vars\n # Get list of variables, remove reserved\n get_var_names.each do |var, _sub|\n code.gsub!(var, \"$#{@rig.init_var(var)}\")\n end\n\n code\n end", "def mess_with_vars2(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars2(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def interpolate_variables(raw_command)\n raw_command.scan(/[^\\\\]\\$[-_a-zA-Z]+\\$/).each do |match|\n match.strip!\n raw_command.gsub!(match, matched_variable(match))\n end\n raw_command.gsub(\"\\\\$\", \"$\")\n end", "def interpolate_variables(raw_command)\n raw_command.scan(/[^\\\\]\\$[-_a-zA-Z]+\\$/).each do |match|\n match = match[0..0] == \"$\" ? match : match[1..(match.size - 1)]\n match.strip!\n raw_command.gsub!(match, matched_variable(match))\n end\n raw_command.gsub(\"\\\\$\", \"$\")\n end", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\nend", "def insert_variables\n # match all variables, every variable begins with an at (@).\n # variables can also end with a semicolon to have a safe declaration.\n @output = @output.gsub(/\\[{3}(\\w+)\\]{3}/) {\n match = Regexp.last_match[1]\n @variables[match] || \"\"\n }\n end", "def _reduce_739(val, _values, result)\n _, (id, line) = val\n identifier = id.to_sym\n\n self.env[identifier] = :lvar\n result = [\"&#{identifier}\".to_sym, line]\n\n result\nend", "def mess_with_vars(_one, _two, _three)\n one = 'two'\n two = 'three'\n three = 'one'\nend", "def var_assign_from_args(source, table)\n matches = source.match(/do \\|(.*)\\|/)\n return '' unless matches\n matches[1].scan(/\\w+/).map.with_index { |var_name, i|\n arg = step_arguments[i]\n if arg.nil? && table\n type = 'table'\n value = table\n else\n type = arg.instance_variable_get(:@parameter_type).type rescue (STDOUT.puts $!.inspect; nil)\n value = args[i]\n end\n value =\n case type\n when 'int', 'float'\n value\n when 'table'\n value.rows_hash.pretty_inspect.strip rescue (STDOUT.puts $!.inspect; nil)\n else\n value.inspect\n end\n \"#{var_name} = #{value}\"\n }.join(\"\\n\")\n end", "def _reduce_712(val, _values, result)\n _, (id, line) = val\n identifier = id.to_sym\n\n self.env[identifier] = :lvar\n result = [\"&#{identifier}\".to_sym, line]\n\n result\nend", "def mess_with_vars(one, two, three)\n one = \"two\"\n two = \"three\"\n three = \"one\"\n return one, two, three\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\",\"two\")\n two.gsub!(\"two\",\"three\")\n three.gsub!(\"three\",\"one\")\nend", "def lex_en_expr_variable=(_arg0); end", "def lex_en_expr_variable=(_arg0); end", "def lex_en_expr_variable=(_arg0); end", "def expand s, evars\n return unless s\n\n ns = s.clone\n t = @vars.merge(evars)\n\n for var in t.keys do\n p = t[var]\n if p.respond_to? :call\n p = p.call(var)\n end\n\n ns.gsub!(var, p)\n end\n\n ns\n end", "def mess_with_vars(one, two, three)\n one.gsub!(\"one\", \"two\")\n two.gsub!(\"two\", \"three\")\n three.gsub!(\"three\", \"one\")\nend", "def variable_name_expr; end", "def set_variables(activity, line_num, file_read)\n val = activity[0].upcase.ord\n return could_not_eval(line_num) unless check_variables([activity[0]])\n if activity[1].nil?\n puts \"Line #{line_num}: operator LET applied to empty stack\"\n error_eval(2, line_num, nil, file_read)\n else\n activity.shift\n store = evaluate_expression(activity, line_num, file_read)\n $user_variables[val - 65] = store unless store.nil?\n end\n end", "def gather_call_parms( line, p )\n\n return if line.length < 2 #empty line, just a \\n\n\n _line = line[7..71]\n\n if _line =~ / USING +.*$/\n $&.split.each do |parm|\n p << parm.tr( \"\\.\", '' )\n end\n else # we've past the USING phrase\n _line.split.each do |parm|\n p << parm.tr(\"\\.\", '')\n end\n end\n print \"DEBUG: gather_call() > #{p}\\n\" \n\n $stmt_ends_in_dot = true if endof_curr_stmt?( _line )\nend", "def lex_en_expr_variable; end", "def lex_en_expr_variable; end", "def lex_en_expr_variable; end", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars(one, two, three)\n one = two\n two = three\n three = one\nend", "def mess_with_vars1(one, two, three)\n one = two\n two = three\n three = one\nend", "def variables; end", "def variables; end", "def showvars(x,y)\n \"x = #{x}\\ny = #{y}\"\nend", "def _reduce_598(val, _values, result)\n _, (id, line) = val\n identifier = id.to_sym\n\n self.env[identifier] = :lvar\n result = [\"&#{identifier}\".to_sym, line]\n\n result\nend", "def expanded; end", "def custom_expand(val, conf)\r\n val.gsub!(/\\$\\(([^()]+)\\)/) do |var|\r\n key = $1\r\n if CONFIG.key? key\r\n custom_expand(conf[key], conf)\r\n else\r\n var\r\n end\r\n end\r\n val\r\n end", "def _reduce_542(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def inline_variables( command )\n\t\tpairs = command.scan( ENV_VARIABLE_REGEX )\n\t\treturn Hash[ *pairs.flatten ]\n\tend", "def preprocessor_expand str, definitions\n while definitions.has_key? str\n str = definitions[str].to_s\n end\n str\n end", "def alignAssignments(theLines)\n\n\tsplitAndAlign(theLines, /^(.*?)\\s+= (.*[^\\\\])$/, \"= \");\n\nend", "def expand_placeholders(text)\n text \\\n .gsub(\"REPO_NAME\", repo_name) \\\n .gsub(\"BRANCH_NAME\", @branch_name) \\\n .gsub(\"FILE_NAMES\", @file_names) \\\n .gsub(\"FILE_DIFFS\", @file_diffs)\n end", "def replaceVars(iLine)\n rResult = iLine.clone\n\n if (defined?(@ContextVars))\n @ContextVars.each do |iVariable, iValue|\n rResult.gsub!(\"%{#{iVariable}}\", iValue)\n end\n rResult.gsub!('%%', '%')\n end\n\n return rResult\n end", "def mess_with_vars(one, two, three)\n one.gsub!('one', 'two')\n two.gsub!('two', 'three')\n three.gsub!('three', 'one')\nend", "def env(variable_name, variable_value, &block); end", "def strict_variables=(_arg0); end", "def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def alignDefineValue(theLines)\n\n\tsplitAndAlign(theLines, [/^(\\s*#define \\w+)\\s+(.*?)$/,\n\t\t\t\t\t\t\t /^(\\s*#define \\w+\\(.*?\\))\\s+(.*?)$/], \"\");\n\nend", "def line_clean_up(x)\n\t\tx=x.lstrip\n\t\tx=x.gsub(/[a-zA-Z\\]\\'\\\"{\\d]+=[a-zA-Z\\[\\'\\\"{\\d]+/){|x| x.split(\"=\").join(\" = \")}\n\t\t#or equal is failing to work in the same way\n\t\t#x=x.gsub(/[a-zA-Z\\]\\'\\\"{\\d]+=[a-zA-Z\\[\\'\\\"{\\d]+/){|x| x.split(\"||=\").join(\" ||= \")}\n\t\treturn x\n\tend", "def _reduce_603(val, _values, result)\n _, (id, line) = val\n identifier = id.to_sym\n\n self.env[identifier] = :lvar\n result = [\"&#{identifier}\".to_sym, line]\n\n result\nend", "def _reduce_603(val, _values, result)\n _, (id, line) = val\n identifier = id.to_sym\n\n self.env[identifier] = :lvar\n result = [\"&#{identifier}\".to_sym, line]\n\n result\nend", "def process_variable_assignment\n regex = %r{(?<name>\\w+)( = )(?<expression>.*$)}\n match = @input.match(regex)\n\n if match\n @name = match.named_captures[\"name\"]\n @expression = match.named_captures[\"expression\"]\n end\n end", "def cvars; end", "def _reduce_580(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def _reduce_580(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def _reduce_580(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "def rename_local_variable\n # Start on either 'asdf', and do viw<leader>rrlv\n asdf = 10\n p asdf\n # TODO: make this work without 'v'\nend" ]
[ "0.6537794", "0.63158387", "0.6120582", "0.610311", "0.60432076", "0.6039906", "0.60265493", "0.5985823", "0.5981582", "0.596007", "0.596007", "0.59542567", "0.59515023", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.59330624", "0.5890355", "0.58724654", "0.58295405", "0.5829129", "0.58162165", "0.5783492", "0.5771651", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57278216", "0.57153654", "0.57153654", "0.57153654", "0.5709247", "0.5707401", "0.56991076", "0.56879187", "0.5685538", "0.56757003", "0.56757003", "0.56757003", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.56736934", "0.565318", "0.5646463", "0.5646463", "0.5646202", "0.5633976", "0.5628409", "0.5627287", "0.56178796", "0.561415", "0.5606498", "0.55999064", "0.5591061", "0.5576082", "0.5572611", "0.5563285", "0.55485684", "0.55279183", "0.55279183", "0.55279183", "0.5520772", "0.5516157", "0.5513775", "0.5513775", "0.5512815", "0.5504774", "0.54874074", "0.54874074", "0.54874074", "0.5483625" ]
0.69487417
0
remove leading and trailing whitespace from expression
def trim_whitespace @expression.strip! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rstrip\r\n match = rewrite(/\\s+\\z/)\r\n match ? match[0] : ''\r\n end", "def undent\n gsub /^.{#{slice(/^ +/).length}}/, ''\n end", "def strip_whitespace!\n replace(self.strip_whitespace)\n end", "def trim\n self.gsub(/^\\s+/,'').gsub(/\\s+$/,'')\n end", "def trim_whitespace; end", "def rstrip!\n erase! @result.length - 1 - (@result.rindex(/[^\\s]/) || -1)\n end", "def rstrip!() end", "def rstrip() end", "def dewhitespace\n gsub(/\\s+/,' ').strip\n end", "def strip\n lambda do |rec, acc|\n acc.collect! do |v|\n # unicode whitespace class aware\n v.sub(/\\A[[:space:]]+/,'').sub(/[[:space:]]+\\Z/, '')\n end\n end\n end", "def lstrip\n `return self.replace(/^\\s*/, '');`\n end", "def lstrip\n `return self.replace(/^\\s*/, '');`\n end", "def strip(s)\n s.gsub(/^\\s+/, '').gsub(/\\s+$/, '')\n end", "def strip_whitespace\n code.gsub!(WHITESPACE_REGEX, ' ')\n\n code\n end", "def evaporate\n self.gsub(/\\s/, '')\n end", "def strip_leading_whitespace(text)\n return text if text.empty?\n leading_spaces = text.lines.first[/^(\\s+)/, 1]\n text.gsub(/^#{leading_spaces}/, '')\n end", "def strip!() end", "def strip() end", "def remove_trailing_spaces(source)\n for_outstrings_of(source) do |str|\n str.gsub! /\\s+/im, ' '\n str.gsub! /\\s*(=|\\+|\\-|<|>|\\?|\\|\\||&&|\\!|\\{|\\}|,|\\)|\\(|;|\\]|\\[|:|\\*|\\/)\\s*/im, '\\1'\n str.gsub! /;(\\]|\\)|\\}|\\.|\\?|:)/, '\\1' # removing wrong added semicolons\n str.gsub /([^\\d\\w_\\$]typeof)\\s+([\\w\\d\\$_]+)/, '\\1(\\2)'\n end\n end", "def whitespace_fixup(text)\n text.andand.gsub(/\\r/, \"\")\n end", "def strip_space!\n replace self.gsub(/:\\s*/, \":\").gsub(/\\n/, \"\").gsub(/\\s+/, \" \").gsub(/(\\/\\*).*?(\\*\\/)/, \"\")\n end", "def trim_whitespace=(_arg0); end", "def whitespace_fixup(text)\n text.andand.gsub(/\\r/, \"\")\n end", "def strip_side_space!\n replace self.gsub(/^\\s+/, \"\").gsub(/\\s+$/, $/)\n end", "def strip_leading_whitespace(str)\n str.gsub(/^(\\s+)/, '').gsub(/^->/, '')\n end", "def whitespace\n @input = @input.gsub(/\\ +/, ' ').strip\n end", "def space_out\n gsub(/(.)/, ' \\1')\n end", "def compact_whitespace s\n s.gsub(/\\s+/, ' ').gsub(/>\\s</, '><').strip\n end", "def lstrip!() end", "def lstrip() end", "def reduce_no_whitespace(_production, _range, _tokens, _children)\n char_shorthand('S')\n end", "def trimming_for_diff_text(code)\n # gsub(/^\\s*$/, '') means remove empty lines\n code.strip.gsub(/^\\s*$/, '')\n end", "def strip_trailing_whitespace(code)\n code.gsub(/[ \\t]+$/, '')\n end", "def strip_surrounding_empty_lines(str)\n str.sub(/\\A[[:space:]]*^/, \"\")\n .sub(/$[[:space:]]*\\z/, \"\")\n end", "def clean( input )\n input.gsub( %r/\\s+/, '' )\n end", "def clean_whitespace(a)\n\n a.gsub(\"\\r\", ' ').gsub(\"\\n\", ' ').squeeze(\" \").strip\n\nend", "def clean_whitespace(a)\n\n a.gsub(\"\\r\", ' ').gsub(\"\\n\", ' ').squeeze(\" \").strip\n\nend", "def tighten\n gsub(/[\\t ]+/,' ').strip\n end", "def rsstrip!(str)\n str = Regexp.quote(str)\n self.gsub!(/(#{str})+$/, '')\n end", "def remove_expression(expression)\n \n end", "def clean_whitespace(a)\n a.gsub(\"\\r\", ' ').gsub(\"\\n\", ' ').squeeze(\" \").strip\nend", "def clean_whitespace(a)\n a.gsub(\"\\r\", ' ').gsub(\"\\n\", ' ').squeeze(\" \").strip\nend", "def normalize_whitespace(input); end", "def no_space(x)\n # code go here\n x.gsub(' ', '')\nend", "def trim(node)\n if (extra_comma = /(?<trail>,\\s*[\\]}]\\s*)$/.match(node))\n node.sub(extra_comma[:trail],\n extra_comma[:trail]\n .slice(1, node.length.pred)\n .sub(/^\\s/, \"\\n\"))\n else node\n end\n end", "def no_space(x)\n x.gsub(\" \", \"\")\nend", "def reduce_whitespace(_production, _range, _tokens, _children)\n char_shorthand('s')\n end", "def trimmed_whitespace(text)\n text.gsub(/[\\t\\n\\f\\r ]+/ium, ' ')\n end", "def on_call_normalize_space(context, expression = nil)\n str = on_call_string(context, expression)\n\n return str.strip.gsub(/\\s+/, ' ')\n end", "def remove_leading_and_trailing_whitespace(text)\n pre_blocks = text.split(DO_NOT_TOUCH_WHITESPACE)\n\n output = []\n pre_blocks.each.with_index do |block, index|\n if index % 2 == 0\n output << block.gsub(/[ \\t]*\\n[ \\t]*/im, \"\\n\").gsub(/ *\\t */im, \"\\t\")\n else\n output << block\n end\n end\n\n output.join\n end", "def normalize_whitespace(text)\n text.to_s.gsub(/[[:space:]]+/, ' ').strip\n end", "def normalize_source(source)\n source.chop.gsub(/\\s*\\n\\s*/, ' ')\n end", "def strip_whitespace\n self.pattern = pattern.strip unless pattern.nil?\n self.archive_directory = archive_directory.strip unless archive_directory.nil?\n end", "def normalize_whitespace!\n @raw.gsub!(/\\s+/, ' ')\n end", "def line_clean_up(x)\n\t\tx=x.lstrip\n\t\tx=x.gsub(/[a-zA-Z\\]\\'\\\"{\\d]+=[a-zA-Z\\[\\'\\\"{\\d]+/){|x| x.split(\"=\").join(\" = \")}\n\t\t#or equal is failing to work in the same way\n\t\t#x=x.gsub(/[a-zA-Z\\]\\'\\\"{\\d]+=[a-zA-Z\\[\\'\\\"{\\d]+/){|x| x.split(\"||=\").join(\" ||= \")}\n\t\treturn x\n\tend", "def normalize_whitespace(input)\n input.to_s.gsub(%r!\\s+!, \" \").tap(&:strip!)\n end", "def pre_proccess(text)\n text.to_s.strip.gsub(/[[:space:]]+/, ' ').gsub(/\\s{2,}/, ' ')\n end", "def whitespace_to!(separator)\n substitute!(/[[:space:]]+/, separator)\n end", "def sstrip!(str)\n str = Regexp.quote(str)\n self.gsub!(/^(#{str})+|(#{str})+$/, '')\n end", "def remove_whitespace\n # NOTE: According to the docs, \\s only matches [ \\t\\r\\n\\f], i.e. it does not\n # match e.g. non-breaking space (&nbsp). The POSIX character class\n # [[:space:]] does match non-breaking space. This is relevant because\n # in Heroku, space in ENV variables might be translated as &nbsp.\n # DOC: http://ruby-doc.org/core-2.5.1/Regexp.html#class-Regexp-label-Character+Classes\n # SOURCE: http://stackoverflow.com/a/13288542\n gsub(/[[:space:]]/, '')\n end", "def strip_trailing_whitespace(text)\n text.split(\"\\n\").collect(&:strip).join(\"\\n\")\n end", "def rstrip_except_escapes(string)\n string.sub(/(?<!\\\\)\\s+$/, '')\n end", "def sans_whitespace_and_commas\n @str.gsub(' ', '').gsub(',', '')\n end", "def trim(**props)\n transform(type: :trim, **props) do |value|\n if value\n value = value.strip\n value = nil if value.empty?\n end\n value\n end\n end", "def trim_all_whitespace(text)\n text.to_a.map do |line|\n left_spacing(line) + line.squeeze(\" \").squeeze(\" \").lstrip #the 2. is a tab\n end.join\n end", "def remove_whitespace\n self.name = self.name.strip\n self.phone = self.phone.strip\n end", "def strip_trailing_whitespace\n %w( title abstract year ).each {|attribute|\n self.send(attribute).to_s.strip!\n }\n end", "def squish!\n gsub!(/\\A[[:space:]]+/, '')\n gsub!(/[[:space:]]+\\z/, '')\n gsub!(/[[:space:]]+/, ' ')\n self\n end", "def squish!\n gsub!(/\\A[[:space:]]+/, '')\n gsub!(/[[:space:]]+\\z/, '')\n gsub!(/[[:space:]]+/, ' ')\n self\n end", "def remove_spaces\n @number = @number.gsub(/\\s+/, '')\n end", "def no_space(x)\n x.delete(' ')\nend", "def strip_naked\n return self if blank?\n self.downcase.strip.gsub(/([\\s]{2,})/, ' ')\n end", "def strip!\n \"\"\n end", "def remove_returns_and_spaces(file_contents)\n clean_file =\n file_contents\n .gsub!(/\\n+/, '')\n .gsub!(/(\\s+)(?![^<])/, '')\n\n clean_file\n end", "def squish!\n gsub!(/[[:space:]]+/, \" \")\n strip!\n self\n end", "def strip!\n acc = 0\n new_te = self.text_elements.drop_while { |te|\n te.text == ' ' && acc += 1\n }\n self.left += self.text_elements.take(acc).inject(0) { |m, te| m += te.width }\n self.text_elements = new_te\n\n self.text_elements.reverse!\n acc = 0\n new_te = self.text_elements.drop_while { |te|\n te.text == ' ' && acc += 1\n }\n self.right -= self.text_elements.take(acc).inject(0) { |m, te| m += te.width }\n self.text_elements = new_te.reverse\n self\n end", "def lsstrip!(str)\n str = Regexp.quote(str)\n self.gsub!(/^(#{str})+/, '')\n end", "def scrub\n self.gsub(/[^a-zA-Z\\s0-9\\.]/, '').gsub(/\\t/, ' ').gsub(/\\r/, ' ').gsub(/\\s\\s/, '').lstrip.rstrip\n end", "def clean t\n # line feed should be removed also\n !t ? '' : t.gsub(\"\\n\",' ').gsub(\"\\t\",' ').strip.gsub(/\\s\\s+/,' ')\nend", "def remove_whitespace(dirty_name)\n \n return dirty_name.split(' ').join(\" \") \n \n end", "def kill_leading_whitespace!(s)\n if s.is_a?(Array)\n s.map{|i| kill_leading_whitespace!(i)}\n else\n s.gsub!(/^ */,\"\").chomp\n s.gsub!(/\\A\\n/,\"\")\n s.gsub!(/\\n\\z/,\"\")\n s\n end\n end", "def kill_leading_whitespace!(s)\n if s.is_a?(Array)\n s.map{|i| kill_leading_whitespace!(i)}\n else\n s.gsub!(/^ */,\"\").chomp\n s.gsub!(/\\A\\n/,\"\")\n s.gsub!(/\\n\\z/,\"\")\n s\n end\n end", "def strip_selector_space!\n replace self.gsub(/\\n/, \"\").gsub(\",\", \", \").gsub(\", \", \", \")\n end", "def remove_whitespace( answer_string )\n if @whitespace.nil?\n answer_string\n elsif [:strip, :chomp].include?(@whitespace)\n answer_string.send(@whitespace)\n elsif @whitespace == :collapse\n answer_string.gsub(/\\s+/, \" \")\n elsif [:strip_and_collapse, :chomp_and_collapse].include?(@whitespace)\n result = answer_string.send(@whitespace.to_s[/^[a-z]+/])\n result.gsub(/\\s+/, \" \")\n elsif @whitespace == :remove\n answer_string.gsub(/\\s+/, \"\")\n else\n answer_string\n end\n end", "def normalize_whitespace(line)\n line.gsub(/\\s+/, ' ')\n end", "def remove_whitespace(ooxml)\n ooxml.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\nend", "def squish\n self.gsub(/[\\n\\t]/, '').squeeze(' ').strip\n end", "def strong_strip\n reverse.gsub(/^\\p{Zs}+|^\\p{Cf}+/, '').reverse.gsub(/^\\p{Zs}+|^\\p{Cf}+/, '')\n end", "def strip_unwanted!(filter)\n substitute!(filter, '')\n end", "def strip_all_spaces(text)\n text&&text.gsub(/&nbsp;|\\xC2\\xA0|\\xA0/, ' ').strip\n end", "def strip(str); end", "def remove_mid_expression_newlines\n scan_tokens do |prev, token, post, i|\n next 1 unless post && EXPRESSION_CLOSE.include?(post[0]) && token[0] == \"\\n\"\n @tokens.delete_at(i)\n next 0\n end\n end", "def strip_lines(value)\n value.to_s.gsub(/\\n\\s*/, ' ')\n end", "def squash(text)\n return text.scrub.gsub(/[[:space:]]+/, ' ').strip\nend", "def auto_trim!; end", "def strip_regex_from(value)\n value.gsub(/^\\/|\\/$/,'')\n end", "def strip_squeeze\n strip.squeeze(\" \")\n end", "def remove_whitespace\n self.first_name = self.first_name.strip\n self.last_name = self.last_name.strip\n self.biography = self.biography.strip\n end", "def restore_spaces\n gsub(/(?<=\\S)(_|\\.)(?=\\S)/, ' ')\n end", "def force_strip(str)\n str[0] = \"\"\n end" ]
[ "0.7307711", "0.7171218", "0.70892143", "0.7087", "0.70736927", "0.7025794", "0.69583726", "0.69527805", "0.6921175", "0.69098747", "0.6826063", "0.6826063", "0.68033904", "0.67857105", "0.67702067", "0.6761271", "0.6749779", "0.67470104", "0.67125535", "0.67108345", "0.67066157", "0.6675144", "0.66688764", "0.66388005", "0.66199267", "0.6590795", "0.6546461", "0.65231484", "0.6518579", "0.65044224", "0.6479901", "0.64775634", "0.64769155", "0.6440592", "0.64347917", "0.6414264", "0.6414264", "0.64124125", "0.6402096", "0.63919336", "0.6365562", "0.6365562", "0.63550186", "0.635216", "0.6296819", "0.629638", "0.6286514", "0.6286462", "0.62861675", "0.6256019", "0.6239166", "0.6238459", "0.6235648", "0.6232699", "0.62116724", "0.62092346", "0.6206556", "0.6199048", "0.61971986", "0.6196298", "0.61925524", "0.6168215", "0.6165825", "0.61592495", "0.61529785", "0.61300075", "0.61275524", "0.61097157", "0.61097157", "0.6104786", "0.6100661", "0.6097563", "0.6086259", "0.60689497", "0.60680693", "0.6066974", "0.605491", "0.6050074", "0.6049524", "0.60466534", "0.60383236", "0.60383236", "0.60378563", "0.6036246", "0.60126334", "0.6004552", "0.59905064", "0.59867525", "0.5974719", "0.5973877", "0.5963109", "0.59615403", "0.5957765", "0.5957122", "0.5942795", "0.59425235", "0.5928164", "0.5913626", "0.5906216", "0.5880852" ]
0.8477355
0
if nonblank expression is invalid then mark mode as :invalid
def validate # @expression && [email protected]? if !@expression || @expression.blank? return elsif !Calculator.valid?(@expression) @expression = nil @mode = :invalid end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate!\n # Expression must be present.\n if expression.to_s.length == 0\n raise SkyDB::Query::ValidationError.new(\"Invalid expression for selection group: '#{expression.to_s}'\")\n end\n end", "def match_regex\n if !self.value.blank? && self.regex\n errors.add(:value, 'is a invalid value') unless self.value =~ Regexp.new(self.regex)\n end\n end", "def valid?(_) true end", "def valid?(_) true end", "def invalid; end", "def valid?\n @expression.valid?\n end", "def literal_validation; end", "def literal_validation; end", "def setInvalid()\n\t\t@isValid = false\n\tend", "def invalid\n @invalid\n end", "def invalid?\n not valid?\n end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def test_invalid_logic\n owner = people(:valid_person)\n rule = Rule.new(:person_id=>owner.id,\n :rule_name=>\"test\",\n :state=>\"active\",\n :logic=>\"aaaaaand\")\n assert !rule.valid?\n # The logic field should have validation errors\n assert rule.errors[:logic].any?\n end", "def check_regex value, validator\n return unless regexp? value\n\n regex = value.value\n unless secure_regex?(regex)\n warn :model => @current_model,\n :warning_type => \"Format Validation\",\n :warning_code => :validation_regex,\n :message => \"Insufficient validation for '#{get_name validator}' using #{regex.inspect}. Use \\\\A and \\\\z as anchors\",\n :line => value.line,\n :confidence => :high\n end\n end", "def invalid?\n !@valid\n end", "def validate\n @invalid=false\n end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?; end", "def valid?; end", "def invalid?\n !valid?\n end", "def invalid?\n !valid?\n end", "def validate expression, types, pname\n raise_without_self \"#{pname} should not be nil!\", HOWT unless expression\n \"#{pname} should not be empty!\" if expression.to_s.empty?\n unless types.include? expression.class\n raise_without_self \"#{pname} should be #{types} but is '#{expression.class.name}'!\", HOWT\n end\n end", "def validate\r\n @invalid=false\r\n end", "def validate_regex_validation()\n if self.regex_validation != nil\n begin\n re = Regexp.new( self.regex_validation )\n rescue RegexpError\n errors.add( :regex_validation, \"is invalid.\" )\n end\n end\n end", "def check_username_format\n errors.add(:username, \"is not a valid username\") unless username =~ Handle.validation_regex\n end", "def test_invalid_with_empty_rule_name_or_state_or_logic\n owner = people(:valid_person)\n rule = Rule.new(:person_id => owner.id)\n assert !rule.valid?\n # The rule_name field should have validation errors\n assert rule.errors[:rule_name].any?\n # The state field should have validation errors\n assert rule.errors[:state].any?\n # The logic field should have validation errors\n assert rule.errors[:logic].any?\n end", "def invalid?\n @invalid\n end", "def is_valid; end", "def complete_expression?(str); end", "def triple_expression?; false; end", "def investigate_invalid_values!\n invalids = @pattern.split(/,|\\/|\\-/).uniq.collect do |value|\n value unless self.class.allowed_values.to_a.include?(value.upcase)\n end.compact\n invalids.delete(\"*\")\n\n err = nil\n if invalids.include?('') || invalids.include?(' ')\n err = \"#{field_name} field's pattern is invalid, please run:\n '#{self.class}.allowed_values' to know valid values\".squish\n elsif invalids.any?\n err = \"value: '#{invalids.join(', ')}' not allowed for '#{field_name}'\n field, run: '#{self.class}.allowed_values' to know valid values\".squish\n end\n raise self.invalid_field_error_class.new(err) if err\n end", "def assert_not_blank(expression)\n assert_false expression.blank?\n end", "def name_is_valid\n errors.add(:name,'Invalid empty string for name.') unless name_is_valid?\n end", "def value_valid?\n return true\n end", "def be_invalid_with(attribute, *values)\n BeInvalidWith.new(attribute, values)\n end", "def invalid?\r\n return @invalid\r\n end", "def call(value)\n if regex !~ value\n raise ValidationError.new(@message, code, regex: regex)\n end\n end", "def validation_regex\n /\\s*validates(?:\\s+|_\\w+\\s+)(?:\\S|\\s)+/\n end", "def valid?(value)\n true\n end", "def valida_titulo\n errors.add_to_base 'avisotitulo' if tituloes.blank? and titulofr.blank? \nend", "def vdate_pin(attr)\nvalidates_presence_of attr , :message => \"^Please Fill #{attr}\"\nvalidates_format_of attr , :with => /^\\d{6}$/ ,\n :message => \"^invalid #{attr}, #{attr} is 6 digit number\"\nend", "def invalid?\n return @invalid\n end", "def name_valid_format\n if name.present? and not name.match(/[\\w]+([\\s]+[\\w]+){1}+/)\n errors.add :name , \"must be seperated by space and should not contain any special characters.\"\n end\n end", "def invalid?(&_block)\n end", "def invalid?(attribute)\n !@errors[attribute.to_sym].nil?\n end", "def invalid?(attribute)\n !@errors[attribute.to_sym].nil?\n end", "def invalid\n puts \"Invalid entry, please try again.\"\n end", "def check_regex\n return true if resource_type_attribute.nil?\n\n regex = resource_type_attribute.validation_regex\n res = true\n if !regex.blank? and !value.blank?\n res = value.match(regex)\n end\n\n return res\n end", "def valid?\n false\n end", "def valid?\n false\n end", "def validate_each(record, attribute, value)\n unless value.blank?\n unless value =~ VALID_MASK\n if value =~ /\\A[^a-z]/i\n record.errors[attribute] << (options[:message] || 'must start with a letter')\n elsif value =~ /_\\z/\n record.errors[attribute] << (options[:message] || 'must not end with an underscore')\n else\n record.errors[attribute] << (options[:message] || 'must contain only letters, numbers, and underscore')\n end\n end\n end\n end", "def validate \n errors.add(:email, \"must be valid.\") unless email.include?(\"@\") \n if account.include?(\" \") \n errors.add(:account,\"cannot include spaces.\") \n end \n end", "def perform\n @invalid_instruction =\n @instructions.detect do |instruction|\n instruction.match(@regexp).nil?\n end\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def validate!\n private_methods.select{ |m| m =~ /^validate_[a-z0-9_]+\\!$/ }.each{ |v| \"#{v}\"; send(v) }\n @nested_expression.each(&:validate!)\n\n true\n end", "def setting_validations\n errors.add(:value, I18n.t(:blank, :scope => 'activerecord.errors.messages')) if validators['presence'] && ['1','true',true].include?(validators['presence']) && self.value.nil?\n errors.add(:value, I18n.t(:inclusion, :scope => 'activerecord.errors.messages')) if valid_values && !valid_values.include?(self.value)\n errors.add(:value, I18n.t(:invalid, :scope => 'activerecord.errors.messages')) if validators['format'] && !(Regexp.new(validators['format']) =~ self.value)\n end", "def allow_value_matcher; end", "def invalid?(attribute)\n !@errors[attribute.to_s].nil?\n end", "def invalid?(attribute)\n !@errors[attribute.to_s].nil?\n end", "def test_invalid_state\n owner = people(:valid_person)\n rule = Rule.new(:person_id=>owner.id,\n :rule_name=>\"test\",\n :state=>\"aaaactive\",\n :logic=>\"and\")\n assert !rule.valid?\n # The state field should have validation errors\n assert rule.errors[:state].any?\n end", "def test(value, attributes)\n value.blank? || value =~ pattern\n end", "def test_invalid_grouping_value\n religion_obj = Religion.new(:grouping => 'Religious < Philosophy', :name => 'Freethinker')\n assert !religion_obj.valid?\n assert religion_obj.errors.invalid?(:grouping)\n end", "def is_valid\n\tend", "def is_valid\n\tend", "def validate_each(record, attribute, value)\n return if value.blank? || value&.match?(MOBILE_REGEX)\n\n record.errors.add(attribute, :is_invalid)\n end", "def skip_validations\n true\n end", "def invalid?(attribute)\n !@errors[attribute.to_s].nil?\n end", "def validate!\n # Expression must be present unless this is a COUNT().\n if expression.to_s.length == 0 && aggregation_type != :count\n raise SkyDB::Query::ValidationError.new(\"Invalid expression for selection field: '#{expression.to_s}'\")\n end\n end", "def last_name_is_valid\n errors.add(:last_name,'Invalid empty string for last name.') unless last_name_is_valid?\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def marked_invalid?\n @marked_invalid\n end", "def valid; end", "def valid?\n not invalid?\n end", "def name_is_valid\n errors.add(:name,\"Invalid string for name.\") unless name_is_valid?\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def valid?\n false\n end", "def end_time_is_valid\n errors.add(:end_time,'Invalid empty string for end time.') unless end_time_is_valid?\n end", "def test_invalid_with_blank_attributes\n offer = Offer.new\n assert !offer.valid?\n assert !offer.errors.invalid?(:saleman_id)\n assert offer.errors.invalid?(:name)\n assert !offer.errors.invalid?(:name_normalized)\n assert offer.errors.invalid?(:amount)\n assert offer.errors.invalid?(:deal_date)\n assert offer.errors.invalid?(:customer_id)\n assert !offer.errors.invalid?(:description)\n assert offer.errors.invalid?(:status_id)\n assert !offer.errors.invalid?(:weight)\n assert !offer.errors.invalid?(:description_normalized)\n assert !offer.errors.invalid?(:delta)\n end", "def validate_format(attribute_name, format, message = nil)\n value = attributes[attribute_name]\n if value && !(format =~ value)\n append_error(attribute_name, message || :is_invalid)\n end\n end", "def _validate(record, pattern)\n\t\trecord.errors[:contact_data] << \"(#{record.contact_data}) is not valid\" unless\n\t\t\t!record.contact_data.nil? and \\\n\t\t\t!record.contact_data.empty? and \\\n\t\t\trecord.contact_data =~ pattern\n\tend", "def validate_regex\n if !company.nil? && company.allow_email_regex == true\n # if email =~ /#{company.email_format}/i\n if email =~ /^([^@\\s]+)@((?:#{company.email_format}))$/i\n true\n else\n errors.add(:email, ' format not match')\n end\n else \n return true\n end\n end", "def is_valid\n return true\n end", "def validator=(_); end", "def validate_display_name\nif ! validate_a_display_name( self.display_name )\nerrors.add( :display_name , \"Invalid display name (see RFC 3261).\" )\nend\nend", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def setting_validations\n if errors.empty?\n errors.add(:value, :blank) if validators['presence'] && ['1','true',true].include?(validators['presence']) && self.value.nil?\n errors.add(:value, :inclusion) if valid_values && !valid_values.include?(self.value)\n errors.add(:value, :invalid) if validators['format'] && !(Regexp.new(validators['format']) =~ self.value)\n end\n end", "def expression?\n !@no_expression\n end", "def validate_each(record, attribute, value)\n # Already validated by the presence validator.\n return if value.nil?\n return if value =~ NAME_REGEXP\n\n record.errors[attribute] << \"can only contain lower case alphanumeric \"\\\n \"characters, with optional underscores and dashes in the middle.\"\n end", "def valid?\n !invalid?\n end", "def not_valid_message; nil; end", "def not_valid_message; nil; end", "def is_valid?\n end" ]
[ "0.628122", "0.62244105", "0.62024724", "0.62024724", "0.61063355", "0.60719776", "0.6065709", "0.6065709", "0.6015074", "0.5882369", "0.57849026", "0.57636803", "0.57636803", "0.57636803", "0.57636803", "0.57636803", "0.57636803", "0.5759746", "0.5747975", "0.574058", "0.5720396", "0.5698555", "0.569251", "0.569251", "0.569251", "0.569251", "0.569251", "0.5669637", "0.5669637", "0.56606007", "0.5656161", "0.564312", "0.5623702", "0.56157535", "0.5603248", "0.5577465", "0.5575046", "0.5566102", "0.5558914", "0.554936", "0.55390483", "0.5516595", "0.5493836", "0.54624516", "0.54587466", "0.54425955", "0.54325557", "0.5425662", "0.54244304", "0.5418097", "0.5415579", "0.5395027", "0.53922015", "0.53922015", "0.5390586", "0.5380811", "0.5376842", "0.5376842", "0.537557", "0.5370981", "0.537015", "0.5368081", "0.5367199", "0.5367179", "0.5355915", "0.53554213", "0.53554213", "0.5353928", "0.53537595", "0.53525317", "0.53488153", "0.53488153", "0.5347925", "0.53469783", "0.5342042", "0.5339659", "0.5334118", "0.5329977", "0.5324065", "0.5310743", "0.52992415", "0.5287694", "0.5282021", "0.52777886", "0.5273784", "0.5267808", "0.5267583", "0.5264516", "0.52620435", "0.52582526", "0.5246455", "0.5245527", "0.52441174", "0.5236924", "0.5220812", "0.52123153", "0.5209766", "0.5208869", "0.5208869", "0.5199742" ]
0.727553
0
def hellobug redirect_to '/user_traits' end
def privacy end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def other_hello\n redirect_to(:controller => 'demo', :action => 'hello')\n end", "def other_hello\n # redirect_to(:controller => 'demo', :action =>'index')\n redirect_to(:action => 'hello')\n end", "def redirect?; end", "def redirects; end", "def redirect_ok; end", "def redirect_ok; end", "def redirect_internal() redirect_to \"/nothing\"; end", "def show\n redirect_to :back#:actina => \"after_log_in_prosess\" :action => \"chouse\"\n end", "def redirect(url); end", "def redirect_non_admins_to\n \"/\"\n end", "def developer\n # redirect_to(:controller => 'docu', :action => 'index')\n end", "def landing\n end", "def landing\n end", "def main\n # noinspection RubyMismatchedArgumentType\n if current_user\n redirect_to dashboard_path\n else\n redirect_to welcome_path\n end\n end", "def reviewer_home\n redirect_to(:action => 'index')\n end", "def redirect_to(args)\n end", "def hello\n redirect_to controller: 'sessions', action: 'new' unless session[:name] #TRY current_user\n end", "def redirect\n redirect_to volunteershome_url if current_user.volunteer?\n redirect_to serviceusershome_url if current_user.service_user?\n show_browser_alert\n end", "def welcome\nend", "def home\n redirect_to action: :index\n end", "def home \n\nend", "def hellopage\nend", "def redirect_url; end", "def welcome \n end", "def redirect_to_lobby\n redirect_to :action => :index\n end", "def home\nend", "def companie\n \tflash[:notice] = \"Learn to spell!!!!\"\n \tredirect_to :controller => 'about', :action => 'company'\n end", "def home\n redirect_to user_path(current_user)\n end", "def redirect_to_setup_path\n redirect_to setup_path unless controller_name == 'users'\n end", "def test\n notify_credit_problem\n redirect_to(:action => 'show')\n end", "def landing\n \n end", "def landing\n \n end", "def loginpage\n end", "def home\r\n\r\nend", "def designer_home\n redirect_to(:action => 'index')\n end", "def random_login\n if random_login_internal\n redirect_to( :controller => \"users\", :action => \"info\" )\n else\n redirect_to( :controller => \"users\", :action => \"index\" )\n end\n end", "def home; end", "def fir_home\n redirect_to(:action => 'index')\n end", "def index\n redirect_to :controller =>\"user\", :action=>\"index\"\n end", "def wp\n redirect_to (\"#{BASE_DOMAIN}/infos/lost/\")\n end", "def home\n\n end", "def home\n\n end", "def home\n\n end", "def home\n\n end", "def landing_page\n if current_user\n redirect_to actions_path(current_user[:id])\n end\n end", "def home \n\tend", "def welcome\n\tend", "def redirect_to_home\n redirect_to '/'\n end", "def welcome \n end", "def home\n\tend", "def usuarios\n redirect_to :action => \"roles\"\n end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def controller; end", "def index\n \tredirect_to :controller => \"user\", :action => \"index\"\n end", "def pcb_admin_home\n redirect_to(:action => 'index')\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def home\n end", "def tutorial\n end" ]
[ "0.704424", "0.6993151", "0.6965169", "0.6918002", "0.6815349", "0.6815349", "0.668292", "0.65834785", "0.65522134", "0.6501314", "0.6496074", "0.6490836", "0.6490836", "0.6481421", "0.6445969", "0.6441586", "0.6415043", "0.6412178", "0.6403546", "0.6400171", "0.64000154", "0.63963383", "0.63921535", "0.6389524", "0.63756305", "0.63578975", "0.6348656", "0.6341459", "0.6338573", "0.6332063", "0.6326211", "0.6326211", "0.6317841", "0.6316891", "0.6315024", "0.63141197", "0.6312328", "0.62936914", "0.6288356", "0.6274215", "0.62672377", "0.62672377", "0.62672377", "0.62672377", "0.6266616", "0.6265542", "0.6256317", "0.62547714", "0.6246608", "0.6243863", "0.62421644", "0.623978", "0.623978", "0.623978", "0.623978", "0.623978", "0.623978", "0.623978", "0.623978", "0.623978", "0.623978", "0.6237719", "0.62209815", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.62205637", "0.6219723" ]
0.0
-1
To prevent the render call from reentrancy we need to remember if we're in our own render path. Our rendering code calls 'render' to access the real view renderer so we need a way to fall back to it.
def in_progressive_render @in_progressive_render = true yield @in_progressive_render = false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync_render_context\n self\n end", "def sync_render_context\n self\n end", "def render?\n true\n end", "def cached_render\n if Global.file_cache\n cached_render_file\n else\n cached_render_memory\n end\n end", "def render?\n true\n end", "def render(options=nil, deprecated_status_or_extra_options=nil, &block)\n if ::Rails::VERSION::STRING >= '2.0.0' && deprecated_status_or_extra_options.nil?\n deprecated_status_or_extra_options = {}\n end\n \n unless block_given?\n unless integrate_views?\n if @template.respond_to?(:finder)\n (class << @template.finder; self; end).class_eval do\n define_method :file_exists? do; true; end\n end\n else\n (class << @template; self; end).class_eval do\n define_method :file_exists? do; true; end\n end\n end\n (class << @template; self; end).class_eval do\n define_method :render_file do |*args|\n @first_render ||= args[0] unless args[0] =~ /^layouts/\n end\n \n define_method :pick_template do |*args|\n @_first_render ||= args[0] unless args[0] =~ /^layouts/\n PickedTemplate.new\n end\n end\n end\n end\n\n if matching_message_expectation_exists(options)\n expect_render_mock_proxy.render(options, &block)\n @performed_render = true\n else\n if matching_stub_exists(options)\n @performed_render = true\n else\n super(options, deprecated_status_or_extra_options, &block)\n end\n end\n end", "def render!; raise NotImplementedError end", "def uncached_render\n before_process\n\n content = engine.transform(self)\n\n if path and tlayout = layout\n [instance, tlayout.instance].each do |i|\n i.instance_variable_set(\"@content\", content)\n end\n\n content = tlayout.render\n end\n\n content\n\n ensure\n after_process unless $!\n end", "def make_render_in_view exp\n make_render exp, true\n end", "def sync_render_context\n @sync_render_context ||= Renderer.new\n end", "def before_rendering( state=nil )\n\t\t# Nothing to do\n\t\treturn nil\n\tend", "def render_once(view, *args, &block)\n @_render_once ||= {}\n if @_render_once[view]\n nil\n else\n @_render_once[view] = true\n render(view, *args, &block)\n end\n end", "def render_once(view, *args, &block)\n @_render_once ||= {}\n if @_render_once[view]\n nil\n else\n @_render_once[view] = true\n render(view, *args, &block)\n end\n end", "def render\n return nil\n end", "def reset_render_method\n @render_method = default_render_method\n end", "def render\n raise \"Trying to call abstract method for #{self}\"\n end", "def render_calls; end", "def render( render_state )\n\t\treturn nil\n\tend", "def init_render_on_dispatch_hook\n @app.on_dispatch do |old_state, new_state|\n render! unless old_state.equal?(new_state)\n end\n end", "def render\n raise NotImplementedError\n end", "def view_renderer\n @_view_renderer ||= ActionView::Renderer.new(lookup_context)\n end", "def render(view)\n # Since only one command is executed per thread, we can store the view to\n # render as a thread-local variable.\n raise \"The render method should be called at most once per command\" if Thread.current[:render_view]\n Thread.current[:render_view] = view.to_s\n return nil\n end", "def render\n raise NotImplementedError\n end", "def render_method\n @render_method ||= default_render_method\n end", "def view_renderer; end", "def view_renderer; end", "def render_renderable(renderable, buffer = nil, locs = {})\n buffer ||= ''.html_safe\n\n benchmark \"Rendered #{renderable.cache_key}\", :level => :warn, :silence => true do\n locs.merge!(:renderable => renderable)\n\n klass = renderable.class\n\n html = ''\n\n partial_path = klass.respond_to?(:partial_path) ? klass.partial_path : klass.model_name.partial_path\n\n html.concat render({\n :partial => partial_path,\n :object => renderable,\n :locals => locs,\n :layout => 'shared/renderable'\n })\n\n element = klass.respond_to?(:element) ? klass.element : klass.model_name.element\n\n div_args = { :id => renderable.to_anchor, :class => \"renderable renderable-#{locs[:render_index]} #{element}\" }\n\n if klass.renderable? && current_user.role.includes?(renderable.role)\n div_args[:\"data-node\"] = node = locs[:node] && locs[:node].id\n div_args[:\"data-renderable\"] = element\n div_args[:\"data-renderable-name\"] = renderable.name\n\n div_args[:\"data-update-node-path\"] = edit_polymorphic_path([:admin, locs[:node]]) rescue nil\n\n # try a few argument setups for polymorphic routes\n path_arg_attempts = [\n\n # admin scoped, object class (the standard)\n [:admin, klass],\n\n # no scope, the object class\n [nil, klass]\n\n # no scope, the object base class (if individual subclass routes don't exist)\n #[nil, klass.base_class]\n ]\n\n begin\n scope, klass = path_arg_attempts.shift\n div_args[:\"data-renderables-path\"] = polymorphic_path([scope, klass])\n div_args[:\"data-renderable-path\"] = edit_polymorphic_path([scope, renderable.becomes(klass)]).sub(/\\/edit$/, '')\n rescue\n retry unless path_arg_attempts.empty?\n end\n end\n\n buffer << content_tag(:div, html.html_safe, div_args)\n end\n end", "def render\n raise NotImplementedError, \"Subclasses must implement a render method\"\n end", "def render\n raise NotImplementedError.new \"Please override 'render' in your \"+\n \"concrete implementation\"\n end", "def process_default_render exp\n process_layout\n process_template template_name, nil\n end", "def method_missing(method, *args, &block) \n return super unless part(method)\n part(method).render\n end", "def render; end", "def render; end", "def render; end", "def render; end", "def render; end", "def render\n end", "def render\n end", "def render\n end", "def render\n end", "def render\n Log.dev(\"Action: #{self}\")\n stack do\n if should_cache?\n # Ignore cache if there is flash session data as the response probably\n # expects to include it, making it unique for this user and request.\n if Global.no_cache_flash && !Current.session.flash.empty?\n Log.debug(\"Action caching ignored as session flash data is present.\")\n uncached_render\n else\n cached_render\n end\n else\n uncached_render\n end\n end\n end", "def render_in(view_context, &block)\n self.class.compile\n @view_context = view_context\n @view_renderer ||= view_context.view_renderer\n @lookup_context ||= view_context.lookup_context\n @view_flow ||= view_context.view_flow\n @virtual_path ||= virtual_path\n @variant = @lookup_context.variants.first\n old_current_template = @current_template\n @current_template = self\n\n # Pass self as a block parameter\n @content = render_block(view_context, &block) if block_given?\n validate!\n\n send(self.class.call_method_name(@variant))\n ensure\n @current_template = old_current_template\n end", "def after_rendering( state=nil )\n\t\t# Nothing to do\n\t\treturn nil\n\tend", "def render\n raise NotImplementedError, 'this should be overridden by concrete sub-class'\n end", "def rendered?\n !!@render_opts\n end", "def process\n # run preload method (which user can subclass)\n preload\n # early out if render nothing is set or if there is already a redirection\n return if @redirect || @render_nothing\n # decide what method on the controller to call\n meth = nil\n if !@workingpath || !@requestpath ||\n ( @workingpath.length >= @requestpath.length && @workingpath.last == @requestpath.last )\n # i have a subtle disambiguation problem between a request for a method whose name\n # matches the controller name itself and a request for the index page - think more. TODO\n meth = \"index\"\n else\n # normal behavior is to pick a method that matches the leaf of the url passed\n # in ruby on rails this is done at the router level; in appwiki it is at controller scope\n meth = @requestpath.last\n @args = @requestpath.slice(@[email protected]+1)\n if !self.respond_to? meth\n @args = [ meth ]\n meth = \"default\"\n end\n end\n # go!\n if self.respond_to? meth\n send meth\n render :action => meth if !@redirect && !@render_nothing && !@rendered_template\n # TODO one design clumsiness here is that the controller method renders\n # directly to the output buffer, and then the layout erases that buffer and\n # then pipes it to itself... it would be better to have a more generalized\n # idea of diffent output buffers that then layout could composit together,\n # this would support the idea of many fragments making up a page and might\n # also help caching. even deferred computation of a fragment would be nice.\n end\n # do post load operations (including skinning)\n postload\n end", "def render(*args)\n super *args\n end", "def rendered_views=(_arg0); end", "def render(view, locals, buffer=nil, &block)\n mod = view.is_a?(Deface.template_class) ? Deface.template_class : view.singleton_class\n\n if @compiled && !mod.instance_methods.include?(method_name.to_sym)\n @compiled = false\n @source = refresh(view).source\n end\n buffer.nil? ? super(view, locals, buffer, &block) : super(view, locals, **buffer, &block)\n end", "def render\n\n end", "def render(view, locals, buffer = nil, add_to_stack: true, &block)\n instrument_render_template do\n compile!(view)\n if buffer\n view._run(method_name, self, locals, buffer, add_to_stack: add_to_stack, has_strict_locals: strict_locals?, &block)\n nil\n else\n view._run(method_name, self, locals, OutputBuffer.new, add_to_stack: add_to_stack, has_strict_locals: strict_locals?, &block)&.to_s\n end\n end\n rescue => e\n handle_render_error(view, e)\n end", "def _normalize_render(*args, &block); end", "def render(options = {}) \n return if @view and !options[:force] # Avoid double rendering, if we have already attached a view\n \n if options == {} # default rendering\n render(:file => default_template_name)\n\n elsif action_name = options[:action]\n result = render(:file => default_template_name(action_name.to_s))\n\n elsif options[:file]\n file = options[:file]\n if file =~ /^\\// # Render from view root\n @view = render_for_file(File.join(\"app\", \"views\", \"#{file}.xml.builder\"))\n else\n @view = render_for_file(view_path(file)) \n end\n\n elsif options[:nothing]\n @view = Skates::Base::View.new()\n end\n end", "def rendered?\n end", "def prepare_rendermode_for_action\n \n $render_translation_link=false\n \n if cookies[\"is_translating\"] == 'true'\n login_from_cookie\n if logged_in? && current_user.can_translate?\n $render_translation_link=true\n \n end\n \n end\n Rengine::Blurb.use_cache=!$render_translation_link\n\n if $render_translation_link\n $render_mode=:force_render\n end\n\n if params[:render_mode]\n render_base.render_mode_override =params[:render_mode].to_sym\n else\n render_base.render_mode_override=nil\n end\n\n @render_preruntime=(\"true\"==params[:render_preruntime])\n \n \n\n\n end", "def render_finish\n raise NotImplementedError\n end", "def render(options = {})\n raise double_render! if rendered?\n @render_opts = options\n end", "def renders(&block)\n define_method(:renderable) do\n instance_eval(&block).try(:to_page)\n end\n end", "def view_renderer\n ActionController::Base.new.tap do |controller|\n controller.request = ActionDispatch::Request.new('HTTP_HOST' => 'example.com',\n 'SCRIPT_NAME' => '',\n 'HTTPS' => 'off',\n 'rack.input' => ''\n )\n controller.response = ActionDispatch::Response.new\n controller.class.prepend_view_path '.'\n\n def controller.render(args)\n super(args)[0].to_str\n end\n end\nend", "def try_render(object)\n begin\n render self.route.instance_variable_get('@original_path').gsub(/(\\(|\\/:).+/, '/') + action_name\n rescue\n case content_type\n when :json\n return object.to_json if object.respond_to?(:to_json)\n when :xml\n return object.to_xml if object.respond_to?(:to_xml)\n end\n raise ::Padrino::Responders::ResponderError, \"Couldn't figure out a way to respond to this.\"\n end\n end", "def render_parent(options = {})\n raise ArgumentError, 'render_parent requires that controller inherit_views' unless (controller.inherit_views? rescue false)\n if template_path = controller.find_inherited_template_path(@current_render, include_self = false)\n render(options.merge(:file => template_path, :use_full_path => true))\n else\n raise InheritedFileNotFound, \"no parent for #{@current_render} found\"\n end\n end", "def rendered=(_arg0); end", "def render\n end", "def to_html\n\n render_method = redirect? ? :redirect_to : :render\n begin\n render\n rescue ActionView::MissingTemplate\n begin\n if default_action\n #now this is sensitive to success state\n logger.debug \"responder rendering: \\ntrying #{render_method} #{default_action}\"\n send render_method, :action => default_action\n else\n logger.debug \"trying default\"\n default_render\n end\n rescue ActionView::MissingTemplate\n if render_method == :redirect_to\n logger.debug \"falling back to redirect resource to #{widget_action(default_action)}\"\n send render_method, resource || current_user, :action => widget_action(default_action)\n else\n logger.debug \"falling back to generic scaffold for #{widget_action(default_action)}\"\n w = widget_class(default_action)\n logger.warn \"render erector widget #{w}\"\n send render_method, navigation_location\n end\n end\n end\n end", "def render_path\n return @render_path.dup unless @page_url.nil?\n generate_file_name()\n @render_path.dup\n end", "def render_holding_page_if_exists\n if view_exists?(HOLDING_VIEW) && !@logged_in_member && request.path == '/'\n render(:template => HOLDING_VIEW, :layout => false) and return\n end\n end", "def render opts = {}\n renderer.render opts\n end", "def renders\n @_renders ||= {}\n end", "def render\n render_background\n\n render_heat_maps\n\n render_star\n render_target\n render_hills\n render_walls\n\n render_paths\n end", "def render_with_defaults(*args)\n options = _normalize_args(*args)\n defaults = options.delete(:if_missing)\n unless defaults.nil?\n begin\n # Ac is important:\n # index/index.html.erb\n # render \"missing_partial\" # MissingTemplate is raised here\n #\n # index_controller.rb\n # def index\n # render :if_missing => {:template => \"layouts/create_me\"} # And caught here\n # end\n #\n # In fact MissingTemplate in a view should not be caught by controller because controller's template exists, but\n # it have errors inside. :nested option tells nested render to raise MissingTemplateContrainer exception instead of\n # raising MissingTemplate. This exception means that action template is resolved, but some of nested partials are not.\n render_without_defaults(options.merge(:nested => true))\n rescue MissingTemplateContainer => e\n unless defaults == false\n defaults = options.merge(defaults)\n render_without_defaults(defaults)\n else\n render_without_defaults(:nothing => true)\n end\n end\n else\n render_without_defaults options\n end\n end", "def render\n # To be implemented.\n end", "def rendered; end", "def renderable?\n !!handler\n end", "def render_result\n layout = @render_args[:layout]\n view = @render_args[:view]\n if layout.kind_of? Symbol # this handles the layout(:none)\n view.result(binding)\n else\n @view[:timestamp] = \"<!-- rendered: #{Time.now()} / env: #{rack_env} -->\"\n @view[:body] = view.result(binding)\n # layout = @layout if layout.nil? # this handles the layout(:some_other_layout) case for formats\n layout.result(binding)\n end\n end", "def render(*args) #:nodoc:\n raise ::AbstractController::DoubleRenderError if response_body\n super\n end", "def renderer\n action_view = ActionView::Base.new(Rails.configuration.paths[\"app/views\"])\n action_view.class_eval do \n include Rails.application.routes.url_helpers if defined? Rails.application.routes\n include ApplicationHelper if defined? ApplicationHelper\n\n def protect_against_forgery?\n false\n end\n end\n return action_view\n end", "def _render_one(entry)\n @entry = entry\n @filename = @entry.filename\n\n # avoid double render of layout path\n return if @entry.source_path == @layout_path\n\n # render. Result goes into @content_for_resources\n input = File.read(@entry.source_path)\n \n # render using either erb or haml\n case File.extname(@entry.source_path)\n when /\\.rhtml$/, /\\.html.erb$/\n @content_for_resources += eval(Erubis::Eruby.new.convert(input))\n when /\\.haml$/, /\\.html.haml$/\n require 'haml'\n @content_for_resources += Haml::Engine.new(input).to_html(self)\n end\n\n @filename =nil\n @entry = nil\n end", "def validate_render!\n throw 'Not a valid renderable' unless valid_render?\n end", "def streamlined_render(options = nil, deprecated_status = nil, &block)\n begin\n render(options, deprecated_status, &block)\n rescue ActionView::TemplateError => ex \n raise ex\n rescue Exception => ex\n if options\n if options[:partial] && @managed_partials.include?(options[:partial])\n options[:partial] = controller.generic_view(options[:partial])\n render(options, deprecated_status, &block)\n else\n raise ex\n end\n else\n view_name = default_template_name.split(\"/\")[-1]\n render(:template => StreamlinedController.generic_view(view_name))\n end\n end\n end", "def rails_render(*args)\n return if rails_api_controller?\n\n rails_controller_instance.render_to_string(*args)\n rescue ActionView::MissingTemplate\n nil\n end", "def default_render(*args)\n return super unless request.format.json?\n\n @simple_json_template = simple_renderer.renderer(template_name(action_name))\n if @simple_json_template\n render(*args)\n else\n super\n end\n end", "def disable_rendering\n\t\t@rendering_enabled = false\n\tend", "def test_render_without_arguments_with_inherited_view\n BCell.class_eval do\n def inherited_view; @a = \"b\"; render; end\n end\n assert_equal \"A/inherited_view/b\", render_cell(:b, :inherited_view)\n end", "def render r\n end", "def default_render\n render(html: \"\", layout: true)\n end", "def stub!(*args)\n if args[0] == :render\n register_verify_after_each\n render_proxy.stub!(args.first, :expected_from => caller(1)[0])\n else\n super\n end\n end", "def allow_double_render\n self.instance_variable_set(:@_response_body, nil)\n end", "def use_rendering_options?\n end", "def render\n request('render').auth_required!\n end", "def render game\n raise NotImplementedError\n end", "def before_rendering( renderstate )\n\t\tif renderstate.tag_data[ :rendering_was_enabled ]\n\t\t\tself.log.debug \" rendering was previously enabled: disabling\"\n\t\t\trenderstate.disable_rendering\n\t\telse\n\t\t\tself.log.debug \" rendering was previously disabled: enabling\"\n\t\t\trenderstate.tag_data[ :rendering_was_enabled ] = true\n\t\t\trenderstate.enable_rendering\n\t\tend\n\n\t\treturn nil\n\tend", "def render_partial_with_inherit_views(partial_path, local_assigns = nil, deprecated_local_assigns = nil)\n if (controller.inherit_views? rescue false) && found_path = controller.find_inherited_template_path(\"#{controller.controller_path}/_#{partial_path}\")\n partial_path = found_path.sub(\"/_#{partial_path}\", \"/#{partial_path}\")\n end\n with_current_render_of(partial_path) do\n render_partial_without_inherit_views(partial_path, local_assigns, deprecated_local_assigns)\n end\n end", "def render_for_file_with_inherit_views(template_path, status = nil, use_full_path = false, locals = {})\n if use_full_path and inherit_views? and found_path = find_inherited_template_path(template_path)\n template_path = found_path\n end\n render_for_file_without_inherit_views(template_path, status, use_full_path, locals)\n end", "def render_template(path)\n render(path)\n exit\n end", "def render\n render_background\n # render_heat_map\n render_walls\n # render_path\n # render_labels\n render_arrows\n render_star\n render_target\n unless grid.walls.has_key?(grid.target)\n render_trail\n end\n end", "def render_result\n layout = @render_args[:layout]\n view = @render_args[:view]\n if layout.kind_of? Symbol # this handles the layout(:none)\n view.result(binding)\n else\n @view[:timestamp] = \"<!-- server: #{@port} / rendered: #{Time.now()} / env: #{rack_env} -->\"\n @view[:body] = view.result(binding)\n # layout = @layout if layout.nil? # this handles the layout(:some_other_layout) case for formats\n layout.result(binding)\n end\n end", "def render (r)\n\tif @init then\n\t\[email protected](@handling.coupled_tests)\n\t\t@init = false\n\tend\n\tr.div.style (\"float:top;\").with {\n\t\tr.render(@menu)\n\t}\n\tr.div {\n\t\tr.render(@current)\n\t} if @current\nend", "def render_remote view\n if params[:remote] == \"true\"\n render view, :layout=>false\n else\n render :nothing=>true, :layout=>true\n end\n end", "def render!\n render :file => template_path\n end", "def render view, options\n options.format! view\n path_store.cached options do\n options.file = template_path view, options\n view.render_with options\n end\n end", "def process_render exp\n process exp.last if sexp? exp.last\n\n add_simple_call :render, exp\n\n exp\n end" ]
[ "0.6574456", "0.6574456", "0.64954865", "0.6488966", "0.6478073", "0.64642256", "0.6463588", "0.64134383", "0.63959855", "0.63636965", "0.63609564", "0.6316424", "0.6316424", "0.62934256", "0.6286148", "0.62748", "0.6259806", "0.62378365", "0.6232748", "0.62122214", "0.62050706", "0.6170278", "0.61618763", "0.61617225", "0.61071664", "0.61071664", "0.610026", "0.60744226", "0.6061513", "0.60611415", "0.603914", "0.6034537", "0.6034537", "0.6034537", "0.6034537", "0.6034537", "0.6019186", "0.6000628", "0.6000628", "0.6000628", "0.5971237", "0.5966987", "0.596334", "0.5959039", "0.59543484", "0.5941875", "0.59113175", "0.5908014", "0.5899774", "0.5896239", "0.58948416", "0.5889364", "0.5886255", "0.5864417", "0.5860761", "0.5857335", "0.5844698", "0.58337516", "0.5832164", "0.5810149", "0.5804319", "0.5753277", "0.57425624", "0.5727822", "0.5727209", "0.57260424", "0.5723796", "0.5712902", "0.5710424", "0.56982005", "0.5690663", "0.5670104", "0.56698686", "0.56689286", "0.5655861", "0.56554025", "0.5642609", "0.56290245", "0.56243944", "0.5623023", "0.5604235", "0.56038487", "0.558936", "0.55860305", "0.55827636", "0.5567326", "0.55641615", "0.55478054", "0.55323356", "0.55315787", "0.55274934", "0.55274755", "0.5522639", "0.5519892", "0.55185556", "0.55172014", "0.55157626", "0.5509607", "0.550925", "0.5506535", "0.5505725" ]
0.0
-1
random number between 152
def random card = rand(1..52) card.to_i end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_no\n rand(5000)\nend", "def random_number\n rand(0..20)\n end", "def gen_num\n rand(1..100)\nend", "def generate_number\r\n return randomNumber = 1 + rand(100)\r\n end", "def n_generator\n number = rand(10..30)\n end", "def number_generator\n rand(1..20)\n end", "def pick_random_number(digits=1)\n min = 10 ** (digits - 1)\n max = (10 ** digits ) - 1\n semirandom = min + rand(max-min)\n semirandom += 1 if semirandom == 666 #would be unpleasant to receive...\n return semirandom\n end", "def rand\n return extract_number / (2**32 -1).to_f\n end", "def random\n 1 + (10 * rand(0))\n end", "def random_num_generator\n return rand(1..100)\nend", "def random_num_generator\n return rand(1..100)\nend", "def random20\n rand(20) + 1\n end", "def generate_random_number\n rand(1..6) + 1\nend", "def random_number\n rand 0..20\nend", "def digit\n rand(10)\n end", "def random_number\n rand(1..20)\nend", "def srand(num=0) end", "def generate_number\r\n \r\n #Generate and return a random number between 1 and 100\r\n return randomNo = 1 + rand($maxChallengeRange)\r\n \r\n end", "def random_number \n rand(6) + 1 \nend", "def generate_number\r\n \r\n #Generate and return a random number between 1 and 1000\r\n return randomNo = 1 + rand(1000)\r\n \r\n end", "def rand(max=0) end", "def non_zero_digit\n rand(1..9)\n end", "def age\n n = rand(55..120)\nend", "def generate_number\n \n #generate and return a random number from 1 to 100\n return randomNO = 1 + rand(1000)\n\n end", "def random_int(max)\n rand(max)\nend", "def random_number(min, max)\n rand(max-min+1)+min\n end", "def generate_random_number\n (1..10).to_a.sample\nend", "def get_random_number(max_value = 10)\n\trand(max_value)\nend", "def generate\n (0..30).sort{ rand() } .take(@conf)\n end", "def random_status_number_generator\n Random.rand(1..10)\n end", "def random_number\n t = Time.now.to_f / (Time.now.to_f % Time.now.to_i)\n random_seed = t * 1103515245 + 12345;\n (random_seed / 65536) % 32768;\nend", "def rand_digit #generate random digit\n\treturn rand(10)\nend", "def get_random_number\n\t\trandom_num = rand(@deck.length)\n\tend", "def random_account_number\r\n acct_num = rand(10**11).to_s.rjust(11, '1')\r\n return acct_num\r\n end", "def random_id\n rand(1000000) + 20000\nend", "def new_account_number\n return rand(99999999)\n end", "def new_account_number\n return rand(99999999)\n end", "def door_num\n\t\treturn rand(3)\n\tend", "def tirar_dado\r\n\trand 1..6\r\nend", "def roll\n Random.rand(6)+1\n end", "def make_not_so_random!\n srand 1213\nend", "def test_random_number_generation\n rand = @game.get_random_number(0, 10)\n assert rand <= 10 && rand >= 0\n end", "def nostalgia; return rand end", "def randomRoll\n\t 1 + rand(6)\n\tend", "def get_random_number()\n rand(0x7fffffff).to_s\nend", "def randomNum()\r\n num = rand(1..10)\r\nend", "def cisco_rand\n rand(1 << 24)\n end", "def initialize(num = rand(52))\n self.num = num\n end", "def tirar_dado\r\n rand 1..6\r\nend", "def random_account_number\n acct_num = rand(10**11).to_s.rjust(11, '1')\n return acct_num\n end", "def rand_id\n rand(10**7...10**8).to_s\n end", "def roll\n number = rand(1..6)\n number\nend", "def int(max)\n (@random.rand * max).floor\n end", "def getRand()\n # With 32-bit MAX_INT to be able to have cool numbers\n return Random.rand() * 2147483647;\nend", "def tirar_dado\n rand 1..6\nend", "def generate_one_random_number()\r\n @l = @total_no_of_bits + 1\r\n bit_string = @total_sequence.join('')\r\n numerator = bit_string.to_i(2)\r\n random_number = numerator *1.0 / 2**@l\r\n\r\n return random_number\r\n end", "def roll\n return rand(1..6)\nend", "def roll\n rand(1...7)\nend", "def random_port\n rand(1024..49151)\n end", "def random_num(min, max)\n rand(max - min + 1) + min\nend", "def roll\n return 1 + rand(6)\n end", "def rand_nr\n return rand(1..2)\nend", "def rand_id\n rand(10**7...10**8).to_s\nend", "def generate_random_number_except_55\n x=rand(100)\n throw :finish if x==55\nend", "def random_integer(max_size)\r\n 1 + rand(max_size)\r\n end", "def set_id\n\t\t\trand(111111111...999999999)\n\t\tend", "def number\n\t\"#{Time.now.to_i}-#{rand(1_000_000)}\"\n end", "def random_num(min, max)\n rand(max - min + 1) + min\nend", "def random_integer(limit)\n Rubinius.primitive :randomizer_rand_int\n raise PrimitiveFailure, \"Randomizer#rand_int primitive failed\"\n end", "def random_integer(limit)\n Rubinius.primitive :randomizer_rand_int\n raise PrimitiveFailure, \"Randomizer#rand_int primitive failed\"\n end", "def tirar_dado\n rand 1..6\nend", "def tirar_dado\n rand 1..6\nend", "def tirar_dado\n rand 1..6\nend", "def dice(minimum, maximum)\n rand(minimum..maximum)\nend", "def roll\n @number = rand(1..6)\n end", "def rand(max)\n max-1\nend", "def roll\n return rand(6) + 1\nend", "def roll\n return rand(1..6)\nend", "def roll\n return rand(1..6)\nend", "def roll\n return rand(1..6)\nend", "def roll\n rand(1..6)\nend", "def roll\n rand(1..6)\nend", "def get_rand range\n\t\t@random_number = rand(range)\n\tend", "def rand_num(range)\n num = @rng.rand(range) + 1\n num\n end", "def roll\n return rand(1..6) #if you use two dots it includes the 6 at the end\n # if you use three dots it excludes the last number in this case the 6\nend", "def roll\n @number = Random.new.rand(6) + 1\n end", "def file_num_generate\n \t\t_random(6) + \"#{file_uid}\"\n\tend", "def random_resilience_generator\n self.resilience = 10.times.sum{ Random.rand(1..13) } \n end", "def get_random(min, max)\r\n rand(min..max)\r\n end", "def roll\n Random.rand(6) + 1\nend", "def randomizer\n number = rand(0..1)\n return number\nend", "def temp_count\n @count = rand(0..10)\n end", "def deal_card\n rand(1...12)\nend", "def random low, high\n $lib_prng.range low, high\nend", "def rand7\n rand * 7\nend", "def random_number( bits )\n m = (1..bits-2).map{ rand() > 0.5 ? '1' : '0' }.join\n s = \"1\" + m + \"1\"\n s.to_i( 2 )\n end", "def generate_random_block_id\n return ((0..9).to_a.sample(5)).join\n end", "def random\n CYCLE * rand\nend", "def random(range)\n return rand(range + 1)\nend" ]
[ "0.77748", "0.7553915", "0.75041515", "0.7427795", "0.74111843", "0.7367872", "0.73326653", "0.72957766", "0.72800153", "0.72745955", "0.72745955", "0.72114116", "0.7194774", "0.7187147", "0.7185083", "0.7156885", "0.71304184", "0.7102128", "0.70645434", "0.7037566", "0.7036595", "0.7031126", "0.7001442", "0.6994891", "0.6989597", "0.69831955", "0.695452", "0.6926205", "0.6925392", "0.6921292", "0.6914223", "0.69137925", "0.69044834", "0.6895056", "0.68704015", "0.68174386", "0.68174386", "0.6816892", "0.6812673", "0.6812113", "0.6802124", "0.6795855", "0.67835015", "0.6770761", "0.6746694", "0.6742255", "0.6737023", "0.67353785", "0.67281187", "0.67215365", "0.67191595", "0.67171323", "0.67148167", "0.6713725", "0.66940093", "0.66890526", "0.6683764", "0.6679399", "0.66789955", "0.6678225", "0.6677408", "0.66749233", "0.6672693", "0.6670862", "0.6670031", "0.66541916", "0.6652265", "0.6642574", "0.6630198", "0.6630198", "0.6622972", "0.6622972", "0.6622972", "0.6618278", "0.66088647", "0.6607925", "0.6598645", "0.65875095", "0.65875095", "0.65875095", "0.65837955", "0.65837955", "0.65805644", "0.6568733", "0.65655273", "0.65625495", "0.6561548", "0.6559269", "0.65587723", "0.65535885", "0.6552466", "0.65513486", "0.65441996", "0.65419877", "0.6538259", "0.6536904", "0.6532848", "0.6527004", "0.6522985" ]
0.7310965
8
GET /uploads GET /uploads.js
def index # Optionally filter by election. if @election @uploads = policy_scope(Upload).where(election: @election).joins(:file_type).order(sort_column.to_s + ' ' + sort_direction.to_s).page(params[:page]).per(params[:limit]) else @uploads = policy_scope(Upload).joins(:file_type).order(sort_column.to_s + ' ' + sort_direction.to_s).page(params[:page]).per(params[:limit]) end authorize @uploads end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @uploads = @user.uploads\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads }\n end\n end", "def file_uploads; end", "def index\n @upload = Upload.new # Allow file uploads on index page via jq_fu\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @uploads }\n end\n end", "def index\n @uploads = current_user.uploads.all\n end", "def upload_url\n respond_to do |format|\n format.js\n end\n end", "def index\n @uploads = Photo.all\n end", "def index\n @uploads = Upload.all\n end", "def index\n @uploads = Upload.all\n end", "def index\n @uploads = Upload.all\n end", "def index\n @uploads = Upload.all\n end", "def index\n @uploads = Upload.all\n end", "def index\n @uploads = Upload.all\n end", "def upload_url\n _get(\"/files/upload_url\") { |json| json }\n end", "def index\n @uploads = Upload.all\n \n @upload = Upload.new\n \n respond_to do |format|\n format.html \n format.json { render json: @uploads } \n end\n end", "def index\n @uploads = Upload.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploads.map{|upload| upload.to_jq_upload } }\n end\n end", "def index\n@uploads = Upload.all\nend", "def images\n if @group.is_member?(@user)\n @images = @group.uploads.images.paginate(:page => @page, :per_page => @per_page, :order => 'created_at desc')\n else\n @images = @group.uploads.images.public.paginate(:page => @page, :per_page => @per_page, :order => 'created_at desc')\n end\n respond_to do |format|\n format.js { render :json => basic_uploads_json(@images) }\n end\n end", "def upload\n @direct_upload_url = params[:direct_upload_url]\n respond_to do |format|\n format.js\n end\n end", "def upload\n @direct_upload_url = params[:direct_upload_url]\n respond_to do |format|\n format.js\n end\n end", "def index\n @title = \"User uploaded files\"\n get_files(params)\n end", "def index\n @uploads = Upload.nw(session[:nw]).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @uploads }\n end\n end", "def index\n @authorized = true\n begin\n authorize! :show, UploadFile\n rescue CanCan::AccessDenied\n @authorized = false\n end\n #added to avoid raise condition when initially uploading multiple files\n check_uploads_collection unless !@authorized\n\n respond_to do |format|\n format.json {\n #TODO find_by_solr could be faster \n @multiresimages = current_user.upload_files.map do |file|\n begin\n Multiresimage.find(file.pid)\n rescue ActiveFedora::ObjectNotFoundError\n end\n end.compact\n render :json=>@multiresimages.map(&:to_jq_upload)\n }\n format.html\n end\n end", "def index\n @file_uploads = FileUpload.all\n end", "def index\n @uploads = [].tap do |files|\n Upload.with_attached_files\n .where(user_id: current_or_guest_user.id)\n .each do |upload|\n upload.files.each do |file|\n files << { id: upload.id, file: file }\n end\n end\n end\n end", "def index\n @assets = @attachable.assets\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assets.map{|upload| upload.to_jq_upload } }\n end\n end", "def upload\n @direct_upload_url = params[:direct_upload_url]\n respond_to do |format|\n format.js { render template: \"#{website.folder}/module_requests/upload.js\", layout: false }\n end # respond_to do |format|\n end", "def files(count = 5)\n connection.get(room_url_for(:uploads))['uploads'].map { |u| u['full_url'] }\n end", "def index\n @picture_uploads = PictureUpload.all\n end", "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end", "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end", "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end", "def show\n @upload = Upload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end", "def upload\n\n\t\t@uploads = Idea.find(params[:id]).uploads\n\t\t@idea = params[:id]\n\t\t@idea_obj = Idea.find(@idea)\n\n\t\t# allows user to delete files\n\t\t@delete = true\n\n\t\t@path = [link_to_ideas, link_to_idea_uploads(@idea_obj)]\n\t\t@subnavigation = [active_link_to_idea_uploads(@idea_obj), link_to_idea(@idea_obj), link_to_show_all_ideas(\"Alle Ideen\", \"title\", \"ASC\", \"\", 0, 30)]\n\tend", "def index\n @uploads = Upload.all\n @upload = Upload.new\n end", "def show\n @uploaded_file = UploadedFile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uploaded_file }\n end\n end", "def index\n @image_uploads = ImageUpload.all\n end", "def files\n redirect_to(ContentServer.uploaded_content_url(params[:id], '.' + params[:ext].to_s))#params[:id].to_s.gsub(\".\")[1]))\n end", "def files\n redirect_to(ContentServer.uploaded_content_url(params[:id], '.' + params[:ext].to_s))#params[:id].to_s.gsub(\".\")[1]))\n end", "def get_upload_url\n url_service = UploadUrlFetcher.new(@context, unsafe_params[:id])\n\n result = url_service.fetch_url(unsafe_params)\n\n render json: result\n end", "def get_web_content_uploads(course_id)\r\n get(PATH_COURSES_WEBCONTENTUPLOADS % [course_id])\r\n end", "def full_virtual_path\n '/uploads'\n end", "def index\n @uploaded_files = UploadedFile.all\n end", "def upload\n end", "def upload\n end", "def uploaded_file\n initalize_breadcrumb(\"Uploaded File(s)\", uploadedfile_datauploaders_path)\n currentUser = current_user.id\n @uploadedFiles = UserFileMapping.where(:user_id =>currentUser )\n respond_with(@uploadedFiles)\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @upload }\n end\n end", "def show\n render json: @uploaded_document\n end", "def upload\n respond_to do |format|\n format.html # upload.html.erb\n end\n end", "def index\n @super_d_uploads = SuperDUpload.all\n end", "def show\n @spawner = Spawner.find(params[:id])\n\n @files = Dir.glob(\"/Users/jmadin/Dropbox/web/trimodal/spawned_thumbs/*\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spawner }\n end\n end", "def multipart_upload\n end", "def uploading_pictures\n end", "def index\n @uploads = policy_scope(@user.uploads)\n authorize @uploads\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @location_photos.map{|upload| upload.to_jq_upload } }\n end\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @upload }\n end\n end", "def show\n show! do\n add_crumb(I18n.t(\"controller.uploads\"), uploads_path)\n add_crumb(@upload.to_s, upload_path(@upload))\n end\n end", "def index\n\t\t@uploads = current_user.all_uploads.sort_by! { |x| x.heading.downcase }\n\tend", "def index\n @uploaders = Uploader.all\n end", "def upload_simple\r\n \r\n end", "def get_upload_urls(mime_type)\n\tputs \"Getting upload urls\"\n\tresponse = request_get_with_param('/api/file/getpreupload', mime_type)\n\tputs response.body\nend", "def spoof_uploads\n [Upload.find(1), Upload.find(2)]\n end", "def fetch_upload\n @upload = Upload.find_by_id(params[:id])\n end", "def show\n @image_upload = ImageUpload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_upload }\n end\n end", "def store_dir\n \"uploads\"\n end", "def store_dir\n 'uploads'\n end", "def client_side_multipart_upload\n end", "def upload_file_url\n \"file://#{upload_full_path}\"\n end", "def index\n @uploaded_files = @page.uploaded_files.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @uploaded_files }\n end\n end", "def set_upload\n @upload = current_user.uploads.find(params[:id])\n end", "def store_dir\n \"uploads/\"\n end", "def store_dir\n \"uploads/\"\n end", "def store_dir\n \"uploads/\"\n end", "def upload\r\n \r\n end", "def path\n \"/#{UPLOAD_DIR}/#{filename}\"\n end", "def list_multipart_uploads(bucket_name, options={})\n params = { uploads: \"\" }\n params.merge! options\n send_request(GET, bucket_name, params)\n end", "def create\n @upload = @user.uploads.build(upload_params)\n authorize @upload\n\n respond_to do |format|\n if @upload.save\n format.json { render json: @upload }\n format.html { redirect_to user_uploads_path(@user) }\n else\n format.json { render json: @upload.errors }\n format.json { render :new }\n end\n end\n end", "def index\n @galleries_galleries = @galleries_album.galleries.all\n respond_to do |format|\n format.html { render :index }\n # format.json { render json: []} # ON PURPOSE\n format.json { render json: @galleries_galleries.map{|x| x.to_jq_upload }}\n end\n end", "def adapter_folder\n 'uploads'\n end", "def index\n @movieuploads = Movieupload.all\n end", "def index\n @assets = @uploadable.assets\n end", "def show\n # redirect_to @upload.url\n end", "def get\n # first find the upload within own uploads\n upload = current_user.uploads.find_by_id(params[:id])\n \n #if not found in own uploads, check if the current_user has share access to the parent folder of the file\n upload ||= Upload.find(params[:id]) if current_user.has_share_access?(Upload.find_by_id(params[:id]).folder)\n \n if upload\n send_file upload.uploaded_file.path, :type => upload.uploaded_file_content_type\n else\n flash[:error] = \"You have no permissions to access this area!!\"\n redirect_to uploads_path\n end\n \n end", "def show\n return render_404 unless uploader&.exists?\n\n if cache_publicly?\n # We need to reset caching from the applications controller to get rid of the no-store value\n headers['Cache-Control'] = ''\n expires_in 5.minutes, public: true, must_revalidate: false\n else\n expires_in 0.seconds, must_revalidate: true, private: true\n end\n\n disposition = uploader.image_or_video? ? 'inline' : 'attachment'\n\n uploaders = [uploader, *uploader.versions.values]\n uploader = uploaders.find { |version| version.filename == params[:filename] }\n\n return render_404 unless uploader\n\n workhorse_set_content_type!\n send_upload(uploader, attachment: uploader.filename, disposition: disposition)\n end", "def index\n @upload_file_to_servers = UploadFileToServer.all\n end", "def upload\n create_document\n \n render_upload\n end", "def files\n @files=get_endpoint('extra').keys\n end", "def index\r\n @cvuploads = Cvupload.all\r\n end", "def index\n @upload_files = UploadFile.all\n end", "def index\n @upload_files = UploadFile.all\n end", "def store_dir\n \"#{Rails.root}/public/uploads/\"\n end", "def show\n @csv_upload = CsvUpload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @csv_upload }\n end\n end", "def show\n @up_file = UpFile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @up_file }\n end\n end", "def store_dir\n \"uploads/photos\"\n end", "def upload_url\n return unless @data['image']\n # Isn't actually displayed in-app without this set\n return unless image['property'] == 'image'\n file(@data['image'])\n end", "def show\n @attachments = @document.attachments\n respond_to do |format|\n format.html\n format.js\n end\n end", "def upload_url\n return @upload_url\n end", "def pshr_uploader(upload)\n render 'pshr/uploads/uploader', upload: upload\n end", "def html_uploader\n # TODO\n end", "def multipart; end", "def store_dir\n 'file_uploads'\n end" ]
[ "0.7486534", "0.73832065", "0.7076796", "0.70105416", "0.6757131", "0.67211336", "0.6681613", "0.6681", "0.6681", "0.6681", "0.6681", "0.6681", "0.6658865", "0.66562563", "0.6578515", "0.6552561", "0.6550858", "0.6420163", "0.6420163", "0.64180577", "0.63670146", "0.6347575", "0.63290006", "0.6293234", "0.6273605", "0.62698936", "0.62684226", "0.61978257", "0.61861914", "0.61861914", "0.61861914", "0.61861914", "0.61546147", "0.611254", "0.61123204", "0.6091695", "0.6076168", "0.6076168", "0.60660356", "0.6055979", "0.6054972", "0.6045204", "0.60407424", "0.60407424", "0.60385597", "0.6034591", "0.60175467", "0.60149044", "0.60078895", "0.60009164", "0.59869766", "0.59804183", "0.59605783", "0.5955537", "0.5938286", "0.5933463", "0.5926922", "0.58828753", "0.58682346", "0.58598465", "0.5853521", "0.58518404", "0.5846422", "0.5845805", "0.58264416", "0.5816881", "0.5808646", "0.5805231", "0.5797649", "0.57945424", "0.57945424", "0.57945424", "0.5794493", "0.57918155", "0.57767475", "0.57686", "0.576734", "0.5759974", "0.57500374", "0.57255703", "0.57177746", "0.57103324", "0.57096004", "0.57019347", "0.5694933", "0.5663325", "0.5647947", "0.5645913", "0.5645913", "0.56424", "0.5616716", "0.56160325", "0.5613213", "0.56012785", "0.5584475", "0.5573912", "0.5567438", "0.5558248", "0.5556184", "0.55463964" ]
0.5744372
79
Determines if the uploaded file should be committed to the blockchain and if so, commits it.
def commit_file if @upload.public? && @upload.file_type.public? && @upload.address.blank? && (@upload.creating? || @upload.failed?) BlockchainCommitJob.perform_later(@upload.id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit_file\n\t\tlogger.info(\"[File Attribute #{sprintf('0x%08x', self.object_id)}] Committing file for #{@obj.class}(#{@obj.id}).#{attribute_name} ...\")\n\t\tif @file\n\t\t\tlogger.info(\"[File Attribute] Saving file #{local_file_name} ...\")\n\t\t\[email protected] if @file.respond_to?(:rewind)\n\t\t\tFile.makedirs(File.dirname(local_file_name))\n\t\t\tFile.open(local_file_name, \"w\") do |f|\n\t\t\t\tf.write(@file.read)\n\t\t\tend\n\t\t\tlogger.info(\"[File Attribute] Done.\")\n\t\telse\n\t\t\tlogger.info(\"[File Attribute] Skipping file save of #{@file.inspect}.\")\n\t\tend\n\t\ttrue\n\tend", "def save\n ensure_file_open!\n @file.commit\n true\n end", "def should_commit?(segregation)\n\t\tseg = @segregations[segregation]\n\t\tif @size_file > 0 and seg[:file_pointers][seg[:current_page]].size > @size_file\n\t\t\[email protected](\"S3> should_commit: upload because of size\")\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\tend", "def commit_if_dirty\n # no op\n end", "def commit args = {}\n action = :deleted if self.deleted?\n action ||= self.is_new? ? :added : (self.is_changed? ? :updated : :nothing_to_commit) \n args[:skip_part_data] ||= false\n \n unless action.eql?(:nothing_to_commit)\n message = \"#{action} #{name}\"\n message = args[:m] if args[:m] \n if action.eql?(:deleted)\n repo.remove(self.file_name)\n self.history_count += 1\n else\n repo.add(self.file_name)\n end\n\n active_message = self.commit_messages[:most_recent]\n message = \"#{active_message.gsub(message,\"\")}\" unless self.deleted? || active_message.blank? || active_message.eql?(message)\n self.remove_message_from_temp_store(:most_recent) unless active_message.blank?\n \n repo.commit(message)\n self.last_commit = repo.log(self.local_path, :limit => 1).first.to_s\n end\n unless action.eql?(:deleted) \n self.part_count = parts.count\n self.part_count ||= 0 \n update_part_data unless args[:skip_part_data]\n\n self.history_count = self.history.size\n self.history_count = 1 if self.history_count.eql?(0) \n end\n self.save if self.changed?\n \n synchronize unless args[:dont_sync] || self.attributes[\"sync\"].blank? #rather than calling sync.blank? to skip the JSON parsing step.\n return action\n end", "def anything_to_commit?(directory)\n directory && false\n end", "def save\n create_ok = exists? ? true : create\n upload_ok = @unwritten_contents ? upload_new_content : true\n\n create_ok && upload_ok\n end", "def commit_required?; end", "def commit( recurse = true )\n return true\n end", "def commit\n if defined? _commit\n if dirty?\n _commit\n end\n end\n nil\n end", "def commit( *files, **options )\n\t\tself.server.run( :commit, *files, **options )\n\t\treturn true\n\tend", "def save\n return if @blob.data == content\n repository.store(self, commit_message)\n end", "def save\n valid? && upload and distribute\n end", "def committed?\n @state == :committed\n end", "def merge_commit?\n !squash?\n end", "def committed?()\n return nil\n end", "def uploaded?( filename, buffer )\n return false if @upload_dir.nil?\n\n savedfile = \"#{@upload_dir}/#{filename}\"\n return false unless File.exist?( savedfile )\n\n old = File.read( savedfile, encoding: buffer.encoding )\n return true if buffer == old\n\n false\n end", "def new_commit_to?(filename, branch_or_tag='master') \n\t\tlog = repo.log(branch_or_tag, filename)\n\t\tif log.first.committed_date > last_commit.committed_date \n\t\t\treturn true \n\t\telse \n\t\t\treturn false\n\t\tend\n\tend", "def commit\n return if name.kind_of?(StringIO) || !commit_required?\n\n on_success_replace do |tmp_file|\n ::Zip::OutputStream.open(tmp_file) do |zos|\n @entry_set.each do |e|\n e.write_to_zip_output_stream(zos)\n e.dirty = false\n e.clean_up\n end\n zos.comment = comment\n end\n true\n end\n initialize(name)\n end", "def upload(http_connection, merge=false, ignore_missing=false, label=nil, low_priority=false, minor_changes=false, force=false, rename_others=false, destination_path=nil)\n success = true\n tries ||= 3\n display = []\n display.push(self.file_path)\n display.push \"#{StringUtil.checksumify(self.local_checksum.to_s)}..#{StringUtil.checksumify(self.remote_checksum.to_s)}\"\n if File.exists?(self.file_path)\n\t if force or self.remote_checksum != self.local_checksum\n File.open(self.file_path) do |file|\n begin\n params = {\"file\" => UploadIO.new(file, \"text/plain\", file.path), \"merge\" => merge, \"ignore_missing\" => ignore_missing, \"label\" => label, \"low_priority\" => low_priority, \"minor_changes\" => minor_changes }\n params[\"name\"] = destination_path unless destination_path.nil?\n params[\"rename_others\"] = rename_others\n request = Net::HTTP::Put::Multipart.new(api_url, params)\n WebTranslateIt::Util.add_fields(request)\n display.push Util.handle_response(http_connection.request(request))\n rescue Timeout::Error\n puts StringUtil.failure(\"Request timeout. Will retry in 5 seconds.\")\n if (tries -= 1) > 0\n sleep(5)\n retry\n else\n success = false\n end\n rescue\n display.push StringUtil.failure(\"An error occured: #{$!}\")\n success = false\n end\n end\n else\n display.push StringUtil.success(\"Skipped\")\n end\n puts ArrayUtil.to_columns(display)\n else\n puts StringUtil.failure(\"Can't push #{self.file_path}. File doesn't exist locally.\")\n end\n return success\n end", "def nothing_to_commit?\n @git.status do |file, status|\n return false unless status.empty?\n end\n return true\n end", "def commit\n sanity_check\n @handle.commit\n end", "def is_commit()\n @is_commit\n end", "def save_changes!(files_to_commit: [], custom_message: nil)\n not_implemented(__method__)\n end", "def upload(_io, _path)\n false\n end", "def commit!\n rsp = post(\"<commit/>\")\n success?(rsp.body) or log_error(rsp.body)\n end", "def commit\n # no op\n end", "def addUnchangedFilesToCommit(prev_commit, commit, changed_files) #:doc:\n# sql = \"select devfiles.path, devfiles.name, devfiles.blob_id from devfiles, blobs, blobs_in_commits where blobs.devfile_id=devfiles.id and blobs_in_commits.blob_id=blobs.id and blobs_in_commits.commit_id=#{prev_commit.id};\"\n# devfiles_of_prev_commit = ActiveRecord::Base.connection.execute(sql)\n#\n devfiles_of_prev_commit = Devfile.find_by_sql(\"select devfiles.path, devfiles.name, devfiles.blob_id from devfiles, blobs, blobs_in_commits where blobs.devfile_id=devfiles.id and blobs_in_commits.blob_id=blobs.id and blobs_in_commits.commit_id=#{prev_commit.id};\")\n if devfiles_of_prev_commit.size > 0\n ActiveRecord::Base.connection.execute(\"begin\")\n now = DateTime.now\n devfiles_of_prev_commit.each do |df|\n if not changed_files.has_key?(df.path + df.name)\n begin\n sql = \"insert into blobs_in_commits(blob_id, commit_id, created_at, updated_at) values('#{df['blob_id']}', '#{commit.id}', '#{now}', '#{now}');\"\n ActiveRecord::Base.connection.execute(sql)\n rescue\n # do nothing\n end\n end\n end\n ActiveRecord::Base.connection.execute(\"commit\")\n end\n end", "def commit_transaction(repo, txn)\n return [false, [:no_files]] unless txn.has_jobs?\n return [true, []] if repo.commit(txn)\n\n [false, [:txn_conflicts, txn.conflicts]]\n end", "def submit_payments_file!(filename, lock_object=nil)\n shortname = filename.match(/[\\\\\\/]([^\\\\\\/]+)$/)[1]\n if lock_object && lock_object.submit_locked?(shortname)\n # raise RuntimeError, \"Submit for #{shortname} is locked!\"\n return nil\n else\n lock_object.submit_lock!(shortname) if lock_object\n res = with_ftp do |ftp|\n # 1) Create the STAGING folder if it's not already there.\n begin\n ftp.mkdir(DCAS::STAGING_BUCKET) unless ftp.nlst.include?(DCAS::STAGING_BUCKET)\n ftp.chdir(DCAS::STAGING_BUCKET)\n # 2) Delete the same filename from the STAGING folder if one exists.\n ftp.delete(shortname) if ftp.nlst.include?(shortname)\n # 3) Upload the file into the STAGING folder.\n puts \"Uploading #{filename} as #{shortname}...\"\n ftp.put(filename, shortname)\n true\n rescue Object\n lock_object.submit_failed!(shortname) if lock_object\n false\n end && begin\n # 4) If we're still connected, check the file size of the file, then move it out of STAGING and mark file as completed.\n if ftp.nlst.include?(shortname) && ftp.size(shortname) == File.size(filename)\n begin\n ftp.rename(shortname, \"../#{incoming_bucket}/#{shortname}\") unless testing || incoming_bucket == DCAS::STAGING_BUCKET\n true\n rescue Object\n false\n end && begin\n lock_object.submit_finished!(shortname) if lock_object\n true\n end\n else\n if lock_object\n lock_object.submit_failed!(shortname)\n false\n else\n raise RuntimeError, \"FAILED uploading `#{filename}' - incomplete or unsuccessful upload. Please try again.\"\n end\n end\n rescue Object\n lock_object.submit_failed!(shortname) if lock_object\n false\n end\n end\n lock_object.submit_failed!(shortname) if lock_object && res.nil?\n res\n end\n end", "def commit(upload_href, data, opts = {})\n data, _status_code, _headers = commit_with_http_info(upload_href, data, opts)\n data\n end", "def normal_commit?\n !ARGV[1] || ARGV[1] == 'message'\n end", "def commit_allowed?(entity = @entity)\n controller.commit_allowed?(entity)\n end", "def post_save\n if self.upload_status_changed?\n if upload_status == \"Waiting to Upload\"\n self.upload_to_dropbox!\n elsif upload_status == \"Uploading\"\n self.extract_metadata!\n elsif upload_status == \"Complete\"\n self.delete_from_server!\n end\n end\n end", "def upload\n @u_logger.info {\"===NEW UPLOAD===\"}\n @u_logger.info { \"Email: \" + @email + \" Bitshares Account: \" + @bitshares_account }\n # Validations of params should have been done before this action started \n # Save uploaded file on disk to /storage/upload \n uploaded_io_full_path = save_stack_file(@uploaded_io)\n @u_logger.info {\"Stack file location: \" + uploaded_io_full_path.to_s }\n @u_logger.info {\"File size: \" + File.stat(uploaded_io_full_path).size.to_s }\n if (File.stat(uploaded_io_full_path).size > 210944)\n @u_logger.error { \"File too big (> 210944 Bytes)\" }\n redirect_to deposit_index_url, alert: \"File is too big. You should upload a file smaller than 206 KB\"\n return\n end\n \n # Get the file content\n uploaded_io_content = File.read(uploaded_io_full_path)\n\n # Send file to online depository via deposit one stack\n # and get the receipt id\n receipt_id = send_to_depository(uploaded_io_content)\n @u_logger.info { \"Receipt ID: \" + receipt_id }\n\n # Do not proceed if receipt id is blank.\n # redirect_to called in send_to_depository\n if receipt_id.blank?\n @u_logger.fatal { \"Receipt ID is blank\" }\n return \n end\n\n @u_logger.info { \"Full receipt URL: https://bank.cloudcoin.global/service/get_receipt?rn=\" + receipt_id + \"&account=***\"}\n # Get full receipt from get receipt service\n full_receipt = get_receipt_json(receipt_id)\n # Do not proceed if full_receipt is blank.\n # redirect_to called in send_to_depository\n if full_receipt.blank?\n @u_logger.fatal { \"Full Receipt is blank\" }\n return\n end\n\n # Calculate value of uploaded cloud coins\n deposit_amount = get_authentic_coins_value(full_receipt)\n @u_logger.info { \"Deposit amount: \" + deposit_amount.to_s }\n\n # Call the Issue bitshares service with the account name and amount\n if deposit_amount > 0\n did_send = send_to_bitshares(@bitshares_account, deposit_amount)\n end\n\n # Send an email to the user\n if deposit_amount > 0\n if did_send\n NotificationMailer.deposit_email(@email, @bitshares_account, deposit_amount).deliver_later\n # Remove the file from local disk\n FileUtils.remove_file(uploaded_io_full_path, force: true)\n @u_logger.info {\"Transfer to Bitshares: SUCCESS\"}\n flash[:notice] = \"Your coins will be transferred to bitshares. An email has been sent to #{@email} for your records.\"\n else\n # logger.warn {@email + \" tried to upload \" + deposit_amount.to_s + \" CloudCoin(s) to bitshares account \" + @bitshares_account}\n @u_logger.info {\"Transfer to Bitshares: FAIL\"}\n redirect_to deposit_index_url, alert: \"Transfer failed! Your CloudCoins were lost\"\n return\n end\n else\n # logger.warn \"nothing to transfer\"\n # logger.warn {@email + \" has 0 CloudCoins to upload to their bitshares account, \" + @bitshares_account + \".\"}\n @u_logger.warn { \"Nothing to transfer\" }\n flash[:alert] = \"Nothing to transfer\"\n end\n\n redirect_to controller: :deposit,\n action: :completed, \n receipt_id: receipt_id,\n email: @email,\n bitshares_account: @bitshares_account\n \n end", "def check_commit\n return if @tree\n \n data = @base.lib.commit_data(@objectish)\n set_commit(data)\n end", "def commit; end", "def commit; end", "def commit; end", "def initial_commit?; end", "def initial_commit?; end", "def commiter() end", "def store(new_file)\n res = client[\"/vaults/#{vault_id}/blobs\"].post file: new_file.to_file\n json = JSON.parse(res)\n self.blob_id = json['blob_id']\n true\n end", "def commit_if_delete_dirty\n # no op\n end", "def uploaded?(file, storage_key)\n file&.storage_key == storage_key\n end", "def create_local_commit author: nil, branch:, file_name:, file_content:, message:, push: false\n on_branch(branch) do\n if (folder_name = File.dirname file_name) != '.'\n Dir.mkdir folder_name\n end\n File.write file_name, file_content\n run \"git add '#{file_name}'\"\n run \"git commit -m '#{message}' #{\"--author='#{author}'\" if author}\"\n run 'git push' if push\n end\nend", "def committed?\n @saved\n end", "def file?\n repos.stat(fs_path, revision).file?\n end", "def stored?(file = self.file)\n uploaded?(file, store_key)\n end", "def add_from_upload?(blob_params)\n !blob_params[:data].blank?\n end", "def commit_sandbox_file(sandbox_file)\n @original_committed_file_location = sandbox_file\n Chef::Log.info(\"Commiting sandbox file: move #{sandbox_file} to #{@storage}\")\n @storage.commit(sandbox_file)\n cdb_save\n end", "def image_commit(project, imagefile)\n if logged_in?\n commit project.path, imagefile.original_filename, imagefile.read, \"Add new file #{imagefile.original_filename}.\" \n end\n end", "def commit!\n _commit( false )\n end", "def upload_shipped\n end", "def commit\n freeze_time\n release_expired\n store_staged_data\n clean\n\n was_dirty?\n end", "def commit\n cfm.commit_change_on(self) if do_commit?\n end", "def upload(bucket, file); end", "def upload_to_sandbox(file, sandbox)\n\n checksum = Pedant::Utility.checksum(file)\n base64 = Pedant::Utility.base64_checksum(checksum)\n headers = {\n 'content-type' => 'application/x-binary',\n 'content-md5' => base64,\n }\n\n if sandbox[\"checksums\"][checksum][\"needs_upload\"]\n upload_url = sandbox[\"checksums\"][checksum][\"url\"]\n # file is an unclosed File object returned from our utility\n # functions that make use of Tempfile. Since we want the\n # entire contents, rewind before read.\n file.rewind\n ensure_2xx(put(upload_url, admin_user, :payload => file.read,\n :headers => headers))\n else\n true\n end\n end", "def commit\n head.commit\n end", "def save_file_to_b2_bucket(file)\n\n result = parse_files_json(file)\n\n if result == {} # file not in bucket\n b2_upload_file(file)\n cleanup_cached_images()\n puts \"Image uploaded to bucket!\"\n else\n cleanup_cached_images()\n puts \"Image already in bucket!\"\n end\n\nend", "def save_file \n Grit.debug = true\n contents = params[:contents]\n message = params[:commit_message]\n @node = Node.new(:name => params[:name], :git_repo_id => params[:git_repo_id], :git_repo_path => params[:git_repo_path])\n save_file_to_disk(contents, @node.abspath)\n stage_and_commit_file(@node.repo_base_path, @node.git_repo_path, message)\n flash[:notice] = \"Created New Version\"\n render :action => :file\n end", "def patch_file(file, &block)\n filename = \"#{Dir.pwd}/#{file}\"\n if File.exist?(filename)\n contents = IO.read(filename)\n new_contents = block.call(contents.dup)\n if contents != new_contents\n File.open(filename, 'wb') {|f| f.write new_contents}\n mysystem(\"git add #{file}\")\n return true\n end\n end\n false\n end", "def check\n super\n uncommitted = Perforce.uncommitted_files\n fail \"Uncommitted files violate the First Principle Of Release!\\n#{uncommitted.join(\"\\n\")}\" unless uncommitted.empty?\n end", "def commit_files(author: nil, message: nil, parent: nil, files: {})\n # check parameters\n raise \"no author given\" if author.nil?\n raise \"no message given\" if message.nil?\n\n # get parent commit\n if not parent.nil?\n parent = @wiki.commit_for(parent)\n elsif parent.nil? and not @wiki.repo.head.commit.nil?\n parent = @wiki.commit_for(@wiki.repo.head.commit.id)\n end\n\n unless parent.nil?\n log_debug \" checkpoint (parent #{parent})\"\n if parent.id != @wiki.repo.head.commit.id\n log_debug \" (parent #{parent} is not head)\"\n\n # now check version of each file individually, if it has been\n # changed in one of the changes since parent.\n #\n # if so, raise error, else proceed\n\n files.each do |path,contents|\n next if @wiki.repo.log(nil, path, {:since => parent.authored_date}).empty?\n log_debug \" file has changed\"\n raise \"repo has changed\"\n end\n end\n end\n\n options = {\n :message => message,\n :author => author,\n }\n unless parent.nil?\n options[:parent] = parent\n end\n\n committer = Gollum::Committer.new(@wiki, options)\n\n files.each do |path,contents|\n path = path.dup.gsub(/^\\.\\//, '')\n if contents.nil?\n committer.index.delete(path)\n else\n committer.index.add(path, normalize(contents))\n end\n # if wikifile_exists? path, parent\n # log_debug \" U path: #{path}, contents: #{normalize(contents)}\"\n # committer.index.add(path.dup, normalize(contents))\n # else\n # log_debug \" A path: #{path}, contents: #{normalize(contents)}\"\n # dir, name, format = split_path path\n # committer.add_to_index(dir, name, format, contents)\n # end\n end\n\n committer.after_commit do |index, sha|\n log_debug \" after_commit: #{index}, #{sha}\"\n @wiki.clear_cache\n\n files.each do |path,contents|\n path = path.gsub(/^\\.\\//, '')\n #dir, name, format = split_path path\n unless @wiki.repo.bare\n Dir.chdir(::File.join(@wiki.repo.path, \"..\")) do\n if contents.nil?\n @wiki.repo.git.rm(path, :force => true)\n else\n @wiki.repo.git.checkout(path, 'HEAD')\n end\n end\n end\n end\n\n @wiki_manager.add_to_index(@wiki, index, sha, files)\n end\n\n sha = committer.commit\n log_debug \"sha #{sha}\"\n end", "def needs_commit?(dir = Dir.pwd, file = nil)\n rval = false\n Dir.chdir(dir) do\n status = %x{git status}\n if file.nil?\n rval = true unless status =~ /nothing to commit \\(working directory clean\\)|nothing added to commit but untracked files present/\n if status =~ /nothing added to commit but untracked files present/\n puts \"WARNING: untracked files present in #{dir}\"\n show_changed_files(status)\n end\n else\n rval = true if status =~ /^#\\t.*modified: #{file}/\n end\n end\n rval\nend", "def commit\n @repo.commit\n end", "def git_commit(message, fail_on_error = true)\n begin\n mysystem(\"git commit -m \\\"#{message}\\\" 2> /dev/null > /dev/null\")\n return true\n rescue Exception => e\n raise e if fail_on_error\n return false\n end\n end", "def anything_to_commit?(name)\n git(name).status.changed.present?\n end", "def process_upload\n return if @upload_processed\n @file.file.process!\n @upload_processed = true\n end", "def stor_file(source, filename)\n self.ftp.chdir(\"/upload\")\n\n if source.is_a?(File)\n self.ftp.putbinaryfile(source, filename, Net::FTP::DEFAULT_BLOCKSIZE)\n else\n self.ftp.storbinary(\"STOR #{filename}\", StringIO.new(source), Net::FTP::DEFAULT_BLOCKSIZE)\n end\n\n true\n end", "def save_to_git\n FileUtils.makedirs File.dirname(blob_path(false)) unless File.exists? File.dirname(blob_path(false))\n File.open(blob_path(false), 'w') do |file|\n file.write to_yaml_git\n end\n if (repository.tree/blob_path).nil?\n add_blob\n end\n end", "def commit(opts = {:use_dirstate => true, :update_dirstate => true})\n valid = false # don't update the DirState if this is set!\n \n commit = ((modified || []) + (added || [])).sort\n remove = removed\n xtra = extra.dup\n branchname = xtra[\"branch\"]\n text = description\n \n p1, p2 = parents.map {|p| p.node }\n c1 = repo.changelog.read(p1) # 1 parent's changeset as an array\n c2 = repo.changelog.read(p2) # 2nd parent's changeset as an array\n m1 = repo.manifest.read(c1[0]).dup # 1st parent's manifest\n m2 = repo.manifest.read(c2[0]) # 2nd parent's manifest\n \n if opts[:use_dirstate]\n oldname = c1[5][\"branch\"]\n tests = [ commit.empty?, remove.empty?, !opts[:force],\n p2 == NULL_ID, branchname == oldname ]\n if tests.all?\n UI::status \"nothing changed\"\n return nil\n end\n end\n \n xp1 = p1.hexlify\n xp2 = p2 == NULL_ID ? \"\" : p2.hexlify\n \n Hook.run_hook :pre_commit\n journal = Amp::Mercurial::Journal.new(:opener => repo.store_opener)\n \n fresh = {} # new = reserved haha i don't know why someone wrote \"haha\"\n changed = []\n link_rev = repo.size\n \n (commit + (remove || [])).each {|file| UI::status file }\n \n # foreach file in commit:\n # commit_file file\n # end\n commit.each do |file|\n versioned_file = self[file]\n fresh[file] = versioned_file.commit :manifests => [m1, m2],\n :link_revision => link_rev,\n :journal => journal ,\n :changed => changed\n \n new_flags = versioned_file.flags\n \n # TODO\n # Clean this shit up\n if [ changed.empty? || changed.last != file, \n m2[file] != fresh[file]\n ].all?\n changed << file if m1.flags[file] != new_flags\n end\n m1.flags[file] = new_flags\n \n repo.staging_area.normal file if opts[:use_dirstate]\n end\n \n # add_manifest_entry\n man_entry, updated, added = *add_manifest_entry(:manifests => [m1, m2],\n :changesets => [c1, c2],\n :journal => journal ,\n :link_rev => link_rev,\n :fresh => fresh ,\n :remove => remove ,\n :changed => changed )\n\n # get_commit_text\n text = get_commit_text text, :added => added, :updated => updated,\n :removed => removed, :user => user ,\n :empty_ok => opts[:empty_ok] ,\n :use_dirstate => opts[:use_dirstate]\n \n # atomically write to the changelog\n # add_changelog_entry\n # for the unenlightened, rents = 'rents = parents\n new_rents = add_changelog_entry :manifest_entry => man_entry,\n :files => (changed + removed),\n :text => text,\n :journal => journal,\n :parents => [p1, p2],\n :user => user,\n :date => date,\n :extra => xtra\n \n \n # Write the dirstate if it needs to be updated\n # basically just bring it up to speed\n if opts[:use_dirstate] || opts[:update_dirstate]\n repo.dirstate.parents = new_rents\n removed.each {|f| repo.dirstate.forget(f) } if opts[:use_dirstate]\n repo.staging_area.save\n end\n \n # The journal and dirstates are awesome. Leave them be.\n valid = true\n journal.close\n \n # if an error and we've gotten this far, then the journal is complete\n # and it deserves to stay (if an error is thrown and journal isn't nil,\n # the rescue will destroy it)\n journal = nil\n \n # Run any hooks\n Hook.run_hook :post_commit, :added => added, :modified => updated, :removed => removed, \n :user => user, :date => date, :text => text,\n :revision => repo.changelog.index_size\n return new_rents\n rescue StandardError => e\n if !valid\n repo.dirstate.invalidate!\n end\n if e.kind_of?(AbortError)\n UI::warn \"Abort: #{e}\"\n else\n UI::warn \"Got exception while committing. #{e}\"\n UI::warn e.backtrace.join(\"\\n\")\n end\n \n # the journal is a vestigial and incomplete file.\n # destroyzzzzzzzzzzz\n journal.delete if journal\n end", "def commit!() raise NotImplementedError end", "def file_unchanged?(js_name)\n # Start-Open3\n Open3.popen3(\"git status --short #{js_name}\") do |stdin, stdout, stderr|\n # Start-If: Check if job script in working dir is modified since last check-in\n if stdout.read.empty? \n return true\n else \n puts \"#{js_name} modified since last commit. Please commit changes to the repo and #{$0} again!\"\n return false\n end\n # End-If: Check if job script in working dir is modified since last check-in\n end\n # End-Open3\nend", "def saved?\n return [email protected]?\n end", "def check\n super\n uncommitted = Git.uncommitted_files\n fail \"Uncommitted files violate the First Principle Of Release!\\n#{uncommitted.join(\"\\n\")}\" unless uncommitted.empty?\n # fail \"You are releasing from a local branch that does not track a remote!\" unless Git.remote\n end", "def save\n valid_file? and successful_conversion?\n end", "def save_file(file, name = '')\n if name.size > 0\n filename = name + File.extname(file[:filename])\n else\n filename = file[:filename]\n end\n FileUtils.mkdir_p(attach_dir) unless File.exists?(attach_dir)\n new_file = File.join(attach_dir, filename)\n\n f = File.new(new_file, 'w')\n f.write(file[:tempfile].read)\n f.close\n\n commit_message = \"uploaded #{filename} for #{@name}\"\n begin\n $repo.add(new_file)\n $repo.commit(commit_message)\n rescue\n # FIXME why!??\n nil\n end\n end", "def createDevfile(f, commit) #:doc:\n \n dev_file = nil\n blob = nil\n b_in_c = nil\n \n # If file already exists, raises an error but nothing needs to be deleted (except the commit is cancelled)\n begin \n dev_file = Devfile.find_by_name_and_path_and_device_id(f['name'], f['path'], @device.id)\n if dev_file != nil\n puts \"Devfile: #{f['path'] + f['name']} already exits, cannot create, use update instead\"\n raise ArgumentError.new(\"Devfile already exits for this device, cannot use CREATE -method, use UPDATE instead to add new version\")\n end\n rescue Exception => e\n puts e.to_s\n puts e.backtrace[0].to_s\n raise e\n end\nputs \"name: #{f['name']}\"\nputs \"path: #{f['path']}\"\n \n # If something goes wrong, raises an error, and deletes the data created\n begin\n \n puts \"Creating new dev_file, blob etc..\"\n \n \n f_filedate = DateTime.strptime(f['filedate'], \"%T %F\")\n f_filedate = f_filedate.strftime('%F %T').to_s\n \n now = DateTime.now\n \n # get or create devfile\n dev_file = Devfile.find_or_create_by_name_and_path_and_device_id(f['name'], f['path'], @device.id)\n if dev_file.created_at >= now\n sql = \"update devfiles set filetype='#{f['filetype']}', path='#{f['path']}', privatefile=0 where id=#{dev_file.id}\" \n ActiveRecord::Base.connection.execute(sql)\n end\n \n # get or create blob\n blob = Blob.find_or_create_by_blob_hash_and_devfile_id(f['blob_hash'], dev_file.id)\n if blob.created_at >= now # if just created\n # Version number\n version = 0\n predecessor_blob_id = \"NULL\"\n follower_blob_id = \"NULL\"\n if dev_file.blob_id != nil\n predecessor_blob_id = dev_file.blobs.find_by_id(dev_file.blob_id) ? dev_file.blobs.find_by_follower_id(dev_file.blob_id).id.to_s : \"NULL\"\n follower_blob_id = dev_file.blobs.find_by_predecessor_id(blob.id) ? dev_file.blobs.find_by_predecessor_id(blob.id).id.to_s : \"NULL\"\n version = dev_file.blobs.find_by_id(dev_file.blob_id).version + 1 \n end\n \nputs \"predecessor_id=#{predecessor_blob_id.to_s},\"\nputs \"follower_id=#{follower_blob_id.to_s},\"\nputs \"size=#{f['size'].to_s},\" \nputs \"filedate='#{f_filedate.to_s}',\" \nputs \"version=#{version.to_s},\" \nputs \"uploaded='0',\" \nputs \"latitude=#{@commit_location['latitude'].to_s}, \" \nputs \"longitude=#{@commit_location['longitude'].to_s} \" \n \n sql = \"update blobs set predecessor_id=#{predecessor_blob_id.to_s}, follower_id=#{follower_blob_id.to_s}, size=#{f['size'].to_s}, filedate='#{f_filedate.to_s}', version=#{version.to_s}, uploaded='0', latitude=#{@commit_location['latitude'].to_s}, longitude=#{@commit_location['longitude'].to_s} where id=#{blob.id};\"\nputs \"sql: \" + sql\n \n ActiveRecord::Base.connection.execute(sql)\n end\n \n # Creates association between blob and commit\n b_in_c = BlobsInCommit.find_or_create_by_blob_id_and_commit_id(blob.id, commit.id)\n \n # update blob_id to devfile\n if dev_file.blob_id != blob.id\n sql = \"update devfiles set blob_id=#{blob.id} where id=#{dev_file.id};\"\n ActiveRecord::Base.connection.execute(sql)\n end\n \n \n #checkForObservers(dev_file)\n \n # If parent_blob_hash is given, tries to find the parent, and creates new branch form the parent\n if f['file_origin'] \n createBranch(f['file_origin'], blob)\n end\n\n rescue Exception => e\n puts \" -- Error in createDevfile: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n \n puts \"Deleting created data..\"\n \n # If dev_file was created now, deletes it\n dev_file.delete if dev_file\n puts \"Deleted created dev_file!\" if dev_file\n \n if blob \n if b_in_c\n BlobsInCommit.delete_all([\"commit_id = ? AND blob_id = ?\", b_in_c.commit_id.to_s, blob.blob_id.to_s])\n puts \"Deleted created blobs_in_commits!\" if b_in_c\n end\n blob.delete \n puts \"Deleted created blob!\"\n end\n \n # Throws forward the exception..\n raise e\n end\n puts \"File created\"\n return dev_file\n end", "def finish(path, write_conflict_policy)\n @client.files.commit_chunked_upload(path, @upload_id, write_conflict_policy)\n end", "def updateDevfile(f, commit) #:doc:\n \n dev_file = nil\n \n begin\n # Checks if there is any changes in files.\n f_filedate = DateTime.strptime(f['filedate'], \"%T %F\")\n f_filedate = f_filedate.strftime('%F %T').to_s \n \n now = DateTime.now.strftime('%F %T')\nputs \"name: #{f['name']}\"\nputs \"path: #{f['path']}\"\n puts \"Finding devfile..\"\n dev_file = @device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", f['name'], f['path']])\n if dev_file != nil\n puts \"devfile found: \" + dev_file.id.to_s\n else\n puts \"Devfile not found\"\n raise Exception.new(\"Devfile not found. Can not update it!\")\n end\n \n \n blob = dev_file.blobs.find_by_blob_hash_and_devfile_id(f['blob_hash'], dev_file.id)\n if blob != nil\n puts \"Blob already exists!\"\n puts \"Blob: \" + blob.id.to_s\n return\n else\n puts \"Blob was not found!\"\n end\n \n # Finds the blob that is newest one\n previous_blob_id = nil\n current_blob = dev_file.blobs.find_by_id(dev_file.blob_id)\n if current_blob != nil\n previous_blob_id = current_blob.id.to_s\n puts \"Current blob: \" + current_blob.id.to_s\n \n end\n \n # If the blob, didn't exist yet, creates it. Ensures that blob will have version number.\n if blob == nil #or current_blob == nil\n version = 0\n if current_blob != nil\n version = current_blob.version + 1\n end\n \n puts \"Creates new blob, verion num: \" + version.to_s\n sql = \"insert into blobs(blob_hash, created_at, updated_at, size, filedate, uploaded, version, devfile_id, predecessor_id, latitude, longitude) values('#{f['blob_hash']}', '#{now}', '#{now}', '#{f['size']}', '#{f_filedate}', '0', '#{version}', '#{dev_file.id}', '#{previous_blob_id}', '#{@commit_location['latitude']}', '#{@commit_location['longitude']}');\"\n ActiveRecord::Base.connection.execute(sql)\n end\n \n puts \"Finding the newly created blob..\"\n blob = dev_file.blobs.find_by_blob_hash(f['blob_hash'])\n puts \" found blob: \" + blob.id.to_s\n \n current_blob.update_attribute(:follower_id, blob.id)\n \n puts \"Updating devfile\"\n # Updates changes in devfile (current blob)\n sql = \"update devfiles set filetype = '#{f['filetype']}', latitude = '#{f['latitude']}', longitude = '#{f['longitude']}', blob_id = '#{blob.id.to_s}', updated_at = '#{now}' where name = '#{f['name']}' and path = '#{f['path']}' and device_id = #{@device.id};\"\n puts \" SQL: \" + sql.background(:red)\n ActiveRecord::Base.connection.execute(sql)\n \n BlobsInCommit.find_or_create_by_blob_id_and_commit_id(blob.id, commit.id)\n \n \n #checkForObservers(dev_file)\n \n rescue => e\n puts \"Errors in updating file\" + e\n raise e\n end\n \n puts \"devfile updated!\"\n return dev_file\n end", "def commit_if_dirty(soft_commit = false)\n session.commit_if_dirty soft_commit\n end", "def commit_blob_change_to_repo_for_user(repo, user, branch, old_oid, files, message)\n return false unless repo.ready_for_writes?\n\n ref = repo.heads.find_or_build(branch)\n\n # use the branch's target_oid, or fall back on the supplied old_oid.\n # both can be nil for an absolutely new file in a new repo.\n parent_oid = ref.target_oid || old_oid\n\n author_email = params[:author_email]\n commit = repo.create_commit(parent_oid,\n message: message,\n author: current_comment.user,\n files: files,\n author_email: author_email,\n committer: user\n )\n\n return false unless commit\n\n if author_email\n if user.primary_user_email.email != author_email\n GitHub.dogstats.increment(\"commit.custom_commit_email\", tags: [\"email:custom\"])\n else\n GitHub.dogstats.increment(\"commit.custom_commit_email\", tags: [\"email:primary\"])\n end\n end\n\n before_oid = ref.target_oid\n ref.update(commit, user, reflog_data: request_reflog_data(\"blob edit\"))\n PullRequest.after_repository_push(\n repo,\n ref.qualified_name,\n user,\n before: before_oid,\n after: commit.oid\n )\n ref.enqueue_push_job(before_oid, commit.oid, user)\n ref.enqueue_token_scan_job(before_oid, commit.oid)\n ref.name\n rescue Git::Ref::HookFailed => e\n @hook_out = e.message\n false\n rescue Git::Ref::ProtectedBranchUpdateError => e\n @hook_out = \"#{ref.name} branch is protected\"\n false\n rescue Git::Ref::ComparisonMismatch, GitRPC::Failure\n false\n rescue Git::Ref::InvalidName, Git::Ref::UpdateFailed\n false\n rescue GitHub::DGit::UnroutedError, GitHub::DGit::InsufficientQuorumError, GitHub::DGit::ThreepcFailedToLock\n false\n end", "def upload!(file_path)\n raise GitCloud::FileException.new(\"NotFound\") unless File.exists? file_path\n file = File.new(File.expand_path(file_path))\n add(file)\n commit\n push\n end", "def check_for_file_edits(committed_files)\n check_for_changes = `git ls-files --modified`\n\n if check_for_changes.each_line { |line|\n # if the user modified any files while executing this hook, then ask for a re-commit and abort the user push\n if committed_files.include?(line.rstrip())\n puts \"**File have been edited. Please stage/re-commit your changes and push again**\"\n exit(1)\n end\n }\n else\n exit(0)\n end\nend", "def promote?(uploaded_file)\n uploaded_file && cache.uploaded?(uploaded_file)\n end", "def initial_commit?\n !Overcommit::Utils.execute(%w[git rev-parse HEAD]).success?\n end", "def initial_commit?\n !Overcommit::Utils.execute(%w[git rev-parse HEAD]).success?\n end", "def save_file(upload)\n return false if upload.blank?\n name = self.id.to_s + \".\" + upload.original_filename\n\n self.aws_connect()\n \n # store the file to Amazon S3\n AWS::S3::S3Object.store(name, upload, 'assetmngr', :access => :public_read)\n self.filename = name\n self.save\n end", "def stage_and_commit_file(repo_base_path, relpath_to_file, commit_message = nil)\n commit_message = \"Updated #{relpath_to_file} via website\" unless !commit_message.blank?\n gitRepo = Repo.new(repo_base_path)\n olddir = Dir.pwd\n Dir.chdir(repo_base_path)\n gitRepo.add(relpath_to_file)\n gitRepo.commit_index(commit_message)\n Dir.chdir(olddir)\n end", "def verify_update_file\n @log.info('Beginning integrity check of downloaded file .')\n @file_sha1 = Digest::SHA1.file(@update_file.path).hexdigest\n\n @log.info('Verifying integrity of downloaded file.')\n\n if download_remote_sha1 == @file_sha1\n @log.info('Integrity verified.')\n true\n else\n abort('File was not downloaded correctly. Please try again.')\n end\n end", "def update\n @resource = params[:content]\n\n\t\tif params[:dir_path] == \"/\"\n\t\t\tparams[:dir_path]=\"\"\n\t\tend\n\n\t\tfile_path = \"#{params[:dir_path]}/#{params[:filename]}\"\n\n if File.open(file_path, 'w') {|f| f.write(params[:content]) }\n\t\t\tDir.chdir(params[:dir_path])\n\t\t\t@git = Git.init()\n\t\t\tGitHelper.commitAll(@git, params[\"comment\"])\n\n\t\t\trender json: {success: \"file successfully uploaded\"}\n else\n render json: { error: \"SOMETHING WENT WRONG SAVING RESOURCE\" }\n end\n end", "def test_add_existing_file\n @gitit.add('hello.txt', 'Hello, dsyph3r')\n @gitit.commit('modifying hello world')\n\n file = @gitit.get_file('hello.txt')\n\n assert_not_nil(file)\n\n assert_equal('Hello, dsyph3r', file['data'], 'File data is incorrect')\n end", "def submit!\n return false if participants.empty?\n return false unless valid?\n nsc.submit_file! if valid?\n end", "def commit\n {}\n end", "def commit\n {}\n end", "def commit_required?\n @entry_set.each do |e|\n return true if e.dirty\n end\n @comment != @stored_comment || @entry_set != @stored_entries || @create\n end", "def commit\n system(\"cd #{repo_path};git commit -m 'to the cloud'\")\n end", "def tx_commit\n write_bytes FrameBytes.tx_commit(@id)\n expect :tx_commit_ok\n nil\n end", "def perform_commit\n raise NotImplementedError\n end" ]
[ "0.70447665", "0.65341896", "0.6500315", "0.6240958", "0.62225926", "0.6187146", "0.60833895", "0.60467666", "0.602827", "0.5978281", "0.5943722", "0.5923486", "0.5871943", "0.5862198", "0.58589554", "0.5825412", "0.5822279", "0.57865465", "0.5734036", "0.5720119", "0.56974626", "0.5688311", "0.5667105", "0.564771", "0.56472033", "0.56323576", "0.561631", "0.5613463", "0.56130123", "0.5610094", "0.5608876", "0.560845", "0.5589035", "0.5577835", "0.5550854", "0.5546247", "0.5542376", "0.5542376", "0.5542376", "0.5521091", "0.5521091", "0.55187666", "0.55179226", "0.55159116", "0.5500641", "0.5497645", "0.5497572", "0.5496602", "0.5485017", "0.54821444", "0.54748744", "0.5466199", "0.54612714", "0.5458267", "0.5454301", "0.5434123", "0.5432205", "0.54321355", "0.54252625", "0.54245913", "0.5424591", "0.54234594", "0.54140353", "0.5412781", "0.540921", "0.53993285", "0.53819776", "0.5377176", "0.5375196", "0.53708816", "0.53660864", "0.536359", "0.53583044", "0.5354835", "0.5321835", "0.5318934", "0.53156185", "0.5308418", "0.5299542", "0.52961564", "0.5283473", "0.52773476", "0.5266986", "0.52621424", "0.5258589", "0.52551097", "0.5251675", "0.5251675", "0.5250407", "0.5249741", "0.52408034", "0.5238843", "0.5235089", "0.52320284", "0.522923", "0.522923", "0.5222205", "0.5220008", "0.5213683", "0.5210909" ]
0.7668371
0
Determines if the uploaded file can be retrieved from the blockchain and if so, retrieves it.
def retrieve_file if @upload.public? && @upload.file_type.public? && @upload.address.present? && @upload.success? BlockchainRetrieveJob.perform_later(@upload.id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_file(file)\n begin\n @ftp.getbinaryfile(file)\n return true\n rescue Exception => e\n error_message(e)\n return false\n end\n end", "def fetchFile #:doc:\n \n begin\n @user = User.find_by_username(params[:username])\n @device = @user.devices.find_by_dev_name(params[:devicename])\n \n getPathAndFilename\n @file = @device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", @filename, @path])\n @blob = Blob.find_by_id(@file.blob_id)\n rescue => e\n puts e\n return false\n end\n \n # if not found\n if @file == nil\n return false\n end\n return true\n end", "def check\n # PS: Api#checkfiles throws exception when file cannot be found\n response = @api.checkfiles(@url).first rescue {}\n\n if response[:file_status] == :ok\n @fileid = response[:file_id]\n @filename ||= response[:file_name]\n @filesize = response[:file_size].to_i\n @server_id = response[:server_id]\n @short_host = response[:short_host]\n\n @remote_filename = @filename\n @filename = @local_filename || @remote_filename\n true\n else\n # TODO report errors according to actual file status\n @error = 'File not found'\n false\n end\n end", "def get(filename)\n begin\n out = @client.get_file(\"#{filename}\")\n rescue DropboxError\n return false\n end\n ProcessLayer.write_data(filename,out) #returns true/false\n end", "def remote_file?\n file? && @remote_file\n end", "def retrieve!\n return false unless submitted?\n nsc.retrieve_files! # This will trigger these files for processing as well.\n end", "def get\n uploaded_file(read) if read\n end", "def fetch_required?\n !(File.exist?(downloaded_file) && digest(downloaded_file, digest_type) == checksum)\n end", "def bak_it\n begin\n path = PathHelper.path(fid)\n $mg.get_file_data(dkey, path)\n rescue => e\n raise e if $debug\n return false\n end\n true\n end", "def file?\n self.file.file?\n end", "def uploaded?(file, storage_key)\n file&.storage_key == storage_key\n end", "def fetch\n self.validation_status = :uploading\n FetchFile.fetch_version(self)\n ensure\n self.validation_status = :unvalidated\n end", "def fully_uploaded?(file_url)\n retry_network_errors(@network_error_retry_options) do\n @http_client.get_url_time(file_url) < Time.now - 2.hours\n end\n end", "def file_matching_path\n !!container.stored_files.where(file_name: file_name, path: path).first\n end", "def check_for_file\n @ff.check_for_file \n end", "def checkFileRightstoResultsinVersionlist\n # Get first blob and check if it is a private file\n if first = @results.first()\n if first.devfile.privatefile == true\n # Check that user has signed in\n # If user is client, see if it is signed in\n if params[:i_am_client]\n username = authenticateClient\n \n # If user is signed in\n elsif session[:username]\n username = session[:username].to_s\n end\n \n # If username was not found, return false\n if username == nil\n return false\n end\n \n user = User.find_by_username(username)\n \n # If user was not found, return false\n if user == nil\n return false\n end\n \n # If user owns the file, he can access it\n if username == first.devfile.device.user.username\n return true\n end\n \n # Groups user is in\n user_groups = user.groups\n \n # Groups file is in\n fileinGroups = DevfileAuthGroup.find_all_by_devfile_id(first.devfile_id)\n \n # Check if file is in one of those groups\n fileinGroups.each do |x|\n if user_groups.find_by_id(x.group_id) != nil\n return true\n end\n end\n \n # Find device the file is in. Is user authorized to access files of the device.\n deviceinGroups = DeviceAuthGroup.find_all_by_device_id(first.devfile.device.id)\n deviceinGroups.each do |d|\n if user_groups.find_by_id(d.group_id) != nil\n return true\n end\n end\n \n return false\n end\n else\n return false\n end\n # User is allowed to access versionlist\n return true\n end", "def stored?(file = self.file)\n uploaded?(file, store_key)\n end", "def retrieve!(file)\n\t\t\t\tclient = uploader.jwt_private_key_path.present? ? box_client_jwt : box_client\n\t\t\t\tCarrierWave::Storage::Box::File.new(uploader, config, uploader.store_path(file), client)\n\t\t\tend", "def check_read(file, bytes); end", "def check_read(file, bytes); end", "def do_retrieve_specs?\n log_info(\"do_retrieve_spec value_for_file_name = #{value_for_file_name}\")\n if @do_retrieve_spec\n return @do_retrieve_spec\n else\n @do_retrieve_spec ||= begin\n if valid_mac?(new_resource.name)\n false\n else\n new_resource.retrieve_specs\n end\n end\n end\n end", "def has_file\n if id == nil \n false\n else\n FileTest.exists?( local_file_path )\n end\n end", "def stored?(file)\n ok_file = get_ok_file_for(file)\n fail_file = get_fail_file_for(file) \n if ( File.exists?(ok_file) or File.exists?(fail_file) )\n return true\n end \n return false\n end", "def file?\n !!@file ||= false\n end", "def can_access_managed_file_resource?( mfr )\n\t\ttrue\n\tend", "def cached?(file = self.file)\n uploaded?(file, cache_key)\n end", "def verify_update_file\n @log.info('Beginning integrity check of downloaded file .')\n @file_sha1 = Digest::SHA1.file(@update_file.path).hexdigest\n\n @log.info('Verifying integrity of downloaded file.')\n\n if download_remote_sha1 == @file_sha1\n @log.info('Integrity verified.')\n true\n else\n abort('File was not downloaded correctly. Please try again.')\n end\n end", "def check\n\n # get enriched entity\n require_enrichment\n uri = _get_entity_name\n headers = {\n Referer: \"#{uri}\"\n }\n\n # check if vuln\n response = http_request :get, \"#{uri}?displayName=whatever&filepath=../../boot.ini\", nil, headers\n if response.code.to_i == 200 && response.body_utf8 =~ /operating systems/\n _log \"Vulnerable!\"\n return \"Retrieved contents of boot.ini file: #{response.body_utf8}\"\n end\n\n # if original URI didn't work, lets try the default url\n _log \"Testing at /vsaPres/web20/core/Downloader.ashx\"\n uri_obj = URI(uri)\n endpoint = \"#{uri_obj.scheme}://#{uri_obj.hostname}:#{uri_obj.port}/vsaPres/web20/core/Downloader.ashx?displayName=whatever&filepath=../../boot.ini\"\n response = http_request :get, endpoint, nil, headers\n if response.code.to_i == 200 && response.body_utf8 =~ /operating systems/\n _log \"Vulnerable!\"\n return \"Retrieved contents of boot.ini file: #{response.body_utf8}\"\n end\n end", "def geifile?\n @raw_image_files.first.geifile?\n end", "def download_and_process_file?(file_name)\n Rails.logger.info \"processing file: #{file_name}\"\n\n @form_count = 0\n @error_count = 0\n\n file_details = parse_file_name(file_name)\n\n return false if file_details.blank?\n\n # downloads S3 file into local file, allows for processing large files this way\n temp_file = Tempfile.new(file_name, encoding: 'ascii-8bit')\n\n # downloads file into temp_file\n bucket.object(file_name).get(response_target: temp_file)\n\n process_file?(temp_file, file_details)\n rescue => e\n Rails.logger.error(e.message)\n false\n end", "def application_guard_block_file_transfer\n return @application_guard_block_file_transfer\n end", "def file?\n [email protected]?\n end", "def get\n file = XFile.get(params[:id])\n raise RequestError.new(:file_not_found, \"File not found\") unless file\n raise RequestError.new(:bad_access, \"No access\") unless file.users.include? session[:user]\n raise RequestError.new(:bad_param, \"Can't get a folder\") if file.folder\n raise RequestError.new(:file_not_uploaded, \"File not completely uploaded\") unless file.uploaded\n raise RequestError.new(:bad_part, \"Incorrect content\") if file.content.nil?\n\n @result = retrieve(file, params[:part].to_i) if (!params[:direct] || params[:direct] != \"true\")\n \tsend_data(full_retrieve(file), filename: file.name) if (params[:direct] == \"true\")\n end", "def readable?\n disk_filename.present? && self.s3_object(false).exists?\n end", "def file_exists? url\n if url.match(/^http/)\n localfile = remote_url_to_local url\n else\n localfile = url\n end\n remotefile = local_to_remote localfile\n begin\n localfile_size = File.size localfile\n remotefile_size = ftp.size remotefile\n # puts \"#{localfile}: #{localfile_size}\"\n # puts \"#{remotefile}: #{remotefile_size}\"\n if remotefile_size == localfile_size\n url\n else\n nil\n end\n rescue Exception=>ex\n # puts ex.message\n nil\n end\n end", "def file?\n repos.stat(fs_path, revision).file?\n end", "def readable?\n transient? || (filename && filename.readable?)\n end", "def can_upload?\n false\n end", "def file?\n original_filename.present?\n end", "def blob?\n @blob\n end", "def retrieve!(identifier)\n CarrierWave::Storage::TrueVault::File.new(api_key, vault_id, identifier)\n end", "def checkFile\n result = Hash.new\n result['status'] = true\n begin # try\n if File.file?('public' + params[:file])\n result['file'] = params[:file]\n else\n result['status'] = false\n end\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def retrieve!(file)\n CarrierWave::Storage::Dropbox::File.new(uploader, config, uploader.store_path(file), dropbox_client)\n end", "def retrieve!(file)\n CarrierWave::Storage::Dropbox::File.new(uploader, config, uploader.store_path(file), dropbox_client)\n end", "def file_exist?\n return FileTest.exist?(@fileurl)\n end", "def fetch_file_by_url\n if (self.url)\n self.file = self.url\n end\n end", "def check( _upload )\n @original = _upload\n path = File.join( @uploadDir, @original )\n res = UploadUtils.filename( path )\n @uploadPath = res['path']\n @ext = res['ext']\n @filename = res['filename']\n end", "def accesible(f)\n begin\n File.open(f,\"r\")\n true\n rescue\n false\n end\nend", "def file_download_access?\n if license_delivery_contact == 'Yes'\n true\n end\n end", "def file_exist?(filename)\n if __transport_connection\n __transport_connection.file(filename).exist?\n else\n File.exist?(filename)\n end\n end", "def on_a_fort\n fort_response = Net::HTTP.get_response(URI('http://files.fort/'))\n fort_response.is_a?(Net::HTTPSuccess)\nrescue\n false\nend", "def disk?\n ! url?\n end", "def file?() end", "def pfile?\n @raw_image_files.first.pfile?\n end", "def storage_exists?\n File.exists?(file_path)\n end", "def uploaded?(uploaded_file)\n uploaded_file.storage_key == storage_key.to_s\n end", "def already_loaded?(uploaded_file)\n uploaded_file.reload\n originals = uploaded_file.original_inputs\n return false unless originals.present?\n sha2_hashes = []\n originals.each do |orig|\n return false if orig.nil? || orig.sha2_hash.nil?\n sha2_hashes << orig.sha2_hash\n end\n\n return false if sha2_hashes.empty?\n\n UploadedFile.joins(:original_inputs)\n .where(status: 'S')\n .where(validate_only: false)\n .where(original_input: {sha2_hash: sha2_hashes,\n mime_type: 'text/stix'}).count > 0\n end", "def file?\n !!@pointer['realpath']\n end", "def verify_remote_file(remotes:, file_location:)\n remotes.any? ? remotes.detect {|remote| remote.name == file_location} : ApplicationController.firecloud_client.execute_gcloud_method(:get_workspace_file, 0, self.bucket_id, file_location)\n end", "def file?\n !!@pointer['realpath']\n end", "def is_file?\n path = self.to_abs_path\n ((File.exist?(path)) &&\n (File.readable?(path)))\n end", "def file_is_physically_present?\n field.file.size > 0\n end", "def has_photo?\n send('file_uploader_url').present?\n end", "def fetch(http_connection, force = false)\n success = true\n tries ||= 3\n display = []\n if self.fresh\n display.push(self.file_path)\n else\n display.push(\"*#{self.file_path}\")\n end\n display.push \"#{StringUtil.checksumify(self.local_checksum.to_s)}..#{StringUtil.checksumify(self.remote_checksum.to_s)}\"\n if !File.exist?(self.file_path) or force or self.remote_checksum != self.local_checksum\n begin\n request = Net::HTTP::Get.new(api_url)\n WebTranslateIt::Util.add_fields(request)\n FileUtils.mkpath(self.file_path.split('/')[0..-2].join('/')) unless File.exist?(self.file_path) or self.file_path.split('/')[0..-2].join('/') == \"\"\n begin\n response = http_connection.request(request)\n File.open(self.file_path, 'wb'){ |file| file << response.body } if response.code.to_i == 200\n display.push Util.handle_response(response)\n rescue Timeout::Error\n puts StringUtil.failure(\"Request timeout. Will retry in 5 seconds.\")\n if (tries -= 1) > 0\n sleep(5)\n retry\n else\n success = false\n end\n rescue\n display.push StringUtil.failure(\"An error occured: #{$!}\")\n success = false\n end\n end\n else\n display.push StringUtil.success(\"Skipped\")\n end\n print ArrayUtil.to_columns(display)\n return success\n end", "def check_file(local_file)\n # Immateriel.info binding, @url\n uniq_str = Digest::MD5.hexdigest(\"#{@url}:#{local_file}\")\n uri = URI.parse(@url)\n fn = \"/tmp/#{uniq_str}_\" + Digest::MD5.hexdigest(File.basename(uri.path)) + File.extname(uri.path)\n self.class.download(@url, fn)\n if File.exist?(fn)\n check_result = self.class.check_image(fn, local_file, uniq_str)\n FileUtils.rm_f(fn)\n if check_result\n true\n else\n false\n end\n else\n false\n end\n end", "def filecheck\n return file.nil? ? false : File.exist?(file)\n end", "def public(filename)\n begin\n data = @client.media(filename)\n rescue DropboxError\n return false\n end\n end", "def fetch_parse?\n\n # If return true a new file has been fetched and parse_products should be rerun.\n # Otherwise the cache of the result of parse_products can be used\n end", "def has_download\n\tend", "def can_upload?\n klass.model_class && mime_types && mime_types.keys.include?(file_mime_type)\n end", "def candownload?(issue = nil)\n if self.isregistered?\n #durante il periodo di prova l'utente NON accede ai attachment degli contenuti rossi che hanno una sezione protetta\n if issue && issue.section && issue.section.protetto\n #tranne quelli che hanno una sezione protetta\n return false\n end\n end\n return true\n end", "def is_chain_loaded?\n loaded = self.loader_status\n if loaded[\"success\"]\n return loaded[\"loaded\"]\n else\n return nil\n end\n end", "def check (uri)\n return nil unless @enabled\n\n # FIXME check some time limits around this\n cache_name = translate_uri(uri)\n \n file = File.join(@directory, cache_name)\n File.exist?(file) and File.open(file) do |f|\n return OpenStruct.new(:body => f.read, :cache_file => file)\n end\n end", "def is_ready\n \n is_ready = false\n \n # Get the size to check on\n size = params[:size]\n \n # Get photo reference\n ref = params[:ref]\n \n # Get photo\n photo = Photo.find_by_ref(ref)\n \n # If the photo exists\n if !photo.nil?\n \n # Check if the file exists\n is_ready = File.exists?(photo.location(size))\n \n end\n \n respond_to do |format|\n format.json { render :json => is_ready } \n end\n \n end", "def smb_file_exist?(file)\n begin\n fd = @smb.open(file, 'ro')\n rescue XCEPT::ErrorCode => e\n # If attempting to open the file results in a \"*_NOT_FOUND\" error,\n # then we can be sure the file is not there.\n #\n # Copy-pasted from smb/exceptions.rb to avoid the gymnastics\n # required to pull them out of a giant inverted hash\n #\n # 0xC0000034 => \"STATUS_OBJECT_NAME_NOT_FOUND\",\n # 0xC000003A => \"STATUS_OBJECT_PATH_NOT_FOUND\",\n # 0xC0000225 => \"STATUS_NOT_FOUND\",\n error_is_not_found = [ 0xC0000034, 0xC000003A, 0xC0000225 ].include?(e.error_code)\n # If the server returns some other error, then there was a\n # permissions problem or some other difficulty that we can't\n # really account for and hope the caller can deal with it.\n raise e unless error_is_not_found\n found = !error_is_not_found\n else\n # There was no exception, so we know the file is openable\n fd.close\n found = true\n end\n found\nend", "def attachment?\n attachment.present? && attachment.readable?\n end", "def checkFile(bucket, file, client)\n\tfilename = File.basename file\n\tbegin\n\t\tresp = client.client.get_object({\n\t\t\tbucket: bucket,\n\t\t\tkey: filename\n\t\t})\n\trescue Aws::S3::Errors::NoSuchKey => err\n\t\tputs err\n\t\tresp = client.client.list_objects({ bucket: bucket })\n\t\tputs \"Valid files currently are: \"\n\t\tresp.contents.each do |obj|\n\t\t\tputs \"=> #{obj.key}\"\n\t\tend\n\t\texit\n\tend\n\treturn resp\nend", "def has_access_to_file(file_id, user_id)\n if get_all_user_data(user_id).first[\"rank\"] >= 1\n return true\n end\n \n owner_id = $db.execute(\"SELECT owner_id FROM files WHERE file_id = ?\", file_id).first[\"owner_id\"]\n if owner_id == user_id\n return true\n end\n\n shared_users = $db.execute(\"SELECT user_id FROM shared_files WHERE file_id = ?\", file_id)\n shared_users.each do |user|\n if user[\"user_id\"] == user_id\n return true\n end\n end\n return false\nend", "def retrieve!(file)\n @client_box = box_client\n CarrierWave::Storage::Box::File.new(uploader, config, uploader.store_path(file), @client_box)\n end", "def request_is_file?(path)\n question = absolute_path(path) \n File.file?(question) \n end", "def retrieve!(identifier)\n self.class.configure_qcloud_sdk(uploader)\n\n if uploader.file # file is present after store!\n uploader.file\n else\n file_path = uploader.store_path(identifier)\n File.new(nil).tap do |file|\n file.path = file_path\n end\n end\n end", "def exists\n if @file && @mp3\n return true\n else\n return false\n end\n end", "def for_asset_file?\n !!((get? || head?) && for_digested_asset? && asset_file.exists?)\n end", "def file_data\n @client.get_file @file_url\n end", "def remote_file_differs?(full_path, content)\n !remote_file_exists?(full_path) || remote_file_exists?(full_path) && !remote_file_content_same_as?(full_path, content)\n end", "def file?\n type == :file\n end", "def download\n return file if file\n\n self.file = retrieve_file\n end", "def local?\n @uri.scheme == 'file'\n end", "def check_file(bucket, file)\n bucket = get_bucket(bucket)\n response = bucket.object(file).exists?\n if response\n return true\n else\n return false\n end\n end", "def test_file(f)\n\treturn (File.file?(f) and File.readable?(f) and File.size?(f).to_i < C_max_filesize*1024*1024 and not (File.socket?(f) or File.blockdev?(f) or File.chardev?(f)))\nend", "def fetch_file_contents(remote_path)\n result = backend.file(remote_path)\n if result.exist? && result.file?\n result.content\n else\n nil\n end\n end", "def can_parse_id3?(filename)\n begin\n trash = Mp3Info.open(filename)\n return true\n rescue\n return false\n end\nend", "def valid_download?\n @download_url != \"\"\n end", "def remote_file_exists?(full_path)\n remote_filetest_passes?('-e', full_path)\n end", "def valid?\n return false if @file_id.nil?\n true\n end", "def result\n result = job.results.find_by!(name: \"my-file\")\n\n if result.file.attached?\n Jobler::FileDownload.new(\n url: url_for_result(name: \"my-file\")\n )\n else\n Jobler::FileDownload.new(\n file_name: \"some-file.zip\",\n temp_file: temp_file_for_result(name: \"my-file\")\n )\n end\n end", "def fetch_torrent_data(the_torrent_url = self.torrent_url)\n if the_torrent_url && torrent_data.nil?\n begin\n torrent_item = open(the_torrent_url)\n self.torrent_data = Base64.encode64(torrent_item.read())\n torrent_item.close\n self.set_state(:to_download)\n return true\n rescue\n self.set_state(:broken) \n end\n end\n \n return false\n end", "def file_exists?\n filepath.present? && s3_object(false).exists?\n end", "def uploaded_file\n instance_read(:uploaded_file)\n end", "def download_file?(file_url, output_file_name, file_type)\n if file_type == \"logo\"\n download_logo?(file_url, output_file_name) \n else\n downloaded_file_path = \"#{Rails.root}/public/uploads/#{output_file_name}\"\n Sync.download_file?(file_url, downloaded_file_path)\n \n downloaded_file_sha1_path = downloaded_file_path + \".sha1\"\n Sync.download_file?(file_url + \".sha1\", downloaded_file_sha1_path)\n \n check_file_integrity(downloaded_file_path, downloaded_file_sha1_path)\n end\n end" ]
[ "0.6731581", "0.666982", "0.65142936", "0.6495629", "0.62553185", "0.61968386", "0.61654264", "0.6135881", "0.6132813", "0.60777885", "0.5985837", "0.5973886", "0.59500945", "0.5936127", "0.5932834", "0.59322786", "0.59254086", "0.59176177", "0.58598405", "0.58598405", "0.5831218", "0.57993335", "0.5792915", "0.5789901", "0.57719547", "0.5732305", "0.57190007", "0.5696793", "0.56955904", "0.56953007", "0.5688294", "0.5682759", "0.56827176", "0.5678605", "0.56581414", "0.56318414", "0.56316763", "0.5605548", "0.55883247", "0.5575001", "0.5569128", "0.55661136", "0.55592996", "0.55592996", "0.5557606", "0.5554615", "0.5549913", "0.5539478", "0.55329293", "0.5528845", "0.5516981", "0.5516098", "0.55102235", "0.55059975", "0.5494492", "0.5469725", "0.5468668", "0.54646754", "0.54636836", "0.54621536", "0.5458643", "0.5438489", "0.54159915", "0.54154027", "0.54041666", "0.54035574", "0.54005724", "0.5398045", "0.539708", "0.5396373", "0.539263", "0.5387033", "0.5385268", "0.537702", "0.5373848", "0.537334", "0.5368238", "0.5367443", "0.5360959", "0.53599757", "0.53584254", "0.53552175", "0.5354673", "0.53265053", "0.5325322", "0.5323659", "0.53064036", "0.5303378", "0.52984405", "0.5298244", "0.5297395", "0.5297277", "0.5294311", "0.52942485", "0.5292689", "0.52810454", "0.5279524", "0.5271432", "0.5270237", "0.5267054" ]
0.75448596
0
Setup the parent resource.
def set_election @election = nil @election = Election.find(params[:filter]) if params[:filter] @election = Election.find(params[:election_id]) if params[:election_id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent(resource)\n if @resource_config[:parent]\n raise DefinitionError, \"parent already declared in #{self}\"\n end\n @resource_config[:parent] = resource\n end", "def parent=(resource)\n @parent = resource\n end", "def set_parent_resource(resource = nil)\n resource ||= parent_resource_class.find_by_uid(parent_params)\n instance_variable_set(\"@#{parent_resource_name}\", resource)\n end", "def set_parent_path\n @parent_resource = \"/\"\n @parent_path = \"\"\n end", "def parent\n @parent || NullResource.new\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def set_parent(parent)\n @parent = parent\n end", "def parent\n @parent or raise LifecycleException.new(\"can't call parent until you materialize the resource\")\n end", "def set_parent\n @parent = Parent.find(params[:id])\n end", "def set_parent\n @parent = Parent.find(params[:id])\n end", "def set_parent\n @parent = Parent.find(params[:id])\n end", "def set_parent\n @parent = Parent.find(params[:id])\n end", "def set_parent\n @parent = Parent.find(params[:id])\n end", "def set_parent\n @parent = Parent.find(params[:id])\n end", "def set_parent(parent)\n @parent = parent\n end", "def set_parent(parent)\n @parent = parent\n end", "def parent\n @parent ||= resource.decorate.parent\n end", "def set_parent\n @parent = Parent.find(session[:parent_id])\n end", "def set_parent(parent)\n @parent = parent\n\n self\n end", "def parent_resource\n return @parent_resource if defined?(@parent_resource)\n @parent_resource = if @mediator.through\n if @controller.instance_variable_defined? :\"@#{@mediator.through}\"\n @controller.instance_variable_get(:\"@#{@mediator.through}\")\n elsif @controller.respond_to?(@mediator.through, true)\n @controller.send(@mediator.through)\n end\n end\n end", "def parent=(parent)\n @parent = parent\n end", "def parent=(parent)\n @parent = parent\n end", "def set_parent_info\n @parent_info = ParentInfo.find(params[:id])\n end", "def parent=(parent)\n @parent = parent\n end", "def parent=(p)\n @parent = p\n end", "def <<(resource)\n resource.parent = source\n super(resource)\n end", "def set_parent_of\n @parent_of = ParentOf.find(params[:id])\n end", "def parent=(value)\n @parent = value\n end", "def initialize(parent)\n @parent = parent\n end", "def ar_verify_parent_resource\r\n parent= ardata.parent_resources.select { |res| res.model == @parent_resource.class }\r\n \r\n real_parent= @resource.send(parent.first.singular)\r\n \r\n if @parent_resource.to_param != real_parent.to_param\r\n @parent_resource= real_parent\r\n ar_set_parent_instance_var if @parent_resource\r\n end\r\n end", "def set_parent_question\n @parent_question = ParentQuestion.find(params[:id])\n end", "def set_rollup_parent\n @rollup_parent = RollupParent.find(params[:id])\n end", "def parent=(obj); end", "def initialize(parent)\n @parent = parent\n end", "def parent_resource\n @parent_resource ||=\n begin\n return nil if resource.try(:imported_metadata).present?\n Wayfinder.for(resource).parent\n end\n end", "def get_parent_resource\n instance_variable_get(\"@#{parent_resource_name}\")\n end", "def set_parent_site\n self.site_id = parent_item.site_id if parent_item.present?\n self.site_id = parent.site_id if parent.present?\n end", "def parent=(instance)\n @controller.instance_variable_set(:\"@#{parent_name}\", instance)\n end", "def parent=(other); end", "def _parent; end", "def set_parent\n @parent = Mutant.find params[:mutant_id] if params[:mutant_id]\n @parent = Term.find params[:term_id] if params[:term_id]\n set_enrollment if params[:action].in? ['show', 'destroy']\n end", "def set_parent(parent_node)\n @parent = parent_node\n end", "def parent!(parent)\n @parent = parent\n @cache = {}\n self\n end", "def create(attributes = {})\n resource = build(attributes)\n @parent.attributes[@name] = resource if resource.save\n resource\n end", "def parent_resource_class\n @parent_resource_class ||= parent_resource_name.classify.constantize\n end", "def setup_generator(parent, qualified_table_name)\n # TODO: Verify possible conflict\n self.parent = parent\n self.qualified_table_name = qualified_table_name\n self.category ||= self.class.default_category\n end", "def set_parent_infomation\n @parent_infomation = ParentInfomation.find(params[:id])\n end", "def make_related(parent, child, resource_config)\n proc = resource_config[:relation][:create]\n proc.call(parent, child) if proc\n child\n end", "def parent=(other)\n raise 'Cannot set parent of root namespace' if root?\n @parent = other\n @registry = nil\n end", "def resource_parent\n project\n end", "def load_parent_assoc\n @parent_model = nil\n raise 'Sovrascrivi funzione \"load_parent_assoc\" nei figli la definizione di questa variabile: @parent_model'\n end", "def set_attributes(data_attributes)\n parent = data_attributes.delete(:parent)\n super\n self.parent = parent if parent\n end", "def initialize_child_run\n self.workflow = parent.workflow\n end", "def set_parent_child\n\t \t@parent_child = ParentChild.find(params[:id])\n\tend", "def set_parent_profile\n @parent_profile = ParentProfile.find(params[:id])\n end", "def create\n @parent_resource = ParentResource.find(params[:child_resource][:parent_resource_id])\n require_privilege(Alberich::Privilege::CREATE, ChildResource,\n @parent_resource)\n @child_resource = ChildResource.new(params[:child_resource])\n\n respond_to do |format|\n if @child_resource.save\n @child_resource.assign_owner_roles(current_user)\n format.html { redirect_to @child_resource, notice: 'Child resource was successfully created.' }\n format.json { render json: @child_resource, status: :created, location: @child_resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @child_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def parent\n _parent\n end", "def initialize(parent); end", "def parent=(parent_node); end", "def parent=(parent_node); end", "def has_parent!(parent)\n @parent = parent\n self\n end", "def set_parent\n tbc = self.class.preceding_key_column\n if tbc && self.respond_to?(tbc)\n write_attribute(tbc, @_before_to_new_record_values[:id])\n end\n end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent; end", "def parent=(value)\n raise UnsupportedOperationError\n end", "def initialize(params = {})\n super(params)\n @parent_id = @params.delete(:parent_id)\n end", "def parent\n @parent\n end", "def parent\n @parent\n end", "def parent\n @parent\n end", "def parent\n @parent\n end", "def set_yaml\n if @parent\n @yaml.has_key?(@parent) ? set(defaults.recursive_merge(@yaml[@parent])) : raise(Configarrr::OptionError, \"Please provide a valid parent value. #{@parent} does not exist.\")\n else\n set defaults.recursive_merge(@yaml)\n end\n end", "def get_parent_resource\n parent_id_param = request.path_parameters.keys.detect { |k| k.to_s.end_with?('_id') }\n if parent_id_param\n parent_type = parent_id_param.to_s.chomp('_id')\n parent_class = safe_class_lookup(parent_type.camelize)\n if parent_class\n @parent_resource = parent_class.find(params[parent_id_param])\n end\n end\n end", "def to_resource\n\t\t\tr = super\n\t\t\tr[\"current room\"] = r.delete(:parent)\n\t\t\tr\n\t\tend", "def setup(resources) ; end", "def parent\n\t\tpardn = self.parent_dn or return nil\n\t\treturn self.class.new( self.directory, pardn )\n\tend", "def parent=(_arg0); end", "def parent=(_arg0); end", "def parent=(_arg0); end", "def parent=(_arg0); end", "def parent=(_arg0); end", "def initialize_attributes(parent, inetwork)\n # Set the parent and interface\n write_attribute(:parent, parent)\n write_attribute(:interface, inetwork)\n\n # Load the interface attributes\n load_interface_attributes(inetwork)\n\n # Clear dirtiness, since this should only be called initially and\n # therefore shouldn't affect dirtiness\n clear_dirty!\n\n # But this is an existing record\n existing_record!\n end", "def set_parent(pa)\n self.parent = pa\n pa.children ||= []\n pa.children << self\n end", "def setParent(parent)\n oldParent = @parent\n @parent = parent\n\n if parent.nil?\n # Remove from parent\n onDetach() if oldParent and oldParent.isAttached\n elsif parent.isAttached\n onAttach()\n end\n end", "def set_parent_app\n @parent_app = ParentApp.find(params[:id])\n end", "def parent_resources\n @parent_resources ||= []\n end", "def set_foster_parent\n @foster_parent = FosterParent.find(params[:id])\n end", "def parent= parent_node\n parent_node.add_child(self)\n parent_node\n end", "def new_parent=(a_parent)\n @new_parent = a_parent\n end", "def generate_parent\n @attachment = Attachment.new\n end", "def set_parent\n @parent_obligation = ParentObligation.where(user_id: params[:id], school_class_id: params[:school_class_id]).take\n end", "def parent\n nil\n end" ]
[ "0.7486468", "0.7392739", "0.73852366", "0.69773346", "0.6879572", "0.6802472", "0.6791323", "0.67704844", "0.67345697", "0.67345697", "0.67345697", "0.67345697", "0.67345697", "0.67345697", "0.67296046", "0.67296046", "0.67282623", "0.6707594", "0.66529775", "0.6596481", "0.65281135", "0.65281135", "0.6527491", "0.65192175", "0.6379285", "0.6325724", "0.6303495", "0.63027513", "0.62536204", "0.6241292", "0.6237378", "0.62101966", "0.6193777", "0.6184412", "0.6164475", "0.6152395", "0.61169666", "0.61015385", "0.60930806", "0.60822767", "0.6078281", "0.6070842", "0.6070112", "0.6056856", "0.60555506", "0.60486", "0.5999215", "0.59927344", "0.5987375", "0.59570193", "0.5943413", "0.591582", "0.5899757", "0.5860168", "0.5848415", "0.5823959", "0.58116484", "0.5803656", "0.5800669", "0.5800669", "0.5795287", "0.5774452", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.5770675", "0.57692784", "0.5761033", "0.5756393", "0.5756393", "0.5756393", "0.5756393", "0.5740193", "0.5724602", "0.5711902", "0.5708675", "0.57018197", "0.57017213", "0.57017213", "0.57017213", "0.57017213", "0.57017213", "0.569942", "0.56894696", "0.56806445", "0.5676245", "0.5675746", "0.56689894", "0.56563693", "0.5655017", "0.56546545", "0.56525135", "0.56444705" ]
0.0
-1
Never trust parameters from the scary Internet, only allow the white list through.
def upload_params params.require(:upload).permit(:election_id, :file_type_id, :public, :file) # Not status, address or checksum. end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def allow_params_authentication!; end", "def param_whitelist\n [:role, :title]\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def valid_params_request?; end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def filtered_parameters; end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def quote_params\n params.permit!\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def check_params; true; end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def permitted_params\n []\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def url_whitelist; end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def filter_parameters; end", "def filter_parameters; end", "def request_params; end", "def url_whitelist=(_arg0); end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def anonymous_filter_params\n p = params.required('payload')\n # p.permit!('controls_params')\n # p.permit!('columns_params')\n # p.permit!('sorting')\n # p.permit!('global_config')\n p.permit(\n 'name',\n 'controls_list' => [],\n 'controls_hl_mode' => [],\n 'controls_params' => {},\n 'columns_list' => [],\n 'columns_params' => {},\n 'sorting' => {},\n 'global_config' => {}\n ).merge(permit_hashes(p, [\n 'controls_params',\n 'columns_params',\n 'sorting',\n 'global_config'\n ]))\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def url_params\n params[:url].permit(:full)\n end", "def check_params\n true\n end", "def parameters(params)\n allowed = [:start,:num,:type,:id,:filter,:tagged,:search,:state,:email,:password]\n params.merge! defaults if defaults\n params.reject {|key,value| !allowed.include? key }\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def permit_request_params\n params.permit(:address)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def query_params\n params.except(:format).permit(:cip_code, :cip_name)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def params() request.params end", "def active_code_params\n params[:active_code].permit\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def known_url_params\n params.require(:known_url).permit(:url, :customer_id, :partial_id)\n end", "def linted_params\n url = params.require(:url)\n begin\n URI.parse(url)\n rescue URI::InvalidURIError\n raise ActionController::BadRequest\n end\n params.permit(:url, :maxwidth, :maxheight, :format, :fullheight,\n :hide_title, :hide_embed, :hide_download, :hide_search, :min_files_to_search,\n :canvas_id, :canvas_index, :search, :suggested_search, :image_tools, :cdl_hold_record_id)\n end", "def url_params\n []\n end", "def list_params\n params.permit(:name)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def param_whitelist\n [\n :school_name,\n :school_id,\n :degree,\n :started_at,\n :finished_at,\n majors: [],\n minors: []\n ]\n end", "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", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def filtering_params\n params.permit(:email)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def blackandwhite_params\n params.fetch(:blackandwhite, {})\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def activity_params \n \n raw_parameters = { \n :activity_Name => \"#{params[:activity_name]}\",\n :active => \"#{params[:active]}\",\n :activity_description => \"#{params[:activity_description]}\",\n :is_page => \"#{params[:is_page]}\"\n }\n parameters = ActionController::Parameters.new(raw_parameters)\n parameters.permit( :activity_Name, :active, :activity_description, :is_page)\n \n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def blacklisted_search_session_params\n PARAM_NOT_PERSISTED\n end" ]
[ "0.6888801", "0.6744586", "0.66958785", "0.6691486", "0.6632683", "0.66152805", "0.6571971", "0.6556105", "0.6498985", "0.6418654", "0.641478", "0.63825935", "0.6380411", "0.6351492", "0.634005", "0.6323299", "0.62733626", "0.6253789", "0.62238204", "0.6222662", "0.6201494", "0.6201218", "0.61655974", "0.61469275", "0.6142841", "0.614162", "0.61020654", "0.6095714", "0.6091748", "0.6087996", "0.6074901", "0.6074887", "0.60745823", "0.6070374", "0.6053054", "0.6052087", "0.6046029", "0.60404575", "0.60393184", "0.60300606", "0.60149217", "0.60148853", "0.6007358", "0.60037893", "0.600261", "0.59993005", "0.599694", "0.599005", "0.599005", "0.5985641", "0.59517235", "0.59482515", "0.5947883", "0.59478486", "0.5945482", "0.5908624", "0.5900977", "0.58943665", "0.589367", "0.58904696", "0.5889534", "0.588785", "0.5886867", "0.58826005", "0.58785796", "0.5875907", "0.5864729", "0.58624643", "0.5861941", "0.58612335", "0.5859462", "0.5858251", "0.58521456", "0.584958", "0.5838779", "0.58364147", "0.5835615", "0.5831109", "0.58308196", "0.58293396", "0.5822006", "0.5821112", "0.5817426", "0.58145297", "0.5811968", "0.58083475", "0.58072203", "0.5805444", "0.5803324", "0.58014554", "0.5795701", "0.57925534", "0.5789364", "0.5789315", "0.57882774", "0.5787497", "0.5783929", "0.57825476", "0.57808405", "0.5776836", "0.577566" ]
0.0
-1
=========================== solved by loris
def odds_and_evens(string, return_odds) newString = String.new puts newString stringArray = string.split(//) if return_odds == true stringArray.each_with_index do |v, k| if k % 2 != 0 newString << v end end else stringArray.each_with_index do |v, k| if k % 2 == 0 newString << v end end end return newString end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def stderrs; end", "def anchored; end", "def berlioz; end", "def rassoc(p0) end", "def malts; end", "def terpene; end", "def suivre; end", "def verdi; end", "def trd; end", "def schumann; end", "def formation; end", "def offences_by; end", "def villian; end", "def deco_pos; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def blg; end", "def lsi; end", "def ismn; end", "def transformations; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def intensifier; end", "def operations; end", "def operations; end", "def gounod; end", "def pos() end", "def pos() end", "def pos() end", "def pos() end", "def tld; end", "def tld; end", "def sld; end", "def celebration; end", "def bs; end", "def getc() end", "def getc() end", "def getc() end", "def identify; end", "def transform; end", "def surge; end", "def internship_passed; end", "def hiss; end", "def diff1; end", "def original_result; end", "def transforms; end", "def refutal()\n end", "def jack_handey; end", "def dh; end", "def r; end", "def r; end", "def isp; end", "def isp; end", "def upc_e; end", "def ravel; end", "def apply\n\t\t\n\tend", "def apply\n\t\t\n\tend", "def index(p0) end", "def index(p0) end", "def romeo_and_juliet; end", "def ibu; end", "def calculated; end", "def same; end", "def diff2; end", "def genome(liszt)\n=begin\n[samopen] SAM header is present: 2 sequences\n7621912 reads; of these:\n 4009241 (52.60%) were paired; of these:\n 1983557 (49.47%) aligned concordantly 0 times\n 1818685 (45.36%) aligned concordantly exactly 1 time\n 206999 (5.16%) aligned concordantly >1 times\n ----\n 1983557 pairs aligned concordantly 0 times; of these:\n 409503 (20.64%) aligned discordantly 1 time\n ----\n 1574054 pairs aligned 0 times concordantly or discordantly; of these:\n 3148108 mates make up the pairs; of these:\n 1009275 (32.06%) aligned 0 times\n 35392 (1.12%) aligned exactly 1 time\n 2103441 (66.82%) aligned >1 times\n 3612671 (47.40%) were unpaired; of these:\n 498719 (13.80%) aligned 0 times\n 2246121 (62.17%) aligned exactly 1 time\n 867831 (24.02%) aligned >1 times\n=end\n #puts(liszt);exit\n dict={}; liszt.shift\n dict[\"total\"]=liszt.shift.split[0]; #liszt.shift\n dict[\"paired\"]=liszt.shift.split[0]; liszt.shift #conc 0\n dict[\"conc_once\"]=liszt.shift.split[0]\n dict[\"conc_mult\"]=liszt.shift.split[0]\n liszt.shift(2); dict[\"disc_once\"]=\"\"; dict[\"disc_mult\"]=\"\"\n line=liszt.shift\n line.include?(\">1 times\") ? dict[\"disc_mult\"]=line.split[0] : dict[\"disc_once\"]=line.split[0]\n liszt.shift\n dict[\"unaligned_pairs\"]=liszt.shift.split[0]\n liszt.shift\n dict[\"unmates\"]=liszt.shift.split[0] #unaligned mates\n dict[\"mate_once\"]=liszt.shift.split[0]\n dict[\"mate_mult\"]=liszt.shift.split[0]\n dict[\"unpaired\"]=liszt.shift.split[0]\n dict[\"unpair_unaligned\"]=liszt.shift.split[0]\n dict[\"unpair_once\"]=liszt.shift.split[0]\n dict[\"unpair_mult\"]=liszt.shift.split[0]\n dict\nend", "def leeway; end", "def leeway; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def alg; end", "def loc; end", "def loc; end", "def loc; end", "def feruchemist; end", "def king_richard_iii; end", "def rossini; end", "def mambo_no_5; end", "def user_os_complex\r\n end", "def required_positionals; end", "def parts; end", "def parts; end", "def parts; end", "def algorithms; end", "def algorithms; end", "def algorithms; end", "def algorithms; end" ]
[ "0.6524386", "0.6120349", "0.5971137", "0.5967669", "0.5901956", "0.5856847", "0.5838328", "0.58174294", "0.5803969", "0.5713613", "0.56706893", "0.5657227", "0.5655819", "0.5617566", "0.5616523", "0.560087", "0.5492753", "0.54742366", "0.54742366", "0.54742366", "0.54742366", "0.54602224", "0.5421027", "0.54068685", "0.53977615", "0.53850436", "0.53850436", "0.53850436", "0.53850436", "0.53850436", "0.53850436", "0.53733903", "0.5360488", "0.5360488", "0.535734", "0.53565294", "0.53565294", "0.53565294", "0.53565294", "0.53316015", "0.53316015", "0.5311181", "0.52993745", "0.5286825", "0.52690196", "0.52690196", "0.52690196", "0.52547526", "0.5247352", "0.5229025", "0.5219993", "0.52064925", "0.5198971", "0.51989144", "0.5183358", "0.51823556", "0.5181265", "0.5180928", "0.5173994", "0.5173994", "0.51565087", "0.51565087", "0.5155331", "0.515385", "0.5152551", "0.5152551", "0.51520425", "0.51520425", "0.5130646", "0.51299244", "0.5111915", "0.5107076", "0.51057816", "0.5105736", "0.5101586", "0.5101586", "0.50833815", "0.50833815", "0.50833815", "0.50833815", "0.50833815", "0.50833815", "0.50833815", "0.50833815", "0.5072234", "0.50613743", "0.50613743", "0.50613743", "0.5056133", "0.50524825", "0.5051609", "0.5047131", "0.5036618", "0.50346947", "0.50251657", "0.50251657", "0.50251657", "0.5020226", "0.5020226", "0.5020226", "0.5020226" ]
0.0
-1
GET /markets GET /markets.json
def index @markets = Market.all fill_markers respond_to do |format| format.html format.csv { send_data @markets.to_csv } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def markets\n get('/markets')['markets']\n end", "def index\n @markets = Market.all\n end", "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end", "def planets\n data = JSON.parse(open(\"http://swapi.co/api/planets\").read)\n @results = data[\"results\"]\n end", "def index\n @sells = Sell.all\n\n render json: @sells\n end", "def index\n if @country\n @markets = @country.markets\n else\n @markets = Market.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def index\n @prices = Price.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prices }\n end\n end", "def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end", "def index\n pets = pets_from_query\n\n respond_to do |format|\n format.html do\n @pets = pets.paginate(page: params[:page], per_page: 10)\n end\n format.json do\n @pets = pets\n end\n end\n end", "def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end", "def index\n @pets = Pet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pets }\n end\n end", "def index\n json_response(Spot.all)\n end", "def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end", "def markets\n @dealing_platform.markets.hierarchy(id).markets\n end", "def index\n @parks = Park.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parks }\n end\n end", "def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end", "def index\n # TODO: ideally instead of eager loading sells, we could just include\n # quantity_sold in the eager_lod for lots.\n @portfolios = Portfolio.eager_graph(lots: :sells).eager_graph(allocations: {:asset_class => :funds}).all\n\n render json: @portfolios\n end", "def market_data\n endpoint = \"#{HOST}/v1/cryptocurrency/listings/latest\"\n get(endpoint)\n end", "def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end", "def index\n @planets = Planet.all\n end", "def index\n @planets = Planet.all\n end", "def index\n @planets = Planet.all\n end", "def index\n @stock_prices = StockPrice.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_prices }\n end\n end", "def index\n authenticate_request!\n @cars = Car.all\n\n render json: @cars\n end", "def index\n @spots = Spot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spots }\n end\n end", "def index\n @offers = Offer.all\n\n render json: @offers\n end", "def index\n @admin_markets = City.find(session[:current_city_id]).around.markets.page(params[:page]).per(10)\n end", "def show\n @supermarket = Supermarket.find(params[:id])\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok } \n end \n end", "def index\n @loves = Love.all\n render json: @loves\n end", "def index\n @seasons = Season.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def market_info( pair = nil )\n get(\"/marketinfo/#{pair}\")\n end", "def index\n @expenses = find_expenses.all\n render json: @expenses\n end", "def index\n @beverages = Beverage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @beverages }\n end\n end", "def index\n @money = Money.all\n require 'net/http'\n require 'json'\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_money = JSON.parse(@response)\n end", "def index\n @diets = @profile.diets\n respond_with @diets\n end", "def index\n @cars = Car.all\n render json: @cars\n end", "def index\n @cars = Car.all\n\n render json: @cars\n end", "def index\n @stars = Star.all\n render :json => @stars\n end", "def index\n @marketers = Marketer.all\n end", "def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def show\n render json: @sell\n end", "def index\n @pets = Pet.all\n # @users= Pet.user.all\n render json: @pets, each_serializer: PetSerializer\n \n end", "def index\n @trades = Trade.all\n render json: @trades\n end", "def list_target_markets\n\treturn if authorise_for_web(program_name?,'read') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:target_markets_page] = params['page']\n\n\t\t render_list_target_markets\n\n\t\t return \n\telse\n\t\tsession[:target_markets_page] = nil\n\tend\n\n\tlist_query = \"@target_market_pages = Paginator.new self, TargetMarket.count, @@page_size,@current_page\n\t @target_markets = TargetMarket.find(:all,\n\t\t\t\t :limit => @target_market_pages.items_per_page,\n\t\t\t\t :offset => @target_market_pages.current.offset)\"\n\tsession[:query] = list_query\n\trender_list_target_markets\nend", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def index\n @trades = Trade\n .only(:created_at, :is_fair, :ash_pokemons, :brock_pokemons)\n respond_to do |format|\n format.json { render json: @trades }\n end\n end", "def index\n @offers = Offer.all\n respond_to do |format|\n format.jsonapi { render jsonapi: @offers }\n format.html { @offers }\n end\n end", "def show\n render json: @portfolio\n end", "def index\n @themes = Theme.all\n json_response(@themes)\n end", "def show\n @simulation_market = SimulationMarket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simulation_market }\n end\n end", "def show\n @species = Specie.find(params[:id])\n\n @pets = Pet.where(:specie_id => @species).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {:secie => @species, :pets => @pets } }\n end\n end", "def index\n @essays = Essay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @essays }\n end\n end", "def index\n @shop_platinum_offers = Shop::PlatinumOffer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_platinum_offers }\n end\n end", "def index\n @offers = Offer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offers }\n end\n end", "def list_all_markets\n counter = 1\n Market.all.each do |market|\n puts \"#{counter} #{market.marketname}\"\n puts \" #{market.streetaddress}, #{market.borough}\\n\"\n puts \"\\n\"\n counter +=1\n end\n puts \"\\n\"\n puts \"Enter the number next to a market to see more info\"\n puts \"Or type 'menu' to go back to main menu\"\n puts \"\\n\"\n puts \"\\n\"\n yield\n end", "def index # public\n if params[:shelter_id]\n set_shelter\n render json: @shelter.animals\n else\n @animals = Animal.includes(:shelter).all\n render 'index.json.jbuilder'\n end\n end", "def scrape_etsy(url)\n data = Net::HTTP.get(url)\n parsed_data = JSON(data)\n # count_listings(parsed_data)\n return parsed_data\nend", "def index\n tags = Tag.all\n render json: tags, status: :ok\n end", "def show\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitty }\n end\n end", "def index\n @prices = Price.where(:category => \"Pielęgnacja dłoni\")\n @prices_feet = Price.where(:category => \"Pielęgnacja stóp\")\n @prices_face = Price.where(:category => \"Pielęgnacja twarzy\")\n @prices_cp = Price.where(:category => \"Zabiegi firmowe (Rejuvi)\")\n @prices_beauty = Price.where(:category => \"Zabiegi upiększające\")\n @prices_make_up = Price.where(:category => \"Makijaż okolicznościowy\")\n @prices_depilation = Price.where(:category => \"Depilacja woskiem\")\n @prices_massage = Price.where(:category => \"Masaż\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prices }\n end\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def index\n @shelter = Shelter.first\n @pets = Pet.get_available_pets.order(:pet_type)\n if (!@cart)\n set_cart\n end\n @selectedPets = @cart.selected_pets\n end", "def index\n @electors = Elector.all\n\n render json: @electors\n end", "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "def index\n @stations = Station.all\n\n render json: @stations\n end", "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end", "def index\n @spots = Spot.visible.order('id desc').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spots }\n end\n end", "def index\n @parkers = Parker.all\n\t\trespond_with @parkers\n end", "def show\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitten }\n end\n end", "def index\n @carts = Cart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end", "def index\n @carts = Cart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end", "def index \n artists = Artist.all \n render json: artists \n end", "def prices (currency='TWD')\n get '/prices/' + currency\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seat_manufacturers }\n end\n end", "def show\n @backend_planet = Backend::Planet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @backend_planet }\n end\n end", "def market_listings_for(item_url)\n render_url = item_url.sub(/\\/$/,'') + '/render/?query=&start=0&count=10'\n begin\n listings = JSON.parse(@c.get_content(render_url))\n rescue\n puts \"Error getting listing info\"\n return []\n end\n begin\n return listings[\"listinginfo\"].map(&:last).map do |listing|\n {\n id: listing[\"listingid\"],\n price: listing[\"converted_price\"] + listing[\"converted_fee\"],\n base_amount: listing[\"converted_price\"],\n fee_amount: listing[\"converted_fee\"],\n page_url: item_url\n }\n end\n rescue\n puts \"Converted price not there. try again\"\n return []\n end\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def index\n @pots = Pot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pots }\n end\n end", "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end", "def index\n render json: {episodes: @season.episodes, season: @season}\n end", "def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end", "def index\n @verticals = Vertical.all()\n render json: @verticals\n end", "def index\n pet_type = PetType.find(params[:pet_type_id])\n @pet_breeds = pet_type.pet_breeds.select { | match | match.published }\n\n respond_to do | format |\n format.html #index.html.erb\n format.json { render json: @pet_breeds }\n end\n end", "def index\n @verticals = Vertical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verticals }\n end\n end", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def show\n @etsy = Etsy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etsy }\n end\n end", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def index\n render json: {seasons: @serial.seasons, series: @serial}\n end", "def index\n # @prices = Price.where(name:['木瓜(元/公斤)','蘿蔔(元/公斤)','香菇(太空包)乾(元/公斤)']).order(:name)\n @prices = Price.order(:name)\n #get_json\n end", "def index\n @marketplaces = Marketplace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @marketplaces }\n end\n end", "def index\n @desks = Desk.all\n\n render json: @desks\n end", "def index\n render json: Seller.all\n end", "def index\n @sectors = Sector.all.order(\"created_at DESC\")\n render json: @sectors\n end", "def index\n @decks = Deck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end", "def index\n @decks = Deck.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end", "def index\n @stores = Store.all\n render json: @stores\n end", "def all_prices\n request :public, :get, :price\n end", "def index\n @teaches = Teach.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teaches }\n end\n end" ]
[ "0.86405236", "0.70124197", "0.6991847", "0.68668693", "0.6417092", "0.63555455", "0.633128", "0.63163906", "0.63156444", "0.6295922", "0.6292435", "0.6274393", "0.6237423", "0.62005645", "0.6156033", "0.6136192", "0.61211365", "0.6120647", "0.6111573", "0.6058865", "0.6058865", "0.6058865", "0.605603", "0.6053518", "0.604625", "0.6004364", "0.5983484", "0.5981366", "0.59570646", "0.59174675", "0.5908843", "0.590642", "0.5901552", "0.58976424", "0.58899385", "0.58855844", "0.5872748", "0.5865908", "0.58575517", "0.5852972", "0.5804499", "0.58014166", "0.5794865", "0.57670563", "0.5766713", "0.57658076", "0.57570285", "0.5752232", "0.57477754", "0.574722", "0.5746842", "0.57423973", "0.5742326", "0.57390356", "0.5736563", "0.57350135", "0.57334656", "0.57332194", "0.5724097", "0.57239276", "0.5721383", "0.57150024", "0.57122386", "0.57072085", "0.5703299", "0.5701212", "0.5698198", "0.56870365", "0.5673367", "0.5667563", "0.5666924", "0.5661549", "0.5661549", "0.56613153", "0.56563014", "0.5653386", "0.56532687", "0.56457084", "0.56442046", "0.5644145", "0.5643237", "0.56430477", "0.5632512", "0.56245786", "0.5617387", "0.5616728", "0.5611018", "0.5608939", "0.56061304", "0.56045043", "0.5603148", "0.5596212", "0.55929303", "0.5592802", "0.55894834", "0.5586511", "0.5586511", "0.5580021", "0.55765104", "0.5575687" ]
0.6068674
19
GET /markets/1 GET /markets/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def markets\n get('/markets')['markets']\n end", "def index\n @markets = Market.all\n end", "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end", "def show\n @supermarket = Supermarket.find(params[:id])\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok } \n end \n end", "def index\n if @country\n @markets = @country.markets\n else\n @markets = Market.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def planets\n data = JSON.parse(open(\"http://swapi.co/api/planets\").read)\n @results = data[\"results\"]\n end", "def show\n @simulation_market = SimulationMarket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simulation_market }\n end\n end", "def index\n @pets = Pet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pets }\n end\n end", "def market_info( pair = nil )\n get(\"/marketinfo/#{pair}\")\n end", "def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end", "def index\n @sells = Sell.all\n\n render json: @sells\n end", "def show\n @market = Market.find(params[:id])\n end", "def index\n json_response(Spot.all)\n end", "def markets\n @dealing_platform.markets.hierarchy(id).markets\n end", "def index\n @prices = Price.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prices }\n end\n end", "def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end", "def market\n Market.find(@market_id)\n end", "def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end", "def show\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitty }\n end\n end", "def index\n pets = pets_from_query\n\n respond_to do |format|\n format.html do\n @pets = pets.paginate(page: params[:page], per_page: 10)\n end\n format.json do\n @pets = pets\n end\n end\n end", "def market\n FarMar::Market.find(market_id)\n end", "def market\n FarMar::Market.find(market_id)\n end", "def show\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitten }\n end\n end", "def index # public\n if params[:shelter_id]\n set_shelter\n render json: @shelter.animals\n else\n @animals = Animal.includes(:shelter).all\n render 'index.json.jbuilder'\n end\n end", "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end", "def show\n @backend_planet = Backend::Planet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @backend_planet }\n end\n end", "def get(market_name)\n @markets.each{|m|\n return m if m.name == market_name\n }\n return nil\n end", "def index\n @planets = Planet.all\n end", "def index\n @planets = Planet.all\n end", "def index\n @planets = Planet.all\n end", "def set_market\n @region = Region.find(params[:region_id])\n # @markets = @region.markets.all\n\n @market = @region.markets.find(params[:id])\n \n end", "def show\n @kit = Kit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kit }\n end\n end", "def market_data\n endpoint = \"#{HOST}/v1/cryptocurrency/listings/latest\"\n get(endpoint)\n end", "def index\n @money = Money.all\n require 'net/http'\n require 'json'\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_money = JSON.parse(@response)\n end", "def index\n @markets = Market.all\n\t\tfill_markers\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.csv { send_data @markets.to_csv }\n\t\tend\n end", "def index\n @stars = Star.all\n render :json => @stars\n end", "def index\n @marketers = Marketer.all\n end", "def index\n @parks = Park.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parks }\n end\n end", "def show\n @species = Specie.find(params[:id])\n\n @pets = Pet.where(:specie_id => @species).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {:secie => @species, :pets => @pets } }\n end\n end", "def show\n @market = Market.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end", "def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end", "def show\n @planets_exoplanet = Planets::Exoplanet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @planets_exoplanet }\n end\n end", "def index\n @themes = Theme.all\n json_response(@themes)\n end", "def show\n render json: @portfolio\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "def show\n @market_activity = MarketActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @market_activity }\n end\n end", "def show\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coin_set }\n end\n end", "def index\n @admin_markets = City.find(session[:current_city_id]).around.markets.page(params[:page]).per(10)\n end", "def index\n @beverages = Beverage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @beverages }\n end\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end", "def index\n @spots = Spot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spots }\n end\n end", "def show\n @etsy = Etsy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etsy }\n end\n end", "def show\n @stock = Stock.find(params[:id])\n\n render json: @stock\n end", "def show\n @item_kit = ItemKit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_kit }\n end\n end", "def index\n @offers = Offer.all\n\n render json: @offers\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def index\n @stock_prices = StockPrice.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_prices }\n end\n end", "def index\n @diets = @profile.diets\n respond_with @diets\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def index\n @seasons = Season.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end", "def show\n pet = BattlePet.find(params[:id])\n render json: pet, status: :ok\n end", "def index\n @carts = Cart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end", "def index\n @carts = Cart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end", "def show\n params.require(%i[id])\n render json: Beverage.find_by!(id: params[:id])\n end", "def show\n @slitter = Slitter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slitter }\n end\n end", "def index\n @shelter = Shelter.first\n @pets = Pet.get_available_pets.order(:pet_type)\n if (!@cart)\n set_cart\n end\n @selectedPets = @cart.selected_pets\n end", "def show\n @setmarkassent = Setmarkassent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @setmarkassent }\n end\n end", "def market\n all_markets = FarMar::Market.all\n all_markets.each do |market|\n if market.id == self.market_id\n return market\n end\n end\n end", "def show\n @territory = current_company.territories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @territory }\n end\n end", "def index\n # TODO: ideally instead of eager loading sells, we could just include\n # quantity_sold in the eager_lod for lots.\n @portfolios = Portfolio.eager_graph(lots: :sells).eager_graph(allocations: {:asset_class => :funds}).all\n\n render json: @portfolios\n end", "def show\n @variety = Variety.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variety }\n end\n end", "def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end", "def show\n render json: @sell\n end", "def list_all_markets\n counter = 1\n Market.all.each do |market|\n puts \"#{counter} #{market.marketname}\"\n puts \" #{market.streetaddress}, #{market.borough}\\n\"\n puts \"\\n\"\n counter +=1\n end\n puts \"\\n\"\n puts \"Enter the number next to a market to see more info\"\n puts \"Or type 'menu' to go back to main menu\"\n puts \"\\n\"\n puts \"\\n\"\n yield\n end", "def index\n @trades = Trade.all\n render json: @trades\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def index\n @stacks = Stack.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stacks }\n end\n end", "def index\n @cars = Car.all\n render json: @cars\n end", "def show\n @price = Price.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @price }\n end\n end", "def show\n @price = Price.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @price }\n end\n end", "def index\n @cars = Car.all\n\n render json: @cars\n end", "def show\n @beverage = Beverage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beverage }\n end\n end", "def show\n @vet = Vet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vet }\n end\n end", "def index\n @quantities = Quantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quantities }\n end\n end", "def show\n @portfolio = Portfolio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @portfolio }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seat_manufacturers }\n end\n end", "def index \n artists = Artist.all \n render json: artists \n end", "def show\n @seat = Seat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seat }\n end\n end", "def planet\n fetch('stargate.planets')\n end", "def show\n @parking_spot = ParkingSpot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @parking_spot }\n end\n end", "def index\n @sectors = Sector.all.order(\"created_at DESC\")\n render json: @sectors\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def show\n render json: @pet\n end", "def index\r\n markers = Marker.all\r\n render json: markers\r\n end", "def magasin\r\n \tvil = params[:id]\r\n \tmagasin = Market.where(vil_id: vil, type_id: 5)\r\n \trender json: magasin\r\n end", "def index\n @loves = Love.all\n render json: @loves\n end", "def show\n @microplst = Microplst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @microplst }\n end\n end", "def index\n @trades = Trade\n .only(:created_at, :is_fair, :ash_pokemons, :brock_pokemons)\n respond_to do |format|\n format.json { render json: @trades }\n end\n end" ]
[ "0.80650157", "0.69190115", "0.6814074", "0.63388085", "0.6314816", "0.63018113", "0.6116833", "0.6085035", "0.60797405", "0.60685396", "0.6040937", "0.60169077", "0.6007949", "0.60025054", "0.5981447", "0.5974471", "0.597257", "0.5972565", "0.59721947", "0.5962268", "0.59092015", "0.59092015", "0.5890361", "0.5883832", "0.58558357", "0.58514255", "0.58503234", "0.5848344", "0.5848344", "0.5848344", "0.5840473", "0.5836963", "0.5835388", "0.58286554", "0.5822068", "0.581305", "0.58009815", "0.57874095", "0.5786799", "0.5777037", "0.5769", "0.57468987", "0.57416314", "0.57413864", "0.5737978", "0.57376", "0.57376", "0.57348907", "0.57278365", "0.5725719", "0.5724887", "0.57156694", "0.57049966", "0.57023036", "0.5692395", "0.56899863", "0.56845856", "0.5683998", "0.56786877", "0.5678212", "0.56722176", "0.5670622", "0.56706136", "0.566991", "0.5640254", "0.5640254", "0.56359553", "0.562818", "0.56262666", "0.562451", "0.5618628", "0.5618218", "0.5615894", "0.5615347", "0.56149095", "0.56109565", "0.5594061", "0.5593669", "0.55884564", "0.55733794", "0.5570841", "0.5569737", "0.5569737", "0.5567321", "0.5563585", "0.5559407", "0.5555957", "0.554983", "0.554869", "0.5547926", "0.5547104", "0.55469334", "0.55390954", "0.5537746", "0.55367714", "0.55360126", "0.5535344", "0.55337983", "0.5531066", "0.55307627", "0.55273634" ]
0.0
-1
POST /markets POST /markets.json
def create @market = Market.new(market_params) respond_to do |format| if @market.save format.html { redirect_to root_url, notice: 'Activity was successfully created.' } format.json { render action: 'show', status: :created, location: @market } else format.html { render action: 'new' } format.json { render json: @market.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def markets\n get('/markets')['markets']\n end", "def create\n userID = session[:user_id]\n editionID = params[:edition_id]\n price = params[:price]\n\n uri = URI(\"http://107.170.7.58:4567/api/create/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"edition_id\" => editionID, \"price\" => price, \"start_date\" => Time.now, \"end_date\" => 90.days.from_now}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def create\n @market = Market.new(market_params)\n\n respond_to do |format|\n if @market.save\n format.html { redirect_to markets_path, notice: '성공적으로 생성되었습니다.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @supermarket = Supermarket.new(supermarket_params)\n respond_to do |format|\n if @supermarket.save\n format.json { render json: @supermarket, status: :ok }\n else\n format.json { render json: @supermarket.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_markets\n Market.all.each do |m|\n if m.name != \"Master\"\n ms = MarketService.new\n ms.service= self\n ms.market= m\n ms.active= true\n ms.save\n end\n end\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create\n @market = Market.new(market_params)\n\n respond_to do |format|\n if @market.save\n format.html { redirect_to @market, notice: 'Market was successfully created.' }\n format.json { render :show, status: :created, location: @market }\n else\n format.html { render :new }\n format.json { render json: @market.errors, status: :unprocessable_entity }\n end\n end\n\n\n @price = Price.new(price_params)\n\n respond_to do |format|\n if @price.save\n format.html { redirect_to @price, notice: 'P was successfully created.' }\n format.json { render :show, status: :created, location: @price }\n else\n format.html { render :new }\n format.json { render json: @price.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_market = Admin::Market.new(admin_market_params)\n\n respond_to do |format|\n if @admin_market.save\n format.html { redirect_to session['previous_url'] || admin_markets_url, notice: 'Mercati è stato creato con successo.' }\n format.json { render :show, status: :created, location: @admin_market }\n else\n format.html { render :new }\n format.json { render json: @admin_market.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n megam_rest.post_marketplaceapp(to_hash)\n end", "def create\n megam_rest.post_marketplaceapp(to_hash)\n end", "def create\n @planet = Planet.new(planet_params)\n\n respond_to do |format|\n if @planet.save\n format.html { redirect_to @planet, notice: 'Planet was successfully created.' }\n format.json { render :show, status: :created, location: @planet }\n else\n format.html { render :new }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @planet = Planet.new(planet_params)\n\n respond_to do |format|\n if @planet.save\n format.html { redirect_to @planet, notice: 'Planet was successfully created.' }\n format.json { render :show, status: :created, location: @planet }\n else\n format.html { render :new }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n Planet.create(\n name: params[:name],\n image: params[:image],\n orbit: params[:orbit],\n diameter: params[:diameter],\n mass: params[:mass],\n moons: params[:moons]\n )\n\n # Create actions have no template of their own, and we also\n # want to avoid accidental form resubmission; so we redirect\n redirect_to( planets_path ) # /planets\n\n end", "def create\n @sell = Sell.new(sell_params)\n\n if @sell.save\n render json: @sell, status: :created, location: @sell\n else\n render json: @sell.errors, status: :unprocessable_entity\n end\n end", "def index\n @markets = Market.all\n end", "def create\n\n #@simulation_market = SimulationMarket.new(params[:simulation_market])\n @simulation_markets = params[:simulation_markets].values.collect { |smarket| SimulationMarket.new(smarket) }\n @markets=Market.all\n @simulation=Simulation.find(@simulation_markets[0].simulation_id)\n SimulationMarket.destroy @simulation.simulation_markets(&:id)\n\n\n @simulation_markets.each_with_index do |sm, index|\n if sm.market_id!=0\n sm.market_id=@markets[index].id\n sm.save!\n end\n end\n\n\n respond_to do |format|\n if @simulation_markets.all?(&:valid?)\n format.html { redirect_to simulation_path(Simulation.find(@simulation_markets[0].simulation_id)) }\n #format.html { redirect_to @simulation_market, notice: 'Simulation market was successfully created.' }\n format.json { render json: @simulation_market, status: :created, location: @simulation_market }\n else\n format.html { render action: \"new\" }\n format.json { render json: @simulation_market.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end", "def create\n @supermarket = Supermarket.new(supermarket_params)\n\n respond_to do |format|\n if @supermarket.save\n format.html { redirect_to @supermarket, notice: 'Supermarket cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @supermarket }\n else\n format.html { render :new }\n format.json { render json: @supermarket.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n new_hash = params.require(:planet).permit(:name, :image_url, :diameter, :mass, :life)\n new_planet = Planet.create(new_hash)\n redirect_to \"/planets/#{new_planet.id}\"\n end", "def create\n @stag_price = StagPrice.new(stag_price_params)\n\n respond_to do |format|\n if @stag_price.save\n format.html { redirect_to @stag_price, notice: 'Stag price was successfully created.' }\n format.json { render :show, status: :created, location: @stag_price }\n else\n format.html { render :new }\n format.json { render json: @stag_price.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @backend_planet = Backend::Planet.new(params[:backend_planet])\n\n respond_to do |format|\n if @backend_planet.save\n format.html { redirect_to @backend_planet, notice: 'Planet was successfully created.' }\n format.json { render json: @backend_planet, status: :created, location: @backend_planet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @backend_planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @park = Park.new(params[:park])\n\n respond_to do |format|\n if @park.save\n format.html { redirect_to @park, notice: 'Park was successfully created.' }\n format.json { render json: @park, status: :created, location: @park }\n else\n format.html { render action: \"new\" }\n format.json { render json: @park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @marketer = Marketer.new(marketer_params)\n\n respond_to do |format|\n if @marketer.save\n format.html { redirect_to @marketer, notice: 'Marketer was successfully created.' }\n format.json { render :show, status: :created, location: @marketer }\n else\n format.html { render :new }\n format.json { render json: @marketer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @market_status = MarketStatus.new(market_status_params)\n\n respond_to do |format|\n if @market_status.save\n format.html { redirect_to @market_status, notice: 'Market status was successfully created.' }\n format.json { render :show, status: :created, location: @market_status }\n else\n format.html { render :new }\n format.json { render json: @market_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @park = Park.new(park_params)\n\n respond_to do |format|\n if @park.save\n format.html { redirect_to @park, notice: \"Park was successfully created.\" }\n format.json { render :show, status: :created, location: @park }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @park.errors, status: :unprocessable_entity }\n end\n end\n end", "def market_params\n params.require(:market).permit(:name, :image_url, :url, :address, :description)\n end", "def create\n @parking_spot = ParkingSpot.new(params[:parking_spot])\n\n respond_to do |format|\n if @parking_spot.save\n format.html { redirect_to @parking_spot, notice: 'Parking spot was successfully created.' }\n format.json { render json: @parking_spot, status: :created, location: @parking_spot }\n else\n format.html { render action: \"new\" }\n format.json { render json: @parking_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "def market_params\n params.require(:market).permit(:name)\n end", "def create\n if @country\n @market = @country.markets.build(params[:market])\n else\n @market = Market.new(params[:market])\n end\n\n respond_to do |format|\n if @market.save\n flash[:notice] = 'Market was successfully created.'\n format.html { redirect_to(context_url) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def market_params\n params.require(:market).permit(:title, :content)\n end", "def create\n @microspot = Microspot.new(microspot_params)\n \n respond_to do |format|\n if @microspot.save\n format.html { redirect_to @microspot, notice: 'Microspot was successfully created.' }\n format.json { render :show, status: :created, location: @microspot }\n else\n format.html { render :new }\n format.json { render json: @microspot.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n form = NewMarketplaceForm.new(params)\n return render status: 400, json: form.errors unless form.valid?\n\n # As there's no community yet, we store the global service name to thread\n # so that mail confirmation email is sent from global service name instead\n # of the just created marketplace's name\n ApplicationHelper.store_community_service_name_to_thread(APP_CONFIG.global_service_name)\n\n marketplace = MarketplaceService::API::Marketplaces.create(\n params.slice(:marketplace_name,\n :marketplace_type,\n :marketplace_country,\n :marketplace_language)\n .merge(payment_process: :preauthorize)\n )\n\n # Create initial trial plan\n plan = {\n expires_at: Time.now.change({ hour: 9, min: 0, sec: 0 }) + 31.days\n }\n PlanService::API::Api.plans.create_initial_trial(community_id: marketplace[:id], plan: plan)\n\n if marketplace\n TransactionService::API::Api.settings.provision(\n community_id: marketplace[:id],\n payment_gateway: :paypal,\n payment_process: :preauthorize,\n active: true)\n end\n\n user = UserService::API::Users.create_user({\n given_name: params[:admin_first_name],\n family_name: params[:admin_last_name],\n email: params[:admin_email],\n password: params[:admin_password],\n locale: params[:marketplace_language]},\n marketplace[:id]).data\n\n auth_token = UserService::API::AuthTokens.create_login_token(user[:id])\n url = URLUtils.append_query_param(marketplace[:url], \"auth\", auth_token[:token])\n\n assign_onboarding_feature_flag(community_id: marketplace[:id])\n\n # TODO handle error cases with proper response\n\n render status: 201, json: {\"marketplace_url\" => url, \"marketplace_id\" => marketplace[:id]}\n end", "def create\n @park = Park.new(park_params)\n\n respond_to do |format|\n if @park.save\n format.html { redirect_to @park, notice: 'Park was successfully created.' }\n format.json { render :show, status: :created, location: @park }\n else\n format.html { render :new }\n format.json { render json: @park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @park = Park.new(park_params)\n\n respond_to do |format|\n if @park.save\n format.html { redirect_to @park, notice: 'Park was successfully created.' }\n format.json { render :show, status: :created, location: @park }\n else\n format.html { render :new }\n format.json { render json: @park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n params[\"_json\"].each do |params_hash|\n puts params_hash.inspect\n @ticker_activity = TickerActivity.new(params_hash)\n @ticker_activity.save\n end\n\n #@ticker_activity = TickerActivity.new(params[:ticker_activity])\n\n respond_to do |format|\n if @ticker_activity.save\n format.html { redirect_to @ticker_activity, notice: 'Ticker was successfully created.' }\n format.json { render json: @ticker_activity, status: :created, location: @ticker_activity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ticker_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @planets_exoplanet = Planets::Exoplanet.new(params[:planets_exoplanet])\n\n respond_to do |format|\n if @planets_exoplanet.save\n format.html { redirect_to @planets_exoplanet, :notice => 'Exoplanet was successfully created.' }\n format.json { render :json => @planets_exoplanet, :status => :created, :location => @planets_exoplanet }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @planets_exoplanet.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n #birdspotter id must be present\n if params[:birdspotter].blank?\n render json: {\n status: 400,\n message: \"Skaparens id saknas.\" \n }\n end\n \n #at least one bird must be present\n if params[:bird].blank?\n render json: {\n status: 400,\n message: \"En birdspot måste innehålla minst en fågel.\" \n }\n end\n \n #latitude and longitude must be present\n if params[:latitude].blank? || params[:longitude].blank?\n render json: {\n status: 400,\n message: \"En birdspot måste innehålla latitud och longitude.\" \n }\n end\n \n #check if birdspotter exists\n if Api::V1::Birdspotter.exists?(params[:birdspotter])\n \n #if exists find birdspotter\n @birdspotter = Api::V1::Birdspotter.find_by_id(params[:birdspotter])\n \n #create a new spot and append to birdspotter\n @spot = Api::V1::Spot.create(:latitude => params[:latitude], :longitude => params[:longitude])\n if @spot.save\n @birdspotter.spots << @spot\n \n #iterate through all birds and append each bird to newly created spot\n params[:bird].tr(' ','').split(',').each do |bird_id|\n if Api::V1::Bird.exists?(bird_id)\n @bird = Api::V1::Bird.find_by_id(bird_id)\n @spot.birds << @bird\n else\n render json: {\n status: 404,\n message: \"En eller flera fåglar med det id:t finns inte.\"\n }\n end\n end\n else\n render json: {\n status: 400,\n message: @spot.errors.full_messages \n }\n end\n else\n render json: {\n status: 404,\n message: \"Skapare med det id:t finns inte.\" \n }\n \n end\n \n render json: { \n status: 201,\n message: \"Din birdspot är registerad. Tack!\", \n spots: Api::V1::SpotSerializer.new(@spot) \n }\n end", "def create\n @market_place = MarketPlace.new(market_place_params)\n\n respond_to do |format|\n if @market_place.save\n format.html { redirect_to @market_place, notice: \"Market place was successfully created.\" }\n format.json { render :show, status: :created, location: @market_place }\n else\n format.html { render :new }\n format.json { render json: @market_place.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tmarkets=Market.all\n stocks=Stock.all\n stocks.delete_all\n kiwoomApi = KiwoomApi.new()\n stock_code_list_all=[]\n market_code_list=[]\n markets.each do |market|\n stock_code_list=kiwoomApi.get_code_list_by_market(market.market_code)\n\n if stock_code_list!=nil\n stock_code_list_all=stock_code_list_all+stock_code_list\n stock_code_list.map do |stock_code|\n market_code_list<<[market.market_code,stock_code]\n end\n end\n end\n\t stock_code_list_all.uniq!\n stock_code_list_all.each do |stock_code|\n stock_name=kiwoomApi.get_master_code_name(stock_code)\n stock_open_date=kiwoomApi.get_master_listed_stock_date(stock_code)\n tmp = Stock.create(\n :stock_code => stock_code,\n :stock_name => stock_name,\n :stock_open_date => stock_open_date)\n puts tmp\n end\n\n\tmarket_stock = MarketStock.all\n market_stock.delete_all\n market_code_list.each do |market_stock_code|\n\t\tMarketStock.create(:market_code_id=> market_stock_code[0],:stock_code_id=>market_stock_code[1])\n end\n\n\trespond_to do |format|\n\t \tformat.html { redirect_to stocks_path, notice: \"Stocks was successfully created.#{markets.length}\" }\n \tformat.json { render :show, status: :created, location: stocks_path}\n\tend\n\n end", "def create\n @etsy = Etsy.new(params[:etsy])\n\n respond_to do |format|\n if @etsy.save\n format.html { redirect_to @etsy, notice: 'Etsy was successfully created.' }\n format.json { render json: @etsy, status: :created, location: @etsy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etsy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pet = Pet.new(pet_params)\n respond_to do |format|\n if @pet.save\n format.html { redirect_to @pet, notice: I18n.t('Pet card was successfully created') }\n format.json { render :show, status: :created, location: @pet }\n else\n format.html { render :new }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_market\n @region = Region.find(params[:region_id])\n # @markets = @region.markets.all\n\n @market = @region.markets.find(params[:id])\n \n end", "def create\n @pet = Pet.new(pet_params)\n\n respond_to do |format|\n if @pet.save\n format.html { redirect_to @pet, notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @pet }\n else\n format.html { render :new }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @kitty = Kitty.new(params[:kitty])\n\n respond_to do |format|\n if @kitty.save\n format.html { redirect_to @kitty, notice: 'Kitty was successfully created.' }\n format.json { render json: @kitty, status: :created, location: @kitty }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kitty.errors, status: :unprocessable_entity }\n end\n end\n end", "def market_params\n params.require(:market).permit(:name, :website, :street, :city, :state, :zip, :latitude, :longitude, :description, :image, :rating)\n end", "def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end", "def market_service_params\n params.require(:market_service).permit(:market_id, :service_id)\n end", "def create\n @supermarket = Supermarket.create(supermarket_params)\n\n redirect_to root_path\n end", "def market_params\n params.require(:market).permit(:name, :current_price, :integer, :fair_value, :discount_value, :YTD_change)\n end", "def create\n @market_order = MarketOrder.new(market_order_params)\n\n respond_to do |format|\n if @market_order.save\n format.html { redirect_to @market_order, notice: 'Market order was successfully created.' }\n format.json { render :show, status: :created, location: @market_order }\n else\n format.html { render :new }\n format.json { render json: @market_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def planets\n data = JSON.parse(open(\"http://swapi.co/api/planets\").read)\n @results = data[\"results\"]\n end", "def create\n #Assigns user if there is no current user\n if current_user\n @portfolio = current_user.portfolios.find_by(name: params[:portfolio])\n @stock = @portfolio.stocks.find_by(symbol: params[:stock])\n @trade = @stock.trades.create(trade_params)\n render json: @trade\n else\n render json: []\n end\n end", "def create\n @planet_type = PlanetType.new(planet_type_params)\n\n respond_to do |format|\n if @planet_type.save\n format.html { redirect_to @planet_type, notice: 'Planet type was successfully created.' }\n format.json { render :show, status: :created, location: @planet_type }\n else\n format.html { render :new }\n format.json { render json: @planet_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ticker = Ticker.new(ticker_params)\n\n respond_to do |format|\n if @ticker.save\n format.html { redirect_to @ticker, notice: \"Ticker was successfully created.\" }\n format.json { render :show, status: :created, location: @ticker }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @ticker.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_parks_from_api\n url = \"https://developer.nps.gov/api/v1/parks?limit=500&api_key=GhGhpL8DrRdsEAwfu0Mn4gXuhgkdnhVnrEnNfmRx\"\n resp = RestClient.get(url)\n json_hash = JSON.parse(resp)\n park_codes = []\n\n json_hash.each do |data_key, value|\n if data_key[\"data\"]\n value.each do |hash_keys|\n Park.create(park_name: hash_keys[\"fullName\"], park_code: hash_keys[\"parkCode\"])\n \n end\n end\n end\n\nend", "def create\n @spot = Spot.new(params[:spot])\n \n respond_to do |format|\n if @spot.save\n format.html { redirect_to @spot, notice: 'Spot was successfully created.' }\n format.json { render json: @spot, status: :created, location: @spot }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n pet_response = pet_create_service.call(pet_params)\n lost_pet_match_service.call(pet_response)\n\n @pet = pet_response\n\n respond_to do |format|\n if pet_response.success?\n format.html { redirect_to pet_response, notice: I18n.t(\"pets.show.created\") }\n format.json { render :show, status: :created, location: pet_response }\n else\n format.html { render :new }\n format.json { render json: pet_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_multiple\n puts params\n\n @ticker_activities = params[\"_json\"].map do |params_hash|\n # ToDo => whitelisted_params einbauen. Siehe mein Beitrag bei stackoverflow unter http://stackoverflow.com/questions/35082478/handling-json-array-from-android-in-rails\n ticker = TickerActivity.create!(params_hash) \n end\n\n respond_to do |format|\n # Check that all the ticker_activities are valid and can be saved\n if @ticker_activities.all? { |ticker_activity| ticker_activity.valid? }\n # Now we know they are valid save each ticker_activity\n @ticker_activities.each do |ticker_activity|\n ticker_activity.save\n end\n\n # Respond with the json versions of the saved ticker_activites\n format.json { render json: @ticker_activities, status: :created, location: multiple_ticker_locations_url }\n \n else\n # We can't save *all* the ticker_activities so we\n # respond with the corresponding validation errors for the ticker_activities\n @errors = @ticker_activities.map { |ticker_activity| ticker_activity.errors }\n format.json { render json: @errors, status: :unprocessable_entity }\n end\n end\nend", "def create\n form = NewMarketplaceForm.new(params)\n return render status: 400, json: form.errors unless form.valid?\n\n # As there's no community yet, we store the global service name to thread\n # so that mail confirmation email is sent from global service name instead\n # of the just created marketplace's name\n ApplicationHelper.store_community_service_name_to_thread(APP_CONFIG.global_service_name)\n\n marketplace = MarketplaceService::API::Marketplaces.create(\n params.slice(:marketplace_name,\n :marketplace_type,\n :marketplace_country,\n :marketplace_language)\n .merge(payment_process: :preauthorize)\n )\n\n # Create initial trial plan\n plan = {\n expires_at: Time.now.change({ hour: 9, min: 0, sec: 0 }) + 31.days\n }\n PlanService::API::Api.plans.create_initial_trial(community_id: marketplace[:id], plan: plan)\n\n if marketplace\n TransactionService::API::Api.settings.provision(\n community_id: marketplace[:id],\n payment_gateway: :paypal,\n payment_process: :preauthorize,\n active: true)\n end\n\n user = UserService::API::Users.create_user({\n given_name: params[:admin_first_name],\n family_name: params[:admin_last_name],\n email: params[:admin_email],\n password: params[:admin_password],\n locale: params[:marketplace_language]},\n marketplace[:id]).data\n\n base_url = URI(marketplace[:url])\n url = admin_getting_started_guide_url(host: base_url.host, port: base_url.port)\n\n # make the marketplace creator be logged in via Auth Token\n auth_token = UserService::API::AuthTokens.create_login_token(user[:id])\n url = URLUtils.append_query_param(url, \"auth\", auth_token[:token])\n\n # Enable specific features for all new trials\n FeatureFlagService::API::Api.features.enable(community_id: marketplace[:id], person_id: user[:id], features: [:topbar_v1])\n FeatureFlagService::API::Api.features.enable(community_id: marketplace[:id], features: [:topbar_v1])\n\n # TODO handle error cases with proper response\n\n render status: 201, json: {\"marketplace_url\" => url, \"marketplace_id\" => marketplace[:id]}\n end", "def create\n @galaxy = Galaxy.find_by(params[:galaxy_id])\n @star = Star.find_by(id: params[:star_id])\n @planet = @star.planets.new(planet_params)\n\n respond_to do |format|\n if @planet.save\n format.html { redirect_to galaxy_star_path(@galaxy, @star), notice: 'Planet was successfully created.' }\n format.json { render :show, status: :created, location: @planet }\n else\n format.html { render :new }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @variety = Variety.new(params[:variety])\n @variety.company_id = current_user.company_id\n\n respond_to do |format|\n if @variety.save\n format.html { redirect_to varieties_path, notice: \"#{@variety.name} fue creada exitosamente.\" }\n format.json { render json: @variety, status: :created, location: @variety }\n else\n format.html { render action: \"new\" }\n format.json { render json: @variety.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @portfolio = Portfolio.new(portfolio_params)\n\n if @portfolio.save\n render json: @portfolio, status: :created, location: @portfolio\n else\n render json: @portfolio.errors, status: :unprocessable_entity\n end\n end", "def create\n @park = Park.new(park_params)\n\n respond_to do |format|\n if @park.save\n format.html { redirect_to @park, notice: 'Park was successfully created.' }\n format.json { render :show, status: :created, location: @park }\n else\n format.html { render :new }\n format.json { render json: @park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @kitten = Kitten.new(params[:kitten])\n\n respond_to do |format|\n if @kitten.save\n format.html { redirect_to @kitten, notice: 'Kitten was successfully created.' }\n format.json { render json: @kitten, status: :created, location: @kitten }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_item()\n\n request_body = {\n 'name' => 'Milkshake',\n 'variations' => [\n {\n 'name' => 'Small',\n 'pricing_type' => 'FIXED_PRICING',\n 'price_money' => {\n 'currency_code' => 'USD',\n 'amount' => 400\n }\n }\n ]\n }\n\n response = Unirest.post CONNECT_HOST + '/v1/' + LOCATION_ID + '/items',\n headers: REQUEST_HEADERS,\n parameters: request_body.to_json\n\n if response.code == 200\n puts 'Successfully created item:'\n puts JSON.pretty_generate(response.body)\n return response.body\n else\n puts 'Item creation failed'\n puts response.body\n return nil\n end\nend", "def create\n @response = HTTParty.get('http://laxapi.herokuapp.com/api/teams')\n CreateTeamService.new.create_team_objects(@response)\n render :json => {\n :message => \" #{Team.count} teams have been created\",\n status: 200\n }\n end", "def push(market)\n @markets.push(market)\n end", "def create\n @spot = Spot.new(spot_params)\n\n respond_to do |format|\n if @spot.save\n format.html { redirect_to @spot, notice: 'Spot was successfully created.' }\n format.json { render :show, status: :created, location: @spot }\n else\n format.html { render :new }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "def create body = {}\n @connection.request(method: :post, path: \"/volumes/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end", "def create\n @coin_set = CoinSet.new(params[:coin_set])\n\n respond_to do |format|\n if @coin_set.save\n format.html { redirect_to root_path, notice: 'Coin set was successfully created.' }\n format.json { render json: @coin_set, status: :created, location: @coin_set }\n else\n format.html { render action: \"new\" }\n format.json { render json: @coin_set.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n authorize! :create, CompetenceTierGroup\n \n @competence_tier_group = CompetenceTierGroup.new(competence_tier_group_params)\n @competence_tier_group.save!\n render json: {status: :ok}\n end", "def create\n @tv_series = TvSeries.new(tv_series_params)\n\n respond_to do |format|\n if @tv_series.save\n format.html { redirect_to root_path, notice: 'Сериал создан!' }\n format.json { render :index, status: :created, location: root_path }\n else\n format.html { render :new }\n format.json { render json: @tv_series.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @sells = Sell.all\n\n render json: @sells\n end", "def new\n @simulation=Simulation.find(params[:simulation_id])\n @markets=Market.all\n @simulation_markets=Array.new(Market.all.count) { SimulationMarket.new }\n @simulation_markets_ids=Array.new\n @present_markets=SimulationMarket.find_all_by_simulation_id(@simulation.id)\n @present_markets.each do |simulation_market|\n @simulation_markets_ids << simulation_market.market_id\n\n end\n\n #@simulation_market = SimulationMarket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @simulation_market }\n end\n end", "def create\n @vet = Vet.new(params[:vet])\n\n respond_to do |format|\n if @vet.save\n format.html { redirect_to @vet, notice: 'Vet was successfully created.' }\n format.json { render json: @vet, status: :created, location: @vet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @seeker = Seeker.new(seeker_params)\n @seeker.user_id = User.find(session[:user_id]).uid\n @seeker.skill_list.add(params[:seeker][:skill_list].to_s.downcase, parse: true)\n\n respond_to do |format|\n if @seeker.save\n format.html { redirect_to root_path, notice: 'Seeker was successfully created.' }\n format.json { render action: 'show', status: :created, location: @seeker }\n else\n format.html { render action: 'new' }\n format.json { render json: @seeker.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_planets(planets)\n planets.each do |planet|\n @planets.push(planet)\n end\n end", "def create\n @vet = Vet.new(vet_params)\n\n respond_to do |format|\n if @vet.save\n format.html { redirect_to @vet, notice: 'Vet was successfully created.' }\n format.json { render :show, status: :created, location: @vet }\n else\n format.html { render :new }\n format.json { render json: @vet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tags_of_novel = TagsOfNovel.new(params[:tags_of_novel])\n\n respond_to do |format|\n if @tags_of_novel.save\n format.html { redirect_to @tags_of_novel, notice: 'Tags of novel was successfully created.' }\n format.json { render json: @tags_of_novel, status: :created, location: @tags_of_novel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tags_of_novel.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @parking = Parking.new(parking_params)\n\n if @parking.save\n render :show, status: :created, location: @parking\n else\n render json: @parking.errors, status: :unprocessable_entity\n end\n end", "def create\n @offer = Offer.new(offers_params)\n\n respond_to do |format|\n if @offer.save\n format.jsonapi { render jsonapi: @offer, status: :created }\n else\n format.jsonapi { render jsonapi: @offer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pet = Pet.new(pet_params)\n @pet.save\n redirect_to \"/pets\"\n end", "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url }\n format.json { head :no_content }\n end\n end", "def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end", "def create\r\n @park_spacerental = ParkSpacerental.new(park_spacerental_params)\r\n\r\n respond_to do |format|\r\n if @park_spacerental.save\r\n format.html { redirect_to @park_spacerental, notice: 'Park spacerental was successfully created.' }\r\n format.json { render :show, status: :created, location: @park_spacerental }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @park_spacerental.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def rate_post(rating)\n mock_request = Rack::MockRequest.new(APP)\n mock_request.put(rate_post_endpoint, { 'router.params' => { rating: rating }, format: :json })\n end", "def create\n @kit = Kit.new(kit_params)\n\n respond_to do |format|\n if @kit.save\n format.html { redirect_to @kit, notice: 'Kit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @kit }\n else\n format.html { render action: 'new' }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n product_details = params.permit(:title, :inventory_count, :price)\n success = Product.create(product_details)\n\n render json: { success: success }\n end", "def addservice\n\n @service = ServiceProvider.find_by(username: params[:serviceprovider][:username]);\n permitted = params[:serviceprovider].permit( :description, :category_id);\n @service.services.create(permitted);\n\n render json: @service\n\n\nend", "def create\n @market_activity = MarketActivity.new(params[:market_activity])\n\n respond_to do |format|\n if @market_activity.save\n format.html { redirect_to @market_activity, notice: 'Market activity was successfully created.' }\n format.json { render json: @market_activity, status: :created, location: @market_activity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @market_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "def tv_series_params\n params.require(:tv_series).permit(:name, :genre, :price, :season)\n end", "def create\n @trek = Trek.new(params[:trek])\n\n respond_to do |format|\n if @trek.save\n format.html { redirect_to @trek, notice: 'Trek was successfully created.' }\n format.json { render json: @trek, status: :created, location: @trek }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def planet_params\n params.require(:planet).permit(:name, :life, :moons, :image, :star_id, :galaxy_id, :description, :category)\n end", "def create\n @spice = Spice.new(spice_params)\n\n if @spice.save\n render json: @spice, status: :created\n else\n render json: @spice.errors, status: :unprocessable_entity\n end\n end", "def create\n @park = Park.new(park_params)\n\n respond_to do |format|\n if @park.save\n format.html { redirect_to @park, notice: 'Field was successfully created.' }\n format.json { render :show, status: :created, location: @park }\n else\n format.html { render :new }\n format.json { render json: @park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(data)\n @planet_model.create(data)\n end", "def create\n @package = Package.create(package_params)\n\n render json: @package\n end", "def create\n @idea = current_member.ideas.new(idea_params) \n respond_to do |format|\n sectors_params.delete(\"\")\n if @idea.save\n sectors_params.each do |k|\n @idea.sectors << Sector.find_by(id:k)\n end\n format.json { head :no_content }\n format.js\n else\n\n format.json { render :json => { :error => @idea.errors.full_messages }, :status => 422 }\n end\n \n end\n end", "def create\n @slab = Slab.new(params[:slab])\n\n respond_to do |format|\n if @slab.save\n format.html { redirect_to @slab, :notice => 'Slab was successfully created.' }\n format.json { render :json => @slab, :status => :created, :location => @slab }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.64508766", "0.6220002", "0.6071341", "0.58297485", "0.57596576", "0.57408005", "0.57232237", "0.5694976", "0.5672033", "0.5672033", "0.5575804", "0.5575804", "0.5563048", "0.5526993", "0.5511544", "0.54852283", "0.54690504", "0.54624027", "0.54268354", "0.54225665", "0.5418387", "0.5411019", "0.54045486", "0.5398799", "0.539782", "0.53899145", "0.5385039", "0.53848565", "0.5373851", "0.5370075", "0.5367705", "0.5360476", "0.5356132", "0.5353606", "0.5329173", "0.53282255", "0.5318746", "0.531697", "0.53133863", "0.5309028", "0.5308205", "0.53065646", "0.5297843", "0.5289682", "0.5276247", "0.5275349", "0.52718216", "0.52685654", "0.52594656", "0.525061", "0.524257", "0.52384925", "0.52331185", "0.52273226", "0.5227001", "0.52261525", "0.5225232", "0.5220539", "0.52171993", "0.52143764", "0.52111226", "0.52010715", "0.5197787", "0.51954365", "0.5175367", "0.5174882", "0.5174065", "0.51690686", "0.5164402", "0.51589656", "0.5132791", "0.5130297", "0.5126004", "0.5124461", "0.51236975", "0.5122916", "0.5122847", "0.5122579", "0.5120956", "0.5119974", "0.5114096", "0.51107204", "0.5098814", "0.50983936", "0.5094324", "0.509097", "0.50854427", "0.5082046", "0.50817025", "0.5074734", "0.5067457", "0.5058884", "0.5058298", "0.5056402", "0.5055522", "0.50539964", "0.50533766", "0.5052054", "0.5049079", "0.50474775" ]
0.5719034
7
PATCH/PUT /markets/1 PATCH/PUT /markets/1.json
def update respond_to do |format| if @market.update(market_params) format.html { redirect_to @market, notice: 'Market was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @market.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n respond_to do |format|\n if @market.update(market_params)\n format.html { redirect_to @market, notice: 'Market was successfully updated.' }\n format.json { render :show, status: :ok, location: @market }\n else\n format.html { render :edit }\n format.json { render json: @market.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @market.update(market_params)\n format.html { redirect_to markets_path, notice: '성공적으로 수정되었습니다.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def put!\n request! :put\n end", "def update\n @kit = Kit.find(params[:id])\n\n respond_to do |format|\n if @kit.update_attributes(params[:kit])\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n if @kitten.update_attributes(params[:kitten])\n format.html { redirect_to @kitten, notice: 'Kitten was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitten.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_market.update(admin_market_params)\n format.html { redirect_to session['previous_url'] || admin_markets_url, notice: 'Mercati è stato aggiornato con successo.' }\n format.json { render :show, status: :ok, location: @admin_market }\n else\n format.html { render :edit }\n format.json { render json: @admin_market.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n if @kitty.update_attributes(params[:kitty])\n format.html { redirect_to @kitty, notice: 'Kitty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kit.update(kit_params)\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @setmarkassent = Setmarkassent.find(params[:id])\n\n respond_to do |format|\n if @setmarkassent.update_attributes(params[:setmarkassent])\n format.html { redirect_to @setmarkassent, notice: 'Setmarkassent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @setmarkassent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.html { redirect_to @supermarket, notice: 'Supermarket cadastrado com sucesso.' }\n format.json { render :show, status: :ok, location: @supermarket }\n else\n format.html { render :edit }\n format.json { render json: @supermarket.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "def update\n respond_to do |format|\n if @market_status.update(market_status_params)\n format.html { redirect_to @market_status, notice: 'Market status was successfully updated.' }\n format.json { render :show, status: :ok, location: @market_status }\n else\n format.html { render :edit }\n format.json { render json: @market_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @market = Market.find(params[:id])\n\n respond_to do |format|\n if @market.update_attributes(params[:market])\n flash[:notice] = 'Market was successfully updated.'\n format.html { redirect_to(context_url) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update\n @simulation_market = SimulationMarket.find(params[:id])\n\n respond_to do |format|\n if @simulation_market.update_attributes(params[:simulation_market])\n format.html { redirect_to @simulation_market, notice: 'Simulation market was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @simulation_market.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @market_place.update(market_place_params)\n format.html { redirect_to @market_place, notice: \"Market place was successfully updated.\" }\n format.json { render :show, status: :ok, location: @market_place }\n else\n format.html { render :edit }\n format.json { render json: @market_place.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to root_path, notice: 'Pet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @asset.update(price: params[:asset][:price])\n json_response(@asset,:created)\n end", "def update\n respond_to do |format|\n if @ticker.update(ticker_params)\n format.html { redirect_to @ticker, notice: \"Ticker was successfully updated.\" }\n format.json { render :show, status: :ok, location: @ticker }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @ticker.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @microspot.update(microspot_params)\n format.html { redirect_to @microspot, notice: 'Microspot was successfully updated.' }\n format.json { render :show, status: :ok, location: @microspot }\n else\n format.html { render :edit }\n format.json { render json: @microspot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @slitter = Slitter.find(params[:id])\n\n respond_to do |format|\n if @slitter.update_attributes(params[:slitter])\n format.html { redirect_to @slitter, notice: 'Slitter was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slitter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @item_kit = ItemKit.find(params[:id])\n\n respond_to do |format|\n if @item_kit.update_attributes(params[:item_kit])\n format.html { redirect_to @item_kit, notice: 'Item kit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_kit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @liftset.update(liftset_params)\n format.html { redirect_to @liftset, notice: 'Liftset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @liftset.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @backend_planet = Backend::Planet.find(params[:id])\n\n respond_to do |format|\n if @backend_planet.update_attributes(params[:backend_planet])\n format.html { redirect_to @backend_planet, notice: 'Planet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @backend_planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @market_offering.update(market_offering_params)\n format.html { redirect_to @market_offering, notice: 'Market offering was successfully updated.' }\n format.json { render :show, status: :ok, location: @market_offering }\n else\n format.html { render :edit }\n format.json { render json: @market_offering.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @marketer.update(marketer_params)\n format.html { redirect_to @marketer, notice: 'Marketer was successfully updated.' }\n format.json { render :show, status: :ok, location: @marketer }\n else\n format.html { render :edit }\n format.json { render json: @marketer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @kit\n respond_to do |format|\n if @kit.update(kit_params)\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { render :show, status: :ok, location: @kit }\n else\n format.html { render :edit }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @microplst = Microplst.find(params[:id])\n\n respond_to do |format|\n if @microplst.update_attributes(params[:microplst])\n format.html { redirect_to @microplst, notice: 'Microplst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microplst.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n team_name = params[:name]\n team_description = params[:description]\n team_id = params[:id]\n\n respond_to do |format|\n if OkrTeam.where(id: team_id).update_all(name: team_name, description: team_description)\n format.json { render json: 'Team is updated successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end", "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "def update\n @etsy = Etsy.find(params[:id])\n\n respond_to do |format|\n if @etsy.update_attributes(params[:etsy])\n format.html { redirect_to @etsy, notice: 'Etsy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etsy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @planets_exoplanet = Planets::Exoplanet.find(params[:id])\n\n respond_to do |format|\n if @planets_exoplanet.update_attributes(params[:planets_exoplanet])\n format.html { redirect_to @planets_exoplanet, :notice => 'Exoplanet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @planets_exoplanet.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n respond_to do |format|\n if @mark.update(mark_params)\n format.html { redirect_to @mark, notice: 'Mark was successfully updated.' }\n format.json { render :show, status: :ok, location: @mark }\n else\n format.html { render :edit }\n format.json { render json: @mark.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n if @coin_set.update_attributes(params[:coin_set])\n # an update should be coming from the coin_set show page.\n format.html { redirect_to @coin_set, notice: 'Coin set was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coin_set.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sphere = Sphere.find(params[:id])\n\n respond_to do |format|\n if @sphere.update_attributes(params[:sphere])\n format.html { redirect_to @sphere, notice: 'Sphere a été édité avec succès.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sphere.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet_true.update(pet_true_params)\n format.html { redirect_to @pet_true, notice: 'Pet true was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pet_true.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supermarket.update(supermarket_params)\n\n redirect_to root_path\n end", "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render json: {\"message\" => \"Pet was successfully updated\", \"success\" => true, \"data\" => @pet}, status: :created, location: @pet }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @shelter = Shelter.find(params[:id])\n\n if @shelter.update(shelter_params)\n head :no_content\n else\n render json: @shelter.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @planet.update(planet_params)\n format.html { redirect_to @planet, notice: 'Planet was successfully updated.' }\n format.json { render :show, status: :ok, location: @planet }\n else\n format.html { render :edit }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @planet.update(planet_params)\n format.html { redirect_to @planet, notice: 'Planet was successfully updated.' }\n format.json { render :show, status: :ok, location: @planet }\n else\n format.html { render :edit }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def update\n respond_to do |format|\n if @tottle.update(tottle_params)\n format.html { redirect_to @tottle, notice: 'Tottle was successfully updated.' }\n format.json { render :show, status: :ok, location: @tottle }\n else\n format.html { render :edit }\n format.json { render json: @tottle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @line_pet.update(line_pet_params)\n format.html { redirect_to @line_pet, notice: 'Line pet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @belt.update(belt_params)\n format.html { redirect_to @belt, notice: 'Belt was successfully updated.' }\n format.json { render :show, status: :ok, location: @belt }\n else\n format.html { render :edit }\n format.json { render json: @belt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trek = Trek.find(params[:id])\n\n respond_to do |format|\n if @trek.update_attributes(params[:trek])\n format.html { redirect_to @trek, notice: 'Trek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @market_order.update(market_order_params)\n format.html { redirect_to @market_order, notice: 'Market order was successfully updated.' }\n format.json { render :show, status: :ok, location: @market_order }\n else\n format.html { render :edit }\n format.json { render json: @market_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @stable = Stable.find(params[:id])\n\n respond_to do |format|\n if @stable.update_attributes(params[:stable])\n format.html { redirect_to @stable, notice: 'Stable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stable.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trek.trek_mountains.clear\n respond_to do |format|\n if @trek.update(trek_params)\n format.html { redirect_to @trek, notice: 'Trek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trek.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @book_mark.update(book_mark_params)\n format.html { redirect_to @book_mark, notice: 'Book mark was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_mark }\n else\n format.html { render :edit }\n format.json { render json: @book_mark.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sphere.update(sphere_params)\n format.html { redirect_to @sphere, notice: 'Sphere was successfully updated.' }\n format.json { render :show, status: :ok, location: @sphere }\n else\n format.html { render :edit }\n format.json { render json: @sphere.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "def update\n if @sell.update(sell_params)\n head :no_content\n else\n render json: @sell.errors, status: :unprocessable_entity\n end\n end", "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "def update\n @sphere = Sphere.find(params[:id])\n\n respond_to do |format|\n if @sphere.update_attributes(params[:sphere])\n format.html { redirect_to(@sphere, :notice => 'Sphere was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sphere.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end", "def update\n @prices = Price.all\n @strains = Strain.all\n @regions = Region.all\n respond_to do |format|\n if @price.update(price_params)\n format.html { redirect_to \"/\", notice: 'Price was successfully updated.' }\n format.json { render :show, status: :ok, location: @price }\n else\n format.html { render :edit }\n format.json { render json: @price.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end", "def update\n respond_to do |format|\n if @settlement.update(settlement_params)\n format.html { redirect_to @settlement, notice: 'Settlement was successfully updated.' }\n format.json { render :show, status: :ok, location: @settlement }\n else\n format.html { render :edit }\n format.json { render json: @settlement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def set_market\n @region = Region.find(params[:region_id])\n # @markets = @region.markets.all\n\n @market = @region.markets.find(params[:id])\n \n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def update\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n if @moose.update_attributes(params[:moose])\n format.html { redirect_to @moose, notice: 'Moose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moose.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @seat = Seat.find(params[:id])\n\n respond_to do |format|\n if @seat.update_attributes(params[:seat])\n format.html { redirect_to @seat, notice: 'Seat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bundlesticker = Bundlesticker.find(params[:id])\n\n respond_to do |format|\n if @bundlesticker.update_attributes(params[:bundlesticker])\n format.html { redirect_to @bundlesticker, notice: 'Bundlesticker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundlesticker.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: I18n.t('Pet card was successfully updated') }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ketamine.update(ketamine_params)\n format.html { redirect_to @ketamine, notice: 'Ketamine was successfully updated.' }\n format.json { render :show, status: :ok, location: @ketamine }\n else\n format.html { render :edit }\n format.json { render json: @ketamine.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kota_stone.update(kota_stone_params)\n format.html { redirect_to kota_stones_url, notice: 'Kota stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kota_stone.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def update\n respond_to do |format|\n if @planet.update(planet_params)\n format.html { redirect_to galaxy_star_planet_path(@planet.star.galaxy_id, @planet.star_id), notice: 'Planet was successfully updated.' }\n # format.json { render :show, status: :ok, location: @planet }\n else\n format.html { render :edit }\n format.json { render json: @planet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @stock_ticker.update(stock_ticker_params)\n format.html { redirect_to @stock_ticker, notice: 'Stock ticker was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock_ticker }\n else\n format.html { render :edit }\n format.json { render json: @stock_ticker.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet_item.update(pet_item_params)\n format.html { redirect_to @pet_item, notice: 'Pet item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pet_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end", "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @microposst = Microposst.find(params[:id])\n\n respond_to do |format|\n if @microposst.update_attributes(params[:microposst])\n format.html { redirect_to @microposst, notice: 'Microposst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microposst.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @yarn.update_attributes(params[:yarn])\n format.html { redirect_to @yarn, notice: 'Yarn was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yarn.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, CompetenceTierGroup\n \n @competence_tier_group.update!(competence_tier_group_params)\n render json: {status: :ok}\n end", "def update\n respond_to do |format|\n if @marketer_ext.update(marketer_ext_params)\n format.html { redirect_to @marketer_ext, notice: 'Marketer ext was successfully updated.' }\n format.json { render :show, status: :ok, location: @marketer_ext }\n else\n format.html { render :edit }\n format.json { render json: @marketer_ext.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @settlement = Settlement.find(params[:id])\n\n respond_to do |format|\n if @settlement.update_attributes(params[:settlement])\n format.html { redirect_to @settlement, :notice => 'Settlement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @settlement.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @basket.set_price\n respond_to do |format|\n if @basket.update(basket_params)\n format.html { redirect_to @basket, notice: 'Basket was successfully updated.' }\n format.json { render :show, status: :ok, location: @basket }\n else\n format.html { render :edit }\n format.json { render json: @basket.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sticker = Sticker.find(params[:id])\n \n respond_to do |format|\n if @sticker.update_attributes(params[:sticker])\n format.html { redirect_to(@sticker, :notice => 'Sticker was successfully updated.') }\n format.json { render :json => @sticker.to_json }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sticker.errors.to_json }\n format.xml { render :xml => @sticker.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n curr_planet = Planet.find(params[:id])\n curr_planet.update(params.require(:planet).permit(:name, :image_url, :diameter, :mass, :life))\n redirect_to \"/planets/#{curr_planet.id}\"\n end", "def update\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: I18n.t(\"pets.show.updated\") }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6689297", "0.6285735", "0.62254876", "0.6205059", "0.6087899", "0.5969578", "0.5943647", "0.5923731", "0.5918055", "0.58609074", "0.5856743", "0.58487135", "0.5837215", "0.5828785", "0.58192664", "0.581824", "0.5796044", "0.5793048", "0.5785845", "0.5774626", "0.57715815", "0.57544124", "0.57342213", "0.5732863", "0.57221746", "0.5709539", "0.5706099", "0.57045466", "0.56987244", "0.5698526", "0.56978613", "0.56956226", "0.5693117", "0.56877387", "0.568521", "0.5684083", "0.5654496", "0.5645358", "0.56330925", "0.562969", "0.5628124", "0.5628086", "0.56212074", "0.56187016", "0.5615023", "0.56065357", "0.5605884", "0.5601189", "0.55999976", "0.55999976", "0.5593536", "0.559123", "0.55912286", "0.5583019", "0.55766565", "0.5573935", "0.5572885", "0.55717313", "0.55679685", "0.5565562", "0.5565089", "0.556487", "0.5556155", "0.55458623", "0.5544632", "0.55422837", "0.5539463", "0.55376744", "0.5537197", "0.5535456", "0.5534367", "0.55288476", "0.5528758", "0.5527226", "0.552254", "0.5520654", "0.5520492", "0.55116", "0.5511247", "0.55091685", "0.550453", "0.55010676", "0.5496059", "0.54947376", "0.5491419", "0.54908735", "0.54908735", "0.54908735", "0.54908735", "0.54908735", "0.54908735", "0.5490315", "0.5486884", "0.5482709", "0.54809725", "0.54796016", "0.54782766", "0.5476364", "0.5473975", "0.5466125" ]
0.63627464
1
DELETE /markets/1 DELETE /markets/1.json
def destroy @market.destroy respond_to do |format| format.html { redirect_to markets_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @market.destroy\n respond_to do |format|\n format.html { redirect_to markets_url, notice: 'Market was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @simulation_market = SimulationMarket.find(params[:id])\n @simulation_market.destroy\n\n respond_to do |format|\n format.html { redirect_to simulation_markets_url }\n format.json { head :ok }\n end\n end", "def destroy\n @supermarket = Supermarket.find(params[:id]) \n @supermarket.destroy\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok }\n end\n end", "def destroy\n Planet.delete(params[:id])\n redirect_to \"/planets\"\n end", "def destroy\n @supermarket.destroy\n respond_to do |format|\n format.html { redirect_to supermarkets_url, notice: 'Supermarket removido com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @supermarket.destroy\n respond_to do |format|\n format.html { redirect_to supermarkets_url, notice: 'Supermarket was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @backend_planet = Backend::Planet.find(params[:id])\n @backend_planet.destroy\n\n respond_to do |format|\n format.html { redirect_to backend_planets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_market.destroy\n respond_to do |format|\n format.html { redirect_to admin_markets_url, notice: 'Mercati cancellata con successo!.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kit = Kit.find(params[:id])\n @kit.destroy\n\n respond_to do |format|\n format.html { redirect_to kits_url }\n format.json { head :ok }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @coin_set = CoinSet.find(params[:id])\n @coin_set.destroy\n\n respond_to do |format|\n format.html { redirect_to coin_sets_url }\n format.json { head :ok }\n end\n end", "def destroy\n @planets_exoplanet = Planets::Exoplanet.find(params[:id])\n @planets_exoplanet.destroy\n\n respond_to do |format|\n format.html { redirect_to planets_exoplanets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vet = Vet.find(params[:id])\n @vet.destroy\n\n respond_to do |format|\n format.html { redirect_to vets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kit.destroy\n respond_to do |format|\n format.html { redirect_to kits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pet = Pet.find(params[:id])\n @pet.destroy\n\n respond_to do |format|\n format.html { redirect_to pets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pet = Pet.find(params[:id])\n @pet.destroy\n\n respond_to do |format|\n format.html { redirect_to pets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pet = Pet.find(params[:id])\n @pet.destroy\n\n respond_to do |format|\n format.html { redirect_to pets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trek.destroy\n respond_to do |format|\n format.html { redirect_to treks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_pet.destroy\n respond_to do |format|\n format.html { redirect_to line_pets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trek = Trek.find(params[:id])\n @trek.destroy\n\n respond_to do |format|\n format.html { redirect_to treks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @etsy = Etsy.find(params[:id])\n @etsy.destroy\n\n respond_to do |format|\n format.html { redirect_to etsies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @supermarket.delete\n\n redirect_to supermarkets_path\n end", "def destroy\n @item_kit = ItemKit.find(params[:id])\n @item_kit.destroy\n\n respond_to do |format|\n format.html { redirect_to item_kits_url }\n format.json { head :ok }\n end\n end", "def destroy\n @kitty = Kitty.find(params[:id])\n @kitty.destroy\n\n respond_to do |format|\n format.html { redirect_to kitties_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @planet.destroy\n respond_to do |format|\n format.html { redirect_to planets_url, notice: 'Planet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @planet.destroy\n respond_to do |format|\n format.html { redirect_to planets_url, notice: 'Planet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @setmarkassent = Setmarkassent.find(params[:id])\n @setmarkassent.destroy\n\n respond_to do |format|\n format.html { redirect_to setmarkassents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @market_status.destroy\n respond_to do |format|\n format.html { redirect_to market_statuses_url, notice: 'Market status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @basket = Basket.find(params[:id])\n @basket.destroy\n\n respond_to do |format|\n format.html { redirect_to baskets_url }\n format.json { head :ok }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @microplst = Microplst.find(params[:id])\n @microplst.destroy\n\n respond_to do |format|\n format.html { redirect_to microplsts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @market = @store_market_relationship.market\n @store_market_relationship.destroy\n respond_to do |format|\n format.html { redirect_to @market, notice: ' successfully quit the market.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @settlement = Settlement.find(params[:id])\n @settlement.destroy\n\n respond_to do |format|\n format.html { redirect_to settlements_url }\n format.json { head :ok }\n end\n end", "def destroy\n @price_schema.destroy\n respond_to do |format|\n format.html { redirect_to price_schemas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n pet = @user.pets.find(params[:id])\n pet.destroy\n render json: pet\n end", "def destroy\n @itemstable = Itemstable.find(params[:id])\n @itemstable.destroy\n\n respond_to do |format|\n format.html { redirect_to itemstables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vegetable = Vegetable.find(params[:id])\n @vegetable.destroy\n\n respond_to do |format|\n format.html { redirect_to vegetables_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @park.destroy\n respond_to do |format|\n format.html { redirect_to parks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n params.require(%i[id])\n beverage = Beverage.find_by!(id: params[:id])\n beverage.destroy!\n head :no_content\n end", "def destroy\n @stable = Stable.find(params[:id])\n @stable.destroy\n\n respond_to do |format|\n format.html { redirect_to stables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @liftset.destroy\n respond_to do |format|\n format.html { redirect_to liftsets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @sphere = Sphere.find(params[:id])\n @sphere.destroy\n\n respond_to do |format|\n format.html { redirect_to spheres_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @microposst = Microposst.find(params[:id])\n @microposst.destroy\n\n respond_to do |format|\n format.html { redirect_to micropossts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def destroy\n @vet.destroy\n respond_to do |format|\n format.html { redirect_to vets_url, notice: 'Vet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ketamine.destroy\n respond_to do |format|\n format.html { redirect_to ketamines_url, notice: 'Ketamine was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @market = Market.find(params[:id])\n @market.destroy\n\n respond_to do |format|\n format.html { redirect_to(country_market_url(@market.country, @market)) }\n end\n end", "def destroy\n @dart = Dart.find(params[:id])\n @dart.destroy\n\n respond_to do |format|\n format.html { redirect_to darts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @slab = Slab.find(params[:id])\n @slab.destroy\n\n respond_to do |format|\n format.html { redirect_to slabs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pet_item.destroy\n respond_to do |format|\n format.html { redirect_to pet_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cloud.delete\n respond_to do |format|\n format.html { redirect_to clouds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stash = Stash.find(params[:id])\n @stash.destroy\n\n respond_to do |format|\n format.html { redirect_to stashes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @flat.destroy\n\n respond_to do |format|\n format.html { redirect_to flats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @settlement.destroy\n respond_to do |format|\n format.html { redirect_to settlements_url, notice: 'Settlement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seat = Seat.find(params[:id])\n @seat.destroy\n\n respond_to do |format|\n format.html { redirect_to seats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seat = Seat.find(params[:id])\n @seat.destroy\n\n respond_to do |format|\n format.html { redirect_to seats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @flat = Flat.find(params[:id])\n @flat.destroy\n\n respond_to do |format|\n format.html { redirect_to flats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @flat = Flat.find(params[:id])\n @flat.destroy\n\n respond_to do |format|\n format.html { redirect_to flats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @point_of_sale.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @tank.destroy\n respond_to do |format|\n format.html { redirect_to tanks_url, notice: 'Tank was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @treasure_treasure = Treasure::Treasure.find(params[:id])\n @treasure_treasure.destroy\n\n respond_to do |format|\n format.html { redirect_to treasure_treasures_url }\n format.json { head :ok }\n end\n end", "def delete\n sellID = params[:sell_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/delete/sell\")\n parameters = {\"ext\" => \"json\", \"id\" => sellID}\n response = Net::HTTP.post_form(uri, parameters)\n list = JSON.parse(response.body)\n\n @response = list[0][\"kind\"]\n end", "def destroy\n @park = Park.find(params[:id])\n @park.destroy\n\n respond_to do |format|\n format.html { redirect_to parks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stage_drymass = StageDrymass.find(params[:id])\n @stage_drymass.destroy\n\n respond_to do |format|\n format.html { redirect_to stage_drymasses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @flat = Flat.find(params[:id])\n @flat.destroy\n\n respond_to do |format|\n format.html { redirect_to flats_url }\n format.json { head :ok }\n end\n end", "def destroy\n id = params[:id]\n @datacenter = Datacenter.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @datacenter.destroy\n\n respond_to do |format|\n format.html { redirect_to datacenters_url }\n format.json { head :ok }\n end\n end", "def pet_delete(pet)\n @db.delete(\"pets\", pet[\"id\"])\n end", "def destroy\n @stag_price.destroy\n respond_to do |format|\n format.html { redirect_to stag_prices_url, notice: 'Stag price was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @baz3.destroy\n respond_to do |format|\n format.html { redirect_to baz3s_url, notice: \"Baz3 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @essay = Essay.find(params[:id])\n @essay.destroy\n\n respond_to do |format|\n format.html { redirect_to essays_url }\n format.json { head :ok }\n end\n end", "def destroy\n @kitten = Kitten.find(params[:id])\n @kitten.destroy\n\n respond_to do |format|\n format.html { redirect_to kittens_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @market_activity = MarketActivity.find(params[:id])\n @market_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to market_activities_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @microfinance_service_provider_typology.destroy\n respond_to do |format|\n format.html { redirect_to microfinance_service_provider_typologies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trumpet = Trumpet.find(params[:id])\n @trumpet.destroy\n\n respond_to do |format|\n format.html { redirect_to trumpets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @aws_datum.destroy\n respond_to do |format|\n format.html { redirect_to aws_data_url, notice: 'Aws datum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @baz35.destroy\n respond_to do |format|\n format.html { redirect_to baz35s_url, notice: \"Baz35 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def destroy\n @sphere = Sphere.find(params[:id])\n @sphere.destroy\n\n respond_to do |format|\n format.html { redirect_to(spheres_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @quartet = Quartet.find(params[:id])\n @quartet.destroy\n\n respond_to do |format|\n format.html { redirect_to quartets_url }\n format.json { head :ok }\n end\n end", "def destroy\n @metum = Metum.find(params[:id])\n @metum.destroy\n\n respond_to do |format|\n format.html { redirect_to meta_url }\n format.json { head :ok }\n end\n end", "def destroy\n @tangent.destroy\n respond_to do |format|\n format.html { redirect_to tangents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tema = Tema.find(params[:id])\n @tema.destroy\n\n respond_to do |format|\n format.html { redirect_to temas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tetramod = Tetramod.find(params[:id])\n @tetramod.destroy\n\n respond_to do |format|\n format.html { redirect_to tetramods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @belt.destroy\n respond_to do |format|\n format.html { redirect_to belts_url, notice: 'Belt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tottle.destroy\n respond_to do |format|\n format.html { redirect_to tottles_url, notice: 'Tottle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @metabolite = Metabolite.find(params[:id])\n @metabolite.destroy\n\n respond_to do |format|\n format.html { redirect_to(metabolites_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @pet = Pet.find(params[:id])\n @pet.destroy\n\n respond_to do |format|\n format.html { redirect_to(pets_url) }\n format.xml { head :ok }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @microspot.destroy\n respond_to do |format|\n format.html { redirect_to microspots_url, notice: 'Microspot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.71753776", "0.7122614", "0.6966567", "0.6872031", "0.6830154", "0.68011874", "0.6796561", "0.6779791", "0.67787063", "0.6742691", "0.6737567", "0.6702646", "0.6678278", "0.66740394", "0.66698384", "0.66698384", "0.66698384", "0.66572165", "0.66490245", "0.6637208", "0.6630803", "0.66259444", "0.660488", "0.66038847", "0.66001666", "0.6593846", "0.65629995", "0.65563864", "0.65563864", "0.6554934", "0.6542183", "0.65375614", "0.6525627", "0.6514156", "0.6513359", "0.6501869", "0.6501039", "0.649932", "0.6493922", "0.6484788", "0.64839303", "0.64796144", "0.64795244", "0.6477945", "0.6471441", "0.64707327", "0.64697057", "0.6469439", "0.64643604", "0.64592403", "0.6457693", "0.6457693", "0.64543825", "0.64527667", "0.64483243", "0.6438506", "0.643838", "0.64294004", "0.6428343", "0.6428316", "0.6427939", "0.64144796", "0.64132696", "0.64128673", "0.6410892", "0.6410892", "0.64089125", "0.64089125", "0.6407853", "0.6399735", "0.6398568", "0.6398336", "0.6397663", "0.63967115", "0.63967115", "0.6390636", "0.6390367", "0.6387771", "0.63872194", "0.638685", "0.6386319", "0.6384242", "0.6381933", "0.63755774", "0.63747996", "0.63743657", "0.6374269", "0.63733023", "0.6372218", "0.6365956", "0.6365541", "0.6365529", "0.6365228", "0.63649666", "0.6361642", "0.63577855", "0.6354166", "0.6353426", "0.6351624", "0.63512987" ]
0.7435892
0
Use callbacks to share common setup or constraints between actions.
def set_market @market = Market.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def market_params params.require(:market).permit(:name, :website, :street, :city, :state, :zip, :latitude, :longitude, :description, :image, :rating) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
finalResult = getHalfMinuteEpisodeInfo(' File.open("output.txt", "w") do |f| finalResult.each do |r| f.puts r.name.strip end end
def getHalfMinuteArticle(showURL,theYear,defaultDate) page = Nokogiri::HTML(open(showURL)) showTitle = page.css('td#contentTd table td h3 strong.title').text.strip showDescription = page.css('td#contentTd p').text.strip episodeTable = page.css('td#contentTd table td a.hmenu') episodeTitle = [] episodeURL = [] episodeDate = [] episodeMaster = [] episodeDesc = [] episodeTable.each do |t| episodeURL.push('http://www.moneyradio.org/'+t['href']) titleText = t.text.strip #episodeDate.push(titleText.index(theYear)) if(titleText.index(theYear).nil?) episodeDate.push(Date.strptime(defaultDate, '%m/%d/%Y')) episodeTitle.push(t.text.strip) #use this print out to debug #puts t.text.strip else if titleText.index('1011/2007') # this is special case in 2007 episodeDate.push(Date.strptime(defaultDate, '%m/%d/%Y')) episodeTitle.push(t.text.strip) else episodeDate.push(Date.strptime(titleText[0..(titleText.index(theYear)+theYear.length-1)], '%m/%d/%Y')) episodeTitle.push(titleText[(titleText.index(theYear)+theYear.length)..titleText.length].to_s.strip) end #use this print out to debug #puts t.text.strip end end f = 0 #episodeURL = episodeURL[0..4] episodeURL.each do |c| articlePage = Nokogiri::HTML(open(c)) content = articlePage.css('td#contentTd p').text.strip #puts content episodeDesc.push(content) puts f.to_s puts episodeDate[f] puts episodeTitle[f] sleep(3) f = f+1 end #puts "title: "+episodeTitle.length.to_s + "content: "+episodeDesc.length.to_s k = 0 episodeURL.each do |j| episode = EpisodePage.new episode.name = episodeTitle[k] episode.date = episodeDate[k] #episode.url = j episode.desc = episodeDesc[k] k = k + 1 episodeMaster.push(episode) end return episodeMaster end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeFile\n File.open(ARGV[1], \"w+\") do |f|\n $results.each{\n |result|\n f.puts(result)\n }\n end\nend", "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", "def print_to_file\n\tFile.open('1to100incl.txt', \"w\") do |file|\n\t\[email protected] {|element| file.puts element }\n\tend\nend", "def exportRunStream(stream,filepath)\n savestring = \"\";\n stream.each do |currentRun|\n savestring = savestring + \"#{currentRun[:weekday]} #{currentRun[:duration]} #{currentRun[:distance]} \\n\"\n end\nFile.open(filepath, 'w') {|f| f.write(savestring)}\nend", "def quickout results\r\n\tout = File.open('out.txt','w')\r\n\tout.sync=true\r\n\t\r\n\tresults.each_pair do |k,v|\r\n\t\tname, images, interwikimap = k, *v\r\n\t\t\r\n\t\tout.puts \"* [[#{name}]]\"\r\n\t\tout.puts images.to_a.map{|img, langs| \r\n\t\t\t\"** [[:commons:File:#{img}|]] na #{langs.uniq.map{|l| \"[[:#{l}:#{interwikimap[l.to_s]}|#{l}]]\"}.join ','}\"\r\n\t\t}\r\n\tend\r\n\t\r\n\tout.close\r\n\t\r\n\treturn ['out.txt']\r\nend", "def write_file\n\t\tlines = nil\n\t\tFile.open(\"songs.txt\", \"w+\") do |song|\n\t\t\[email protected] do |line|\n\t\t\t\tlines = song.write(\"#{line.title}\\t#{line.artist}\\t#{line.album}\\t#{line.year}\\t#{line.comments}\\t#{line.length}\\n\")\n\t\t\tend\n\t\tend\n\t\treturn lines\n\tend", "def exportfile arr\n begin\n file = File.open(\"result.txt\", \"w\")\n text = showResulf arr\n file.puts text\n file.close\n binding.pry\n rescue IOError => e\n puts \"Can not write file. Please try again after there.\"\n ensure\n file.close unless file.nil?\n end\nend", "def scrape_altgenres(starting_number)\n n = starting_number\n loop do\n begin \n netflix_page = agent.get(\"http://movies.netflix.com/WiAltGenre?agid=#{n}\")\n rescue \n retry\n end\n genre = netflix_page.at('#page-title a').content\n puts \"netflix genre #{n} is #{genre}\"\n File.open(\"netflix_genres.txt\", 'a+') {|f| f.write( n.to_s + \"\\t\" + genre + \"\\n\") } \n n += 1\n end \nend", "def print_songs\n songs.each do |song|\n print song.name + \"\\n\"\nend \nend", "def get_tourney_name(id)\n output = \"\"\n File.open(\"#{get_tourney_dir(id)}/tourneyinfo\", \"r\") do |f|\n output = f.read.split(\"\\n\")[0].split(\":\")[1].gsub(\" \", \"\").downcase\n end\n return output\nend", "def cleanupOutput()\n\tlines_array = IO.readlines(\"outputList.txt\")\n\n\toutputFile = File.open(\"outputListFinal.txt\", 'w')\n\tlines_array.each do |line|\n\t\tif line =~ /file '(.*)'/\n\t\t\tfilename = $1.to_s\n\t\t\tif(File.exist?(filename))\n\t\t\t\toutputFile.write(\"file '\"+filename+\"'\\n\")\n\t\t\tend\n\t\tend\n\tend\n\n\toutputFile.close\nend", "def parse_character_movies(films_array)\n output_array = []\n films_array.each do |film|\n #binding.pry\n title = film[\"title\"]\n director = film[\"director\"]\n episode_number = film[\"episode_id\"]\n year_released = film[\"release_date\"][0..3]\n\n #Put puts here'\n\n output_array << \"Episode #{episode_number}: #{title}, directed by #{director}, released in #{year_released}\"\n end\n #binding.pry\n output_array.sort_by! do |film|\n film[(film.length-4)..(film.length-1)]\n end\n puts output_array\n # some iteration magic and puts out the movies in a nice list\nend", "def saveDeviceCapabilitiesInfo (result)\n path = Pathname.new(File.dirname(__FILE__)).realpath\n time = Time.now.strftime(\"%F %H.%M\")\n name = \"#{time} Device_Info.txt\"\n file = File.new(\"#{path}/../../DataSave/DeviceInfo/#{name}\", \"a+\")\n\n file.puts \"===========================Device_Capabilitise_info=====================\"\n file.print \"Device GetCapabilities Support : \"\n result.each do |capName, capData|\n if capName.to_s != \"ipa\"\n file.print \"#{capName} \".capitalize\n end\n end\n file.puts\n file.puts \"=========================Device_Capabilitise_info_End===================\"\n\n file.close\nend", "def create_goal_file\n File.open(\"Goal/goal#{file_counter}.txt\", 'w') { |file| file.write(\"#{final_name_info}\") }\nend", "def saveDeviceMediaInfo (result)\n path = Pathname.new(File.dirname(__FILE__)).realpath\n time = Time.now.strftime(\"%F %H.%M\")\n name = \"#{time} Device_Info.txt\"\n file = File.new(\"#{path}/../../DataSave/DeviceInfo/#{name}\", \"a+\")\n\n\tfile.puts \"============================Device_Media_info===========================\"\n\tresult.each do |source|\n\t file.puts \"Stream Name : #{source[:name]}\"\n\t file.puts \"Profile Name : #{source[:token]}\"\n\n\t if source.has_key? :video_source_configuration\n\t\t file.puts \"Video Source Configuration \"\n\t\t file.puts \" Configuration Name : #{source[:video_source_configuration][:name]}\"\n\t\t file.puts \" Configuration Token : #{source[:video_source_configuration][:token]}\"\n\t\t file.puts \" Source Use Conut : #{source[:video_source_configuration][:use_count]}\"\n\t\t file.puts \" Source Token : #{source[:video_source_configuration][:source_token]}\"\n\t\t if source[:video_source_configuration].has_key? :bounds\n\t\t \tfile.puts \" Source Resolution Width : #{source[:video_source_configuration][:bounds][:width]}\"\n\t\t \tfile.puts \" Source Resolution Height : #{source[:video_source_configuration][:bounds][:height]}\"\n\t\t\tend\n\t\tend\n\n\t\tif source.has_key? :video_encoder_configuration\n\t\t file.puts \"Video Encoder Configuration \"\n\t\t file.puts \" Configuration Name : #{source[:video_encoder_configuration][:name]}\"\n\t\t file.puts \" Configuration Token : #{source[:video_encoder_configuration][:token]}\"\n\t\t file.puts \" Encoder Use Conut : #{source[:video_encoder_configuration][:use_count]}\"\n\t\t file.puts \" Encoding : #{source[:video_encoder_configuration][:encoding]}\"\n\t\t file.puts \" Video Quality : #{source[:video_encoder_configuration][:quality]}\"\n\t\t \tfile.puts \" Session Timeout : #{source[:video_encoder_configuration][:session_timeout]}\"\n\t\t if source[:video_encoder_configuration].has_key? :resolution\n\t\t\t file.puts \" Encoder Resolution Width : #{source[:video_encoder_configuration][:resolution][:width]}\"\n\t\t\t file.puts \" Encoder Resolution Height : #{source[:video_encoder_configuration][:resolution][:height]}\"\n\t\t\tend\n\t\t\tif source[:video_encoder_configuration].has_key? :rate_control\n\t\t\t file.puts \" Frame Rate limit : #{source[:video_encoder_configuration][:rate_control][:frame_rate_limit]}\"\n\t\t\t file.puts \" Encoding Interval : #{source[:video_encoder_configuration][:rate_control][:encoding_interval]}\"\n\t\t\t file.puts \" Bitrate Limit : #{source[:video_encoder_configuration][:rate_control][:bitrate_limit]}\"\n\t\t\tend\n\t\t\tif source[:video_encoder_configuration].has_key? :H264\n\t\t\t file.puts \" Gov Length : #{source[:video_encoder_configuration][:H264][:gov_length]}\"\n\t\t\t file.puts \" H264 Profile : #{source[:video_encoder_configuration][:H264][:h264_profile]}\"\n\t\t\tend\n\t\t\tif source[:video_encoder_configuration].has_key? :multicast\n\t\t\t\tif source[:video_encoder_configuration][:multicast].has_key? :address\n\t\t\t\t\tfile.puts \" Type : #{source[:video_encoder_configuration][:multicast][:address][:type]}\"\n\t\t\t\t\tfile.puts \" Multicast Address : #{source[:video_encoder_configuration][:multicast][:address][:ipv4_address]}\"\n\t\t\t\tend\n\t\t\t file.puts \" Pott : #{source[:video_encoder_configuration][:multicast][:port]}\"\n\t\t\t file.puts \" TTL : #{source[:video_encoder_configuration][:multicast][:ttl]}\"\n\t\t\t file.puts \" Auto Start Status : #{source[:video_encoder_configuration][:multicast][:auto_start]}\"\n\t\t\tend\n\t\tend\n\n\t\tif source.has_key? :video_analytics_configuration\n\t\t file.puts \"Video Analytics Configuration \"\n\t\t file.puts \" Configuration Name : #{source[:video_analytics_configuration][:name]}\"\n\t\t file.puts \" Configuration Token : #{source[:video_analytics_configuration][:token]}\"\n\t\t file.puts \" Analytice Use Count : #{source[:video_analytics_configuration][:use_count]}\"\n\t\t if source[:video_analytics_configuration][:analytics_engine_configuration].has_key? :analytics_module\n\t\t\t source[:video_analytics_configuration][:analytics_engine_configuration][:analytics_module].each do |mod|\n\t\t\t file.puts \" Analytics Module Name : #{mod[:name]}\"\n\t\t\t file.puts \" Analytics Module Type : #{mod[:type]}\"\n\t\t\t end\n\t\t\tend\n\t\tend\n\t file.puts \"========================================================================\" unless source == result[result.count - 1]\n\tend\n\tfile.puts \"============================Device_Media_info_End=======================\"\n\n\tfile.close\nend", "def write_data\n \n puts \"Writing out new HR data\"\n processed_record =\".\"\n output_file = File.open(OUTPUT_FILE, 'w')\n \n @completed_users.each do |user| \n output_file.puts user.to_s \n STDERR.print processed_record\n end #basic puts but driven to open file\n \n output_file.close #closes\n puts \"\\nCompleted writing out new HR data \\n#{@completed_users.length} records processed\"\n\nend", "def process_page_results(output_file_name, result_items)\n file = output_file(output_file_name)\n\n result_items.each do |result|\n file.write(\"#{result['id']},#{result['full_name']},#{result['language']}\\n\")\n end\nend", "def output_to_file\n File.open(\"mips_results.txt\", \"w\") do |f|\n in_file = \"\"\n disassemble.each { |instruction| in_file << instruction + \"\\n\" }\n f.write(in_file)\n end\n end", "def correct_name(file)\n request = File.basename file\n episode_status, episode_name, episode_season, episode_episode = tv_file(\"#{request} foo.avi\")\n if episode_status == true\n episode = Episode.new $opt[\"correct-name\"]\n if episode.is_ep?\n episode.season.gsub!(/^/,'0') if episode.season.to_i < 10 and episode.season.to_i != 0\n episode.number.gsub!(/^/,'0') if episode.number.to_i < 10 and episode.number.to_i != 0\n print \"#{episode.show} #{episode.season} #{episode.number}\"\n end\n end\nend", "def printRunStream(stream)\n stream.each do |currentRun|\n puts \"Weekday: #{currentRun[:weekday]} Duration: #{currentRun[:duration]}s Distance: #{currentRun[:distance]}m\"\n end\nend", "def write_info_file\n file_info = File.read(\"setup-info.txt\").split(\"\\n\")\n file_info.delete(\"\")\n\n number_of_people = file_info[0].to_i\n lines_to_keep = file_info.drop(number_of_people * 3 + 1)\n\n string_to_write = \"#{number_of_people}\"\n @residents.each { |resident| string_to_write += \"\\n#{resident.name}\\n#{resident.email}\\n#{resident.chore}\" }\n lines_to_keep.each { |line| string_to_write += \"\\n#{line}\"}\n\n File.write(\"setup-info.txt\", string_to_write)\nend", "def bannerOutPut(file)\n File.open(\"#{file}\").each do |line|\n puts line\n sleep (0.10)\n end\n sleep (2)\nend", "def print_songs \n songs.each {|song| puts song.name}\n end", "def list_songs_by_band(term)\n response = search_itunes(term)\n results = response[\"results\"]\n puts results.class\n\n\n #loop over results here and print out each song title\n results.each do |x|\n puts \" #{x[\"trackName\"]}\"\n end\nend", "def getLastfmArtistPopularity altnet_name\n url = getLastfmArtistPopularityUrl(altnet_name)\n puts url \n begin\n html = open(url, \"User-Agent\" => getUseragent(), :proxy=>getProxy()) \n document = Hpricot(html)\n #ar = document.search(\"//div[@id='catalogueHead']\");\n ar = document.search(\"//div[@id='catalogueHead']\").search(\"//p[@class='stats']\"); \n return ar\n rescue Exception => e\n puts \"html grab error\"\n return \"\"\n end \n end", "def after_resolution\n output.puts\n end", "def to_s\n string = \"\"\n current = @head\n while current\n\t\t string += current.value + \"\\n\"\n current = current.next\n\t\tend\n\t\tFile.open(\"mymovies.txt\", \"w+\") do |f| \n\t\t\tf.puts string\n\t\tend\n end", "def print_track track\n puts('Track title is: ' + track.name)\n puts('Track file location is: ' + track.location)\nend", "def write_file\n match_file = File.new(\"matches.txt\", \"w\")\n no_of_match = @matchesarr.length\n match_file.puts(no_of_match.to_s)\n for i in 0..no_of_match - 1\n match_file.puts(@matchesarr[i])\n end\n match_file.close\n end", "def grab_all_usernames\n puts \" \"\n puts \"Successfully unfollowed everyone.\"\n puts \"Currently jotting down all of the usernames unfollowed...\"\n puts \" \"\n new_document = File.open(\"List_Of_Usernames.txt\", \"w\")\n counter = 1\n @browser.divs(:class => \"_f5wpw\").each do |username|\n names = username.text.split(\"\\n\")\n account_name, actual_name = [names.first, names.last]\n new_document.puts \"#{counter} -- Account Name: @#{account_name} -- Actual Name: #{actual_name}\"\n counter += 1\n puts \"Wrote down #{counter} usernames, around #{(100) - ((counter.to_f/@total_following_count) * 100).round}% remaining\" if counter % (@total_following_count * 0.10).round == 0\n end\n puts \" \"\n puts \"Successfully wrote down all #{@total_following_count} of the usernames. Closing file now.\"\n new_document.close\nend", "def print_latest_song(tracks)\n\t\n\tputs tracks[0]['artist']['#text']\n\tputs tracks[0]['name'] + \" - \" + tracks[0]['album']['#text']\nend", "def print_tracks tracks\r\n\tindex = 0\r\n\ttimes = tracks.length\r\n\twhile (index < times)\r\n\t\tputs tracks[index].name\r\n\t\tputs tracks[index].location\r\n\t\tindex += 1\r\n\tend\r\nend", "def print_charmander\n puts \"\\nHere's your dragon! Meet #{@name}!\"\n File.open(\"charmander.txt\").each do |line|\n puts line\n end\n end", "def print_track track\r\n\tputs('Track title is: ' + track.name)\r\n \tputs('Track file location is: ' + track.location)\r\nend", "def print_title_track track\r\n\tputs('Track title is: ' + track.name)\r\n \tputs('Track file location is: ' + track.location)\r\nend", "def raw_output\n @raw_output ||= begin\n lines = path.read.split(\"\\n\")\n lines.shift\n [titre, lines.join(' ').strip_tags(' ')]\n end\n end", "def main\n music_file = File.new(\"album.txt\", \"r\")\n\talbum = read_album(music_file)\n music_file.close()\n\n\tprint_album(album)\nend", "def parse_character_movies(films_hash)\n films_hash.each do |film|\n puts # blank line\n puts \"Your character appears in:\"\n puts \"Star Wars Episode #{film[\"episode_id\"]}\"\n puts film[\"title\"]\n puts film[\"opening_crawl\"]\n end\nend", "def print_track track\n\t\tputs('Title: ' + track.name.to_s)\n \tputs('File location: ' + track.location.to_s)\nend", "def print_timeline(tweets)\n \ttweets.each do |tweet| File.open(\"tweet.txt\", 'w') {|f| f.write(tweet[\"text\"]) } end\nend", "def write_pearson_file(outputfile,forthwordhash)\n pearsonfile = File.open(\"./tmp/\"+outputfile,'w')\n forthwordhash.each do |wordname, stuff|\n pearsonfile.write \"#{stuff.name}\\n\" unless stuff.tags.index \"nosymbol\"\n end\n end", "def write_file( fname )\n File.open(fname, \"w\") do |f|\n f << TDP.application.result\n end\n TDP.application.result = String.new\n# puts \"...written to #{fname}\"\n end", "def write_to_file(filename) # Take name and status of file, output and save it to a new file\n completed = @all_tasks.map(&:to_machine).join(\"\\n\")\n IO.write(filename, completed)\n end", "def find_names_ages(filename)\n output_file = File.open('names-ages.txt' , 'w')\nFile.read(filename).each_line do |line|\n person = line.split(',')\n name = person [0].strip\n age = person [1]. strip\noutput_file.puts(\"#{name} #{age}\")\nend\n output_file.close\nend", "def print_songs\n songs.each do |song|\n puts song.name\n end\n end", "def print_songs\n songs.each do |song|\n puts song.name\n end\n end", "def print_track(track)\n puts('Track title is: ' + track.name)\n puts('Track file location is: ' + track.location)\n end", "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n puts \"---------- #{film[\"title\"]} ----------\\n\"\n #puts \"Title: #{film[\"title\"]}\"\n puts \"Episode: #{film[\"episode_id\"]}\"\n puts \"Director: #{film[\"director\"]}\"\n puts \"Producer(s): #{film[\"producer\"]}\"\n puts \"Release Date: #{film[\"release_date\"]}\"\n puts \"This move had: #{film[\"characters\"].length} character(s), #{film[\"species\"].length} specie(s) & #{film[\"planets\"].length} planet(s)!!\"\n\n # puts \"Opening Crawl: #{film[\"opening_crawl\"][0..100]}\" + \"...\"\n end\nend", "def print_songs\n self.songs.each.do |song|\n puts song.name\n end", "def print_songs\n @songs.each do |song|\n puts song.name\n end \n end", "def self_writing_programme\nFile.open(\"ex14.8.rb\", \"r\") do |file|\nfile.readlines.each do |line|\n puts line\nend\nfile.close\nend\nend", "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n puts response_hash[\"title\"]\n end\nend", "def store_results_file\r\n\taFile = File.new(\"./random_number_result.txt\", \"r+\")\r\n\taFile.truncate(0)\r\n\tnumber = generate_random_number\r\n\tputs aFile.syswrite(\"#{number}\")\r\nend", "def print_stat\n puts \"\\n\"\n puts \"********************\"\n puts \"Statistics:\"\n\n puts \"\\n\"\n puts \"Failed: #{$fail_uploaded_count}\"\n $not_uploaded_features_list.each do |feature|\n puts feature\n end\n\n puts \"\\n\"\n puts \"Success: #{$success_uploaded_count}\"\n $uploaded_features_list.each do |feature|\n puts feature\n end\n puts \"********************\"\n\n File.write('result.log', \"#{$updated_count},#{$created_count},#{$deleted_count}\")\nend", "def create_own_results_file(filename,output)\n # Create a blank file and put the output in\n self.create_file(\"#{filename}\", output)\n end", "def file_output output_lines, friend\n # using 'write_to' method with given parameters\n write_to \"#{friend}.txt\" do |file|\n file.write output_lines[0]\n file.write output_lines[1]\n end\nend", "def print_output(a)\n\t\t#output name of the connects\n\t\tFile.open('complex_output.txt', 'w') do |f1|\n\t\t\tall_speakers = a[0]\n\t\t\ta_length = a.length\n\t\t\tall_speakers.each_with_index do |speaker, index| \n\t\t\t\ta.each_with_index do |e,x|\n\t\t\t\t\tif e[index].class == Array\n\t\t\t\t\t\tif e[index].join(\", \").length != 0\n\t\t\t\t\t\t\tf1.puts e[index].join(\", \")\n\t\t\t\t\t\tend\n\t\t\t\t\telsif e[index].class == String\n\t\t\t\t\t\tif e[index].length != 0\n\t\t\t\t\t\t\tf1.puts e[index]\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tf1.puts \"\\n\"\n\t\t\tend\n\t\tend\n\tend", "def save_to_text(final_location)\n #open the pre-determined file to write on\n location_save = open('last_saved.txt','w')\n\n #Generate the lines for the file\n\t location_save.puts(\"Lunch Location:\"+final_location.name)\n\t location_save.puts(\"Lunch Address:\"+final_location.address)\n\t location_save.puts(\"Cuisine Type:\"+final_location.cuisine)\n\t location_save.puts(\"Healthy?:\"+final_location.healthy)\n\t location_save.puts(\"Halal or Non-halal:\"+final_location.halal)\n\t location_save.puts(\"Price range:\"+final_location.price)\n\n\n #close the file\n location_save.close\nend", "def print_songs\n @songs.each {|x| puts \"#{x.name}\\n\"}\n end", "def download_movie_info(title)\n # Fetch movie data from IMBD per the title entered.\n raw_movie_data = Imdb::Search.new(title).movies.first\n\n # Organize the fetched movie data into array\n array_movie_data = []\n array_movie_data << raw_movie_data.title << raw_movie_data.year << raw_movie_data.company << raw_movie_data.genres.join(\", \").to_s << raw_movie_data.length << raw_movie_data.director << raw_movie_data.mpaa_rating << raw_movie_data.tagline << raw_movie_data.poster << raw_movie_data.release_date\n\n # Save the array into 'movies.csv' file as pipe-separated data for later access\n f = File.new('movies.csv', 'a+')\n f.puts(array_movie_data.join(\"|\"))\n f.close\n return array_movie_data\nend", "def print_out_line\n\t\t\t#p ['id', id, 'ctd', ctd]\n\t\t\t#p rcp.results.zip(rcp.results.map{|r| send(r)})\n\t\t\tname = @run_name\n\t\t\tname += \" (res: #@restart_id)\" if @restart_id\n\t\t\tname += \" real_id: #@real_id\" if @real_id\n\t\t\tbeginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s)\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s)\n\t\t\tif @status == :Incomplete and @completed_timesteps\n\t\t\t\tbeginning += sprintf(\" %d steps \", @completed_timesteps)\n\t\t\telsif @percent_complete\n \t\t\t\tbeginning+=sprintf(\" %3s%1s \", percent_complete, \"%\")\n\t\t\tend\n\t\t\tif ctd\n\t\t\t\t#beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n\t\t\tend\n\t\t\tbeginning += \" ---#{@comment}\" if @comment\n\t\t\tbeginning\n\t\tend", "def create_finals_file\n file = File.open('final.csv', 'w')\n $students.each do |student|\n name = student[:name]\n avg = get_avggrades(student)\n file.puts \"#{name} #{avg}\"\n end\n file.close\nend", "def add_to_all_results_file(filename,output)\n self.add_to_file(filename,output)\n end", "def write_to_file(filename)\n IO.write(filename, @all_tasks.map(&:display).join(\"\\n\"))\n\tend", "def generate_output\n write_average_fitness('output/average.txt')\n write_best_fitness('output/best.txt')\n write_survivors('output/survivors.txt')\n write_traits('output/traits.txt')\n end", "def log(output)\n file = File.open(\"./output/#{Date.today.to_s}.txt\", \"a\")\n file.puts(\"#{output}\\n\")\n end", "def print_out_line\n #p ['id', id, 'ctd', ctd]\n #p rcp.results.zip(rcp.results.map{|r| send(r)})\n name = @run_name\n name += \" (res: #@restart_id)\" if @restart_id\n name += \" real_id: #@real_id\" if @real_id\n beginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s) %3s%1s\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s, percent_complete, \"%\")\n if ctd and fusionQ\n beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n end\n beginning += \" ---#{@comment}\" if @comment\n beginning\n end", "def save_and_exit(appointments)\n File.open('details.txt', 'w') do |f|\n appointments.each do |element|\n f.puts(\"#{element.doctor_name},#{element.date},#{element.time},#{element.full_name},#{element.dob},#{element.mobile_num}\")\n end\n end\nrescue StandardError => e\n puts \"failed to save #{e}\"\nend", "def print_songs\n songs.each {|song| puts song.name}\n end", "def write_file\n File.open(\"image_urls.txt\", \"a\") do |a|\n $urls.each do |f|\n a << \"#{f[1]}\\n\"\n end\n end\nend", "def create_text\n songs.inject(\"\") do |list, song|\n list << \"#{song.filename}, #{song.title}\\n\"\n end\n end", "def print_to_file\n #f = File.new(\"#{Dir.pwd}/tmp/geoname_tree.txt\", \"wb\")\n File.open(\"geoname_tree.txt\", 'w') do |f|\n nodes.keys.each do |id|\n ts = tree_numbers(id).join(\"|\")\n f.write(\"#{id}|#{ts}\")\n f.write(\"\\n\")\n puts \"#{id}|#{ts}\"\n end\n end\n end", "def print_track track\n puts('Track title is: ' + track.title)\n\tputs('Track file location is: ' + track.file_location)\nend", "def print_track track\n puts('Track title is: ' + track.title)\n\tputs('Track file location is: ' + track.file_location)\nend", "def produce_roster(day, hour)\n File.open(\"#{day.to_s}-roster.txt\", \"w\") do |file|\n file.puts \"#{hour}\\n\\n\"\n who_is_available_on(day, hour).collect {|student| student.name}.sort.collect {|name| file.puts name}\n end\n \n puts \"#{day.to_s.capitalize} roster saved as #{day.to_s}-roster.txt\"\n end", "def mysql_lines\n File.open(file_name, \"r\") do |line|\n #File.open('./lib/databasers/fibered_files_output.txt') do |line|\n line.each do |x|\n puts \"('\" + \"#{x.strip}\" + \"')\"\n end\n end\n end", "def output_to_file(dir,algorithm, path, cost,n, running_time)\n file_path = \"#{dir}/#{algorithm.to_s}_#{n}_output.txt\"\n FileUtils.rm file_path, :force => true\n file = File.new(file_path, \"w\")\n # write the path to file\n path.each do |vertex|\n file.puts \"#{vertex}\"\n end\n file.puts \"Total Cost: #{cost}\"\n file.puts \"Running Time: #{running_time}\"\n end", "def output(filename)\r\n outs = File.new(filename , \"w\")\r\n outs.puts self.to_s\r\n outs.close\r\n end", "def work_received(results)\n # write results to disk\n @@output_file.puts results\n end", "def metadata\n puts \"Adding Metadata...\"\n doc = Nokogiri::HTML(open(\"http://www.last.fm/search?q=#{query}&type=track\"))\n url = doc.css(\"span.chartlist-ellipsis-wrap\").first.css(\"a.link-block-target\").first.attr('href')\n ch = url.gsub('/music/', \"\")\n artist, title = ch.split(\"/_/\")\n artist = artist.gsub('+', \" \")\n title = title.gsub('+', \" \")\n doc = Nokogiri::HTML(open(\"http://www.last.fm#{url}\"))\n album = doc.css(\"h3 a\").first\n begin\n Mp3Info.open(\"#{query.gsub(\"+\",\"-\")}.mp3\") do |mp3|\n mp3.tag.title = \"#{URI.unescape(title)}\".strip\n mp3.tag.artist = \"#{URI.unescape(artist)}\".strip\n mp3.tag.album = \"#{URI.unescape(album.content)}\".strip\n end\n puts \"Done\"\n rescue\n puts \"Fail\"\n end\n end", "def artist_details(artist)\n Scraper.scrape_individual_artist(artist) \n\n puts \"\"\n puts \"Here are more details about #{artist.name.bold}.\".black.on_light_white\n puts \"\"\n puts \"Representing Gallery: #{artist.gallery.name} \"\n puts \"\"\n puts \"Artist Bio: #{artist.bio}\"\n puts \"\"\n puts \"About the Artist : #{artist.about_art}\"\n puts \"\"\n\n end", "def print_execute_titles(execute)\r\n execute.each do |line|\r\n titles = []\r\n line.each do |name, value|\r\n if name.is_a? String\r\n titles << name\r\n end\r\n end\r\n puts titles.join(\"|\")\r\n end\r\nend", "def get \n log_debug\n $plex.episodes.keys.each do |show|\n thetvdb_missing_last_process(show)\n end\nend", "def getMp4Info(file)\n def get_val(string)\n string.split(\":\")[1]\n end\n\n ret = {}\n tagstrings = `AtomicParsley #{file} -t | grep -Pi '(art|alb|nam)'`.split(\"\\n\")\n ret[:artist] = get_val(tagstrings.grep(/ART\" contains/i)[0])\n ret[:title] = get_val(tagstrings.grep(/nam\" contains/i)[0])\n\n tmp = tagstrings.grep(/alb\" contains/i)[0]\n ret[:album] = (tmp.nil?) ? $default_album : tmp.split(\":\")[1]\n if ret[:artist].nil? || ret[:album].nil? || ret[:title].nil?\n raise \"Error parsing m4a tags - is it possible that AtomicParsley output format has changed?\"\n end\n ret\nend", "def to_s\n fail \"No results for '#{self.class.name.split('::').last}'\" \\\n unless File.exist? results_path\n\n out = ''\n File.open(results_path, 'r') do |f|\n while (line = f.gets)\n out << line\n end\n end\n out\n end", "def get_player_hash(id)\n output = {}\n file_array = []\n File.open(\"#{get_tourney_dir(id)}/playerindex\", \"r\") do |f|\n file_array = f.read.split\n end\n file_array.each_with_index do |name, index|\n output[file_array[index]] = file_array[index+1] if index % 2 == 0\n end\n puts output\n return output\nend", "def print_songs\n @songs.each do |song|\n puts song.name\n end\n end", "def print_songs\n puts @songs.collect {|song| song.name}\n end", "def beetle_complete\n puts File.open(\"./pics/beetle_complete.txt\").read\n end", "def printall\n $page.css('.oneRes').each do |play|\n puts \"#{play.css('.eventTitle').text}---#{play.css('.detail li a')[0].text}\"\n end\nend", "def for_calc(files)\n files[0].each_index do |i|\n string = files[0][i].file_name + \"\\t\"\n for f in files\n string += f[i].percent_realtime.to_s + \"%\\t\"\n end\n puts string\n end\nend", "def display_and_save_description(label, description)\n puts \"Starting round: #{label}\"\n puts description\n\n output = File.open(\"challenges/#{label}.txt\", 'w')\n output << description\n output.close\n puts \"Challenge description saved to file: #{output.path}.\"\n\n 'OK'\nend", "def print_songs\n songs.each {|song| puts song.name}\n end", "def report_results( timings )\n t = timings.first\n output.puts \n output.puts \" Total files read : #{\"%12d\" % t.value_stats.count}\"\n output.puts \" Total bytes read : #{\"%12d\" % t.value_stats.sum}\"\n output.puts \" Minimum filesize : #{\"%12d\" % t.value_stats.min}\"\n output.puts \" Average filesize : #{\"%16.3f\" % t.value_stats.mean}\"\n output.puts \" Maximum filesize : #{\"%12d\" % t.value_stats.max}\"\n output.puts \" Stddev of sizes : #{\"%16.3f\" % t.value_stats.stddev}\"\n output.puts\n\n output.puts [\"%28s\" % \"read order\", \"%20s\" % \"Elapsed time (sec)\", \"%22s\" % \"Read rate (bytes/sec)\" ].join(\" \")\n output.puts \"-\" * 72\n timings.each do |timing|\n p = [ ]\n p << \"%28s\" % timing.name\n p << \"%20.3f\" % timing.timed_stats.sum\n p << \"%22.3f\" % timing.rate\n output.puts p.join(\" \")\n end\n output.puts\n end", "def writeOut(fname=\"out\")\n File.open(fname, \"w\").write(@mResult)\n end", "def voa_headline\n # url = 'http://www.voanews.com/api/zym_ocutrrrrponktqdktqfjti!ktqey$_rrrpo'\n url = 'http://www.voanews.com/api/zym_ocutrrrrponpuqdvkifjti!ktqejqyrrrpp'\n txt = open(url, :read_timeout => 20)\n @xml_doc = Nokogiri::XML(txt) { |x| x.noblanks }\n pub_date = @xml_doc.root.xpath(\"channel/lastBuildDate\").first.text\n pub_date = Time.zone.parse pub_date\n if File.exists? \"/tmp/pangea_date.txt\"\n tt = File.read \"/tmp/pangea_date.txt\"\n pre_date = Time.zone.parse tt\n else\n pre_date = 1.day.ago\n end\n # if pre_date < pub_date\n puts \"Akamai uploading NNOW_HEADLINES.mp3\"\n upload_voa_mp3\n File.write \"/tmp/pangea_date.txt\", pub_date.iso8601\n # end\n\n end", "def write_to_disk(output)\n path = \"./output.txt\"\n time = output[:time].strftime(\"%H:%M:%S:%N\")\n output_string = output[:value].to_s + \", \" + time + \"\\n\"\n File.open(path, 'a') { |file| file.write(output_string) }\n end", "def to_log(output, result)\n\tFile.open(\"./result.txt\", \"a\") do |f|\n\t\tf.puts \"Test case: Delete User - #{output}, #{result} \"\n\tend\nend", "def print_version()\n puts\n file_array = IO.readlines $0\n version = file_array.grep(/^# Version/)[0].split(\":\")[1].gsub(/^\\s+/,'').chomp\n packager = file_array.grep(/^# Packager/)[0].split(\":\")[1].gsub(/^\\s+/,'').chomp\n name = file_array.grep(/^# Name/)[0].split(\":\")[1].gsub(/^\\s+/,'').chomp\n puts name+\" v. \"+version+\" \"+packager\n puts\nend", "def print_movies(films_hash)\n#binding.pry\n films_hash.each do |film|\n\n # some iteration magic and puts out the movies in a nice list\n movie = RestClient.get(film)\n movie_hash = JSON.parse(movie)\n puts movie_hash[\"title\"]\n\n\n #movie_hash[\"results\"].each do |title|\n end\n\nend" ]
[ "0.64996266", "0.62931234", "0.6069133", "0.6062333", "0.6050378", "0.59020406", "0.58799666", "0.58142805", "0.5789743", "0.5752137", "0.57201827", "0.56929183", "0.5680116", "0.56533235", "0.56233144", "0.5618905", "0.56125146", "0.56022274", "0.5541119", "0.55317575", "0.5527605", "0.54920113", "0.54810154", "0.5458792", "0.5457532", "0.54376966", "0.54349685", "0.5433117", "0.5432328", "0.54316616", "0.5426357", "0.5416967", "0.5413456", "0.5388349", "0.53861415", "0.5385935", "0.5383848", "0.5381113", "0.5378122", "0.5359347", "0.53540635", "0.5352861", "0.534934", "0.53371644", "0.5301414", "0.5301414", "0.52986467", "0.5291362", "0.5290346", "0.52890956", "0.5281735", "0.5277318", "0.5274866", "0.5266533", "0.5264332", "0.52620345", "0.52590513", "0.52561617", "0.52525175", "0.524376", "0.5239931", "0.5236667", "0.52349645", "0.5234756", "0.5232409", "0.5230174", "0.5226499", "0.5224137", "0.5215862", "0.52100855", "0.5199081", "0.5196219", "0.5191871", "0.5191871", "0.51823074", "0.51802844", "0.51761794", "0.51690245", "0.5165213", "0.5161474", "0.51610994", "0.5160835", "0.51588094", "0.51534194", "0.5152537", "0.51491773", "0.51466966", "0.5145254", "0.5144128", "0.51414317", "0.5138475", "0.5134223", "0.5133903", "0.5130928", "0.51253295", "0.5124677", "0.51232255", "0.5122236", "0.5120305", "0.5119689" ]
0.51890177
74
finalResult = getHalfMinuteArticle(' puts "final: " + finalResult.length.to_s
def getArticleWithHTML(showURL) page = Nokogiri::HTML(open(showURL)) showTitle = page.css('td#contentTd table td h3 strong.title').text.strip showDescription = page.css('td#contentTd p').text.strip episodeTable = page.css('td#contentTd table td a.hmenu') episodeTitle = [] episodeURL = [] episodeDate = [] episodeMaster = [] episodeDesc = [] episodeTable.each do |t| episodeURL.push('http://www.moneyradio.org/'+t['href']) titleText = t.text.strip puts titleText end f = 0 #episodeURL = episodeURL[0..4] episodeURL.each do |c| articlePage = Nokogiri::HTML(open(c)) content = articlePage.css('td#contentTd p').text.strip puts content episodeDesc.push(content) #puts f.to_s #puts episodeTitle[f] sleep(3) f = f+1 end #puts "title: "+episodeTitle.length.to_s + "content: "+episodeDesc.length.to_s k = 0 episodeURL.each do |j| episode = EpisodePage.new episode.name = episodeTitle[k] episode.date = '' #episode.url = j episode.desc = episodeDesc[k] k = k + 1 episodeMaster.push(episode) end return episodeMaster end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combien_journaliste(journaliste)\n\tputs \"Reponse: \"\n\tputs \" Il y en a \"\n\tputs journaliste.length\n\tputs \" \"\n\nend", "def prindex(output_string)\n print output_string\n output_string.length #returns this\nend", "def get_length\n\t\tsynchronized do\n\t\t\[email protected] \"get_length\"\n\t\t\[email protected]_i\n\t\tend\n\tend", "def length() end", "def length() end", "def length() end", "def length() end", "def get_time_length \n send_cmd(\"get_time_length\")\n end", "def calculate_article_read_time\n time = description.split(' ').length\n self.read_time = (time.to_f / 250).ceil.to_s\n end", "def length\n document[\"runtime\"].to_i/60 rescue nil\n end", "def length\n `return self.length;`\n end", "def length\n `return self.length;`\n end", "def query_len; mrna.len; end", "def length; end", "def length; end", "def length; end", "def length; end", "def length; end", "def length; end", "def length; end", "def actual_length\n @transfer[:actual_length]\n end", "def length_of_string(the_string)\n puts 'your string is this many characters ' + the_string.length.to_s\nend", "def length\n @content.length\n end", "def length\n `self.length`\n end", "def length; return @results.length; end", "def message_length; complete_message.length; end", "def length()\n return to_s.size\n end", "def sum_power\n\tsum = 2**1000\n\tputs sum\n\n\tsum_s = sum.to_s\n puts sum_s.split(\"\").inject(0){|accum, value| accum += value.to_i}\n #some how sum_s.length doesn't work\n #puts (0...(sum_s.length)).inject(0){|accum, value| accum += (sum_s[value] - ?0)}\n\n #puts \"1230989\".length\nend", "def success\n calc_duration\n end", "def Longitud_Cadena\n print \"Ingrese su cadena: \"\n cadena = gets.chomp\n puts cadena.length\n end", "def length_calculator; end", "def query_len; @hit.mrna.len; end", "def length\n @length\n end", "def calculate_min_read \n self.min_read = (content.length / 1375.0).ceil\n end", "def phrase_length(user_phrase)\n puts \"Your phrase is \" + user_phrase.length.to_s + \" characters long\"\nend", "def length\n to_s.length\n end", "def length\n return 0.0/0.0 unless depart_time && return_time\n (return_time - depart_time)/60\n end", "def length\n end", "def query_len; @seq1.len; end", "def getcontentlength\n 0\n end", "def length\n length = 0; each {length += 1}; length\n end", "def length\n dump.length\n end", "def length\n @parts.length\n end", "def length\n count = 0\n each { count += 1 }\n count\n end", "def length\n @fulldeck.length # => 52\n end", "def calculate_length(minutes, seconds)\n (minutes * 60) + seconds\nend", "def length_out(obj)\n puts obj.length\nend", "def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end", "def length\n seconds.to_runtime\n end", "def long_read_len()\n #This is a stub, used for indexing\n end", "def length\n end", "def length\n end", "def length\n end", "def length\n end", "def length\n end", "def length; count end", "def inspect\n \"#{size} words\"\n end", "def length_of_string(input)\n test_string = input.length\n return test_string\nend", "def summarize(length = 100, elipsis = true)\n return truncate(length)\n end", "def length\n self.to_s.length\n end", "def content_length\n# stat.size\n @bson['length'] || 0\n end", "def length\n @count\n end", "def CountingMinutesI(str)\n\n # code goes here\n return str \n \nend", "def long_word_count(text)\n \nend", "def how_long thing\n $lengthCache[thing] ||= $things[thing] && (1 + $things[thing].map{|t|how_long(t)}.inject(&:+)) || 0\nend", "def length (string)\n string.length\nend", "def length\n\t\t@length\n\tend", "def total_time=(_arg0); end", "def length()\n return (@end_point.milliseconds - @start_point.milliseconds)\n end", "def length()\n return (@end_point.milliseconds - @start_point.milliseconds)\n end", "def m\n a.length\n end", "def length\n to_s.length\n end", "def length\n length = 0\n each{|s| length += s.bytesize}\n length\n end", "def length(*) end", "def length(*) end", "def print_statistics(bv)\n diff = bv.length- encode(bv).length\n percent_reduction = (1 - (bv.length - diff).to_f/bv.length) * 100\n puts \"Original Length: #{bv.length}\"\n puts \"Encoded Length: #{encode(bv).length}\"\n puts \"Characters saved: #{diff}\"\n puts \"Percent Reduction: #{percent_reduction}%\"\n diff\nend", "def digest_length()\n #This is a stub, used for indexing\n end", "def digest_length()\n #This is a stub, used for indexing\n end", "def length_calculator=(_arg0); end", "def length\n length = width\n end", "def word_length\n\t\t@ans_word.length\n\tend", "def chunk_length(param = 10)\n \"chunkLength=#{param}\"\n end", "def number_ingredients(perfect_10_recipe)\n puts perfect_10_recipe.length\nend", "def current_length; end", "def printResult(result)\r\n puts\r\n puts \" Least number of times you can copy paste a \"\r\n puts \" print statement: #{result}\"\r\n puts \"======================== END ========================\\n\\n\"\r\nend", "def read_time\n words = (self.content.split(\" \").count.to_f / 275).round\n image = self.has_image? ? 1 : 0\n \n return words + image\n end", "def display_card_total(player_hand, dealer_hand, dealer_turn)\n\tplayer_total = get_player_total(player_hand).to_s\n\tdealer_total = get_dealer_total(dealer_hand,dealer_turn).to_s\n\t\n\tputs\n\tputs \"Total\" + (\" \" * (8 - player_total.length)) + player_total + (\" \" * (17 - dealer_total.length)) + dealer_total\n\nend", "def length\n @length ||= (count.to_f / @per_chunk).ceil\n end", "def length=(_arg0); end", "def length()\n return to_s.gsub(\" \", \"\").gsub(\"-\", \"\").length\n end", "def take_a_number(katz_deli,y)\nkatz_deli.push(y)\nwelcome_message = \"Welcome, \" + y + \". You are number \" + katz_deli.length.to_s + \" in line.\"\nputs welcome_message\nreturn y, katz_deli.length\nend", "def length\n @duration.length\n end", "def length\n count\n end", "def find_total_rides(rides)\n length = rides.length\n return length\nend", "def length\n @length\n end", "def length\n @length\n end", "def length\n @length\n end", "def length\n text.length\n end", "def remaining\n 80 - current_line.size\n end", "def test_string(string_1)\n length_of_string = string_1.length\n return string_1 + length_of_string\nend", "def size\n @result.size\n end" ]
[ "0.6628418", "0.62732923", "0.60890436", "0.6028374", "0.6028374", "0.6028374", "0.6028374", "0.5999339", "0.59858006", "0.5938901", "0.59271765", "0.59271765", "0.5881196", "0.5837409", "0.5837409", "0.5837409", "0.5837409", "0.5837409", "0.5837409", "0.5837409", "0.58361465", "0.5827437", "0.5823489", "0.58214194", "0.5818934", "0.5805508", "0.5805118", "0.5795683", "0.5793033", "0.5774634", "0.5772174", "0.5754085", "0.57368845", "0.5725483", "0.5722346", "0.5703971", "0.56955665", "0.56918967", "0.56891835", "0.56740355", "0.566901", "0.56634057", "0.56582", "0.5653194", "0.56505555", "0.5649051", "0.5648846", "0.564852", "0.56445324", "0.5634482", "0.5632753", "0.5632753", "0.5632753", "0.5632753", "0.5632753", "0.56021136", "0.5600846", "0.55818087", "0.5574606", "0.55717665", "0.5571582", "0.5564795", "0.5562374", "0.5558952", "0.55543345", "0.5536352", "0.55313414", "0.5530665", "0.5529281", "0.5529281", "0.5521971", "0.55210316", "0.55193436", "0.55131614", "0.55131614", "0.55071336", "0.55069506", "0.55069506", "0.5504801", "0.54982483", "0.5484883", "0.548202", "0.54762435", "0.5470707", "0.5470314", "0.5467256", "0.5465556", "0.5464689", "0.54606414", "0.54597527", "0.5453965", "0.54442763", "0.54399496", "0.5435142", "0.54345965", "0.54345965", "0.54345965", "0.54292166", "0.5427915", "0.54054856", "0.54042685" ]
0.0
-1
GET /movies GET /movies.json
def index respond_with Movie.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def movies\n get('Movies')\n end", "def pull_movies(options = {})\n response = HTTParty.get(build_url('movie', options), headers: HEADERS, debug_output: $stdout)\n JSON.parse(response.body)\n end", "def index\n @movies = @category.movies.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def get_all_actors_for_movie(movie)\n url = \"http://movies.api.mks.io/actors\"\n response = RestClient.get(url, accept: 'application/json')\n\nend", "def get_all_movies_for_actor(actor)\n url = \"http://movies.api.mks.io/movies\"\n response = RestClient.get(url, accept: 'application/json')\n\nend", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def index\n\t\t@movies = Movie.all\n\t\trespond_with @movies\n\tend", "def movie_data\n response = RestClient.get(\"critics.api.mks.io/movie-genres\")\n JSON.parse(response)\nend", "def show\n if @movie\n render json: { data: @movie }, status: 200\n end\n end", "def search_movie(title)\n headers = {\n accept: 'application/json',\n api_key: ENV['TMDB_API_KEY'],\n content_type: 'json',\n query: title,\n }\n\n response = RestClient.get \"https://api.themoviedb.org/3/search/movie/\", { params: headers }\n json_response = JSON.parse(response)\n\n return json_response\n end", "def show\n @movie = @category.movies.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def index\n page = 1\n request_url = MOVIE_DB_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n request_url += \"&page=#{page}\"\n # if sort by release date\n # request_url += RELEASE_DATE_DESC_URL\n # if sort by title\n # request_url += RELEASE_DATE_DESC_URL;\n @movies = Unirest.get(request_url).body[\"results\"]\n end", "def get_movies_from_api\n all_films = RestClient.get('http://www.swapi.co/api/films/')\n film_hash = JSON.parse(all_films) \nend", "def show\n movie = Movie.find(params[:id])\n if movie.nil?\n render json: {message: \"movie not found\"}, status: :ok\n else\n render json: movie, status: :ok, serializer: Movies::Show::MovieSerializer\n end\n end", "def control \n @movies = Movie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def list\n movies = Movie.order(release_date: :desc)\n render :json => movies.to_json\n\tend", "def index\n @title = 'Homepage'\n @all_movies = Movie.all.order(:title)\n # @movies = @all_movies.page(params[:page]).per(10)\n @movies = @all_movies\n\n respond_to do |format|\n format.html\n format.json do\n render json: @movies.as_json(methods: %i[genre num_ratings stars], include:\n { category: { only: %i[id name] },\n ratings: { only: %i[id user_id movie_id stars] } },\n except: :category_id)\n end\n end\n end", "def show\n @classication = Classication.find(params[:id])\n @movies = @classication.movies\n\n respond_to do |format|\n format.html\n format.json {render :json => @classication}\n end\n end", "def show\n @movie_info = MovieInfo.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie_info }\n end\n end", "def index\n @movies = Movie.all\n @search = Movie.search(params[:search]) \n @movies = @search.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def index\n @movies = Movie.all\n\t# @alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movielist?partner=YW5kcm9pZC12M3M&count=25&filter=nowshowing&order=toprank&format=json\").read)[\"feed\"]\n\t@alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movielist?partner=YW5kcm9pZC12M3M&count=40&filter=nowshowing&order=toprank&format=json&profile=small\").read)[\"feed\"]\n\tresponse = {}\n\tmovies = []\n\t@alloCineJson[\"movie\"].each{ |mv|\n\t\tmovie=Movie.where(:alloCineCode => mv[\"code\"]).first\n\t\tif !movie\n\t\t\tmovie = Movie.create(:alloCineCode => mv[\"code\"], :title=>mv[\"title\"])\n\t\tend\n\t\tmovieHash = {}\n\t\tmovieHash[\"id\"] = movie.id\n\t\tmovieHash[\"code\"] = movie[\"title\"]\n\t\tmovieHash[\"code\"] = mv[\"title\"]\n\t\tmovieHash[\"title\"] = mv[\"title\"]\n\t\tmovieHash[\"poster\"] = mv[\"poster\"][\"href\"]\n\t\tmovies << movieHash\n\t}\n\tresponse[\"movies\"] = movies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: response }\n end\n end", "def get_movies\n\t\t@movies = Movie.order(\"RANDOM()\").where(\"release_date > ?\", 3.years.ago).order('random()').joins(:critic_movies).group('movies.id').having(\"count(movie_id) >= #{CUTOFF}\")\n\t\t.limit(750).to_a\n\t\[email protected] do | movie | \n\t\t\tmovie.title = movie.title.split.map(&:capitalize).join(' ')\n\t\tend\n\t\t@movies = @movies.to_a.map(&:serializable_hash).to_json\n\t\trender :json => @movies\n\tend", "def movie(id, details = nil)\n get(\"/catalog/titles/movies/#{id.to_s}#{details.nil? ? \"\" : \"/#{details}\"}\")\n end", "def show\n @movie = @catalogue.movies.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @movie }\n format.json { render :json => @movie }\n end\n end", "def show\n render json: [movie: @movie, review: @movie.ratings, avg_rating: @movie.avg_rating ]\n # render json: { movie: { name: 'IronMan' },\n # review: [{ rating: 4 }, coment: 'superhero movie'] }\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def show\n\t\t@movie = Movie.find params[:id]\n\t\trespond_with @movie\n\tend", "def show\n @watched_movie = WatchedMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @watched_movie }\n end\n end", "def show\n @movies = Genre.find(params[:id]).movies\n p @movies\n end", "def show\n @unseen_movie = UnseenMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unseen_movie }\n end\n end", "def index\n @movies = Movie.all \n end", "def show\n respond_with Movie.search(params[:id])\n # respond_with movie: movie\n end", "def index\n @movie = Movie.find(params[:movie_id])\n end", "def get_popular_movies\n\t\t\tmovies = Array.new\n\t\t\tname = \"TmdbService#GetPopularMovies\"\n\t\t\tpath = \"/3/movie/popular\"\n\t\t\tparams = {\n api_key: @key\n\t\t\t}\n\t\t\[email protected]('X-Service-Name' => name)\n\t\t\tbegin\n \traw_response = @conn.get(path, params, @headers)\n\t\t\trescue\n\t\t\t\t#do something exceptional\n\t\t\tend\n\t\t\tmovies = @data_mapper.list_of_movies(raw_response)\n\t\tend", "def movie\n @movie ||= parse_json\n end", "def show\n @bollywood_movie = BollywoodMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bollywood_movie }\n end\n end", "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n puts response_hash[\"title\"]\n end\nend", "def show\n @cinemas_movie = CinemasMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cinemas_movie }\n end\n end", "def index\n @movies = current_user.movies.page(params[:page]).per(Movie::PER_PAGE)\n end", "def index\n movie_params = params[:movies] || {}\n if movie_params[:page].blank?\n movie_params[:page] = 0\n end\n\n @movies = Movie.search movie_params[:word], 0, EACH_LIMIT_WHEN_SEARCH do |response|\n @movies_count = response['numFound']\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def movies\n @movies ||= parse_movie_infos\n end", "def index\n page_number = params[:page] && params[:page][:number] ? params[:page][:number] : Rails.configuration.default_page\n page_size = params[:page] && params[:page][:size]? params[:page][:size] : Rails.configuration.default_per_page\n @movies = Movie.includes(:actors).all.page(page_number).per(page_size)\n end", "def get_movies_by_film(title)\n all_movies = RestClient.get('http://www.swapi.co/api/films/')\n movies_hash = JSON.parse(all_movies)\n\n results = movies_hash[\"results\"].select {|movie| movie[\"title\"].downcase == title}\n # results is an array containing a hash\n\n if results[0].length > 0\n puts \"Title: #{results[0][\"title\"]}\"\n puts \"Director: #{results[0][\"director\"]}\"\n puts \"Release Date: #{results[0][\"release_date\"]}\"\n else\n puts \"Movie not found\"\n end\nend", "def detail\n @movies = Movie.all\n render json: @movies , status: :ok, each_serializer: MovieDetailSerializer\n end", "def get_movie (id)\n\t\taction = \"movie/\" + id\n\t\targument = \"&language=en-US\"\n\t\tresponse = call_api(action, argument)\n\t\tmovie = process_result(response)\n\tend", "def all_movies\n # in case the file is empty or missing, return an empty collection\n JSON.parse(File.read('data.json')) rescue []\nend", "def show\n @movie_list = MovieList.find(params[:id])\n @movies = Movie.search(params, current_user, @movie_list.movies)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @movie_list }\n end\n end", "def get_all_single_critic_movies\n\t\treviews_array = []\n\t\tcritic_id = params[:id]\n\t\treviews = Critic.find(critic_id).critic_movies\n\t\treviews_array.push(reviews)\n\t\treviews = reviews_array.to_json\n\t\trender :json => reviews\n\tend", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @park = Park.find(params[:id])\n @movies = @park.movies\n @movie = Movie.find(params[:id])\n @movie_events = MovieEvent.where(park_id: params[:id], movie_id: params[:id])\n\n \n require 'uri'\n require 'net/http'\n\n url = URI(\"https://api.themoviedb.org/3/configuration?api_key=feb440596767b82e73112b66f54d1c4d\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(url)\n request.body = \"{}\"\n\n response = http.request(request)\n puts response.read_body\n end", "def show\n\t# require 'net/http'\n\trequire 'open-uri'\n\trequire 'json'\n\n @movie = Movie.find(params[:id])\n\tresponse = {}\n\t@alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movie?partner=YW5kcm9pZC12M3M&format=json&filter=movie&profile=small&mediafmt=mp4&code=\"+ @movie.alloCineCode.to_s, :proxy => @@proxyUTC).read)[\"movie\"]\n\tresponse[\"title\"]=@alloCineJson[\"title\"]\n\tresponse[\"directors\"]=@alloCineJson[\"castingShort\"][\"directors\"]\n\tresponse[\"actors\"]=@alloCineJson[\"castingShort\"][\"actors\"]\n\tresponse[\"synopsisShort\"]=@alloCineJson[\"synopsisShort\"]\n\tresponse[\"releaseDate\"]=@alloCineJson[\"release\"][\"releaseDate\"]\n\tresponse[\"poster\"]=@alloCineJson[\"poster\"][\"href\"]\n\tresponse[\"runtime\"]=@alloCineJson[\"runtime\"]\n\t@trailerInfoJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/media?format=json&partner=aXBhZC12MQ&profile=small&mediafmt=mp4&code=\"+ @alloCineJson[\"trailer\"][\"code\"].to_s).read)[\"media\"]\n\tresponse[\"trailer\"]=@trailerInfoJson[\"rendition\"][0][\"href\"]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: response }\n end\n end", "def show_character_movies(character)\n films = get_character_movies_from_api(character)\n #print_movies(films)\nend", "def index\n @movies = Movie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @movies }\n end\n end", "def index\n @videos = Video.all\n render json: @videos\n end", "def film_api(url)\n film_response = RestClient.get(url)\n film_hash = JSON.parse(film_response)\nend", "def index\n @movies = current_user.movies\n end", "def index\n @movies = Movie.all.order('avg_rating DESC')\n # @movies.each do |movie|\n # movie.as_json.merge!(rating: movie.avg_rating)\n # end\n render json: @movies\n # render json: { movies: [{ name: 'IronMan' },\n # { name: 'hulk' },\n # { name: 'ironman2' },\n # { name: 'thor' },\n # { name: 'captain america' },\n # { name: 'avengers' }] }\n end", "def index\n @movies = PlatformMovie.current.sort { |a, b| b.meta_score <=> a.meta_score }.collect do |movie|\n {\n image_url: movie.movie.image_url,\n platform_link: movie.platform_link,\n platform: (movie.type == 'HboMovie') ? 'hbo' : 'Showtime',\n meta_score: movie.meta_score,\n youtube: movie.movie.youtube,\n title: movie.movie.title,\n summary: movie.movie.summary,\n rating: movie.movie.rating,\n year: movie.movie.year,\n created_at: movie.started\n }\n end\n end", "def get_character_movies_from_api(character)\n #make the web request\n all_characters = RestClient.get('http://www.swapi.co/api/people/')\n character_hash = JSON.parse(all_characters)\n film_urls = get_film_urls(character_hash, character)\n\n parse_character_movies(parse_films(film_urls))\nend", "def show_character_movies(character)\n urls_of_films = get_character_movies_from_api(character)\n films_hash = add_film_urls(urls_of_films)\n parse_character_movies(films_hash)\nend", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def print_movies(films)\n list = films.map do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n response_hash[\"title\"]\n end\n puts list\n # some iteration magic and puts out the movies in a nice list\nend", "def show\n @movie = Movie.find(params[:id])\n @movie.set_kind_of_movie\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def index\n @reviews = Review.includes(:movie).order('created_at Desc').all\n render json: @reviews, include: [:movie]\n end", "def show\n @movie = Movie.find(params[:id])\n @vote = Vote.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def search\n @movies = Movie.includes(:reviews).where(\"title ILIKE ?\", \"%#{params[:title]}%\")\n @reviews = @movies.map do |movie|\n movie.reviews\n end\n @reviews.flatten!\n render json: { movies: @movies, reviews: @reviews }\n end", "def people\n Birdman::Requester.get(\"movies/#{id}/people\")\n end", "def show_character_movies(character)\n films_hash = get_character_movies_from_api(character)\n parse_character_movies(films_hash)\nend", "def show_character_movies(character)\n films_hash = get_character_movies_from_api(character) #returns films list/url\n parse_character_movies(films_hash)\nend", "def show\n @movie = Movie.find(params[:id])\n @serie = Serie.where(movie_id: @movie)\n end", "def index\n @actors_movies = ActorsMovie.all\n end", "def index\n @theatre_movies = TheatreMovie.all\n end", "def show_character_movies(character)\n films = get_character_movies_from_api(character)\n print_movies(films)\nend", "def show_character_movies(character)\n films = get_character_movies_from_api(character)\n print_movies(films)\n\n\n\nend", "def show\n id = params[:id]\n @movie = Movie.find(id)\n end", "def show\n id = params[:id]\n @movie = Movie.find(id)\n end", "def show\n @movie_item = MovieItem.find(params[:id])\n\t\tredirect_to root_path, :notice => \"You are not supposed to view this page.\"\n# respond_to do |format|\n# format.html # show.html.erb\n# format.json { render json: @movie_item }\n# end\n end" ]
[ "0.8227555", "0.7484902", "0.74789107", "0.74730414", "0.74474025", "0.7354044", "0.7354044", "0.7354044", "0.7354044", "0.7354044", "0.7354044", "0.73434794", "0.7283256", "0.7214987", "0.7197649", "0.7150194", "0.7128301", "0.703391", "0.70069593", "0.70027626", "0.6960787", "0.6959025", "0.6927098", "0.6880148", "0.6855929", "0.684521", "0.683455", "0.6804383", "0.6801787", "0.68000895", "0.67887545", "0.67887545", "0.67887545", "0.67887545", "0.67887545", "0.67887545", "0.67887545", "0.67887545", "0.67887545", "0.6779411", "0.67748207", "0.67539525", "0.67516565", "0.673808", "0.6710303", "0.6708301", "0.6684105", "0.66609436", "0.66594994", "0.664244", "0.66413397", "0.6592391", "0.65730995", "0.6561985", "0.6553322", "0.65512466", "0.65124756", "0.65110886", "0.6496289", "0.64804554", "0.6479911", "0.6458419", "0.6458419", "0.6458419", "0.6455564", "0.64531815", "0.6449013", "0.64459234", "0.644282", "0.6428165", "0.6421019", "0.64048433", "0.6401126", "0.6396336", "0.63954484", "0.6386667", "0.6386667", "0.6386667", "0.6386667", "0.6386667", "0.6386667", "0.6386667", "0.6386667", "0.6386667", "0.6365113", "0.63643354", "0.6362025", "0.63608855", "0.63486624", "0.63203275", "0.6303766", "0.63025224", "0.6295277", "0.62839264", "0.62834615", "0.62783414", "0.62720704", "0.62645376", "0.62645376", "0.6263246" ]
0.69713336
20
GET /movies/1 GET /movies/1.json
def show respond_with Movie.search(params[:id]) # respond_with movie: movie end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def movies\n get('Movies')\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def get_all_movies_for_actor(actor)\n url = \"http://movies.api.mks.io/movies\"\n response = RestClient.get(url, accept: 'application/json')\n\nend", "def index\n @movies = @category.movies.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def get_all_actors_for_movie(movie)\n url = \"http://movies.api.mks.io/actors\"\n response = RestClient.get(url, accept: 'application/json')\n\nend", "def show\n @movie = @category.movies.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def movie(id, details = nil)\n get(\"/catalog/titles/movies/#{id.to_s}#{details.nil? ? \"\" : \"/#{details}\"}\")\n end", "def index\n page = 1\n request_url = MOVIE_DB_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n request_url += \"&page=#{page}\"\n # if sort by release date\n # request_url += RELEASE_DATE_DESC_URL\n # if sort by title\n # request_url += RELEASE_DATE_DESC_URL;\n @movies = Unirest.get(request_url).body[\"results\"]\n end", "def index\n\t\t@movies = Movie.all\n\t\trespond_with @movies\n\tend", "def show\n if @movie\n render json: { data: @movie }, status: 200\n end\n end", "def movie_data\n response = RestClient.get(\"critics.api.mks.io/movie-genres\")\n JSON.parse(response)\nend", "def search_movie(title)\n headers = {\n accept: 'application/json',\n api_key: ENV['TMDB_API_KEY'],\n content_type: 'json',\n query: title,\n }\n\n response = RestClient.get \"https://api.themoviedb.org/3/search/movie/\", { params: headers }\n json_response = JSON.parse(response)\n\n return json_response\n end", "def show\n movie = Movie.find(params[:id])\n if movie.nil?\n render json: {message: \"movie not found\"}, status: :ok\n else\n render json: movie, status: :ok, serializer: Movies::Show::MovieSerializer\n end\n end", "def index\n @movie = Movie.find(params[:movie_id])\n end", "def pull_movies(options = {})\n response = HTTParty.get(build_url('movie', options), headers: HEADERS, debug_output: $stdout)\n JSON.parse(response.body)\n end", "def show\n @movie_info = MovieInfo.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie_info }\n end\n end", "def show\n\t\t@movie = Movie.find params[:id]\n\t\trespond_with @movie\n\tend", "def show\n @classication = Classication.find(params[:id])\n @movies = @classication.movies\n\n respond_to do |format|\n format.html\n format.json {render :json => @classication}\n end\n end", "def control \n @movies = Movie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def show\n @watched_movie = WatchedMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @watched_movie }\n end\n end", "def show\n @movie = @catalogue.movies.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @movie }\n format.json { render :json => @movie }\n end\n end", "def show\n @movies = Genre.find(params[:id]).movies\n p @movies\n end", "def show\n @unseen_movie = UnseenMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unseen_movie }\n end\n end", "def index\n @title = 'Homepage'\n @all_movies = Movie.all.order(:title)\n # @movies = @all_movies.page(params[:page]).per(10)\n @movies = @all_movies\n\n respond_to do |format|\n format.html\n format.json do\n render json: @movies.as_json(methods: %i[genre num_ratings stars], include:\n { category: { only: %i[id name] },\n ratings: { only: %i[id user_id movie_id stars] } },\n except: :category_id)\n end\n end\n end", "def get_movies_from_api\n all_films = RestClient.get('http://www.swapi.co/api/films/')\n film_hash = JSON.parse(all_films) \nend", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def index\n respond_with Movie.all\n end", "def show\n @bollywood_movie = BollywoodMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bollywood_movie }\n end\n end", "def list\n movies = Movie.order(release_date: :desc)\n render :json => movies.to_json\n\tend", "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n puts response_hash[\"title\"]\n end\nend", "def show\n id = params[:id]\n @movie = Movie.find(id)\n end", "def show\n id = params[:id]\n @movie = Movie.find(id)\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all\n end", "def index\n @movies = Movie.all \n end", "def index\n @movies = Movie.all\n @search = Movie.search(params[:search]) \n @movies = @search.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def get_movie (id)\n\t\taction = \"movie/\" + id\n\t\targument = \"&language=en-US\"\n\t\tresponse = call_api(action, argument)\n\t\tmovie = process_result(response)\n\tend", "def show\n @cinemas_movie = CinemasMovie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cinemas_movie }\n end\n end", "def index\n @movies = Movie.all\n\t# @alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movielist?partner=YW5kcm9pZC12M3M&count=25&filter=nowshowing&order=toprank&format=json\").read)[\"feed\"]\n\t@alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movielist?partner=YW5kcm9pZC12M3M&count=40&filter=nowshowing&order=toprank&format=json&profile=small\").read)[\"feed\"]\n\tresponse = {}\n\tmovies = []\n\t@alloCineJson[\"movie\"].each{ |mv|\n\t\tmovie=Movie.where(:alloCineCode => mv[\"code\"]).first\n\t\tif !movie\n\t\t\tmovie = Movie.create(:alloCineCode => mv[\"code\"], :title=>mv[\"title\"])\n\t\tend\n\t\tmovieHash = {}\n\t\tmovieHash[\"id\"] = movie.id\n\t\tmovieHash[\"code\"] = movie[\"title\"]\n\t\tmovieHash[\"code\"] = mv[\"title\"]\n\t\tmovieHash[\"title\"] = mv[\"title\"]\n\t\tmovieHash[\"poster\"] = mv[\"poster\"][\"href\"]\n\t\tmovies << movieHash\n\t}\n\tresponse[\"movies\"] = movies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: response }\n end\n end", "def movie\n Movie.find_by(:id => movie_id)\n end", "def show\n render json: [movie: @movie, review: @movie.ratings, avg_rating: @movie.avg_rating ]\n # render json: { movie: { name: 'IronMan' },\n # review: [{ rating: 4 }, coment: 'superhero movie'] }\n end", "def get_movies_by_film(title)\n all_movies = RestClient.get('http://www.swapi.co/api/films/')\n movies_hash = JSON.parse(all_movies)\n\n results = movies_hash[\"results\"].select {|movie| movie[\"title\"].downcase == title}\n # results is an array containing a hash\n\n if results[0].length > 0\n puts \"Title: #{results[0][\"title\"]}\"\n puts \"Director: #{results[0][\"director\"]}\"\n puts \"Release Date: #{results[0][\"release_date\"]}\"\n else\n puts \"Movie not found\"\n end\nend", "def get_all_single_critic_movies\n\t\treviews_array = []\n\t\tcritic_id = params[:id]\n\t\treviews = Critic.find(critic_id).critic_movies\n\t\treviews_array.push(reviews)\n\t\treviews = reviews_array.to_json\n\t\trender :json => reviews\n\tend", "def detail\n @movies = Movie.all\n render json: @movies , status: :ok, each_serializer: MovieDetailSerializer\n end", "def show\n #render json: params\n #@movie = Movie.find(params[:id])\n render html:'ciao io sono index'[email protected]_s\n #render json: @movie\n end", "def get_movies\n\t\t@movies = Movie.order(\"RANDOM()\").where(\"release_date > ?\", 3.years.ago).order('random()').joins(:critic_movies).group('movies.id').having(\"count(movie_id) >= #{CUTOFF}\")\n\t\t.limit(750).to_a\n\t\[email protected] do | movie | \n\t\t\tmovie.title = movie.title.split.map(&:capitalize).join(' ')\n\t\tend\n\t\t@movies = @movies.to_a.map(&:serializable_hash).to_json\n\t\trender :json => @movies\n\tend", "def callAPI(name)\n unless name.nil?\n # I chose to use the title_popular option over the title_exact option since\n # we don't know the full title and over the title_substring since it seemed\n # to return videos related to our search term instead of movies\n json = JSON.parse(open(\"http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q=#{name}\") { |x| x.read })\n # Should do more date validation but I will assume it's always the first 4 characters\n return \"Title: \" + json[\"title_popular\"][0][\"title\"] + \"\\nYear: \" + json[\"title_popular\"][0][\"title_description\"][0..3] unless json[\"title_popular\"].nil?\n \"No movie with the specified title\"\n else\n \"Please specify a movie title\"\n end\nend", "def movie\n @movie ||= parse_json\n end", "def show\n @movie = Movie.find(params[:id])\n @vote = Vote.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n @imdb_movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n @serie = Serie.where(movie_id: @movie)\n end", "def show\n @movie = Movie.find(params[:id])\n @movie.set_kind_of_movie\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n\t# require 'net/http'\n\trequire 'open-uri'\n\trequire 'json'\n\n @movie = Movie.find(params[:id])\n\tresponse = {}\n\t@alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movie?partner=YW5kcm9pZC12M3M&format=json&filter=movie&profile=small&mediafmt=mp4&code=\"+ @movie.alloCineCode.to_s, :proxy => @@proxyUTC).read)[\"movie\"]\n\tresponse[\"title\"]=@alloCineJson[\"title\"]\n\tresponse[\"directors\"]=@alloCineJson[\"castingShort\"][\"directors\"]\n\tresponse[\"actors\"]=@alloCineJson[\"castingShort\"][\"actors\"]\n\tresponse[\"synopsisShort\"]=@alloCineJson[\"synopsisShort\"]\n\tresponse[\"releaseDate\"]=@alloCineJson[\"release\"][\"releaseDate\"]\n\tresponse[\"poster\"]=@alloCineJson[\"poster\"][\"href\"]\n\tresponse[\"runtime\"]=@alloCineJson[\"runtime\"]\n\t@trailerInfoJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/media?format=json&partner=aXBhZC12MQ&profile=small&mediafmt=mp4&code=\"+ @alloCineJson[\"trailer\"][\"code\"].to_s).read)[\"media\"]\n\tresponse[\"trailer\"]=@trailerInfoJson[\"rendition\"][0][\"href\"]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: response }\n end\n end", "def get_first_movies\n\t\t@movies = Movie.where(\"release_date > ?\", 3.years.ago).order('random()').joins(:critic_movies).group('movies.id').having(\"count(movie_id) > #{CUTOFF}\")\n\t\t.limit(1).to_a\n\t\[email protected] do | movie | \n\t\t\tmovie.title = movie.title.split.map(&:capitalize).join(' ')\n\t\tend\n\t\t@movies = @movies.to_a.map(&:serializable_hash).to_json\n\t\trender :json => @movies\n\tend", "def index\n @movies = current_user.movies.page(params[:page]).per(Movie::PER_PAGE)\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n id = params[:id] # retrieve movie ID from URI route\n @movie = Movie.find(id) # look up movie by unique ID\n # will render app/views/movies/show.<extension> by default\n end", "def show\n id = params[:id] # retrieve movie ID from URI route\n @movie = Movie.find(id) # look up movie by unique ID\n # will render app/views/movies/show.<extension> by default\n end", "def show\n \t@movie = Tmdb::Movie.detail(params[:id])\n \t@images = Tmdb::Movie.images(params[:id])\n \t@cast = Tmdb::Movie.casts(params[:id])\n \t@trailers = Tmdb::Movie.trailers(params[:id])\n \t@similar_movies = Tmdb::Movie.similar_movies(params[:id])\n end", "def index\n @movies = Movie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @movies }\n end\n end", "def show\n @movie_item = MovieItem.find(params[:id])\n\t\tredirect_to root_path, :notice => \"You are not supposed to view this page.\"\n# respond_to do |format|\n# format.html # show.html.erb\n# format.json { render json: @movie_item }\n# end\n end", "def show\n @movie_list = MovieList.find(params[:id])\n @movies = Movie.search(params, current_user, @movie_list.movies)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @movie_list }\n end\n end", "def film_api(url)\n film_response = RestClient.get(url)\n film_hash = JSON.parse(film_response)\nend", "def show\r\n @movie = session[:movies][params[:id].to_i]\r\n end", "def index\n # # if page value a param, use that, else ...\n # page = 3\n # request_url = MOVIE_DB_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n genre_request_url = GENRE_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n # request_url += \"&page=#{page}\"\n # if sort by release date\n # request_url += RELEASE_DATE_DESC_URL\n # if sort by title\n # request_url += RELEASE_DATE_DESC_URL;\n # @movies = Unirest.get(request_url).body[\"results\"]\n @genres = Unirest.get(genre_request_url).body[\"genres\"]\n # puts @genres\n end", "def people\n Birdman::Requester.get(\"movies/#{id}/people\")\n end", "def index\n movie_params = params[:movies] || {}\n if movie_params[:page].blank?\n movie_params[:page] = 0\n end\n\n @movies = Movie.search movie_params[:word], 0, EACH_LIMIT_WHEN_SEARCH do |response|\n @movies_count = response['numFound']\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def find_movie_by_title(arg)\n query_response = RestClient.get(\"http://www.omdbapi.com/?t=#{arg}&apikey=a2d3299b\") #query the database\n parsed_response = JSON.parse(query_response) #parse the response into a useable hash\n movie_deets_hash = #extract relevant details from the hash\n {\"Title\" => parsed_response[\"Title\"],\n \"Released\" => parsed_response[\"Released\"].slice(-4..).to_i,\n \"Genre\" => parsed_response[\"Genre\"],\n \"Director\" => parsed_response[\"Director\"]}\n add_movie_to_database(movie_deets_hash) #create a movie_object for the selected movie, if it doesn't already exist\n end", "def fetchMovieRatingAndYear(movieID)\n #Construct the URL used to access the API\n url = \"http://api.themoviedb.org/3/movie/#{movieID}/releases?api_key=#{$apiKey}\"\n #RESTful request\n data = JSON.parse(RestClient.get(url))\n #Pull out the list of releases from the parsed request\n countries = data[\"countries\"]\n #Get just the US release (including date and rating info) and return it\n us = countries.select{ |country| country[\"iso_3166_1\"]==\"US\"}\n return us[0]\nend", "def show\n @park = Park.find(params[:id])\n @movies = @park.movies\n @movie = Movie.find(params[:id])\n @movie_events = MovieEvent.where(park_id: params[:id], movie_id: params[:id])\n\n \n require 'uri'\n require 'net/http'\n\n url = URI(\"https://api.themoviedb.org/3/configuration?api_key=feb440596767b82e73112b66f54d1c4d\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(url)\n request.body = \"{}\"\n\n response = http.request(request)\n puts response.read_body\n end", "def index\n @videos = Video.all\n render json: @videos\n end", "def show\n\t\tid = params[:id];\t\t\t\t#get the movie id\n\t\t@movie = Movie.find_by_id(id) \t#get the movie from the database\n\tend", "def show\n\n # default to type = 'movie'\n type = params[:type] ? params[:type] : 'movie'\n\n # find polymorphic by indexed tmdb info\n # since primary key is reindexed for pagination, this key does not change\n watch = Watchable.find_by(tmdb_id: params[:id], tmdb_type: type)\n \n # grab all details including guidebox info.\n # this will affect API limits\n watch.full_details\n render json: watch\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def ratings\n Birdman::Requester.get(\"movies/#{id}/ratings\")\n end", "def index\n page_number = params[:page] && params[:page][:number] ? params[:page][:number] : Rails.configuration.default_page\n page_size = params[:page] && params[:page][:size]? params[:page][:size] : Rails.configuration.default_per_page\n @movies = Movie.includes(:actors).all.page(page_number).per(page_size)\n end", "def detail\n mv = Tmdb::Movie.detail(params[:id].to_i).to_h\n mv = mv.delete_if { |key, value| %w[production_companies spoken_languages production_countries genres].include?(key.to_s) }\n @movie = Movie.new(mv.to_h)\n respond_to do |format|\n if @movie\n format.json { render :show, status: :created }\n else\n format.json do\n render json: @movie.errors, status: :unprocessable_entity\n end\n end\n end\n end" ]
[ "0.7840408", "0.7417043", "0.7417043", "0.7417043", "0.7417043", "0.7417043", "0.7417043", "0.7337925", "0.7307941", "0.7254705", "0.7145913", "0.712192", "0.7111538", "0.70936346", "0.7092198", "0.70896614", "0.70844346", "0.7034522", "0.6987229", "0.69613814", "0.6960965", "0.69298595", "0.692781", "0.69009906", "0.68844986", "0.6841898", "0.6836183", "0.683071", "0.68168235", "0.68109185", "0.6740375", "0.6740375", "0.6740375", "0.6727756", "0.6721874", "0.6711992", "0.6710538", "0.6678656", "0.6678656", "0.6678036", "0.6678036", "0.6678036", "0.6678036", "0.6678036", "0.6678036", "0.6678036", "0.6678036", "0.6678036", "0.6636007", "0.6631818", "0.66241246", "0.66222805", "0.66066796", "0.66000146", "0.6596443", "0.6569363", "0.65634555", "0.65068793", "0.6500321", "0.64989686", "0.6497009", "0.64884436", "0.64796686", "0.64726824", "0.6466775", "0.6457479", "0.64506394", "0.6447637", "0.64272225", "0.64230776", "0.64230776", "0.64230776", "0.64230776", "0.64230776", "0.64230776", "0.64230776", "0.64230776", "0.64230776", "0.6421797", "0.6421797", "0.6403751", "0.6394849", "0.63898855", "0.63863724", "0.6382406", "0.63805646", "0.6373471", "0.6370407", "0.63635206", "0.6363439", "0.6359366", "0.63492316", "0.6338382", "0.63354856", "0.63324153", "0.6290667", "0.6290667", "0.6288709", "0.6273506", "0.62709844" ]
0.67870307
30
DELETE /movies/1 DELETE /movies/1.json
def destroy @movie.destroy end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url}\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @omdb_movie.destroy\n respond_to do |format|\n format.html { redirect_to omdb_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # Find the movie in the movies table using the id\n # passed in via the path.\n # @movie = Movie.find(params[:id])\n\n # Delete the row from the movies table.\n # using ActiveRecord#destroy method\n @movie.destroy\n\n\n respond_to do |format|\n # Show all the movies, index action\n format.html { redirect_to movies_url, notice: \"You deleted a Movie\"}\n format.json { head :no_content} # do nothing as a response.\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to(movies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to(movies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to(movies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @watched_movie = WatchedMovie.find(params[:id])\n @watched_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to watched_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: '削除しました' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html {redirect_to movies_url, notice: 'Movie was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def destroy\n @theatre_movie.destroy\n respond_to do |format|\n format.html { redirect_to theatre_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unseen_movie = UnseenMovie.find(params[:id])\n @unseen_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to unseen_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = @category.movies.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to(category_movies_url(@category)) }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_movie = Movie.find(params[:id])\n @admin_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to user_list_movies_path, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie_model.destroy\n respond_to do |format|\n format.html { redirect_to movie_models_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movies.each do |movie|\n #@movie = Movie.find(params[:id])\n movie.destroy\n end\n\n # respond_to do |format|\n \n # format.xml { head :ok }\n # end\n end", "def destroy\n @movie_info = MovieInfo.find(params[:id])\n @movie_info.destroy\n \n respond_to do |format|\n format.html { redirect_to movie_infos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movies_ive_watched.destroy\n respond_to do |format|\n format.html { redirect_to movies_ive_watcheds_url, notice: 'Movies ive watched was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cinemas_movie = CinemasMovie.find(params[:id])\n @cinemas_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to cinemas_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bollywood_movie = BollywoodMovie.find(params[:id])\n @bollywood_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to bollywood_movies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tmdbmovie.destroy\n respond_to do |format|\n format.html { redirect_to tmdbmovies_url, notice: 'Tmdbmovie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @type_movie.destroy\n respond_to do |format|\n format.html { redirect_to type_movies_url, notice: 'Type movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n redirect_to root_path\n end", "def destroy\n authorize! :destroy, @movie\n\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: 'Movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete() #DELETE film1.delete (removes 1 film)\n sql = \"DELETE FROM films WHERE id = $1;\"\n values = [@id]\n SqlRunner.run(sql, values)\n end", "def destroy\n @users_movie = UsersMovie.find(params[:id])\n @users_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_movies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @film.destroy\n respond_to do |format|\n format.html { redirect_to films_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @film.destroy\n respond_to do |format|\n format.html { redirect_to films_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @role_in_a_movie = RoleInAMovie.find(params[:id])\n @role_in_a_movie.destroy\n\n respond_to do |format|\n format.html { redirect_to role_in_a_movies_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user = current_user\n @FavoriteMovie = FavoriteMovie.find(params[:id]).delete\n render json: { msg: \"Delete Successful\" }\n end", "def destroy\n @actors_movie.destroy\n respond_to do |format|\n format.html { redirect_to actors_movies_url, notice: 'Actors movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @theatre_movie.destroy\n respond_to do |format|\n format.html { redirect_to theatre_movies_url, notice: 'Theatre movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cinema_movie.destroy\n respond_to do |format|\n format.html { redirect_to cinema_movies_url, notice: 'Cinema movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def destroy\n @genres_movie.destroy\n respond_to do |format|\n format.html { redirect_to genres_movies_url, notice: 'Genres movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @moviie.destroy\n respond_to do |format|\n format.html { redirect_to moviies_url, notice: 'Moviie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie = Movie.find params[:id]\n @movie.destroy\n flash[:notice] = \"Deleted '#{@movie.title}'.\"\n redirect_to movies_path\n end", "def destroy\n @movie = Movie.find params[:id]\n @movie.destroy\n flash[:notice] = \"Deleted '#{@movie.title}'.\"\n redirect_to movies_path\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @movie_crew.destroy\n respond_to do |format|\n format.html { redirect_to movie_crews_url, notice: \"Movie crew was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @movie_type.destroy\n respond_to do |format|\n format.html { redirect_to movie_types_url, notice: 'Movie type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n Movie.find(params[:id]).destroy \n flash[:success] = \"Movie was successfully deleted.\"\n redirect_to index_url\n end", "def destroy\n @movie.destroy\n respond_to do |format|\n format.html { redirect_to movies_url, notice: \"Movie was successfully destroyed.\" }\n format.json { head :no_content }\n format.js\n end\n end", "def destroy\n @categories_movie.destroy\n respond_to do |format|\n format.html { redirect_to categories_movies_url, notice: 'Categories movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @users_movie = UsersMovie.find(params[:id])\n @users_movie.destroy\n end", "def destroy\n @movie = Movie.find(params[:id])\n @movie.destroy\n\n respond_to do |format|\n format.html { redirect_to movies_url }\n format.js\n end\n end", "def destroy\n @movieupload.destroy\n respond_to do |format|\n format.html { redirect_to movieuploads_url, notice: 'Movieupload was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie_participant.destroy\n respond_to do |format|\n format.html { redirect_to movie_participants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @video.destroy\n render json: @video, :status => :ok\n end", "def destroy\n @movie_show.destroy\n respond_to do |format|\n format.html { redirect_to movie_shows_url, notice: \"Movie show was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @moviepost.destroy\n respond_to do |format|\n format.html { redirect_to movieposts_url, notice: 'Moviepost was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @foo = Foo.find(params[:id])\n @foo.destroy\n\n respond_to do |format|\n format.html { redirect_to foos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @adocao_animal = AdocaoAnimal.find(params[:id])\n @adocao_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adocao_animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @film_genre.destroy\n respond_to do |format|\n format.html { redirect_to film_genres_url, notice: 'Film genre was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def delete\n request(:delete)\n end", "def destroy\n @microfilm_reel = MicrofilmReel.find(params[:id])\n @microfilm_reel.destroy\n\n respond_to do |format|\n format.html { redirect_to microfilm_reels_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @remito = Remito.find(params[:id])\n @remito.destroy\n\n respond_to do |format|\n format.html { redirect_to remitos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @omdb_genre.destroy\n respond_to do |format|\n format.html { redirect_to omdb_genres_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.75603294", "0.7552992", "0.7552992", "0.7552992", "0.7552992", "0.7552992", "0.7552992", "0.7552992", "0.7529331", "0.7491699", "0.7491699", "0.7491699", "0.7491699", "0.7437082", "0.731825", "0.72664374", "0.72664374", "0.72664374", "0.7200594", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.71991533", "0.7198995", "0.71660435", "0.7161143", "0.7152111", "0.71434003", "0.7139287", "0.7137765", "0.71156204", "0.71123064", "0.7086344", "0.7082721", "0.7071559", "0.70696735", "0.70407283", "0.7020957", "0.70199513", "0.69926775", "0.6979278", "0.6974824", "0.6940295", "0.6936606", "0.6899736", "0.6899736", "0.6892035", "0.689038", "0.6847417", "0.684044", "0.68397194", "0.68347436", "0.68342483", "0.6800403", "0.6791448", "0.6786484", "0.6786484", "0.67787796", "0.6772498", "0.67692155", "0.67420375", "0.6730987", "0.6730469", "0.67295104", "0.67288554", "0.67196333", "0.67140114", "0.6684656", "0.6681468", "0.6680324", "0.6651757", "0.6651619", "0.66442955", "0.6639962", "0.6623308", "0.6621468", "0.6618105", "0.6603679", "0.6602196", "0.6585941", "0.6584389", "0.6584133", "0.6583718", "0.65760076" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_movie @movie = Movie.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup_handler\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def before_dispatch(env); end", "def process_action(...)\n send_action(...)\n end", "def setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def action\n end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def config(action, *args); end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def before_action \n end", "def action\n end", "def setup\n # override this if needed\n end", "def matt_custom_action_begin(label); end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def setup_signals; end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def initialize(*args)\n super\n @action = :set\nend", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def lookup_action; end", "def around_hooks; end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def action_target()\n \n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def setup(&blk)\n @setup_block = blk\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def call\n setup_context\n super\n end", "def _handle_action_missing(*args); end", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.5328757", "0.5310255", "0.5300339", "0.5298796", "0.5295774", "0.5256034", "0.5243039", "0.5236007", "0.5235239", "0.5235239", "0.5235239", "0.5235239", "0.5235239", "0.52321917", "0.5227032", "0.52216744", "0.5216349", "0.52161187", "0.5210265", "0.5207244", "0.5177388", "0.5177142", "0.51747334", "0.516293", "0.51629275", "0.5155534", "0.51540613", "0.515197", "0.5151636", "0.5145279", "0.51380795", "0.5135777", "0.5117378", "0.5115066", "0.5115066", "0.5110235", "0.5106418", "0.50917816", "0.50909185", "0.50855017", "0.5082105", "0.506359", "0.5055345", "0.50546116", "0.50523037", "0.50523037", "0.50327307", "0.5024364", "0.5021113", "0.50174654", "0.50163317", "0.5000553", "0.50002855", "0.49991882", "0.49905527", "0.49905527", "0.49849054", "0.4982546", "0.4980941", "0.4979153", "0.49693102", "0.4967172", "0.49594432", "0.49564302", "0.49552485", "0.49533385", "0.49506924", "0.49452737", "0.49442786", "0.49347955", "0.49341312", "0.49295264", "0.49261844", "0.4925649", "0.49251428", "0.4920729", "0.49177617", "0.4916373", "0.49158472", "0.4915794", "0.49156648" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def movie_params params.require(:movie).permit(:title, :desc, :year) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Example: === class MyController < ApplicationController def index theme 'dark' end end ===
def theme(name) @current_theme = name path = ThemePark.resolve_views_path(name) prepend_view_path path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @themes = Theme.all\n end", "def index\n @user=User.find(session[:user_id])\n @app = @user.apps.find(params[:app_id])\n ThemeColorsHelper.updateTheme @app.id\n @theme_colors = ThemeColor.where(\"app_id = '#{@app.id}'\")\n end", "def set_theme\n # @theme = Theme.find(params[:id])\n @theme = Theme.current_theme\n end", "def theme\n @theme ||= Theme.unscoped.find(params[:id])\n halt 404 unless @theme\n @theme\n end", "def theme; end", "def theme; end", "def theme; end", "def theme\n @theme\n end", "def get_theme\n @theme = Theme.find(params[:theme_id])\n end", "def index\n @settings = self.current_user.setting\n @themes = Theme.by_weight\n rescue => ex\n handle_exception(ex)\n ensure\n end", "def theme(theme)\n case theme\n when :dark\n @methods[:theme] = MIDNIGHT\n when :deep\n @methods[:theme] = SUBMARINE\n when :light\n @methods[:theme] = BLUESCALE\n else\n throw ArgumentError.new('Not a valid theme')\n end\n end", "def set_theme\n @theme = Theme.find_by(name: params[:name])\n end", "def theme_name\n \n if params[:action] == \"home\"\n @theme_name = ThemeOption.where(user_id: current_user.id).first.template.downcase\n else\n \"application\"\n end\n end", "def index\n @themes = Theme.all\n json_response(@themes)\n end", "def set_theme\n @theme = params[:id].to_i.zero? ? Theme.new : Theme.find(params[:id])\n end", "def index\n @themes = Theme.where(site_id: @site.id).order('name asc')\n end", "def set_theme_color\n @theme_color = ThemeColor.find(params[:id])\n end", "def theme_name\n if params[:action] == \"home\"\n @theme_name = ThemeOption.where(user_id: current_user.id).first.template.downcase\n else\n \"application\"\n end\n end", "def dark; end", "def dark; end", "def index\n @cms_themes = current_portal.themes\n end", "def color_themes # :nologin:\n end", "def set_theme\n @theme = Theme.find(params[:id])\n end", "def set_theme\n @theme = Theme.find(params[:id])\n end", "def show\n @theme = Theme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @theme }\n end\n end", "def theme=(_arg0); end", "def index\n @theme1s = Theme1.all\n end", "def show\n @theme = Theme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @theme }\n end\n end", "def show\n @theme = Theme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @theme }\n end\n end", "def index\n @theme_names = ThemeName.all\n end", "def get_theme val\n case action_name\n when 'index'\n val == 1 ? 'b' : 'd'\n when 'sent'\n val == 2 ? 'b' : 'd'\n when 'seller'\n val == 1 ? 'b' : 'd'\n when 'unposted'\n val == 2 ? 'b' : 'd'\n when 'sold'\n val == 3 ? 'b' : 'd'\n when 'received'\n val == 2 ? 'b' : 'd'\n when 'new'\n val == 3 ? 'b' : 'd'\n when 'contact'\n val == 2 ? 'b' : 'd'\n when 'password'\n val == 3 ? 'b' : 'd'\n end\n end", "def index\n @themes = TemplateTheme.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @themes }\n end\n end", "def find_theme\n @theme = Theme.find(params[:theme_id])\n end", "def theme\n Design::Theme.array.find_by_name(self.theme_name) || site.theme\n end", "def theme\n @theme || 'plastik'\n end", "def theme_name\n if request.subdomain != \"www\" && request.subdomain.present?\n @subdomain = request.subdomain\n @site = Site.where(subdomain: request.subdomain).first\n @user = User.where(id: @site.user_id).first\n @theme_name = ThemeOption.where(site_id: @site.id).first.template\n @theme = ThemeName.where(id: @theme_name).first.name.downcase\n if params[:action] == \"home\"\n @theme\n elsif params[:action] == \"leasing\"\n @theme + \"leasing\"\n end\n else\n \"test\"\n end\n end", "def get_theme\n respond theme, 200, {'Content-Type' => 'text/plain'}\n end", "def change_theme\n cookies[:theme] = { value: params[:id].replace_non_alphanumeric, expires: Time.now + 1825.days }\n redirect_back(fallback_location: index)\n end", "def show\n @theme = Theme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render :json => @theme }\n end\n end", "def methodology\n disert_theme = DisertTheme.find(params[:id])\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @themes }\n end\n end", "def get_theme\n @theme = Broadcaster::Theme.find(params[:theme_id])\n end", "def get_theme\n @theme = Broadcaster::Theme.find(params[:theme_id])\n end", "def get_theme\n @theme = Broadcaster::Theme.find(params[:theme_id])\n end", "def set_theme\n @theme = Theme.find_by(id: params[:id],site_id: @site.id)\n redirect_to admin_errors_url(error_template: '403') unless @theme\n end", "def switch_theme(stylesheet)\n # TS_INFO: Manage themes not implemented\n end", "def theme\n {\n variant: {\n name: cookies[:themeVariantName],\n hue: cookies[:themeVariantHue]\n },\n mode: cookies[:themeMode] || \"light\"\n }\n end", "def index\n @user_themes = Theme.where(\"user_id = ?\", current_user.id).order(\"created_at\")\n \n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @user_themes }\n end\n end", "def theme=(value)\n @theme = value\n end", "def index\n @color_schemes = ColorScheme.all\n end", "def set_admintheme\n @admintheme = Theme.find(params[:id])\n end", "def theme\n return @theme\n end", "def show\n redirect_to themes_path(:id => @theme)\n end", "def current_theme(passed_theme=nil)\n theme = passed_theme || self.class.read_inheritable_attribute(\"theme\")\n \n @active_theme = case theme\n when Symbol then send(theme)\n when Proc then theme.call(self)\n when String then theme\n end\n end", "def theme_check\r\n @m=request.request_uri.split('/')\r\n @path=@m[2];\r\n if(@path.nil?)\r\n else\r\n @[email protected]('?')\r\n @path=@path[0]\r\n end\r\n #puts @path\r\n # if (@path!='momentdetails'&& @path !='videomoment_details' && @path !='moment_page' && @path !='gallery' && @path !='subchapters' && @path !='gallery_fisheye' && @path !='shoppingcart_payment' && @path !='chapter_next' && @path !='sub_chapter_gallery' && @path !='chapter_gallery' && @path !='add_sizes' && @path !='share_journal')\r\n if(params[:familyname])\r\n @family_name_tag = params[:familyname]\r\n else\r\n @family_name_tag = params[:id]\r\n end\r\n\r\n #generic theme for shopping cart\r\n if(@path=='selected_items' || @path=='add_sizes' || @path=='edit_sizes' || @path=='delete_msg' || @path =='shoppingcart_payment' || @path =='payment_complete' || @path =='chapter_gallery' || @path =='chapterindex' || @path =='chapter_next' || @path =='sub_chapter_gallery')\r\n @theme_check='myfamilywebsite'\r\n else\r\n @theme_check = HmmUser.find(:all, :conditions => \"family_name = '#{@family_name_tag}' || alt_family_name = '#{@family_name_tag}' \")\r\n @theme_check[0]['themes']\r\n end\r\n end", "def index\n\n conditions = {:_id => {:$ne => current_group.current_theme_id}}\n @themes = current_group.themes.where(conditions).page(params[\"page\"])\n\n if params[:tab] == \"all\"\n conditions[:$or] = [{:community => true}, {:group_id => current_group.id}]\n\n @themes = Theme.where(conditions).page(params[\"page\"])\n end\n\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render :json => @themes }\n end\n end", "def update_theme user\n user.theme = Theme.get(params[\"theme\"])\n end", "def set_theme_name\n @theme_name = ThemeName.find(params[:id])\n end", "def apply\n SpreeTheme.site_class.current.apply_theme @template_theme \n respond_with(@template_theme) \n end", "def index\n set_page_title_for 'home'\n @page = (request.params[:page] || 1).to_i\n\n offset = (@page - 1) * PAGE_SIZE\n\n @count = Theme.perfect.count\n\n @previous = if @page == 2\n themes_path\n else\n themes_path(page: @page - 1)\n end\n\n @next = if offset + PAGE_SIZE >= @count\n nil\n else\n themes_path(page: @page + 1)\n end\n\n @themes = Theme\n .perfect\n .offset(offset)\n .limit(PAGE_SIZE)\n .order(version: :desc)\n end", "def theme\n options.fetch(:theme, nil)\n end", "def get_theme\n\t\tif @current_user and @current_user.theme\n\t\t\t@current_theme = @current_user.theme.css_class\n\t\telse\n\t\t\t@current_theme = \"pond\"\n\t\tend\n\tend", "def theme\n @theme ||= resource.cache.theme(theme_id)\n end", "def show\n @wtheme = Wtheme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wtheme }\n end\n end", "def with_each_theme\n yield nil, ''\n Theme.find_all.each do |theme|\n theme_dir = theme.path\n view_path = \"#{theme_dir}/views\"\n require \"#{theme_dir}/helpers/theme_helper.rb\" if File.exist?(\"#{theme_dir}/helpers/theme_helper.rb\")\n yield theme.name, view_path\n end\nend", "def new\n @theme = Theme.new\n end", "def set_theme_intere\n @theme_intere = ThemeIntere.find(params[:id])\n end", "def select_theme\n theme = nil\n #response.headers['Cache-Control']='private'\n response.headers['Vary'] = 'User-Agent'\n ua = request.user_agent\n force_mobile_format if ua.blank?\n response.headers['Cache-Control'] = 'no-cache' if is_mobile_device?\n @group ||= Group.find(Setting.default_group) if Setting.default_group.present?\n theme = @group.options[:theme] if @group.present? and @group.options.present? and @group.options.include?(:theme)\n end", "def index\n @organization_themes = if current_manager\n current_manager.organization.organization_theme\n else\n OrganizationTheme.newest_first.per_page(params[:page])\n end\n end", "def create_theme_routes(map)\n map.theme_images \"/themes/:theme/images/*filename\", :controller=>'theme', :action=>'images'\n map.theme_stylesheets \"/themes/:theme/stylesheets/*filename\", :controller=>'theme', :action=>'stylesheets'\n map.theme_javascript \"/themes/:theme/javascripts/*filename\", :controller=>'theme', :action=>'javascript'\n map.connect \"/themes/*whatever\", :controller=>'theme', :action=>'error'\n end", "def index\n @concesionaria = Concesionarium.all\n @bg_gray = true;\n end", "def theme_path\n \"#{ThemesForRails.config.themes_path}/#{current_theme}\"\n end", "def show\n @jquery_theme = JqueryTheme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @jquery_theme }\n end\n end", "def show\n @theme = TemplateTheme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @theme }\n end\n end", "def index\n @node_has_themes = NodeHasTheme.all\n end", "def current_theme(passed_theme = nil)\n theme_name = unless passed_theme .blank?\n passed_theme\n else\n current_blog_user ? current_blog_user.blog_config.theme_name : ''\n end\n Theme.find(theme_name)\n end", "def color_method(method)\n case method\n when /delete/i then RED\n when /get|search|reload|find/i then BLUE\n when /post|create/i then GREEN\n when /put|patch|update/i then YELLOW\n when /login|logout|download|query/i then CYAN\n else MAGENTA\n end\n end", "def edit\n @theme = Theme.find(params[:id])\n end", "def themes(theme_list)\n @themes = theme_list\n end", "def new\n logger.debug(\"HIIIIIIIIII\")\n @theme = Theme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @theme }\n \n end\n end", "def theme_resolver\n theme(current_account.account_prefix) if DmCore.config.enable_themes\n end", "def set_cms_theme\n @cms_theme = current_portal.themes.friendly.find(params[:id])\n end", "def update\n respond_to do |format|\n if @theme.update(theme_params)\n format.html { redirect_to @theme, notice: 'Theme was successfully updated.' }\n format.json { render :show, status: :ok, location: @theme }\n else\n format.html { render :edit }\n format.json { render json: @theme.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @menu = \"admininfo\"\n @board = \"skins\"\n @section = \"index\"\n \n if Skin.all.count > 0 \n @skin = Skin.first()\n else\n @skin = Skin.new\n @skin.is_custom = false\n @skin.skin_name = \"cloud\"\n @skin.save\n end\n \n render 'skin' \n end", "def create\n @theme = Theme.new(params[:theme])\n\n respond_to do |format|\n if @theme.save\n format.html { redirect_to @theme, notice: 'Theme was successfully created.' }\n format.json { render json: @theme, status: :created, location: @theme }\n else\n format.html { render action: \"new\" }\n format.json { render json: @theme.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @theme = Theme.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render :json => @theme }\n end\n end", "def current_theme(passed_theme = nil)\n @current_theme ||= get_current_theme(passed_theme)\n end", "def new\n @theme = Theme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @theme }\n end\n end", "def set_theme1\n @theme1 = Theme1.find(params[:id])\n end", "def themes_path\n \"#{Rails.root}/app/themes\"\n end", "def create\n @theme = Theme.new(theme_params)\n respond_to do |format|\n if @theme.save\n flash[:success] = 'Theme was successfully created.'\n format.html { redirect_to admin_theme_url(@theme) }\n format.json { render :show, status: :created, location: @theme }\n else\n flash[:danger] = 'Theme was successfully created.'\n format.html { render :new }\n format.json { render json: @theme.errors, status: :unprocessable_entity }\n end\n end\n end", "def default_controller; end", "def new\n @theme = Theme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @theme }\n end\n end", "def new\n @theme = Theme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @theme }\n end\n end", "def new\n @theme = Theme.new\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @theme }\n end\n end", "def update\n if !current_group.shapado_version.has_custom_js?\n params[:theme].delete(:javascript)\n end\n if !current_group.shapado_version.has_custom_themes?\n params[:theme].delete(:javascript)\n params[:theme].delete(:layout_html)\n params[:theme].delete(:questions_index_html)\n params[:theme].delete(:questions_show_html)\n end\n @theme = Theme.find(params[:id])\n @theme.ready = false\n @theme.set_has_js(params[:theme][:javascript])\n\n respond_to do |format|\n if @theme.update_attributes(params[:theme])\n Jobs::Themes.async.generate_stylesheet(@theme.id).commit!(4)\n format.html { redirect_to(edit_theme_path(@theme), :notice => 'Theme was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @theme.errors, :status => :unprocessable_entity }\n end\n end\n end", "def default_theme\n nil\n end", "def controller_css_class\n controller_name\n end", "def update\n @theme = Theme.find(params[:id])\n\n respond_to do |format|\n if @theme.update_attributes(params[:theme])\n format.html { redirect_to @theme, notice: 'Theme was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @theme.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @theme = Theme.find(params[:id])\n\n respond_to do |format|\n if @theme.update_attributes(params[:theme])\n format.html { redirect_to @theme, notice: 'Theme was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @theme.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6704911", "0.64578456", "0.6457647", "0.6420494", "0.6404305", "0.6404305", "0.6404305", "0.6401397", "0.63236445", "0.62932104", "0.6274972", "0.62701505", "0.6233011", "0.61959016", "0.61286694", "0.6106358", "0.6090321", "0.60799366", "0.6056535", "0.6056535", "0.6045142", "0.60434943", "0.6009111", "0.6009111", "0.6007435", "0.5987177", "0.5986189", "0.59683037", "0.59683037", "0.59664476", "0.5948278", "0.5928397", "0.5916235", "0.590597", "0.5905617", "0.589979", "0.5892108", "0.5890423", "0.5887642", "0.58752656", "0.58500427", "0.58455557", "0.58455557", "0.58455557", "0.58232945", "0.5789821", "0.5771505", "0.5722989", "0.5706409", "0.5704133", "0.57005817", "0.5688923", "0.5657544", "0.5615195", "0.55788666", "0.5569665", "0.55650806", "0.5558098", "0.5544755", "0.55411506", "0.55317396", "0.54996836", "0.5493776", "0.5484838", "0.5478131", "0.54707295", "0.54579955", "0.5456617", "0.545367", "0.54399925", "0.5438906", "0.5419733", "0.54166186", "0.5416093", "0.54152614", "0.54033846", "0.5390064", "0.5386137", "0.537794", "0.5360872", "0.5346988", "0.534083", "0.53307974", "0.5306628", "0.5289625", "0.5284059", "0.52705985", "0.52692455", "0.52675265", "0.5258865", "0.52581185", "0.5255303", "0.52527434", "0.52527434", "0.52437675", "0.5240651", "0.5239233", "0.52367795", "0.52308184", "0.52308184" ]
0.5648856
53
Returns the base_path value.
def base_path instance.options[:base_path] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_path(val=nil)\n if val\n @base_path = val\n else\n @base_path || default_base_path_name\n end\n end", "def base_path\n @base_path || self.class.base_path\n end", "def base_path path=nil\n if path\n @base_path = path\n end\n @base_path || default_base_path\n end", "def path\n @base\n end", "def base_path\n @base_path ||= Dir.pwd\n end", "def base_path\n Dir.pwd + \"/\"\n end", "def base_path\n @base_path ||= server_path(File.expand_path(Dir.pwd))\n end", "def base_path\n self.class.base_path\n end", "def base_path\n @base_path ||= self.class.respond_to?(:base_path) ? self.class.base_path : Merb.dir_for(:public)\n end", "def base_path\n File.join(attachment_options[:path_prefix], attachment_path_id)\n end", "def base_path\n [attachment_options[:path_prefix], attachment_path_id].join(\"/\")\n end", "def basepath; end", "def base_path\n if debug\n \"/#{debug_prefix}/\"\n else\n \"/#{digest_prefix}/\"\n end\n end", "def base\n return @config[\"base\"]\n end", "def base_uri\n url = URI.parse( @config[\"portal_url\"] )\n if url.path === \"/\"\n return \"\"\n else\n return url.path\n end\n end", "def base_url_path; end", "def base_url\n current_base_href = base_href.to_s.strip.empty? ? nil : URL.absolutify(base_href, URL.new(url).root_url)\n current_base_href || url\n end", "def base_url\n @base_url||=@options['base_url']\n end", "def base()\n sub_ext('').basename.to_s\n end", "def base_path\n Settings.form526_backup.url\n end", "def base_directory\n @base_directory\n end", "def base_path(type = 'import')\n ENV['HYKU_MULTITENANT'] ? File.join(Bulkrax.send(\"#{type}_path\"), Site.instance.account.name) : Bulkrax.send(\"#{type}_path\")\n end", "def default_base_path_name\n self.name.split('::').last.downcase\n end", "def base_uri\n @base_uri ||= guess_base_uri\n end", "def base\n @info[:base]\n end", "def base_url\n File.join(host, path)\n end", "def path_root\n base_uri ? base_uri : path_to( '/' )\n end", "def get_base\n # See if we need to extend the base_dir\n if @config['base']\n extended_base = File.expand_path(File.join(@real_base, @config['base']))\n if File.directory? extended_base\n @base_dir = extended_base\n else\n puts \"Your base directory doesn't exist: #{extended_base}\"\n exit 1\n end\n end\n end", "def base_path=(base_path)\n @base_path = base_path\n end", "def base_url\n base_href || url\n end", "def base_dir_for_path_parameters; end", "def base_uri(in_or_out = :in)\n Rails.my_config(\"base_uri_#{in_or_out}\".to_sym)\n end", "def base_url\n @url.to_s.split('?').first\n end", "def base_url\n context[:base_url] || \"/\"\n end", "def base\n @base = if doc\n href = doc.search('//head/base/@href')\n URI(href.to_s) unless href.nil? rescue nil\n end unless @base\n\n return nil if @base && @base.to_s().empty?\n @base\n end", "def base_path\n raise NotImplementedError, \"Subclass #{self.class.name} of Configuration must implement base_path\"\n end", "def base_path\n # starts out like \"users/index\"\n @view.virtual_path.sub(%r{/[^/]*$}, '')\n end", "def path\n File.join(@base, @name)\n end", "def path()\n\t\t\t\t@basePath + \"/\" + hierarchy().join( \"/\" )\n\t\t\tend", "def build_path\n @path_values.inject(base_value){|uri,path| uri.merge URI::Generic.build(path: path) }.path\n end", "def base_dir\n options.fetch('base_dir', '')\n end", "def base_href\n parsed_search('base').first.attributes['href'].value rescue nil\n end", "def base_href\n parsed.search('base').first.attributes['href'].value rescue nil\n end", "def base_uri\n attributes.fetch(:baseUri)\n end", "def base?\n @base ||= path.compact.empty?\n end", "def absolute_path_base\n absolute_path.gsub File.extname( absolute_path ), ''\n end", "def base_path\n wiki.base_path\n end", "def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end", "def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end", "def path\n File.join(@base, @name)\n end", "def base_uri\n ary = contents_uri.to_s.split(\"/\")\n ary.pop if ary[-1].blank?\n ary.pop\n ary.join(\"/\") + \"/\"\n end", "def base_config_path\n BASE_CONFIG_PATH\n end", "def get_base_path()\n return TembooSession.get_base_path + \"/choreos\"\n end", "def base_url_path=(_arg0); end", "def basedir\n return nil if !file\n File.dirname File.absolute_path @file\n end", "def root\n settings[:basedir]\n end", "def file_path\n base_image ? base_image.base_filename : nil\n end", "def base_path # rubocop:disable Rails/Delegate\n chip_api.base_path\n end", "def get_corresponding_file_base_name\n return File.basename(@URL)\n end", "def base_uri(value)\n @config[:base_uri] = value\n end", "def base_name\n File.basename @absolute_name\n end", "def basedir\n self.class._basedir\n end", "def base\n _base = base_inheritable\n _base = configuration[:base] if _base.nil? and configuration\n _base ||= base_inheritable(true)\n [prefix, _base].find_all do |component|\n component and !component.empty?\n end.join(\",\")\n end", "def to_s\n return (@BasePath || \"\") + \"|\" + (@RelativePath || \"nil\")\n end", "def base_name\n File.basename @relative_name\n end", "def path(ident=:default)\n tail = identifying_path_part(ident)\n if tail.empty?\n base_path\n else\n File.join base_path, tail\n end\n end", "def path(value = nil)\n @path = value if value\n\n return @path if @path\n\n superclass.respond_to?(:path) ? superclass.path : nil\n end", "def base_uri\n uri = s9_document_builder.getBaseURI\n uri.nil? ? uri : URI(uri.to_s)\n end", "def api_path(path)\n \"#{options[:base_path]}/#{path}\" || \"/#{path}\"\n end", "def base_paths\n @base_paths ||= find_base_paths\n end", "def get_replica_path(replica_base_path)\n return File.join(replica_base_path, @loc_key)\n end", "def base_url\n self.class.base_url\n end", "def root_path\n attributes.fetch(:rootPath)\n end", "def base_dir; end", "def base_dir; end", "def base_dir; end", "def base_dir; end", "def base_dir; end", "def base_dir; end", "def base_dir; end", "def path\n real_path = Pathname.new(root).realpath.to_s\n full_path.sub(%r{^#{real_path}/}, '')\n end", "def base_uri\n @base_uri\n end", "def base\n if self.attributes['xml:base']\n return self.attributes['xml:base'].to_s\n elsif self.parent != nil\n return self.parent.base\n else\n return nil\n end\n end", "def default_path\n [ (std_path || key).to_s ]\n end", "def base_url(arg = nil)\n # TODO: Better URL validation\n set_or_return(:base_url, arg, kind_of: String, default: DEFAULT_BASE_URL)\n end", "def basedir\n File.dirname File.absolute_path options[:file]\n end", "def base_path\n Settings.forms_api_benefits_intake.url\n end", "def request_path\n [request.base_url, request.path].join\n end", "def base\n node.attributes['base'] ? node.attributes['base'].value : nil\n end", "def base_uri\n @options[:base_uri]\n end", "def base_uri\n @options[:base_uri]\n end", "def base_relative_dir\n \t\[email protected](/^\\//,\"\")\n \tend", "def value\n uniq_lastmost(abs_path).join(Cabar.path_sep)\n end", "def base_uri(value)\n @document_builder.base_uri = value\n end", "def path\n `window.location.pathname`\n end", "def account_site_assets_base_url\n Account.current.url_base + account_site_assets_base(true)\n end", "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end", "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end", "def base_uri\t\t\t\n\t\tURI.parse( \"http://\" + @factory.site_name + \".\" + @factory.api_host_base + @path )\n\tend", "def pathBaseSummary()\n return \"#{@resultBaseDir}/#{getConf(:basenameSummary)}\" ;\n end" ]
[ "0.8596282", "0.8317347", "0.8245711", "0.8209672", "0.82091814", "0.790009", "0.77242315", "0.7668497", "0.7497538", "0.74226797", "0.742109", "0.7391522", "0.73889166", "0.7380746", "0.73708135", "0.7271474", "0.7167864", "0.71206844", "0.7109751", "0.70852864", "0.70742846", "0.70613885", "0.7053908", "0.7025393", "0.70134866", "0.698857", "0.6986706", "0.6970881", "0.69648594", "0.69613385", "0.69520766", "0.69167435", "0.6898172", "0.68899876", "0.6882106", "0.68795514", "0.6873944", "0.68707025", "0.68622017", "0.68603075", "0.6843195", "0.6840242", "0.6827588", "0.68215764", "0.68153685", "0.6812858", "0.68025166", "0.6797029", "0.6797029", "0.67940027", "0.67853034", "0.6757037", "0.67480284", "0.67409086", "0.67246807", "0.6716901", "0.67115664", "0.6706592", "0.67020965", "0.66921514", "0.6686808", "0.6666686", "0.6655363", "0.665337", "0.66443837", "0.66346544", "0.662359", "0.66129035", "0.6607053", "0.6586388", "0.65727323", "0.6572336", "0.65608335", "0.6547783", "0.6547783", "0.6547783", "0.6547783", "0.6547783", "0.6547783", "0.6547783", "0.65464485", "0.65336984", "0.65335417", "0.6530655", "0.6526787", "0.65077835", "0.6506078", "0.650573", "0.6503861", "0.64971924", "0.64971924", "0.6489533", "0.64879334", "0.648455", "0.6464927", "0.6456689", "0.64481074", "0.64481074", "0.64430785", "0.64417857" ]
0.79422367
5
Returns the compression value.
def compression instance.options[:compression] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compression\n unless defined?(@compression)\n @compression = :bzip2\n reset_computed_values\n end\n @compression\n end", "def compression_codec\n cluster.config.compression_codec if compressed?\n end", "def compression_level; end", "def compress(value)\n Zlib::Deflate.deflate(value)\n end", "def compression_method; end", "def compression; @store.compression; end", "def compression\n @j_del.getTryUseCompression\n end", "def get_compression()\n return(get_cmd('CP;',0.1,0.5,3).gsub(/^CP/,'').gsub(/;$/,'').to_i)\nend", "def compression?; end", "def compression; end", "def compression\n configuration[:copy_compression] || :gzip\n end", "def compressed_size; end", "def compressed_size; end", "def compression\n @gapi.compression\n end", "def compressed_value?(v)\n v.to_s.start_with?(COMPRESSION_MARKER)\n end", "def compressed_file_size\n return @compressed_file_size\n end", "def compression_ratio\n return @compressed_file_size / @original_file_size\n end", "def default_compression; end", "def compressed(v); @options[:compressed] = v;end", "def default_compression=(_arg0); end", "def compressed_size=(_arg0); end", "def compression_method=(_arg0); end", "def compress_value?(value, req_options)\n return false unless value.bytesize >= compression_min_size\n return compress_by_default? unless req_options && !req_options[:compress].nil?\n\n req_options[:compress]\n end", "def compressed_size\n @deflater.closed? ? @compressed_size : @deflater.total_out\n end", "def compress\n compressed_data = @compressor.deflate @data\n JSON.dump({:version => Ripple::Compression::VERSION, :data => Base64.encode64(compressed_data)})\n end", "def compress\n Zlib::Deflate.deflate(marshal)\n end", "def value\n @bytes.pack('C*')\n end", "def tar_compression_flag\n case compression\n when :bzip2, \"bzip2\", nil\n \"j\"\n when :gzip, \"gzip\"\n \"z\"\n when :none, \"none\"\n \"\"\n end\n end", "def compressed_size\n @inflater.closed? ? @compressed_size : @inflater.total_in\n end", "def compression_mode\n mediainfo.audio.compression_mode\n end", "def compression_extension\n case compression\n when :gzip, :gz then \"tar.gz\"\n when :bzip2, :bz2 then \"tar.bz2\"\n when :zip then \"zip\"\n else raise ArgumentError, \"invalid compression type #{compression.inspect}\"\n end\n end", "def compress!; end", "def compress\n scheme + compressed_path\n end", "def set_compression(compression)\n puts \"Setting compression to #{compression}\" if $verbose\n c='CP'+(('000'+compression.to_s)[-3..-1])+';'\n puts c if $verbose\n ret=send_cmd(c,'CP;',c,0.5,1.5,3)\n if(ret)\n return(ret.gsub(/^CP/,'').gsub(/;$/,'').to_i)\n else\n return(nil)\n end\nend", "def compressed?\n @compressed == true\n end", "def compression\n @j_del.isCompressionSupported\n end", "def decompressed_size; end", "def compressor\n @compressor ||= Compressor.for_current_system(compressors.keys).new(self)\n end", "def compress\n input_len = @input.bytesize\n tmp = optipng(quantize(@input))\n\n # Check to see whether we've improved the situation\n output_len = tmp.bytesize\n if input_len > output_len\n $LOG.debug \" %d bytes -> %d bytes = %.1f%%\" % [ input_len, output_len, 100 * output_len/input_len ] if $LOG.debug?\n @output = tmp\n @modified = true\n else\n $LOG.debug \" no gain\" if $LOG.debug?\n @output = @input\n @modified = false\n end\n self\n end", "def encode\n return [Zlib::Deflate.deflate(Marshal.dump(self))].pack('m')\n end", "def compressor; end", "def content\n [keyword, ChunkyPNG::COMPRESSION_DEFAULT, Zlib::Deflate.deflate(value)].pack('Z*Ca*')\n end", "def tar_compression_extension\n case compression\n when :bzip2, \"bzip2\", nil\n \".bz2\"\n when :gzip, \"gzip\"\n \".gz\"\n when :none, \"none\"\n \"\"\n end\n end", "def content\n [\n keyword,\n ChunkyPNG::COMPRESSION_DEFAULT,\n Zlib::Deflate.deflate(value),\n ].pack(\"Z*Ca*\")\n end", "def compression= new_compression\n frozen_check!\n @gapi.compression = new_compression\n end", "def compression_schema\n value = self.values[:compression_schema]\n if value.nil?\n value = []\n else\n value = value.gsub(/\\[|\\]|\\(|\\)/,'').split(',').map(&:to_i) unless value.is_a?(Array)\n end\n value\n end", "def get_bytes()\n @value\n end", "def content_compression_resistance_priority(value, for_axis: orientation)\n content_compression_resistance_priority(value, for_orientation: orientation)\n end", "def compression_was_achieved\n return compression_ratio() < 1\n end", "def z_value\n @z_value ||= self.class.z_value\n end", "def compression\n type = configuration[:copy_compression] || :gzip\n case type\n when :gzip, :gz then Compression.new(\"tar.gz\", %w(tar czf), %w(tar xzf))\n when :bzip2, :bz2 then Compression.new(\"tar.bz2\", %w(tar cjf), %w(tar xjf))\n when :zip then Compression.new(\"zip\", %w(zip -qr), %w(unzip -q))\n else raise ArgumentError, \"invalid compression type #{type.inspect}\"\n end\n end", "def compressed\n require 'jsmin'\n @compressed ||= self.class.compress(combined)\n end", "def compression_server; end", "def deflate\n return Zlib::Deflate.deflate(self)\n end", "def compression_client; end", "def compressed?\n false\n end", "def payload_compressor\n @header.payload_compressor\n end", "def binary_value\n\t\treturn self.value.unpack( 'm' ).first\n\tend", "def compress_option_sql(attrs)\n\t case value=attrs[:compress]\n\t when Fixnum, Integer then \"COMPRESS(#{value})\"\n\t else flag_option_sql attrs, :compress\n\t end\n end", "def is_compressed?\n bit_set?(COMPRESSED_FLAG_BIT)\n end", "def compress(data); end", "def get_value\r\n @bitstring\r\n end", "def compressors\n uri_options[:compressors]\n end", "def maybe_compress(compressor, zlib_compression_level = nil)\n self\n end", "def string_compression(str)\n\nend", "def compression=(bool); @store.compression = bool; end", "def uncompressed_size\n @deflater.closed? ? @uncompressed_size : @deflater.total_in\n end", "def compressor_name\n self.class.to_s.sub(\"Backup::\", \"\")\n end", "def content\n [width, height, depth, color, compression, filtering, interlace].pack('NNC5')\n end", "def put_compressed ob\n data = Boss.dump(ob)\n whdr TYPE_EXTRA, TCOMPRESSED\n type = case data.length\n when 0..160\n 0\n when 161..8192\n data = Zlib::Deflate.new.deflate(data, Zlib::FINISH)\n 1\n else\n data = Zlib::Deflate.new.deflate(data, Zlib::FINISH)\n 1\n #data = Bzip2.compress data\n #2\n end\n whdr type, data.length\n wbin data\n end", "def compute_pack_code(size: self.size, integer: self.integer?, unsigned: self.unsigned?)\n if integer\n INTEGER_PACK_CODES[[size, unsigned, ModelKit::Types.big_endian?]]\n else\n FLOAT_PACK_CODES[[size, ModelKit::Types.big_endian?]]\n end\n end", "def compress_output(codec, type)\n properties['mapred.output.compress'] = 'true'\n properties['mapred.output.compression.codec'] = case codec\n when :default then Java::OrgApacheHadoopIoCompress::DefaultCodec.java_class.name\n when :gzip then Java::OrgApacheHadoopIoCompress::GzipCodec.java_class.name\n else raise \"Codec #{codec} not yet supported by cascading.jruby\"\n end\n properties['mapred.output.compression.type'] = case type\n when :none then Java::OrgApacheHadoopIo::SequenceFile::CompressionType::NONE.to_s\n when :record then Java::OrgApacheHadoopIo::SequenceFile::CompressionType::RECORD.to_s\n when :block then Java::OrgApacheHadoopIo::SequenceFile::CompressionType::BLOCK.to_s\n else raise \"Compression type '#{type}' not supported\"\n end\n end", "def joker_value\n @joker_value ||= self.class.joker_value\n end", "def uncompressed_size\n @inflater.closed? ? @uncompressed_size : @inflater.total_out\n end", "def z\n return @z\n end", "def compressed_size\n # A number of these are commented out because we just don't care enough to read\n # that section of the header. If we do care, uncomment and check!\n proto = @data_buffer.read_int64(0)\n size = proto & 0xFFFFFFFFFFFF\n msg_type = (proto >> 48) & 0xFF\n\n return nil if msg_type != AS_MSG_TYPE_COMPRESSED\n\n size\n end", "def action_compress\n end", "def as_signed_byte(value)\n [ value ].pack(\"c\").unpack(\"c\").first\n end", "def string_compression(string)\n count_char_hash = count_char(string)\n\n result = ''\n count_char_hash.each do |key, value|\n result += \"#{key}#{value}\"\n end\n if result.length == string.length\n string\n else\n result\n end\nend", "def all_virtual_compression_statistics\n super\n end", "def to_s\n value.unpack('B*').first[0...size]\n end", "def bytesize\n case value\n when NilClass\n 0\n when String\n @value.bytesize\n else\n @s ||= Marshal.dump(@value).bytesize\n end\n end", "def encode_content str\n str = ::Zlib.gzip str if @gzip\n str = ::Zlib.deflate str if @deflate\n str\n end", "def tar_compression_flag(path)\n case path\n when /\\.tar\\.bz2$/\n return \"-j\"\n when /\\.tar\\.gz$|\\.tgz$/\n return \"-z\"\n when /\\.tar\\.xz$/\n return \"-J\"\n else\n return nil\n end\n end", "def compress(file)\n if File.file?(file) # file file file file\n content = File.read(file)\n zipped = Zlib::Deflate.deflate(content)\n puts \"Compressed '#{File.basename(file)}' : #{content.size - zipped.size} bytes smaller than original\"\n return zipped\n else\n return false\n end\n end", "def compress!\n self.compressed = compressed? || !!compress_tree!\n self\n end", "def encode_compressed(string)\n self.encode(Zlib::Deflate.deflate(string))\n end", "def bytes\n @number\n end", "def getbyte()\n #This is a stub, used for indexing\n end", "def uncompressed_size\n @header.size\n end", "def signed_byte(ret_val)\n ret_val = [ret_val].pack(\"c\").unpack(\"c\")[0]\n return ret_val\n end", "def byte_size()\n @value.length * 4\n end", "def byte_size()\n @value.length * 4\n end", "def full_decompressed_length(compressed)\n total_length = 0\n min_length = compressed.length\n weights = [1] * min_length\n i = 0\n\n while i < min_length\n # noinspection RubyResolve\n if compressed[i].eql? '('\n length, times = compressed.slice(i .. -1).match(/\\((\\d+)x(\\d+)\\)/).captures\n marker_end = i + 3 + length.length + times.length\n length = length.to_i\n times = times.to_i\n\n (marker_end ... marker_end + length).each do |j|\n weights[j] *= times\n end\n\n i = marker_end\n else\n total_length += weights[i]\n i += 1\n end\n end\n\n total_length\n end", "def file_extension\n 'gz'\n end", "def normalize_compression_name(name); end", "def compressed_request\n Zlib::Deflate.deflate(MultiJson.dump(api_request), Zlib::BEST_SPEED)\n end", "def short\n quality + number.to_s \n end", "def content(compress = p?)\n compress ? cached : joined\n end" ]
[ "0.74775016", "0.7133638", "0.7039516", "0.6944209", "0.6895531", "0.6887365", "0.6846899", "0.67695725", "0.6640865", "0.66004616", "0.65864617", "0.6493128", "0.6493128", "0.6441703", "0.6433299", "0.6386159", "0.6340291", "0.6291131", "0.6234644", "0.6156641", "0.6134908", "0.6102183", "0.60861236", "0.60742813", "0.6073579", "0.60556674", "0.6038435", "0.6027319", "0.59657323", "0.59418166", "0.5891759", "0.5891406", "0.5886377", "0.5864518", "0.5843612", "0.5814965", "0.5810551", "0.57408434", "0.5731201", "0.5709708", "0.5707664", "0.5706602", "0.5689447", "0.56875366", "0.5675531", "0.56652963", "0.5661704", "0.5618185", "0.55803525", "0.5573605", "0.556617", "0.55565685", "0.55515206", "0.55332386", "0.5510227", "0.548593", "0.54788166", "0.5454363", "0.5439703", "0.54266024", "0.54067147", "0.5372959", "0.52866226", "0.5283942", "0.5276686", "0.52483696", "0.52224094", "0.51972187", "0.5186026", "0.5185182", "0.51774895", "0.516577", "0.5142855", "0.51285404", "0.5121519", "0.5098661", "0.50855184", "0.5072982", "0.50566196", "0.5049694", "0.5043337", "0.5037704", "0.50146586", "0.5012775", "0.500992", "0.49876782", "0.4983306", "0.4978716", "0.4972071", "0.49651712", "0.49517938", "0.49439836", "0.49439836", "0.49407727", "0.49401948", "0.49348179", "0.4933984", "0.49296063", "0.49185517" ]
0.7026591
4
Returns the configuration singleton. Append configuration methods to access the configuration variable.
def configuration instance end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration\n Configuration::get\n end", "def configuration\n Configuration::get\n end", "def config\n @configuration ||= Configuration.new\n end", "def config\n @configuration ||= Configuration.new\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\n @config ||= Configuration.new\n end", "def configuration\n return self\n end", "def config\n @config ||= Config.new\n end", "def config\n @config ||= Config.new\n end", "def configuration\n self\n end", "def config\n configuration\n end", "def config\n @config ||= load_config\n end", "def config\r\n @configuration\r\n end", "def configuration\n @configuration ||= Configuration.new()\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n self.class.configuration\n end", "def configuration\n self.class.configuration\n end", "def configuration\n @config ||= setup\n end", "def config\n @config ||= read_config\n end", "def config\n self\n end", "def configuration\n @_configuration ||= Configuration.new\n end", "def configuration\n @_configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new(self)\n end", "def config\n @config ||= nil\n return @config unless @config.nil?\n @config = app_config.find_config config_key\n @config.freeze\n @config\n end", "def configuration\n self[:configuration]\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def configuration\n @configuration ||= Clever::Configuration.new\n end", "def configuration\n @configuration ||= Configuration.new\n end", "def config\n @config ||= Config.create ConfigLoader.new(root, CONFIG_FILE).to_hash, options.merge_config\n end", "def configuration\n @configuration ||= configuration_type.new\n end", "def config\n self.class.configuration_builder.configuration\n end", "def config\n unless @config\n @config = Configuration.new\n @config.reset\n end\n @config\n end", "def config\n @config ||= {}\n end", "def config\n @config ||= {}\n end", "def configuration\n self.class.configuration\n end", "def configuration\n self.class.configuration\n end", "def configuration\n self[:configuration] || {}\n end", "def configuration\n application.config\n end", "def configuration\n @configuration\n end", "def config\n if Config.config.nil? or Config.config.empty?\n begin\n Config.config = Configuration.load_config(Config.config_file,\n Config.config_options)\n rescue Errno::ENOENT\n Config.config = {}\n end\n end\n\n return Config.config\n end", "def config\n @config\n end", "def config\n @config\n end", "def config\n @config\n end", "def config\n @_config ||= Config.new\n yield @_config if block_given?\n @_config\n end", "def c\n configuration\n end", "def c\n configuration\n end", "def get_config\n\t\tend", "def config\n @config\n end", "def config\n @config ||= multi_config || single_config\n end", "def configuration\n Ablerc::Configuration.instance\n end", "def config\n @_config ||= self.class.config.inheritable_copy\n end", "def config\n @config\n end", "def configuration\n application.configuration\n end", "def configuration\n @configuration\n end", "def config\n @config ||= @module_config || {}\n end", "def configuration\n provider.configuration\n end", "def config\n @config ||= @module_config || {}\n end", "def config\n @config ||= Smartgen::Configuration.new\n end", "def config\n XConfig::Core.fetch(self)\n end", "def config\n App.instance.load_project_config\n App.instance.config\n end", "def config(&block)\n @config ||= Configuration.new\n instance_exec(@config, &block) if block_given?\n @config\n end", "def config\n Troy.configuration\n end", "def config\n\t\t\t@app_class.config\n\t\tend", "def configuration\n\t\t\t\tconfiguration = Configuration.new\n\t\t\t\t\n\t\t\t\tself.resolved_paths.each do |path|\n\t\t\t\t\tpath = File.expand_path(path)\n\t\t\t\t\t\n\t\t\t\t\tconfiguration.load_file(path)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn configuration\n\t\t\tend", "def config\n Config.new(connection)\n end", "def config\n (null_config? ? NoConfig.instance : actual_config)\n end", "def config\n @config ||= Redlics::Config.new\n end", "def load_config\n # Nothing in base class. This should be used to load the configuration from\n # disk if saved to a file.\n configuration || {}\n end", "def config\n @options[:config]\n end", "def configuration\n notifier.configuration\n end", "def config\n @config ||= compile\n end", "def actual_config\n Config.instance\n end", "def config\n site.config\n end", "def config\n @config ||= PaperTrail::Config.instance\n yield @config if block_given?\n @config\n end", "def config\n machined.config\n end", "def config\n Pakyow::Config\n end", "def config_get(id)\n Configuration.get(id)\n end", "def configuration\n @configuration ||= Configuration.new\n if block_given?\n yield @configuration\n else\n @configuration\n end\n end", "def configuration\n @configuration = nil unless defined?(@configuration)\n @configuration || LOCK.synchronize { @configuration ||= Bugsnag::Configuration.new }\n end", "def config\n @config ||= OpenStruct.new(YAML.load_file(self.config_path))\n end", "def get_config()\n return @api.do_request(\"GET\", get_base_api_path() + \"/config\")\n end", "def config\n @config ||= begin\n conf = Bolt::Config.new(Bolt::Project.default_project, config_data)\n conf.modulepath = [modulepath].flatten\n conf\n end\n end" ]
[ "0.82394314", "0.82394314", "0.799018", "0.799018", "0.79115945", "0.79115945", "0.79115945", "0.79115945", "0.79115945", "0.79115945", "0.78919566", "0.78064716", "0.7733344", "0.7733344", "0.7728442", "0.7702278", "0.7687167", "0.7653952", "0.7633891", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7615704", "0.7606593", "0.7606593", "0.75996053", "0.7594772", "0.7590817", "0.7583804", "0.7583804", "0.758368", "0.7578381", "0.75746447", "0.75438035", "0.75438035", "0.75438035", "0.75438035", "0.7528144", "0.75167143", "0.7495988", "0.7470369", "0.7465927", "0.74483997", "0.7434624", "0.7434624", "0.74174744", "0.74174744", "0.7387356", "0.7362022", "0.734813", "0.7345452", "0.7341015", "0.7341015", "0.7341015", "0.73098606", "0.7295239", "0.72800916", "0.72677463", "0.7264448", "0.7257579", "0.725733", "0.7254311", "0.7253225", "0.7222483", "0.7198243", "0.7183247", "0.71829426", "0.7170988", "0.7130262", "0.7113426", "0.7097694", "0.70719385", "0.70618516", "0.7053421", "0.7052427", "0.7032379", "0.702785", "0.7005771", "0.7002243", "0.69776803", "0.6975142", "0.69613004", "0.69569904", "0.69522434", "0.6922639", "0.69181085", "0.6917487", "0.6875588", "0.6874954", "0.68681276", "0.68638897", "0.68508106", "0.68403524" ]
0.7520445
45
Returns the chosen colour mode.
def colour_mode instance.options[:colour_mode] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_modes\n return @color_modes\n end", "def colormode\n # TODO: Return a ColorMode object\n mode_value = @attributes.fetch('colormode', nil)\n ColorMode.new(mode_value)\n end", "def detect_colour_mode\n case ENV['TERM']\n when /-truecolor$/ then 16_777_216\n when /-256color$/, 'xterm' then 256\n when /-color$/, 'rxvt' then 16\n else 256\n end\n end", "def detect_colour_mode\n case ENV['TERM']\n when /-truecolor$/ then 16_777_216\n when /-256color$/, 'xterm' then 256\n when /-color$/, 'rxvt' then 16\n else 256\n end\n end", "def detect_mode\n if ENV['NO_COLOR'] # see https://no-color.org/\n 0\n elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # windows\n if ENV['ANSICON']\n 16\n elsif ENV['ConEmuANSI'] == 'ON'\n TRUE_COLOR\n else\n 0\n end\n elsif ENV['TERM_PROGRAM'] == 'Apple_Terminal'\n 256\n else\n case ENV['TERM']\n when /^rxvt-(?:.*)-256color$/\n 256\n when /-color$/, /^rxvt/\n 16\n else # optimistic default\n TRUE_COLOR\n end\n end\n end", "def colour_mode(value = nil)\n fail InvalidSyntax, '`colour_mode` must be `8`, `16`, `256`, ' \\\n '`16777216`.' unless valid_colour_mode?(value)\n\n Vedeu.log(\"Configuration::API colour_mode: #{value}\")\n\n options[:colour_mode] = value\n end", "def color_channels\n color == 2 ? 3 : 4\n end", "def color_modes=(value)\n @color_modes = value\n end", "def color_type\n @src.color_model.has_alpha ? ARGB : RGB\n end", "def color_type\n @src.color_model.has_alpha ? ARGB : RGB\n end", "def mode\n modes(false)[0]\n end", "def mode\n modes(false)[0]\n end", "def actual_color\n ColorCode.where(numeric_code: default_code.split(\"-\")[-2])[0]\n end", "def selected_mode\n @selected_mode\n end", "def get_color\n if @thread\n return CYCLING\n end\n\n pins = COLORS.select do |pin|\n get_pin pin\n end\n\n if pins.length == 0\n return nil\n elsif pins.length == 1\n return pins.first\n else\n return INVALID_STATE\n end\n end", "def mode\n\t\treturn self.modes[0]\n\tend", "def determine_color\n colors = {'Red' => 0, 'Green' => 0, 'Yellow' => 0, 'Blue' => 0}\n @hand.each do |card|\n colors[card.suit] += 1\n end\n return colors.key(colors.values.max)\n end", "def get_mode()\n end", "def mode() @mode ||= detect_mode end", "def colorspace\n case colortype\n when 0 then depth == 1 ? 'InvertedMonochrome' : 'InvertedGrayscale'\n when 1 then depth == 1 ? 'Monochrome' : 'Grayscale'\n when 2 then 'RGB'\n when 3 then 'Indexed'\n when 4 then 'RGBA'\n when 5 then 'CMYK'\n end\n end", "def mode\n case @data_list\n when QRNumeric\n :mode_number\n when QRAlphanumeric\n :mode_alpha_numk\n else\n :mode_8bit_byte\n end\n end", "def determine_color_scheme\n @default_options.color_scheme = @highline.choose do |menu|\n menu.layout = :one_line\n menu.select_by = :name\n menu.header = nil\n menu.prompt = \"What color scheme would you like? \"\n menu.choice(\"none\") { :none }\n menu.choice(\"dark terminal background\") { :dark_bg }\n menu.choice(\"light terminal background\") { :light_bg }\n end\n end", "def get_color\n @color\n end", "def color_mode=(color_mode)\n validator = EnumAttributeValidator.new('String', [\"Normal\", \"Grayscale\"])\n if color_mode.to_i == 0\n unless validator.valid?(color_mode)\n raise ArgumentError, \"invalid value for 'color_mode', must be one of #{validator.allowable_values}.\"\n end\n @color_mode = color_mode\n else\n @color_mode = validator.allowable_values[color_mode.to_i]\n end\n end", "def getColor(c)\n if c == \"r\" then return :red\n elsif c == \"b\" then return :blue\n elsif c == \"g\" then return :green\n elsif c == \"y\" then return :yellow\n elsif c == \"c\" then return :cyan\n elsif c == \"m\" then return :magenta\n end\nend", "def color_provider\n attributes.fetch(:colorProvider)\n end", "def default_color_profile\n self.default_options[:color_profile].presence\n end", "def mode\n @mode\n end", "def best_color_settings\n if black_and_white?\n [ChunkyPNG::COLOR_GRAYSCALE, 1]\n elsif grayscale?\n if opaque?\n [ChunkyPNG::COLOR_GRAYSCALE, 8]\n else\n [ChunkyPNG::COLOR_GRAYSCALE_ALPHA, 8]\n end\n elsif indexable?\n [ChunkyPNG::COLOR_INDEXED, determine_bit_depth]\n elsif opaque?\n [ChunkyPNG::COLOR_TRUECOLOR, 8]\n else\n [ChunkyPNG::COLOR_TRUECOLOR_ALPHA, 8]\n end\n end", "def context_get_fgcolor()\n return $gimp_iface.gimp_context_get_foreground()[0]\nend", "def modes\n mode_codes.keys\n end", "def color_name\n COLOR[self.color.to_s]\n end", "def get_mode\n send_request(FUNCTION_GET_MODE, [], '', 1, 'C')\n end", "def get_color\n @colors.each {\n |key, val| \n (val[:set] = true; return val[:syn]) unless val[:set]\n }\n DEFAULT_COLOR\n end", "def target_mode\n return nil if resource.mode.nil?\n (resource.mode.respond_to?(:oct) ? resource.mode.oct : resource.mode.to_i) & 007777\n end", "def mode\n Initialize() if @_mode == nil\n\n @_mode\n end", "def color\n @color || $def_fg_color\n end", "def calcular_seguro\n\t\tcase color.upcase\n\t\t\twhen \"BLANCO\"\n\t\t\t\tif modelo.upcase == \"A\"\n\t\t\t\t\treturn 240\n\t\t\t\telse\t# modelo B\n\t\t\t\t\treturn 300\n\t\t\t\tend\n\t\t\twhen \"METALIZADO\"\n\t\t\t\tif modelo.upcase == \"A\"\n\t\t\t\t\treturn 330\n\t\t\t\telse \t# modelo B\n\t\t\t\t\treturn 360\n\t\t\t\tend\n\t\t\telse\t# otro color\n\t\t\t\tif modelo.upcase == \"A\"\n\t\t\t\t\treturn 270\n\t\t\t\telse \t# modelo B\n\t\t\t\t\treturn 330\n\t\t\t\tend\n\t\tend\t\t\t\t\n\tend", "def kiosk_mode_require_color_inversion\n return @kiosk_mode_require_color_inversion\n end", "def color\n\t\treturn @color\n\t\t\n\tend", "def r; self.color.r end", "def mode \n frequency_count = reduce(Hash.new(0)) { |freq, value| freq[value] += 1; freq}\n mode_count = frequency_count.values.max\n mode = frequency_count.select { |key, value| value == mode_count } # Select mode pairs\n return mode.keys.max # In case of multi-modes, return largest\n end", "def colour_for(char)\n return '' if char.colour == @colour\n\n @colour = char.colour\n @colour.to_s\n end", "def mode\n params['mode']\n end", "def _color\n\t\tcolor = Color.where(:inki_model_name => self.class.to_s, :model_id => self.id).first\n\t\tif color\n\t\t\tcolor.rgb_id\n\t\tend\n\tend", "def mode_name\n if mode >= 0 && mode <= 15\n MODES[mode]\n else\n \"(#{mode})\"\n end\n end", "def color_pick\n if mark_ratio < (day_parameter + least_mark_ratio)\n color = \"#C7E6F2\" #light color below average performance\n elsif mark_ratio >= ((2*day_parameter) + least_mark_ratio)\n color = \"#44bbdf\" #dark color excellent perfomance\n else\n color = \"#70c9e5\" #meduim color average performance\n end \n return color \n end", "def select_color\n selected ? :red : color\n end", "def mode() end", "def GetColorFromEvaluation(evaluation)\n\t\tevaluation = evaluation.downcase\n\t\tcase evaluation\n\t\twhen \"pass\"\n\t\t\treturn \"5cb85c\"\n\t\twhen \"fail\"\n\t\t\treturn \"d9534f\"\n\t\twhen \"other\"\n\t\t\treturn \"800080\"\n\t\telse\n\t\t\treturn \"5bc0de\"\n\t\tend\n\tend", "def currentgamemode\r\n\t\t\t@gamemode\r\n\t\tend", "def state_color\n result = nil\n states.each do |state|\n result = state.color if state.color\n end\n return result || EmptyColor\n end", "def color\n @color ||= color_scope.first\n end", "def color\n @color ||= COLORS[label.length%COLORS.length].to_sym\n end", "def get_mode()\n return(get_cmd('MD;',0.1,0.5,3).gsub(/^MD/,'').gsub(/;$/,'').to_i)\nend", "def to_c\n\t\t\tif color == \"white\"\n\t\t\t\t\"\\u26aa\"\n\t\t\telsif color == \"red\"\n\t\t\t\t\"\\u26d4\"\n\t\t\telsif color == \"black\"\n\t\t\t\t\"\\u26ab\"\n\t\t\tend\n\t\tend", "def color\n return @color\n end", "def color\n return @color\n end", "def selected_mode\n return @data[self.index]\n end", "def stream_colour\n return interface.colour if name\n\n default[:colour]\n end", "def colorspace\n return unless valid?\n\n case metadata[:colorspace].to_s\n when /rgb/i\n \"rgb\"\n when /cmyk/i\n \"cmyk\"\n when /gray/i, /b-w/i\n \"gray\"\n end\n end", "def colour_for(char)\n return ''.freeze if char.colour == @colour\n\n @colour = char.colour\n @colour.to_s\n end", "def color?\n @color\n end", "def get_color(rating)\n colors = {\n 10 => '#00cc00',\n 9 => '#33cc99',\n 8 => '#66ff99',\n 7 => '#99ffff',\n 6 => '#9999ff',\n 5 => '#cc99ff',\n 4 => '#ff66cc',\n 3 => '#ff6699',\n 2 => '#ff3366',\n 1 => '#ff0000',\n }\n return colors[rating]\n end", "def color_name\n fetch('color.name')\n end", "def mode_to_string(mode)\n if mode==MODE_LSB\n return(\"LSB\")\n elsif mode==MODE_USB\n return(\"USB\")\n elsif mode==MODE_CW\n return(\"CW\")\n elsif mode==MODE_FM\n return(\"FM\")\n elsif mode==MODE_AM\n return(\"AM\")\n elsif mode==MODE_DATA\n return(\"DATA\")\n elsif mode==MODE_CW_REV\n return(\"CW-REV\")\n elsif mode==MODE_DATA_REV\n return(\"DATA-REV\")\n else\n return(\"Unknown\")\n end\nend", "def modes; end", "def colorQuest(color)\n color = color.downcase if color\n return \"7DC076EF\" if color == \"blue\"\n return \"089D5EBF\" if color == \"red\"\n return \"26CC4B56\" if color == \"green\"\n return \"6F697395\" if color == \"cyan\"\n return \"5CFA729D\" if color == \"magenta\"\n return \"135D47BF\" if color == \"yellow\"\n return \"56946F5A\" if color == \"gray\"\n return \"7FDE6B39\" if color == \"white\"\n return \"751272B7\" if color == \"purple\"\n return \"0E7F4F3F\" if color == \"orange\"\n return \"2D4A5694\" # Returns the default dark gray color if all other options are exhausted\nend", "def mode; end", "def mode; end", "def mode; end", "def mode; end", "def color\n return @color\n end", "def get_color_list_name\n\t\t@availible_colors.keys[0]\n\tend", "def mode\n options[:mode]\n end", "def safe_colorize_active\n CLIColorize.on\n end", "def color_codes\n {\n :black => 0, :light_black => 60,\n :red => 1, :light_red => 61,\n :green => 2, :light_green => 62,\n :yellow => 3, :light_yellow => 63,\n :blue => 4, :light_blue => 64,\n :magenta => 5, :light_magenta => 65,\n :cyan => 6, :light_cyan => 66,\n :white => 7, :light_white => 67,\n :default => 9\n }\n end", "def color\n @red ? \"R\" : \"B\"\n end", "def default_colour\n\t\t\tOmniboard::Colour.new(0).standard\n\t\tend", "def getDrawColor()\n return @drawColor\n end", "def getColor(theColor, default = 'gray')\n preset = Proc.new do |color|\n case color\n when 'windowBackground' then return NSColor.windowBackgroundColor # 0.93\n when 'textColor' then return NSColor.textColor # 0.0\n when 'backgroundColor' then return NSColor.textBackgroundColor # 1.0\n when 'clear' then return NSColor.clearColor\n else color\n end\n end\n if preset.call(theColor) == 'box' # box fill color doesn't have a system color\n dark = !NSAppearance.currentAppearance.name.to_s.index('Dark').nil?\n rgb = dark ? [0.12, 0.12, 0.12] : [0.89, 0.89, 0.89]\n else # get the specified color or default - no dark mode swaps are performed\n rgb = COLORS[preset.call(default)] if (rgb = COLORS[theColor]).nil?\n end\n rgb = [0.5, 0.5, 0.5] if rgb.nil? # get gray if nothing else has worked\n NSColor.colorWithSRGBRed( rgb[0],\n green: rgb[1],\n blue: rgb[2],\n alpha: 1.0 )\n end", "def symbol\n @color \n end", "def get_mode(key)\n case key\n when \"S\", \"s\" then -1 # AUTO\n when \"N\", \"n\" then 0 # NUMERIC\n when \"A\", \"a\" then 1 # ALNUM - British number: 0-9 A-Z SP $% * + - /.:\n when \"8\" then 2 # 8BIT\n when \"K\", \"k\" then 3 # KANJI\n end\n end", "def fg(c)\n return self unless ANSI_COLORS[c]\n return colorize(ANSI_COLORS[c])\n end", "def winner_color\n [[:w, :b], [:b, :w]].each do |color, o_color|\n return color if pieces_by_color(o_color).empty?\n end\n nil\n end", "def current_mode\n self.say \"The current mode is: #{@config[:mode]}\"\n end", "def mode?\n return @mode\n end", "def color(*options)\n return '' if mode.zero? || options.empty?\n mix = []\n color_seen = false\n colors = ANSI_COLORS_FOREGROUND\n\n options.each{ |option|\n case option\n when Symbol\n if color = colors[option]\n mix << color\n color_seen = :set\n elsif ANSI_EFFECTS.key?(option)\n mix << effect(option)\n elsif option == :random\n mix << random(color_seen)\n color_seen = :set\n else\n raise ArgumentError, \"Unknown color or effect: #{ option }\"\n end\n\n when Array\n if option.size == 3 && option.all?{ |n| n.is_a? Numeric }\n mix << rgb(*(option + [color_seen])) # 1.8 workaround\n color_seen = :set\n else\n raise ArgumentError, \"Array argument must contain 3 numerals\"\n end\n\n when ::String\n if option =~ /^#?(?:[0-9a-f]{3}){1,2}$/i\n mix << hex(option, color_seen)\n color_seen = :set\n else\n mix << rgb_name(option, color_seen)\n color_seen = :set\n end\n\n when Numeric\n integer = option.to_i\n color_seen = :set if (30..49).include?(integer)\n mix << integer\n\n when nil\n color_seen = :set\n\n else\n raise ArgumentError, \"Invalid argument: #{ option.inspect }\"\n\n end\n\n if color_seen == :set\n colors = ANSI_COLORS_BACKGROUND\n color_seen = true\n end\n }\n\n wrap(*mix)\n end", "def get_color_code\n\t\t{ r: @term_hex[0], g: @term_hex[1], b: @term_hex[2], alpha: @term_hex[-1] }\n\tend", "def emacs_color(type, options = {})\n default = options.fetch(:default, DEFAULTS[:default])\n options.fetch(type.to_sym, default)\n end", "def name\n return mode_desc\n end", "def calculate_color\n\n self.color || color_by_title\n end", "def use_color?\n use_color\n end", "def color\n case (@code.to_i / 100)\n when 2\n color = :green\n when 3\n color = :yellow\n when 4, 5\n color = :red\n else\n color = :blue\n end\n color\n end", "def auxiliary_colour\n @cr[0xe] >> 4\n end", "def modes\n fre = frequencies\n max = fre.values.max\n fre.select { |k, f| f == max }\n end", "def getComplement(color)\n\tcase color\n\n\twhen \"red\"\n\t\treturn \"cyan\"\n\twhen \"green\"\n\t\treturn \"magenta\"\n\twhen \"yellow\"\n\t\treturn \"blue\"\n\twhen \"blue\"\n\t\treturn \"yellow\"\n\twhen \"magenta\"\n\t\treturn \"green\"\n\twhen \"cyan\"\n\t\treturn \"red\"\n\telse\n\t\tputs \"ERROR in getComplement\"\n\t\treturn\n\tend\n\nend", "def computer_color\n\t valid_colors = [\"r\", \"y\", \"b\", \"w\", \"c\", \"g\"] \n\t return [valid_colors[rand(0..5)],valid_colors[rand(0..5)], valid_colors[rand(0..5)], valid_colors[rand(0..5)]]\n\tend", "def possible_colors\n %w(R G B Y)\n end" ]
[ "0.74411714", "0.7409013", "0.7105346", "0.7105346", "0.7052336", "0.6993235", "0.68241763", "0.6773737", "0.66509247", "0.66509247", "0.6645449", "0.6645449", "0.66019326", "0.65880203", "0.65370166", "0.6438889", "0.6363784", "0.6352362", "0.6347746", "0.633593", "0.62741417", "0.62016255", "0.6186621", "0.6175882", "0.6123819", "0.609243", "0.6082262", "0.6072532", "0.60539025", "0.59807783", "0.597949", "0.59723747", "0.595992", "0.5957125", "0.5949667", "0.5946231", "0.59451944", "0.5935976", "0.5928316", "0.5912406", "0.59085333", "0.58721614", "0.5869135", "0.5868018", "0.58678526", "0.58637035", "0.58514875", "0.58503467", "0.5845551", "0.5837991", "0.5835464", "0.5832247", "0.5831758", "0.5827909", "0.5813732", "0.5812238", "0.5811256", "0.5811256", "0.5808824", "0.57762605", "0.5775873", "0.5764048", "0.5753323", "0.57505316", "0.57468307", "0.5736573", "0.5733769", "0.5731094", "0.57281613", "0.57281613", "0.57281613", "0.57281613", "0.572617", "0.571715", "0.57117486", "0.5701664", "0.5690253", "0.56895494", "0.5668328", "0.5647857", "0.56429696", "0.56413454", "0.56186306", "0.5607925", "0.55998856", "0.5594752", "0.5586184", "0.5586048", "0.5583837", "0.557961", "0.5572386", "0.55718964", "0.5569269", "0.5562203", "0.5561232", "0.5561001", "0.55579627", "0.55550766", "0.5552246" ]
0.8042531
1
Returns whether debugging is enabled or disabled. Default is false; meaning only the top line of a backtrace from an exception is shown to the user of the client application.
def debug? instance.options[:debug] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debugging?\n Options[:debug]\n end", "def debug?\n false\n end", "def debug?\n true\n end", "def debug?\n true\n end", "def debug_through?\r\n return false\r\n end", "def debug?\n @@debug\n end", "def debug_mode?\n @@debug_mode\n end", "def debug?\n !!@debug # rubocop:disable Style/DoubleNegation\n end", "def debug?\n !!@debug\n end", "def debug?\n @debug || ENV['HATCHET_DEBUG'] || false\n end", "def debug?\n @@debug\n end", "def debug?\n debugging || !ENV['DEBUG'].nil?\n end", "def debug?\n\t\t!!@debuggable_status\n\tend", "def debug?\n @level <= 0\n end", "def debug?\n self[:debug] == 'true'\n end", "def debugging?\n debugging = ENV[\"DEBUG\"]\n if defined?(Rails) && Rails.respond_to?(:env)\n debugging = true if [\"development\", \"test\"].include? Rails.env\n end\n debugging\n end", "def debug?\n @debug || to_bool( ENV['LAUNCHY_DEBUG'] )\n end", "def debug_mode\n @@debug_mode == 1\n end", "def debug?\n level <= DEBUG\n end", "def debug?\n $DEBUG\n end", "def debugging?\n @debug_style.eql? \"NA_PRINT_DONT_PARSE\"\n end", "def debug?\n !!self.debug\n end", "def debugging?\n ENV['DEBUG'] && ENV['DEBUG'] != ''\nend", "def trace?\n Options[:trace]\n end", "def debug?\n !production?\n end", "def debug\n @@debug ||= false\n end", "def http_debug?\n Options[:http_debug]\n end", "def debug?\n return @debug_mode if defined?(@debug_mode)\n @debug_mode = ENV['MOLINILLO_DEBUG']\n end", "def debugging?\n\t\t(datastore['DEBUG'] || '') =~ /^(1|t|y)/i\n\tend", "def debug?\n DEBUG == log_level\n end", "def debug?\n severity == :DEBUG\n end", "def log_debug?\n @logger.debug?\n end", "def debug?\n level >= ASL_LEVEL_DEBUG\n end", "def display_exceptions?\n !!@exception_display_handler\n end", "def debug_mode\n @configuration[:debug_mode] = true\n end", "def backtrace?\n !!@backtrace\n end", "def trace?\n !!@trace\n end", "def backtrace?\n (@backtrace || @locations) ? true : false\n end", "def backtrace\n @backtrace or $DEBUG\n end", "def debugging(bool)\n @@debug = bool\n end", "def debug? ; $DEBUG ; end", "def debug?\n puts \"Debug mode is #{@shell_debug ? 'ON' : 'OFF'}\\n\\n\"\n nil\nend", "def trace_disabled?(options)\n !(traced? || options[:force])\n end", "def toggle_debug\n @debug = @debug == false ? true : false\n end", "def debug?; end", "def debug?; end", "def debug?\n @loggers.any? { |logger| logger.respond_to?(:debug?) && logger.debug? }\n end", "def getDebugFlag()\n\t\t\treturn @_debug_flag\n\t\tend", "def session_debug?(controller = nil)\n dev = developer?\n local = not_deployed?\n setting =\n if controller\n session[\"app.#{controller}.debug\"]\n elsif local || dev\n session['app.debug']\n end\n if local && dev || dev_client?\n !false?(setting) # Debugging *on* by default.\n else\n true?(setting) # Debugging *off* by default.\n end\n end", "def debug status=true\n\t\t@debuggable_status = !!status\n\tend", "def internal_error enabled\n @backtrace_500 = enabled\n end", "def debug_stream?\n @debug_stream\n end", "def debug_stream?\n @debug_stream\n end", "def is_remote_exception_logging?\n SystemStatus.is_remote_exception_logging?\n end", "def debug?; @logger.debug? end", "def debug?; run_options[:debug]; end", "def debugging(debug_bool)\n Facter::Options[:debug] = debug_bool\n end", "def enable_advanced_debugging_tools; end", "def debug state=true\n @debug = state\n end", "def show_detailed_exceptions?\n !!current_admin\n end", "def show_command?\n ENV['DEBUG'] || ENV['SHOW_COMMAND']\n end", "def debug_logging\n log.level == Logger::DEBUG\n end", "def force_debug\n self.level = :debug\n @level_frozen = true\n end", "def logging_enabled?\n !!logging_enabled\n end", "def debug?; @level <= DEBUG; end", "def debug?; @level <= DEBUG; end", "def trace? ; (lgr = logger).respond_to?(:trace?) && lgr.trace? end", "def debug_on(debug=true)\n ap \"Debugging is ON\"\n @debug = debug\n end", "def do_debug\n # debugging = true\n debugging = false\n puts yield if debugging\n end", "def secure?\n #debugger\n false\n end", "def request_debug_assets?\n debug_assets || (defined?(controller) && controller && params[:debug_assets])\n rescue\n return false\n end", "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend", "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend", "def debug!(value = true)\n if options.key?(:trace) && options[:trace] != false\n Vedeu.log(\"Configuration::API debug: true\")\n\n options[:debug] = true\n\n else\n Vedeu.log(\"Configuration::API debug: #{value}\")\n\n options[:debug] = value\n\n end\n end", "def netDebug\n NetDebug.Trace(nil)\n NetDebug.Trace(true)\n NetDebug.Trace(false)\n NetDebug.Trace(getString)\n NetDebug.Trace(getWackyString)\n NetDebug.Trace(getArray)\n NetDebug.Trace(getMixedArray)\n NetDebug.Trace(getHash)\n NetDebug.Trace(getFixNum)\n NetDebug.Trace(getBigNum)\n NetDebug.Trace(getFloat)\n NetDebug.Trace(getXML)\n return true\n\tend", "def debug!\n return false if @debug_was_enabled_by # Prevent multiple calls\n\n config.debug ||= true # Enable debug mode in config if it wasn't enabled from other sources\n @debug_was_enabled_by = caller_locations(1, 1)[0].to_s\n\n configure do\n group :yabeda\n\n histogram :collect_duration,\n tags: %i[location], unit: :seconds,\n buckets: [0.0001, 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60].freeze,\n comment: \"A histogram for the time required to evaluate collect blocks\"\n end\n\n adapters.each_value(&:debug!)\n\n true\n end", "def show_detailed_exceptions?; end", "def error_yes_stack_trace!\n @@_error_stack_trace = true\n end", "def enabled?\n distributed_tracing_enabled? &&\n span_events_enabled? &&\n trace_observer_configured?\n end", "def debug=(truthy=false)\n\t@debug=truthy\n end", "def trace(bool)\n Options[:trace] = bool\n end", "def debug(message)\n return unless debugging?\n\n logger.debug(message.to_s)\n nil\n end", "def verbose?\n !!ENV[\"DEBUG\"]\nend", "def disabled?\n Support.new(ENV, verbose: verbose).disabled?\n end", "def include_debug_build_modes(bundle_name=nil)\n env = environment_for(bundle_name) || {}\n [(env[:include_debug] || :development)].flatten\n end", "def toggle_debug!\n stream = @config[:debug]\n\n if stream.respond_to?(:<<)\n self.class.debug_output(stream)\n else\n self.class.debug_output\n end\n end", "def debug?; @loggers.first.level <= DEBUG; end", "def debug\n ::RSpec.configure do |config|\n config.add_setting :debugger_proc\n config.debugger_proc = ->(ex) do\n exception = ex.exception\n defined?(Pry) ? binding.pry : debugger # rubocop:disable Debugger\n end\n config.after(debug: true) do |ex|\n instance_exec(ex, &config.debugger_proc) if ex.exception\n end\n end\n end", "def debug! \n $DEBUG = true\n end", "def should_log?\n return false if @skip_logging\n true\n end", "def exception?\n false\n end", "def include_errors?\n !!self.__options[:include_errors]\n end", "def traced?\n NewRelic::Agent.is_execution_traced?\n end", "def debug_mode\n orig = @@debug_mode\n @@debug_mode = true\n yield\n @@debug_mode = orig\n end", "def debug_state\n super\n end", "def debug_state\n super\n end", "def contact_points_visible?\n @debug_contact_points\n end", "def contact_points_visible?\n @debug_contact_points\n end", "def get_cli_debug\n if ENV.include?(\"debug\")\n if ENV[\"debug\"] == \"false\" || ENV[\"debug\"] == \"0\"\n $options[:verbose] = false\n else\n $options[:verbose] = true\n end\n else\n # default is on!\n $options[:verbose] = true\n end\n end" ]
[ "0.74383974", "0.7377318", "0.725585", "0.725585", "0.7119016", "0.7113887", "0.7105518", "0.70937675", "0.705628", "0.7026666", "0.70124555", "0.70080554", "0.6969551", "0.69695175", "0.689556", "0.6853887", "0.68417865", "0.68046445", "0.6744632", "0.6743809", "0.6738521", "0.6638247", "0.66037714", "0.6586705", "0.6577839", "0.6571156", "0.65668595", "0.6560415", "0.6543745", "0.65186536", "0.6472779", "0.6468127", "0.6439981", "0.6437427", "0.64350027", "0.637034", "0.6362633", "0.63246477", "0.6313195", "0.63089687", "0.62728924", "0.6248967", "0.6227391", "0.61812586", "0.6130513", "0.6130513", "0.6055026", "0.604996", "0.6048029", "0.60187316", "0.60074764", "0.5978403", "0.5978403", "0.5964473", "0.59069014", "0.5906818", "0.58860135", "0.5824798", "0.5821462", "0.5819798", "0.5797929", "0.57639223", "0.57037073", "0.56929964", "0.569002", "0.569002", "0.56754535", "0.56515443", "0.5641085", "0.56394804", "0.56139845", "0.5594482", "0.5594482", "0.5525969", "0.5512135", "0.55101156", "0.5472636", "0.5441504", "0.5441031", "0.54369044", "0.5434001", "0.5426383", "0.5402604", "0.54004866", "0.539483", "0.53883576", "0.5378759", "0.537596", "0.537338", "0.5369349", "0.53565633", "0.53444415", "0.5316605", "0.5316172", "0.53144544", "0.53144544", "0.5310483", "0.5310483", "0.5308195" ]
0.68841505
16
Returns whether the DRb server is enabled or disabled. Default is false.
def drb? instance.options[:drb] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enabled?\n !host.nil?\n end", "def enabled?\n\n return @enabled\n\n end", "def enabled?\n \n return @enabled\n \n end", "def enabled?\n \n return @enabled\n \n end", "def enabled?\n !!configuration.enabled\n end", "def enabled?\n return enabled\n end", "def enabled?\n @enabled\n end", "def enabled?\n @enabled\n end", "def enabled?\n @enabled\n end", "def enabled?\n @enabled\n end", "def enabled?\n status == 'enabled'\n end", "def enabled?\n @enabled || false\n end", "def is_enabled\n return @is_enabled\n end", "def is_enabled\n return @is_enabled\n end", "def is_enabled\n return @is_enabled\n end", "def is_enabled\n return @is_enabled\n end", "def is_enabled\n return @is_enabled\n end", "def is_enabled\n return @is_enabled\n end", "def is_enabled\n return @is_enabled\n end", "def enabled?\n @enabled != false\n end", "def enabled?\n !!@enabled\n end", "def enabled?\n !!@enabled\n end", "def enabled?\n !!@enabled\n end", "def enabled?\n enabled.nil? || enabled\n end", "def disabled?\n self.disabled || self.account.blank? || Rails.env.development?\n end", "def disabled?\n status == 'disabled'\n end", "def enabled?\n !disabled?\n end", "def enabled?\n !disabled?\n end", "def enabled?\n true\n end", "def enabled?\n true\n end", "def enabled?\n false\n end", "def disabled?\n !Agent.config[:agent_enabled]\n end", "def enabled?\n false\n end", "def enabled?\n if $game_system != nil && self.tag != nil &&\n $game_system.enabling_options[self.tag] == false\n return false\n end\n return true if @enabled_condition.nil?\n return eval(@enabled_condition)\n end", "def enabled\n !false?(configuration[:enabled])\n end", "def disabled?\n Support.new(ENV, verbose: verbose).disabled?\n end", "def enabled?\n !@test_mode || @test_mode == :enabled\n end", "def disabled?\n state == :DISABLED\n end", "def disabled?\n host.nil?\n end", "def enabled?\n true\n end", "def disabled?\n @disabled\n end", "def enabled?\n state.nonzero?\n end", "def disabled?\n @disabled == true\n end", "def enabled?\n state.eql? 'active'\n end", "def server?\n return (server == true)\n end", "def disabled?\n @disabled ||= (user_configuration_from_key('disabled') || false)\n end", "def disabled?\n @disabled ||= (user_configuration_from_key('disabled') || false)\n end", "def enabled?\n if $game_system != nil && self.tag != nil &&\n $game_system.enabling_options[self.tag] == false\n return false\n end\n return true if @enabled_condition.nil?\n eval(@enabled_condition)\n end", "def enabled?\n o = _options\n o[:enabled].nil? || o[:enabled]\n end", "def plugin_disabled?\n if config['enabled']\n false\n else\n true\n end\n end", "def dell_server?\n provider.dell_server?\n end", "def enabled?\n !!store[:enabled]\n end", "def is_disabled?\n client = RestClient.where(:api_key => @api_key).first\n return true if client.nil?\n client.is_disabled\n end", "def server?\n return @mode == :server\n end", "def disabled?\n state.zero?\n end", "def plugin_disabled?\n if config['enabled']\n false\n else\n true\n end\n end", "def has_disabled?\n options.key?(:disabled) ? options[:disabled] : disabled_by_policy?\n end", "def disabled?\n self.disabled = !site.incremental? if disabled.nil?\n disabled\n end", "def disabled?\n \n return ! @enabled\n\n end", "def enabled?\n inclusively { @enabled }\n end", "def enabled?\n config.roadie.enabled\n end", "def disabled?\n !enabled?\n end", "def disabled?\n \n return ! @enabled\n \n end", "def disabled?\n !enabled?\n end", "def balancer_enabled?\n @admin.isBalancerEnabled\n end", "def enabled?()\n #This is a stub, used for indexing\n end", "def active?\n enabled\n end", "def enabled?\n !Rails.env.test?\n end", "def enabled\n return @enabled\n end", "def enabled\n return @enabled\n end", "def enabled\n return @enabled\n end", "def is_sol_enabled(handle:, server_id: 1)\n solif_mo = SolIf.new(parent_mo_or_dn: ImcCoreUtils.get_server_dn(handle, server_id))\n solif_mo = handle.query_dn(dn: solif_mo.dn)\n return [\"enable\", \"enabled\"].include? solif_mo.admin_state.downcase\nend", "def enabled?\n !!PaperTrail.config.enabled\n end", "def enabled?\n $game_switches[Yuki::Sw::Nuzlocke_ENA]\n end", "def enabled?\n return false if !@remote_url.nil? &&\n Fizzy::Sync.others(self).any? { |e|\n @remote_url.to_s.start_with?(\"#{e.name}:\")\n }\n return true if default? && Fizzy::Sync.others(self).\n map { |e| e.new(@local_dir_path, @remote_url) }.\n all? { |e| !e.enabled? }\n end", "def config_service?\n true\n end", "def find_command_enabled?\n $find_command_enabled ||= scanned_client_server!.features.find_command_enabled?\nend", "def find_command_enabled?\n $find_command_enabled ||= scanned_client_server!.features.find_command_enabled?\nend", "def disabled?\n\n return ! @enabled\n \n end", "def enabled?\n return @provider.enabled? if [email protected]?\n true\n end", "def manual_enabled?\n return true\n end", "def enabled?\n return policy_setting.enabled\n end", "def client?\n return (server == false)\n end", "def enabled?\n enabled = :false\n rcstatus('-C', '-a').each_line do |line|\n case line.chomp\n when /^Runlevel: /\n enabled = :true\n when /^\\S+/ # caption of a dynamic runlevel\n enabled = :false\n when self.class::STATUSLINE\n return enabled if @resource[:name] == $1\n end\n end\n :false\n end", "def service_enable?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_ENABLE)\n return false\n end", "def server?\r\n @connect_type == :server\r\n end", "def enabled?\n !suspended\n end", "def enabled?\n @metadata.fetch(:enabled, true)\n end", "def enabled?\n APP_CONFIG.enabled?(\"ldap\") && APP_CONFIG.enabled?(\"ldap.group_sync\")\n end", "def disabled?\n\t\t\tuserAccountControl.to_i & UAC_ACCOUNT_DISABLED != 0\n\t\tend", "def is_kvm_enabled(handle:, server_id: 1)\n kvm_mo = CommKvm.new(parent_mo_or_dn: _get_comm_mo_dn(handle, server_id))\n kvm_mo = handle.query_dn(dn: kvm_mo.dn)\n return(kvm_mo.admin_state.downcase == \"enabled\")\nend", "def disabled?\n false\n end", "def is_dc?\n\t\tis_dc_srv = false\n\t\tserviceskey = \"HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Services\"\n\t\tif registry_enumkeys(serviceskey).include?(\"NTDS\")\n\t\t\tif registry_enumkeys(serviceskey + \"\\\\NTDS\").include?(\"Parameters\")\n\t\t\t\tprint_good(\"\\tThis host is a Domain Controller!\")\n\t\t\t\tis_dc_srv = true\n\t\t\tend\n\t\tend\n\t\treturn is_dc_srv\n\tend", "def dns_enabled?\n return false if @config[:dns_lookup] == :off\n return false if @config[:host_validation] == :syntax\n true\n end", "def enable?\n return false if eval_shop_condition(@disable_condition)\n return true\n end", "def enabled?\n enabled = @options[:enabled] == true\n unless enabled\n note = \"tessen collects anonymized data to help inform the sensu team about installations\"\n note << \" - you can opt-in via configuration: {\\\"tessen\\\": {\\\"enabled\\\": true}}\"\n @logger.info(\"the tessen call-home mechanism is not enabled\", :note => note)\n end\n enabled\n end", "def enabled?\n [email protected]? || (active? && connection.is_experiment_enabled?(@id))\n end", "def is_dc?\n is_dc_srv = false\n serviceskey = 'HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Services'\n if registry_enumkeys(serviceskey).include?('NTDS')\n if registry_enumkeys(serviceskey + '\\\\NTDS').include?('Parameters')\n print_good(\"\\tThis host is a Domain Controller!\")\n is_dc_srv = true\n end\n end\n return is_dc_srv\n end", "def only_configs?(server)\n return false if server['general']['alive'].to_i == 1\n return false unless server['netdb'].empty?\n return false unless server['vmware'].empty?\n\n true\n end" ]
[ "0.71876234", "0.7178591", "0.71595466", "0.71595466", "0.71483284", "0.7133109", "0.71328086", "0.71328086", "0.71328086", "0.71328086", "0.7120174", "0.70945644", "0.70928025", "0.70928025", "0.70928025", "0.70928025", "0.70928025", "0.70928025", "0.70928025", "0.70766693", "0.698215", "0.698215", "0.6980797", "0.69703776", "0.69662344", "0.6944002", "0.69162565", "0.69162565", "0.6830549", "0.6830549", "0.68168575", "0.680263", "0.6779669", "0.6771776", "0.67651004", "0.67617744", "0.6760785", "0.6721091", "0.67069304", "0.66967195", "0.66919595", "0.6685679", "0.66827136", "0.66755193", "0.66647536", "0.6657359", "0.66564214", "0.66495144", "0.66435003", "0.66389287", "0.6636552", "0.66289586", "0.66179585", "0.66148525", "0.66101813", "0.66096866", "0.66052693", "0.65842795", "0.6582094", "0.65284216", "0.65229934", "0.6494465", "0.6489404", "0.64520395", "0.6444808", "0.6415135", "0.6396783", "0.63938", "0.63889515", "0.63889515", "0.63889515", "0.6382365", "0.63485277", "0.63412845", "0.6323649", "0.6321206", "0.63189346", "0.63189346", "0.63126063", "0.6312547", "0.6305147", "0.62986493", "0.6285877", "0.62778676", "0.62768054", "0.6276197", "0.62741274", "0.62475514", "0.62400997", "0.6235076", "0.6185155", "0.61567396", "0.61564416", "0.615382", "0.6134265", "0.6133091", "0.61077976", "0.61024714", "0.6087829" ]
0.6851658
29
Returns the hostname for the DRb server.
def drb_host instance.options[:drb_host] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_server_hostname\n (`hostname`).strip\n end", "def hostname\n Socket.gethostname.split('.').first.strip\n end", "def hostname\n @hostname ||= `hostname`.strip\n end", "def hostname\n @hostname ||= `hostname`.chomp\n end", "def hostname\n Socket.gethostname\n end", "def hostname\n Socket.gethostname\n end", "def get_server_domain\n @hostname ||= Socket.gethostname\n end", "def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.delete(\"\\n\")\n end", "def hostname\n v = self.host\n v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v\n end", "def hostname\n return @hostname\n end", "def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.chomp\n end", "def server_hostname\n @node['serverHostname']\n end", "def hostname\n name + '.localhost'\n end", "def server_host\n Socket.gethostname\n end", "def hostname\n Resolv.getname(ip_address) rescue nil\n end", "def hostname\n Socket.gethostname\n end", "def hostname\n if (host = @host.at('tag[name=host-fqdn]'))\n host.inner_text\n end\n end", "def fqdn\n ssh.exec!(\"hostname --fqdn\").chomp\n end", "def hostname\n hostname = nil\n run \"hostname\" do |channel, stream, data|\n hostname = data.chomp\n end\n hostname\n end", "def private_hostname_of(server)\n server[:fqdn]\n end", "def hostname\n ssh.exec!(\"hostname\").chomp\n end", "def hostname\n return 'unknown' unless available?\n @hostname ||= ssh_cmd('hostname').chomp\n end", "def fqdn\n exit_code, stdout = ssh.exec(\"hostname --fqdn\")\n (exit_code == 0) ? stdout.chomp : \"\"\n end", "def client_hostname\n @opts[:hostname]\n end", "def determine_hostname\n @info[:hostname] = @shell.query('HOST', 'hostname')\n end", "def hostname\n FFI::Libvirt.virConnectGetHostname(pointer)\n end", "def host\n\t\t\t# FIXME: This is both a hack and the best way I know to do this.\n\t\t\tSocket.getaddrinfo(Socket.gethostname, 0)[0][2]\n\t\tend", "def peer_hostname\n (error, name) = Cproton.pn_ssl_get_peer_hostname(@impl, 1024)\n raise SSLError.new if error < 0\n return name\n end", "def hostname\n if @hostname.nil?\n @hostname = ENV[\"COMPUTERNAME\"]\n @hostname = ENV[\"HOSTNAME\"] if @hostname.blank?\n @hostname = `hostname` if @hostname.blank?\n @hostname = @hostname.gsub(/\\.terracotta\\.lan/, '').strip\n end\n \n @hostname\n end", "def dns_host_name\n @dns_host_name ||= ::SimpleIDN.to_ascii(@host_name)\n end", "def build_hostname\n hostname\n end", "def this_host_name\n if is_zz?\n return zz[:local_hostname]\n end\n\n return @this_host_name if @this_host_name != nil\n\n instances = ey['environment']['instances']\n # assume localhost if can't find\n @this_host_name = 'localhost'\n\n this_id = this_instance_id\n instances.each do |instance|\n if instance['id'] == this_id\n @this_host_name = instance['private_hostname']\n break\n end\n end\n @this_host_name\n end", "def hostname\n options[:hostname]\n end", "def hostname\n Rails.env.development? ? h.root_url(port: 3000).chomp!('/') : h.root_url.chomp!('/')\n end", "def hostname()\n unless @host.is_str?\n @host = ENV['HOSTNAME']\n @host = `/bin/hostname` unless @host.is_str?\n raise \"Failed to determine current HOSTNAME\" unless @host.is_str?\n\n @host = @host.downcase.sub(/\\..*$/, '').strip\n raise \"Failed to determine current HOSTNAME\" unless @host.is_str?\n end\n @host = @host.to_sym\n end", "def get_hostname\n cmd_exec('uname -n').to_s\n rescue\n raise 'Unable to retrieve hostname'\n end", "def hostname; end", "def hostname; end", "def hostname\n protocol = request.headers['HTTP_X_FORWARDED_PROTO'] ||\n request.protocol ||\n 'http'\n protocol += '://' unless protocol.match?(%r{://})\n\n \"#{protocol}#{request.host}\"\n end", "def get_public_hostname\n rpc_get_fact_direct('public_hostname')\n end", "def hostname\n @options[:host][:name] if @options[:host]\n end", "def hostname\n session.transport.socket.client_name\n end", "def hostname\n (request.env['HTTP_X_FORWARDED_SERVER'] =~ /[a-z]*/) ? request.env['HTTP_X_FORWARDED_SERVER'] : request.env['HTTP_HOST']\n end", "def hostname\n raise 'empty hostname, something wrong' if @in_hostname.empty?\n @in_hostname\n end", "def host\n Socket.gethostname\n end", "def host\n Socket.gethostname\n end", "def hostname(arg = nil)\n set_or_return(:hostname, arg, kind_of: [String])\n end", "def public_hostname_of(server)\n server[:cloud][:public_hostname] rescue public_ip_of(server)\n end", "def hostname\n host_hash['vmhostname'] || @name\n end", "def server_name\n return @server_name\n end", "def hostname(node)\n \"#{node.to_s}.smartengine.local\"\nend", "def configured_hostname\n running_config.scan(/hostname\\s*(\\S+)/).flatten.first\n end", "def remote_host\n # NOTE: Celluloid::IO does not yet support non-blocking reverse DNS\n @socket.peeraddr(true)[2]\n end", "def host\n @config.db_hostname\n end", "def ssh_hostname\n name = \"\"\n Net::SSH.start(@ip, \"pipeline\") do |ssh|\n name = ssh.exec! \"hostname -s\"\n end\n name.downcase.chomp\n end", "def client_name\n return @hostname if defined? @hostname\n\n sockaddr = @socket.getsockname\n begin\n @hostname =\n Socket.getnameinfo( sockaddr, Socket::NI_NAMEREQD ).first\n rescue\n begin\n @hostname = Socket.getnameinfo( sockaddr ).first\n rescue\n begin\n @hostname = Socket.gethostbyname( Socket.gethostname ).first\n rescue\n @logger.error \"the client ipaddr/name could not be determined\"\n end\n end\n end\n\n return @hostname\n end", "def name\n ssh.exec!(\"hostname\").chomp\n end", "def get_server_fqdn(server)\n return nil unless server\n\n nic = get_server_default_nic(server) || {}\n networks = client.list_networks(project_id: server['projectid']) || {}\n\n id = nic['networkid']\n network = networks.select { |net|\n net['id'] == id\n }.first\n return nil unless network\n\n \"#{server['name']}.#{network['networkdomain']}\"\n end", "def domain\n server_name || http_host\n end", "def public_hostname\n get_proxy.get_public_hostname\n end", "def srvhost\n datastore['SRVHOST']\n end", "def get_host\n @host\n end", "def read_hostname\n return nil unless running?\n\n begin\n return ContainerControl::Commands::GetHostname.run!(self)\n rescue ContainerControl::Error => e\n log(:warn, \"Unable to read container hostname: #{e.message}\")\n return nil\n end\n end", "def canonical\n dns_host_name\n end", "def fqdn domain_name\n Service.fqdn domain_name, dns\n end", "def hostname\n if resolution = CloudModel::AddressResolution.where(ip: ip).first\n resolution.name\n else\n begin\n Resolv.getname(ip)\n rescue\n ip\n end\n end\n end", "def new_hostname\n host || incremented_hostname || local_host_name\n end", "def hostname\n unless defined?(@hostname)\n @hostname = solr_url.host if solr_url\n @hostname ||= user_configuration_from_key('solr', 'hostname')\n @hostname ||= default_hostname\n end\n @hostname\n end", "def host(n=nil)\n if n.nil? \n @host ||= dns_name\n else\n @host = n\n end\n end", "def hostname(value)\n value || BASE_URI\n end", "def get_event_host(host)\n unless options[:fqdn]\n return host.split('.')[0]\n end\n return host\n end", "def fqdn\n [ hostname, domain ].join('.') unless hostname.nil? and domain.nil?\n end", "def resolve_fqdn\n hostname = from_cmd(\"hostname\")\n addrinfo = Socket.getaddrinfo(hostname, nil).first\n iaddr = IPAddr.new(addrinfo[3])\n Socket.gethostbyaddr(iaddr.hton)[0]\n rescue\n nil\n end", "def get_fqdn\n return @resource[:name]\n end", "def hostname\n Rails.env.development? ? 'http://localhost:3000' : 'http://coderalert.com'\n end", "def host_name=(value)\n @hostname = value\n end", "def name\n @config.db_name.gsub(/@thismachinehostname@/, Socket.gethostname).\n gsub(/@prefix@/, prefix)\n end", "def name\n \"#{self[:host]}\"\n end", "def host\n @host ||= target.split(':',2).first\n end", "def normalized_host; end", "def target_host\n\t\tif(self.respond_to?('rhost'))\n\t\t\treturn rhost()\n\t\tend\n\n\t\tif(self.datastore['RHOST'])\n\t\t\treturn self.datastore['RHOST']\n\t\tend\n\n\t\tnil\n\tend", "def hostinfo\n return self.host.to_s + (self.port ? ':' + self.port.to_s : '')\n end", "def host_as_string; end", "def server_domain\n url = get_configuration 'server_domain', @work_type_config.dig('hydra_endpoint'), @config\n URI.parse(url.gsub(/\\/$/, ''))\n end", "def pdb_get_hostname(node_ip_hostname)\n if test_env\n node_ip_hostname = TEST_NODE_NAME\n Puppet.info(\"#{log_prefix} node_ip_hostname=#{node_ip_hostname}\")\n node_ip_hostname\n else\n Puppet.info(\"#{log_prefix} node_ip_hostname=#{node_ip_hostname}\")\n node_ip_hostname\n end\n end", "def host_url\n proto = request.env['SERVER_PROTOCOL'].downcase.index(\"https\").nil? ? \"http\" : \"https\"\n return \"#{proto}://#{request.env['HTTP_HOST']}\"\n end", "def host\n return @host\n end", "def host\n return @host\n end", "def hostname(m_configuration)\n 'http' + (m_configuration[:use_secure] ? 's' : '') + \"://\" + m_configuration[:highrise_account_name] + \".highrisehq.com/dl/avatars/person/\"\n end", "def tls_hostname; end", "def get_mysql_hostname \n @mysql_hostname = @sequel[\"SELECT @@hostname;\"].first[:@@hostname]\n end", "def get_mysql_hostname \n @mysql_hostname = @sequel[\"SELECT @@hostname;\"].first[:@@hostname]\n end", "def host\n @connection.host\n end", "def server_name\n return @forwarded_server || @config[:ServerName]\n end", "def local_host\n get('beef.http.host') || '0.0.0.0'\n end", "def dns_name\n [\"public\", fqdn].join(\".\")\n end", "def lookup_hostname(host)\n Socket.getaddrinfo(host, nil, nil, Socket::SOCK_STREAM)[0][3]\n rescue SocketError\n raise(InvalidHostname, Errstr::INVALID_HOST % host)\n end", "def getpeername\n ::Socket.sockaddr_in(port, host)\n end", "def hostname=(value)\n @hostname = value\n end" ]
[ "0.8333672", "0.8114324", "0.7988389", "0.7946411", "0.78441477", "0.78441477", "0.77882487", "0.77625924", "0.7716973", "0.7707606", "0.7681261", "0.7625978", "0.7564779", "0.7535949", "0.7526177", "0.74967456", "0.7488563", "0.7444619", "0.74378985", "0.7405823", "0.7398562", "0.7383938", "0.7379139", "0.73676383", "0.73617506", "0.73387176", "0.73133236", "0.72984123", "0.7209662", "0.7202954", "0.71878535", "0.7139855", "0.71337354", "0.70685697", "0.7051357", "0.7049442", "0.7046433", "0.7046433", "0.7037913", "0.70130455", "0.70080423", "0.6999082", "0.6986982", "0.6979402", "0.69669336", "0.6966309", "0.69622", "0.69496495", "0.69124013", "0.69085544", "0.6870778", "0.6868437", "0.68631697", "0.68198925", "0.68081725", "0.6802764", "0.6787842", "0.67803127", "0.6766614", "0.67611086", "0.6759818", "0.6751427", "0.67376465", "0.6721822", "0.66967475", "0.665456", "0.6651536", "0.6643448", "0.66329163", "0.6629027", "0.66210157", "0.658258", "0.657858", "0.6560238", "0.65271443", "0.6520392", "0.65189755", "0.6518415", "0.65101874", "0.64627737", "0.64495", "0.6445754", "0.6443619", "0.6441984", "0.6433914", "0.64305896", "0.64234316", "0.64234316", "0.64225256", "0.6417953", "0.64148396", "0.64148396", "0.6412508", "0.6410049", "0.6407189", "0.6379121", "0.6369206", "0.6361517", "0.63609576" ]
0.69291645
49
Returns the port for the DRb server.
def drb_port instance.options[:drb_port] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def port\n return @port.to_i\n end", "def port\n return @port if @port\n\n @server = TCPServer.new('127.0.0.1', 0)\n @port = @server.addr[1].to_i\n @server.close\n\n return @port\n end", "def obtain_port\n server = TCPServer.new(\"127.0.0.1\", 0)\n port = server.addr[1]\n server.close\n port\n end", "def port\n raise \"Http-server not spawned yet. Call Hayabusa#start to spawn it.\" if !@httpserv\n return @httpserv.server.addr[1]\n end", "def server_port(id = '__default__')\n @servers[id].port\n end", "def port\n @connection.port\n end", "def port\n get_value :port\n end", "def listening_port\n @dbi.endpoint.port\n end", "def listening_port\n @dbi.endpoint.port\n end", "def port\n @port ||= target.split(':',2).last.to_i\n end", "def server_port\n AgileProxy.config.server_port\n end", "def server_port ; @env['SERVER_PORT' ].to_i ; end", "def port\n @socket.connect_address.ip_port\n rescue SocketError\n # Not bound to any local port\n rescue IOError\n # Socket has been closed\n end", "def port\n configuration.port\n end", "def port\n configuration.port\n end", "def getPort()\n return @uri.port\n end", "def port\n data[:port]\n end", "def remote_port\n return @remote_port\n end", "def port\n @request_spec_server.port\n end", "def port\n request.port\n end", "def port\n connect_address.ip_port\n rescue SocketError\n # Not bound to any local port\n rescue IOError\n # Socket has been closed\n end", "def port\n @hash[\"Listen\"].to_i\n end", "def server_port; end", "def port\n p = attributes['port'].to_i\n (p == 0 ? nil : p)\n end", "def port\n nodes[0][1].to_i\n end", "def port\n self.port\n end", "def socket_port; end", "def actual_port; end", "def actual_port; end", "def getPort()\n return @port\n\tend", "def port\n return @forwarded_port || @port\n end", "def srvport\n datastore['SRVPORT']\n end", "def port\n @attributes[:port]\n end", "def port\n @options[:port]\n end", "def port\n @port\n end", "def port\n @port\n end", "def port\n @port\n end", "def db_instance_port\n data[:db_instance_port]\n end", "def local_port\n get('beef.http.port') || '3000'\n end", "def port\n ENV.fetch('PORT', 8983)\n end", "def port\n @port ||= opts.fetch(:port, parsed_uri.port)\n end", "def port\n @manager.primary_pool.port\n end", "def port\n @port ||= use_ssl ? 636 : 389\n end", "def port\n 20000 + ($$ % 40000)\n end", "def find_available_port\n server = TCPServer.new(\"127.0.0.1\", 0)\n server.addr[1]\n ensure\n server.close if server\n end", "def find_available_port\n server = TCPServer.new(FIND_AVAILABLE_PORT)\n server.addr[1]\n ensure\n server.close if server\n end", "def find_open_port\n server = TCPServer.new('127.0.0.1', 0)\n port = server.addr[1]\n server.close\n port\n end", "def rport\n datastore['RPORT']\n end", "def port\n conf['api']['port'].to_s\n end", "def base_port\n (options[:port] || env[\"PORT\"] || ENV[\"PORT\"] || 5000).to_i\n end", "def port\n @uri.port\n end", "def beef_port\n public_port || local_port\n end", "def webserver_port\n AgileProxy.config.webserver_port\n end", "def port\n 7779\n end", "def local_port\n return @local_port\n end", "def available_port\n server = TCPServer.new('0.0.0.0', 0)\n server.addr[1].tap do\n server.close\n end\n end", "def port\n @port ||= Port.new(@event.at('@port'), @event.at('@svc_name'), @event.at('@protocol'))\n end", "def port\n end", "def port\n conf['dashboard']['port'].to_s\n end", "def get_debugger_port\n throw \"Could not get devices from adb\" if @adb.getDevices.size == 0\n dev = @adb.getDevices[0]\n sleep(1)\n throw \"Could not get clients for device (#{dev})\" if dev.getClients.size == 0\n dev.getClients.each do |cli|\n $DEBUG and puts(\"Found process: #{cli}\")\n if(cli.getClientData.getDebuggerConnectionStatus.to_s == \"WAITING\")\n $DEBUG and puts(\"Found process waiting for debugger: #{cli} : #{cli.getDebuggerListenPort}\")\n return(cli.getDebuggerListenPort)\n end\n end\n throw(\"Could not find a process waiting for debugger.\")\n return(nil)\n end", "def port; end", "def port; end", "def port; end", "def port; end", "def port; end", "def port; end", "def port; end", "def port; end", "def port\n options.fetch(:port, \"8080\").to_s\n end", "def port\n conf['port'] || '80'\n end", "def random_port\n # NOTE: the BOB protocol unfortunately requires us to pick the port\n # that the BOB bridge will then proceed to bind; this introduces an\n # inherent and unavoidable race condition.\n TCPServer.open('127.0.0.1', 0) { |server| server.addr[1] }\n end", "def true_port\r\n port = servlet_response.getLocalPort\r\n $log.debug(\"True port is #{port}\")\r\n port\r\n end", "def port\n unless defined?(@port)\n @port = solr_url.port if solr_url\n @port ||= user_configuration_from_key('solr', 'port')\n @port ||= default_port\n @port = @port.to_i\n end\n @port\n end", "def port\n if @port == DEFAULT_HTTP_PORT\n DEFAULT_SSL_PORT\n else\n @port\n end\n end", "def port; config[:port]; end", "def get_open_port\n socket = Socket.new(:INET, :STREAM, 0)\n socket.bind(Addrinfo.tcp(\"127.0.0.1\", 0))\n port = socket.local_address.ip_port\n socket.close\n port\n end", "def port\n @port || (secure ? 443 : 80)\n end", "def default_port\n data.default_port\n end", "def port_string; end", "def port\n if !block_given?\n return @j_del.java_method(:port, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling port()\"\n end", "def rport; datastore['RPORT']; end", "def port(opts={})\n # Check if port was specified in options hash\n pnum = opts[:port]\n return pnum if pnum\n\n # Check if we have an SSH forwarded port\n pnum = nil\n env.vm.vm.network_adapters.each do |na|\n pnum = na.nat_driver.forwarded_ports.detect do |fp|\n fp.name == env.config.ssh.forwarded_port_key\n end\n\n break if pnum\n end\n\n return pnum.hostport if pnum\n\n # This should NEVER happen.\n raise Errors::SSHPortNotDetected\n end", "def default_httpd_port\n if monit_version && UNIXSOCKET_VERSION.satisfied_by?(monit_version)\n monit_name_path('/var/run/%{name}.sock')\n else\n 2812\n end\n end", "def get_def_cqlsh_port()\n cassandra_home = node.default[:cassandra_home]\n cassandra_current = \"#{cassandra_home}/current\"\n yaml_file = \"#{cassandra_current}/conf/cassandra.yaml\"\n\n if node.workorder.has_key?(\"rfcCi\")\n ci = node.workorder.rfcCi.ciAttributes\n else\n ci = node.workorder.ci.ciAttributes\n end\n\n ver = ci.version.to_f\n yaml = YAML::load_file(yaml_file)\n\n if ver >= 2.1\n port = yaml['native_transport_port']\n else\n port = yaml['rpc_port']\n end\n return port\n end", "def ssh_port\n max_adapters = machine.parent.system_properties.get_max_network_adapters(machine.chipset_type)\n\n max_adapters.times do |i|\n adapter = machine.get_network_adapter(i)\n\n port_details = adapter.nat_driver.redirects.detect do |redirect|\n redirect.split(',').first == 'ssh'\n end\n\n if port_details\n return port_details.split(',')[3]\n end\n end\n\n nil\n end", "def client_port\n host_settings['client_port']\nend", "def port\n @port ||=\n if user_configuration.has_key?('solr')\n user_configuration['solr']['port']\n end || 8983\n end", "def port=(v)\n check_port(v)\n set_port(v)\n port\n end", "def default_port\n transport.default_port\n end", "def test_server_port\n 3000\n end", "def port\n @port || 161\n end", "def local_port\n socket = Socket.new(:INET, :STREAM, 0)\n socket.bind(Addrinfo.tcp(\"127.0.0.1\", 0))\n port = socket.local_address.ip_port\n socket.close\n port\n end", "def get_port(port)\n send_request(FUNCTION_GET_PORT, [port], 'k', 1, 'C')\n end", "def port(p)\n @config[:port] = p\n end", "def find_port(port)\n port += 1 while port_bound?('127.0.0.1', port)\n port\nend", "def findPort()\n # this is REALLY ugly\n port = @config['startPort']\n while true\n good = true\n #self.class.each { |v|\n # if (v.port == port)\n # good = false\n # break\n # end\n #}\n # Retrieve the list of all Daemons running\n if (@@inst[self.class] != nil)\n @@inst[self.class].each_value { |value|\n # For each Daemon, check its used port compared to our candidate one\n if (value.port == port)\n good = false\n break\n end\n }\n end\n if (good)\n begin\n info \"Checking port TCP:#{port}...\"\n serv = TCPServer.new(port)\n rescue\n good = false\n info \"Port TCP:#{port} is in use!\"\n else\n serv.close\n info \"Port TCP:#{port} is free!\"\n begin\n info \"Checking port UDP:#{port}...\"\n serv = UDPSocket.new\n\t serv.bind(nil,port)\n rescue\n good = false\n info \"Port UDP:#{port} is in use!\"\n else\n serv.close\n info \"Port UDP:#{port} is free!\"\n\t end\n end\n end\n return port if (good)\n # The candidate port is already used, increase it and loop again...\n port += 1\n end\n end", "def searchkick_port\n return nil unless @@url.is_valid_searchkick_url?\n\n port = @@url[/:([0-9]{0,5}$)/, 1]\n return port.to_i if port.present?\n nil\n end", "def port=(_); end", "def standard_port; end" ]
[ "0.78573924", "0.7751077", "0.7741788", "0.7621609", "0.7609246", "0.7569713", "0.7567313", "0.7535585", "0.7535585", "0.7478608", "0.74193746", "0.7378621", "0.73672485", "0.73563725", "0.73563725", "0.7347567", "0.72674215", "0.72454524", "0.72010654", "0.71956474", "0.7182592", "0.7169564", "0.71317154", "0.71262985", "0.7120415", "0.7117632", "0.71139914", "0.70535994", "0.70535994", "0.7045138", "0.7013581", "0.7002671", "0.6976719", "0.6967531", "0.69672406", "0.69672406", "0.69672406", "0.69623876", "0.6927058", "0.69190454", "0.6876088", "0.6867244", "0.68614364", "0.6853088", "0.68447953", "0.6840344", "0.68102556", "0.6787927", "0.6770631", "0.67613435", "0.6758839", "0.6712679", "0.67120034", "0.6701071", "0.6684786", "0.66615576", "0.6651413", "0.6649312", "0.66356385", "0.6609231", "0.66068524", "0.66068524", "0.66068524", "0.66068524", "0.66068524", "0.66068524", "0.66068524", "0.66068524", "0.65836614", "0.65812814", "0.6558648", "0.65439016", "0.6543707", "0.6542145", "0.65414995", "0.65315646", "0.65277874", "0.64970666", "0.64841366", "0.648113", "0.6472556", "0.64412636", "0.6422607", "0.642218", "0.6350524", "0.632466", "0.6321256", "0.63039434", "0.629212", "0.6290257", "0.62714195", "0.6238142", "0.62015134", "0.6180836", "0.61782706", "0.61734384", "0.6145713", "0.6138347", "0.61052" ]
0.777007
2
Returns the height for the fake terminal in the DRb server.
def drb_height instance.options[:drb_height] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height\n Terminal.height\n end", "def terminal_height\n terminal_size.last\n end", "def terminal_height; end", "def terminal_height; end", "def height\n `#{clientRect}.height`\n end", "def terminal_size\n m_GetStdHandle = Win32API.new( 'kernel32',\n 'GetStdHandle',\n ['L'],\n 'L' )\n m_GetConsoleScreenBufferInfo = Win32API.new(\n 'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L'\n )\n\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = m_GetStdHandle.call(0xFFFFFFF5)\n \n m_GetConsoleScreenBufferInfo.call(stdout_handle, buf)\n bufx, bufy, curx, cury, wattr,\n left, top, right, bottom, maxx, maxy = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end", "def terminal_size\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = WinAPI.GetStdHandle(0xFFFFFFF5)\n\n WinAPI.GetConsoleScreenBufferInfo(stdout_handle, buf)\n _, _, _, _, _,\n left, top, right, bottom, _, _ = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end", "def max_height\n FFI::NCurses.getmaxy FFI::NCurses.stdscr\n end", "def terminal_size\n if /solaris/ =~ RUBY_PLATFORM and\n `stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/\n [$2, $1].map { |c| x.to_i }\n else\n `stty size`.split.map { |x| x.to_i }.reverse\n end\n end", "def height\n lines.size\n end", "def height\n lines.size\n end", "def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end", "def height\n @screenplay.line_height * @lines.size\n end", "def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end", "def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end", "def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end", "def height\n @dimensions.y\n end", "def height\n return nil unless @height\n if @height < 0\n return ((FFI::NCurses.LINES + @height) - self.row) + 1\n #return (FFI::NCurses.LINES + @height) \n end\n @height\n end", "def browser_height\n @browser_height\n end", "def height\n return data.height\n end", "def display_height\n (display_width.to_f / width.to_f) * height\n end", "def display_height\n (display_width.to_f / width.to_f) * height\n end", "def display_height\n (display_width.to_f / width.to_f) * height\n end", "def height\n memoized_info[:height]\n end", "def formatted_height\n '000'\n end", "def terminal_size; end", "def terminal_size; end", "def height\r\n assert_exists\r\n return @o.invoke(\"height\").to_s\r\n end", "def height\n return @height\n end", "def get_terminal_size\n terminal_size ||= {}\n if ENV[\"LINES\"] && ENV[\"COLUMNS\"]\n terminal_size[\"lines\"] = ENV[\"LINES\"]\n terminal_size[\"columns\"] = ENV[\"COLUMNS\"]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && shell_command_exists?('tput')\n terminal_size[\"lines\"] = `tput lines`.strip.to_i\n terminal_size[\"columns\"] = `tput cols`.strip.to_i\n elsif STDIN.tty? && shell_command_exists?('stty')\n terminal_size[\"lines\"], terminal_size[\"columns\"] = `stty size`.strip.split(/\\s/).map(&:to_i)\n else\n terminal_size[\"lines\"], terminal_size[\"columns\"] = 40, 90\n end\n terminal_size\n end", "def height\n line_count = layout.line_count\n h = (line_count - 1) * layout.spacing\n line_count.times do |i|\n h += layout.get_line_bounds(i).height\n end\n h\n end", "def get_space_height\n return get_keyword_value(\"SPACE-HEIGHT\").to_f\n end", "def terminal_size\n if JRUBY_VERSION =~ /^1.7/\n [ @java_terminal.get_width, @java_terminal.get_height ]\n else\n [ @java_terminal.getTerminalWidth, @java_terminal.getTerminalHeight ]\n end\n end", "def window_height\n base_height = (wb = current_window_builder)[5] + wb[-1]\n base_height + default_line_height * line_number\n end", "def base_height; 24; end", "def base_height; 24; end", "def get_height\n return get_keyword_value(\"FLOOR-HEIGHT\").to_f\n end", "def height\n @height || 100\n end", "def get_ScreenHeight\n System::get_property('screen_height')\n end", "def height(path)\n io_for(path).height\n end", "def height\n dimensions()[:y]\n end", "def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map{ |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def box_height\n return line_height + 104 + line_height * (@params.size + 1)\n end", "def line_height\n return @common.lineHeight\n end", "def height\n @grpc.height\n end", "def height\n (self.width.to_f * (9.to_f/16.to_f)).to_i\n end", "def height\n attr('height')\n end", "def terminal_size\n if /solaris/ =~ RUBY_PLATFORM && (`stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/)\n w, r = [$2, $1]\n else\n w, r = `stty size`.split.reverse\n end\n w = `tput cols` unless w # last ditch effort to at least get width\n\n w = w.to_i if w\n r = r.to_i if r\n\n return w, r\n end", "def output_cols\n return 80 unless @output.tty?\n terminal.terminal_size.first\n rescue NoMethodError\n return 80\n end", "def height\n size.first\n end", "def height\n size.first\n end", "def height\n\t\treturn @height\n\tend", "def height(lines=1)\n return @font.height * lines + 4 # Where's this magic '4' come from?\n end", "def height\n options[:height] || Config.height\n end", "def height\n metadata[:height] if valid?\n end", "def height\n size_a[1]\n end", "def terminal_width\n terminal_size.first\n end", "def pixel_height\n @sensor_height / @height_in_pixels\n end", "def height()\n 0\n end", "def height\n @alive ? @height.round(1) : \"A dead tree is not very tall. :(\"\n end", "def terminal_width; end", "def terminal_width; end", "def retrieve_terminal_width\n ts = TerminalSize::TerminalSize.new()\n @width = ts.columns - @entry_size - 3\n end", "def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def contents_height\n Graphics.height\n end", "def height\n if clear_border?\n geometry.height\n\n else\n border.height\n\n end\n end", "def cursor_height\n return Font.default_size\n end", "def size_from_stty\n return unless @output.tty? && command_exist?(\"stty\")\n\n out = run_command(\"stty\", \"size\")\n return unless out\n\n size = out.split.map(&:to_i)\n size if nonzero_column?(size[1])\n end", "def height\n dimensions.last\n end", "def terminal_dimensions\n [0, 0] unless STDOUT.tty?\n [80, 40] if OS.windows?\n\n if ENV['COLUMNS'] && ENV['LINES']\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif ENV['TERM'] && command_in_path?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif command_in_path?('stty')\n `stty size`.scan(/\\d+/).map {|s| s.to_i }\n else\n [0, 0]\n end\n rescue\n [0, 0]\n end", "def line_height\n TDD::ABF::SETTINGS::OVERRIDE_LINE_HEIGHT[name] || @info[:lineHeight]\n end", "def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\nrescue\n nil\nend", "def height\n @font.height\n end", "def height\n return 0 if @root.nil?\n return hegiht_helper(@root)\n end", "def height\n @height\n end", "def height\n instance.options[:height]\n end", "def window_height\n return ACTOR_WINDOW_HEIGHT\n end", "def height\n\t\tnode['height']\n\tend", "def size_from_readline(verbose: false)\n require \"readline\" unless defined?(::Readline)\n\n return unless ::Readline.respond_to?(:get_screen_size)\n\n size = ::Readline.get_screen_size\n size if nonzero_column?(size[1])\n rescue LoadError\n warn \"no readline gem\" if verbose\n rescue NotImplementedError\n end", "def get_terminal_width\n if (ENV['COLUMNS'] =~ /^\\d+$/)\n ENV['COLUMNS'].to_i\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n `tput cols`.to_i\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse[0]\n else\n 80\n end\n rescue\n 80\n end", "def cursor_height\n if @segments.first.text.empty?\n # Heights are off for empty text layouts. Fake it to make it (it\n # being a real height).\n new_segment = TextSegment.new(@dsl, \"Hi\", 100)\n height_from_segment(new_segment)\n else\n height_from_segment(@segments.first)\n end\n end", "def height\n @rows * @block_size\n end", "def height\n top + bottom\n end", "def size\n $stdout.winsize.reverse rescue [80,25]\n end", "def pixelheight\n end", "def window_height\n end", "def height \n @height || text_area_height + 2*@vertical_padding\n end", "def contents_height\n height - standard_padding * 2\n end", "def height()\n @view__.height\n end", "def window_height\n fitting_height(11)\n end", "def window_height\n fitting_height(11)\n end", "def window_height\n fitting_height(11)\n end", "def height\n content.size\n end", "def window_height\n Graphics.height - under_help - @keys_window.height\n end", "def height_calc\n lines = [@data.length, page_row_max].min rescue page_row_max\n return lines * line_height + standard_padding * 2\n end", "def height_calc\n lines = [@data.length, page_row_max].min rescue page_row_max\n return lines * line_height + standard_padding * 2\n end", "def contents_height\n h = height - standard_padding * 2\n h + (@item_max * line_height)\n end", "def height; end" ]
[ "0.81953776", "0.81500757", "0.7879972", "0.7879972", "0.6810739", "0.670882", "0.66298324", "0.65752274", "0.657413", "0.6557479", "0.6557479", "0.6541053", "0.65252703", "0.6478256", "0.6478256", "0.6466753", "0.64069104", "0.63990843", "0.6390148", "0.6354114", "0.6345416", "0.6345416", "0.6345416", "0.6319779", "0.6318789", "0.6315775", "0.6315775", "0.63012254", "0.6299423", "0.629308", "0.6290456", "0.6278846", "0.62714434", "0.6270489", "0.6264434", "0.6264434", "0.6260211", "0.6259202", "0.62521225", "0.62519515", "0.6244924", "0.624486", "0.62430114", "0.62116295", "0.6207121", "0.6193827", "0.61814684", "0.61713696", "0.61533695", "0.615052", "0.61492795", "0.61492795", "0.6141479", "0.61062986", "0.60982126", "0.60890704", "0.6075807", "0.60616946", "0.6057604", "0.60554385", "0.6047246", "0.6044565", "0.6044565", "0.6031173", "0.6026589", "0.60232574", "0.60154074", "0.60074246", "0.60064024", "0.599323", "0.5987447", "0.59841293", "0.59776235", "0.59572166", "0.5949843", "0.59466434", "0.5945871", "0.5933551", "0.59283775", "0.5926423", "0.5918238", "0.5902215", "0.5877672", "0.58676803", "0.58661646", "0.5850075", "0.58345234", "0.582843", "0.5827165", "0.58219004", "0.581755", "0.581755", "0.581755", "0.5814092", "0.58093894", "0.5809344", "0.5809344", "0.58071077", "0.58050346" ]
0.6467048
16
Returns the width for the fake terminal in the DRb server.
def drb_width instance.options[:drb_width] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def terminal_width\n terminal_size.first\n end", "def width\n Terminal.width\n end", "def terminal_width\n TerminalWidthCalculator.calculate\n end", "def terminal_width\n TerminalWidthCalculator.calculate\n end", "def retrieve_terminal_width\n ts = TerminalSize::TerminalSize.new()\n @width = ts.columns - @entry_size - 3\n end", "def terminal_width; end", "def terminal_width; end", "def terminal_width\n return 80 unless unix?\n\n result = dynamic_width\n (result < 20) ? 80 : result\n rescue\n 80\n end", "def terminal_width\n return 80 unless unix?\n\n result = dynamic_width\n (result < 20) ? 80 : result\n rescue\n 80\n end", "def terminal_width\n if ENV['THOR_COLUMNS']\n result = ENV['THOR_COLUMNS'].to_i\n else\n result = unix? ? dynamic_width : 80\n end\n (result < 10) ? 80 : result\n rescue\n 80\n end", "def get_terminal_width\n if (ENV['COLUMNS'] =~ /^\\d+$/)\n ENV['COLUMNS'].to_i\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n `tput cols`.to_i\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse[0]\n else\n 80\n end\n rescue\n 80\n end", "def terminal_width\n @terminal_width ||= (ENV[\"COLUMNS\"] || 80).to_i\nend", "def terminal_size\n if /solaris/ =~ RUBY_PLATFORM and\n `stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/\n [$2, $1].map { |c| x.to_i }\n else\n `stty size`.split.map { |x| x.to_i }.reverse\n end\n end", "def terminal_size\n m_GetStdHandle = Win32API.new( 'kernel32',\n 'GetStdHandle',\n ['L'],\n 'L' )\n m_GetConsoleScreenBufferInfo = Win32API.new(\n 'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L'\n )\n\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = m_GetStdHandle.call(0xFFFFFFF5)\n \n m_GetConsoleScreenBufferInfo.call(stdout_handle, buf)\n bufx, bufy, curx, cury, wattr,\n left, top, right, bottom, maxx, maxy = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end", "def terminal_size\n if /solaris/ =~ RUBY_PLATFORM && (`stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/)\n w, r = [$2, $1]\n else\n w, r = `stty size`.split.reverse\n end\n w = `tput cols` unless w # last ditch effort to at least get width\n\n w = w.to_i if w\n r = r.to_i if r\n\n return w, r\n end", "def terminal_size; end", "def terminal_size; end", "def term_width\n return @@terminal_width unless @terminal_width == nil\n begin\n require 'terminfo'\n @@terminal_width = TermInfo.screen_width - 1\n rescue\n @@terminal_width = 79\n end\n end", "def terminal_height; end", "def terminal_height; end", "def get_width\n # FIXME: I don't know how portable it is.\n default_width = 80\n begin\n tiocgwinsz = 0x5413\n data = [0, 0, 0, 0].pack(\"SSSS\")\n if @out.ioctl(tiocgwinsz, data) >= 0 then\n #rows, cols, xpixels, ypixels = data.unpack(\"SSSS\")\n cols = data.unpack(\"SSSS\")[1]\n if cols >= 0 then cols else default_width end\n else\n default_width\n end\n rescue Exception\n default_width\n end\n end", "def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end", "def terminal_height\n terminal_size.last\n end", "def console_width\n @console_width ||= infer_console_width\n end", "def height\n Terminal.height\n end", "def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end", "def display_width\n @width ||= begin\n require 'curses'\n Curses.init_screen\n x = Curses.cols\n Curses.close_screen\n x\n rescue\n HELP_WIDTH\n end\n @width - HELP_INDENT\n end", "def terminal_size\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = WinAPI.GetStdHandle(0xFFFFFFF5)\n\n WinAPI.GetConsoleScreenBufferInfo(stdout_handle, buf)\n _, _, _, _, _,\n left, top, right, bottom, _, _ = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end", "def window_width\n $game_system.macmm_command_width\n end", "def determine_console_width(total_width)\n [[total_width / 4, 120].min, 80].max\nend", "def output_cols\n return 80 unless @output.tty?\n terminal.terminal_size.first\n rescue NoMethodError\n return 80\n end", "def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map{ |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def winsize; IO.console.winsize end", "def infer_console_width\n interactive? ? interaction_highline.output_cols-3 : 80\n end", "def screen_width\n @screen_width ||= begin\n `tput cols`.chomp.to_i\n rescue\n 80\n end\n end", "def terminal_dimensions\n [0, 0] unless STDOUT.tty?\n [80, 40] if OS.windows?\n\n if ENV['COLUMNS'] && ENV['LINES']\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif ENV['TERM'] && command_in_path?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif command_in_path?('stty')\n `stty size`.scan(/\\d+/).map {|s| s.to_i }\n else\n [0, 0]\n end\n rescue\n [0, 0]\n end", "def window_width\n return COMMAND_WINDOW_WIDTH\n end", "def terminal_size\n if JRUBY_VERSION =~ /^1.7/\n [ @java_terminal.get_width, @java_terminal.get_height ]\n else\n [ @java_terminal.getTerminalWidth, @java_terminal.getTerminalHeight ]\n end\n end", "def size\n $stdout.winsize.reverse rescue [80,25]\n end", "def screen_width(out=STDERR)\n default_width = ENV['COLUMNS'] || 76\n begin\n tiocgwinsz = 0x5413\n data = [0, 0, 0, 0].pack(\"SSSS\")\n if out.ioctl(tiocgwinsz, data) >= 0 then\n rows, cols, xpixels, ypixels = data.unpack(\"SSSS\")\n if cols >= 0 then cols else default_width end\n else\n default_width\n end\n rescue Exception\n default_width\n end\n end", "def prefix_width\n CLI::UI::ANSI.printing_width(prefix)\n end", "def length\n length = width\n end", "def get_terminal_size\n terminal_size ||= {}\n if ENV[\"LINES\"] && ENV[\"COLUMNS\"]\n terminal_size[\"lines\"] = ENV[\"LINES\"]\n terminal_size[\"columns\"] = ENV[\"COLUMNS\"]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && shell_command_exists?('tput')\n terminal_size[\"lines\"] = `tput lines`.strip.to_i\n terminal_size[\"columns\"] = `tput cols`.strip.to_i\n elsif STDIN.tty? && shell_command_exists?('stty')\n terminal_size[\"lines\"], terminal_size[\"columns\"] = `stty size`.strip.split(/\\s/).map(&:to_i)\n else\n terminal_size[\"lines\"], terminal_size[\"columns\"] = 40, 90\n end\n terminal_size\n end", "def width\r\n assert_exists\r\n return @o.invoke(\"width\").to_s\r\n end", "def columns; IO.console.winsize[1] rescue 80; end", "def width\n `#{clientRect}.width`\n end", "def get_width; end", "def max_width\n FFI::NCurses.getmaxx FFI::NCurses.stdscr\n end", "def windows_width\n Graphics.width / 2 + 10 # + 64\n end", "def size\n console.winsize\n end", "def size_from_stty\n return unless @output.tty? && command_exist?(\"stty\")\n\n out = run_command(\"stty\", \"size\")\n return unless out\n\n size = out.split.map(&:to_i)\n size if nonzero_column?(size[1])\n end", "def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def winsize\n $stdout.winsize\nend", "def width\n string = to_s\n max_width = 0\n string.each_line do |line|\n max_width = [max_width, line.uncolored.chomp.size].max\n end\n max_width\n end", "def detect_terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\nrescue\n nil\nend", "def width(path)\n io_for(path).width\n end", "def _rl_get_screen_size(tty, ignore_env)\r\n\r\n if @hConsoleHandle\r\n csbi = 0.chr * 24\r\n @GetConsoleScreenBufferInfo.Call(@hConsoleHandle,csbi)\r\n wc,wr = csbi[0,4].unpack('SS')\r\n # wr,wc, = `mode con`.scan(/\\d+\\n/).map{|x| x.to_i}\r\n @_rl_screenwidth = wc\r\n @_rl_screenheight = wr\r\n else\r\n wr, wc = 0\r\n retry_if_interrupted do\r\n wr, wc = `stty size`.split(' ').map { |x| x.to_i }\r\n end\r\n @_rl_screenwidth = wc\r\n @_rl_screenheight = wr\r\n if ignore_env==0 && ENV['LINES']\r\n @_rl_screenheight = ENV['LINES'].to_i\r\n end\r\n if ignore_env==0 && ENV['COLUMNS']\r\n @_rl_screenwidth = ENV['COLUMNS'].to_i\r\n end\r\n end\r\n\r\n # If all else fails, default to 80x24 terminal.\r\n if @_rl_screenwidth.nil? || @_rl_screenwidth <= 1\r\n @_rl_screenwidth = 80\r\n end\r\n if @_rl_screenheight.nil? || @_rl_screenheight <= 0\r\n @_rl_screenheight = 24\r\n end\r\n # If we're being compiled as part of bash, set the environment\r\n # variables $LINES and $COLUMNS to new values. Otherwise, just\r\n # do a pair of putenv () or setenv () calls.\r\n sh_set_lines_and_columns(@_rl_screenheight, @_rl_screenwidth)\r\n\r\n if !@_rl_term_autowrap\r\n @_rl_screenwidth-=1\r\n end\r\n @_rl_screenchars = @_rl_screenwidth * @_rl_screenheight\r\n end", "def to_s_auto \n width = Terminal.terminal_width\n end", "def window_width() Graphics.width - 128 end", "def window_width\n Graphics.width / 2\n end", "def width\n size.last\n end", "def width\n size.last\n end", "def size\n size = from_io_console\n size ||= from_readline\n size ||= from_tput\n size ||= from_stty\n size ||= from_env\n size ||= from_ansicon\n size || default_size\n end", "def width\n chars.inject(0) { |length, char| length + (char.bytesize == 1 ? 1 : 2) }\n end", "def width\n #@font.text_width(self.text)\n return 200\n end", "def getWidth\n @width\n end", "def getWidth\n @width\n end", "def get_col_widths()\n w_name = 0\n w_serial = 0\n\n $devices[:connected].each { |dev|\n next if dev[:disabled]\n next if not is_selected(dev)\n\n l_name = dev[:name].length\n w_name = l_name if l_name > w_name\n\n if $verbose\n l_serial = dev[:serial].length\n w_serial = l_serial if l_serial > w_serial\n end\n }\n\n if $verbose\n return [ w_name, w_serial + 1 ]\n end\n return w_name\nend", "def columns\n IO.console.winsize.last\n end", "def width\n barcode.encoding.length * xdim\n end", "def size_from_readline(verbose: false)\n require \"readline\" unless defined?(::Readline)\n\n return unless ::Readline.respond_to?(:get_screen_size)\n\n size = ::Readline.get_screen_size\n size if nonzero_column?(size[1])\n rescue LoadError\n warn \"no readline gem\" if verbose\n rescue NotImplementedError\n end", "def calc_width; Graphics.width; end", "def width\n return @width\n end", "def natural_width\n renderer.column_widths.inject(0, &:+) + border_size + padding_size\n end", "def getWidth\n @width\n end", "def display_width(string)\n Unicode::DisplayWidth.of(Strings::ANSI.sanitize(string))\n end", "def display_width(string)\n Unicode::DisplayWidth.of(Strings::ANSI.sanitize(string))\n end", "def width\n @dsl.opts[:width]\n end", "def console_col_size\n IO.console.winsize[1]\n end", "def width(str)\n str.length\n end", "def width(str)\n str.length\n end", "def getWidth\n @width\n end", "def console_width=(width)\n @console_width = width\n end", "def width\n @width || Vedeu.width\n end", "def getWidth\n @width\n end", "def width\n @width\n end", "def window_width\n return CONTROL_WINDOW_WIDTH \n end", "def max_width\n breakpoints.last ? breakpoints.last.id.to_s.length : 1\n end", "def width; end", "def width; end", "def width; end", "def width; end", "def width; end", "def width; end", "def width; end", "def width; end", "def width; end", "def from_stty\n return unless output.tty?\n size = run_command('stty', 'size').split.map(&:to_i)\n size if nonzero_column?(size[1])\n rescue Errno::ENOENT\n end" ]
[ "0.81788385", "0.81221664", "0.80832714", "0.80832714", "0.8067197", "0.8058721", "0.8058721", "0.8049164", "0.80297434", "0.79175663", "0.7636462", "0.7485408", "0.7287358", "0.7211136", "0.71877944", "0.71762216", "0.71762216", "0.71291876", "0.7061458", "0.7061458", "0.70470357", "0.7033078", "0.7026142", "0.70257556", "0.70086616", "0.6996508", "0.69957566", "0.6939617", "0.68622017", "0.6792178", "0.67583406", "0.6716157", "0.67146534", "0.6653214", "0.6630636", "0.66154903", "0.661123", "0.6600418", "0.6599109", "0.6569154", "0.65484244", "0.6516231", "0.6448914", "0.6445155", "0.64422846", "0.6439318", "0.64365035", "0.6420749", "0.64091563", "0.63940716", "0.6377125", "0.63523674", "0.6349818", "0.6349018", "0.63477284", "0.63112575", "0.62986594", "0.6263482", "0.62628275", "0.6246168", "0.6241836", "0.61898315", "0.61898315", "0.61833644", "0.6175267", "0.616783", "0.61386454", "0.61386454", "0.6137679", "0.6133551", "0.61121553", "0.6101035", "0.6093167", "0.60901886", "0.60860735", "0.60761315", "0.6071322", "0.6071322", "0.60610753", "0.6059542", "0.6048244", "0.6048244", "0.6045411", "0.6035901", "0.6029585", "0.60271394", "0.6019219", "0.60187685", "0.6013845", "0.60077775", "0.60077775", "0.60077775", "0.60077775", "0.60077775", "0.60077775", "0.60077775", "0.60077775", "0.60077775", "0.6003555" ]
0.64504623
43
Return the configured foreground colour for the client application.
def foreground instance.options[:foreground] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def context_get_fgcolor()\n return $gimp_iface.gimp_context_get_foreground()[0]\nend", "def fg(c)\n return self unless ANSI_COLORS[c]\n return colorize(ANSI_COLORS[c])\n end", "def foreground(color=nil)\n @options[:foreground] = color unless color.nil?\n @options[:foreground]\n end", "def color\n @color || $def_fg_color\n end", "def foreground=(value)\n @foreground = Vedeu::Colours::Foreground.coerce(value)\n end", "def foreground_fill\n red = background_fill[1..2].to_i(16)\n green = background_fill[3..4].to_i(16)\n blue = background_fill[5..6].to_i(16)\n (red * 0.299 + green * 0.587 + blue * 0.114) > 186 ? '#000000' : '#FFFFFF'\n end", "def system_color\n return Color.new(255,255,0)\n end", "def context_get_bgcolor()\n return $gimp_iface.gimp_context_get_background()[0]\nend", "def foreground(fgcolor)\n fgcolor.split(/\\s+/).collect { |fg| names_to_code(fg) }.join(\"\")\n end", "def system_color\n return Color.new(192, 224, 255)\n end", "def receipt_bgcolor\n get_attribute(Yoti::Attribute::APPLICATION_RECEIPT_BGCOLOR)\n end", "def alt_heading_colour\n if self.theme.background_colour == Color::RGB::White.html\n self.palette.foreground_dark\n else\n self.palette.foreground_light\n end\n end", "def foreground_color(index)\n \"\\e[38;5;#{index}m\"\nend", "def colour_mode\n instance.options[:colour_mode]\n end", "def colour_mode\n instance.options[:colour_mode]\n end", "def default_color\n return current_layout.default_color\n end", "def default_colour\n\t\t\tOmniboard::Colour.new(0).standard\n\t\tend", "def foreground\n server.remote_expr(\"foreground()\")\n end", "def _context_set_fgcolor!(rgb)\n $gimp_iface.gimp_context_set_foreground(rgb)\nend", "def on_49(_) { fg: fg_color(9) } end", "def bgColor\n return @bg_color\n end", "def background_color\n return @peer.background_color\n end", "def determine_color_scheme\n @default_options.color_scheme = @highline.choose do |menu|\n menu.layout = :one_line\n menu.select_by = :name\n menu.header = nil\n menu.prompt = \"What color scheme would you like? \"\n menu.choice(\"none\") { :none }\n menu.choice(\"dark terminal background\") { :dark_bg }\n menu.choice(\"light terminal background\") { :light_bg }\n end\n end", "def get_fg(str)\n\treturn Color.get_t(\"fg\")[str]\nend", "def detect_colour_mode\n case ENV['TERM']\n when /-truecolor$/ then 16_777_216\n when /-256color$/, 'xterm' then 256\n when /-color$/, 'rxvt' then 16\n else 256\n end\n end", "def detect_colour_mode\n case ENV['TERM']\n when /-truecolor$/ then 16_777_216\n when /-256color$/, 'xterm' then 256\n when /-color$/, 'rxvt' then 16\n else 256\n end\n end", "def backgroundColor\n if self.highest?\n \"#ff884d\"\n elsif self.high?\n \"#ffcc80\"\n else\n \"#ffefcc\"\n end\n end", "def background_colour\n @cr[0xf] >> 4\n end", "def actual_color\n ColorCode.where(numeric_code: default_code.split(\"-\")[-2])[0]\n end", "def bgcolor\n @bgcolor || $def_bg_color\n end", "def colors\n Outpost::Config.instance.colors\n end", "def heading_colour\n palette.foreground\n end", "def kiosk_mode_require_color_inversion\n return @kiosk_mode_require_color_inversion\n end", "def blue\n Color.new(80, 0, 67, 88)\n end", "def display_color\n if @deleted\n return '#FF0000' # Red\n elsif !@enabled\n return '#AAAAAA' # Gray\n end\n \n '#000000'\n end", "def default_color\n return translate_color(current_layout.default_color)\n end", "def stream_colour\n return interface.colour if name\n\n default[:colour]\n end", "def color\n @color ||= color_scope.first\n end", "def get_color\n @color\n end", "def border_colour\n @cr[0xf] & 0x07\n end", "def background_color\n ::Color::RGB.from_applescript(advanced_typing_apparatus.background_color).html\n end", "def background_color\n @background_color ||= [0, 0, 0]\n end", "def light_colour\n\t\t\tOmniboard::Colour.new(0).light\n\t\tend", "def textColor\n return @text_color\n end", "def get_color(key)\n if key.is_a? String\n color = key\n elsif Wirb::COLORS.key?(key)\n color = Wirb::COLORS[key]\n end\n\n color ? \"\\033[#{ color }m\" : ''\n end", "def color_to_use\n return :no_bg_color if value == :none\n value =~ /^on_/ ? value : \"on_#{value}\".to_sym\n end", "def set_fg\n STDOUT.write \"\\033[38;5;#{to_xterm}m\"\n end", "def getColor(theColor, default = 'gray')\n preset = Proc.new do |color|\n case color\n when 'windowBackground' then return NSColor.windowBackgroundColor # 0.93\n when 'textColor' then return NSColor.textColor # 0.0\n when 'backgroundColor' then return NSColor.textBackgroundColor # 1.0\n when 'clear' then return NSColor.clearColor\n else color\n end\n end\n if preset.call(theColor) == 'box' # box fill color doesn't have a system color\n dark = !NSAppearance.currentAppearance.name.to_s.index('Dark').nil?\n rgb = dark ? [0.12, 0.12, 0.12] : [0.89, 0.89, 0.89]\n else # get the specified color or default - no dark mode swaps are performed\n rgb = COLORS[preset.call(default)] if (rgb = COLORS[theColor]).nil?\n end\n rgb = [0.5, 0.5, 0.5] if rgb.nil? # get gray if nothing else has worked\n NSColor.colorWithSRGBRed( rgb[0],\n green: rgb[1],\n blue: rgb[2],\n alpha: 1.0 )\n end", "def color( *val )\n if val.empty?\n return @color if @color\n return @form.color if @form\n return $def_fg_color\n else\n @color_pair = nil\n return property_set :color, val\n end\n end", "def yellow\n colorize \"\\033[33m\"\n end", "def background_color\n return @background_color\n end", "def color\n fetch('creature.bird.colors')\n end", "def font_color()\n validate_worksheet\n if @workbook.fonts[font_id()][:font][:color].nil?\n '000000' #black\n else\n @workbook.fonts[font_id()][:font][:color][:attributes][:rgb]\n end\n end", "def chco\n (foreground || \"FFFFFF\") + \",\" + super\n end", "def ListView_GetBkColor(hwnd) send_listview_message(hwnd, :GETBKCOLOR) end", "def Pager_GetBkColor(hwnd) send_pager_message(hwnd, :GETBKCOLOR) end", "def default_color_profile\n self.default_options[:color_profile].presence\n end", "def back_color1\n Color.new(0, 0, 0, 192)\n end", "def foreground?\n !!self.foreground\n end", "def knockout_color\n return Color.new(255, 64, 0)\n end", "def color?\n ##Chef::Config[:color] && stdout.tty? && !Chef::Platform.windows?\n :red\n end", "def foreground(*values); end", "def foreground(*values); end", "def gauge_back_color\n return Color.new(120,120,120)\n end", "def default_use_color\n if HighLine.default_instance\n HighLine.default_instance.use_color\n else\n true\n end\n end", "def color(color_code)\n colors = color_code.scan(/\\d+/)\n\n # Extended set foreground x-term color\n if colors[0] == \"38\" && colors[1] == \"5\"\n return @fg_color = \"term-fgx#{colors[2]}\"\n end\n\n # Extended set background x-term color\n if colors[0] == \"48\" && colors[1] == \"5\"\n return @bg_color = \"term-bgx#{colors[2]}\"\n end\n\n # If multiple colors are defined, i.e. \\e[30;42m\\e then loop through each\n # one, and assign it to @fg_color or @bg_color\n colors.each do |cc|\n c_integer = cc.to_i\n\n # Reset all styles\n if c_integer == 0\n @fg_color = nil\n @bg_color = nil\n @other_colors = []\n\n # Primary (default) font\n elsif c_integer == 10\n # no-op\n\n # Turn off bold / Normal color or intensity (21 & 22 essentially do the same thing)\n elsif c_integer == 21 || c_integer == 22\n @other_colors.delete(\"term-fg1\")\n @other_colors.delete(\"term-fg2\")\n\n # Turn off italic\n elsif c_integer == 23\n @other_colors.delete(\"term-fg3\")\n\n # Turn off underline\n elsif c_integer == 24\n @other_colors.delete(\"term-fg4\")\n\n # Turn off crossed-out\n elsif c_integer == 29\n @other_colors.delete(\"term-fg9\")\n\n # Reset foreground color only\n elsif c_integer == 39\n @fg_color = nil\n\n # Reset background color only\n elsif c_integer == 49\n @bg_color = nil\n\n # 30–37, then it's a foreground color\n elsif c_integer >= 30 && c_integer <= 37\n @fg_color = \"term-fg#{cc}\"\n\n # 40–47, then it's a background color.\n elsif c_integer >= 40 && c_integer <= 47\n @bg_color = \"term-bg#{cc}\"\n\n # 90-97 is like the regular fg color, but high intensity\n elsif c_integer >= 90 && c_integer <= 97\n @fg_color = \"term-fgi#{cc}\"\n\n # 100-107 is like the regular bg color, but high intensity\n elsif c_integer >= 100 && c_integer <= 107\n @fg_color = \"term-bgi#{cc}\"\n\n # 1-9 random other styles\n elsif c_integer >= 1 && c_integer <= 9\n @other_colors << \"term-fg#{cc}\"\n end\n end\n end", "def std_colors\n FFI::NCurses.use_default_colors\n # 2018-03-17 - changing it to ncurses defaults\n FFI::NCurses.init_pair(0, FFI::NCurses::BLACK, -1)\n FFI::NCurses.init_pair(1, FFI::NCurses::RED, -1)\n FFI::NCurses.init_pair(2, FFI::NCurses::GREEN, -1)\n FFI::NCurses.init_pair(3, FFI::NCurses::YELLOW, -1)\n FFI::NCurses.init_pair(4, FFI::NCurses::BLUE, -1)\n FFI::NCurses.init_pair(5, FFI::NCurses::MAGENTA, -1)\n FFI::NCurses.init_pair(6, FFI::NCurses::CYAN, -1)\n FFI::NCurses.init_pair(7, FFI::NCurses::WHITE, -1)\n # ideally the rest should be done by application\n #FFI::NCurses.init_pair(8, FFI::NCurses::WHITE, -1)\n #FFI::NCurses.init_pair(9, FFI::NCurses::BLUE, -1)\n FFI::NCurses.init_pair(10, FFI::NCurses::BLACK, FFI::NCurses::CYAN)\n FFI::NCurses.init_pair(12, FFI::NCurses::BLACK, FFI::NCurses::BLUE)\n FFI::NCurses.init_pair(13, FFI::NCurses::BLACK, FFI::NCurses::MAGENTA)\n\n FFI::NCurses.init_pair(14, FFI::NCurses::WHITE, FFI::NCurses::CYAN)\n=begin\n FFI::NCurses.init_pair(8, FFI::NCurses::WHITE, FFI::NCurses::BLUE)\n FFI::NCurses.init_pair(9, FFI::NCurses::BLUE, FFI::NCurses::BLUE)\n FFI::NCurses.init_pair(10, FFI::NCurses::BLACK, FFI::NCurses::GREEN)\n FFI::NCurses.init_pair(11, FFI::NCurses::BLACK, FFI::NCurses::YELLOW)\n FFI::NCurses.init_pair(12, FFI::NCurses::BLACK, FFI::NCurses::BLUE)\n FFI::NCurses.init_pair(13, FFI::NCurses::BLACK, FFI::NCurses::MAGENTA)\n FFI::NCurses.init_pair(14, FFI::NCurses::BLACK, FFI::NCurses::CYAN)\n FFI::NCurses.init_pair(15, FFI::NCurses::BLACK, FFI::NCurses::WHITE)\n=end\n end", "def getDrawColor()\n return @drawColor\n end", "def validate_colors\n super\n validate_color(foreground) if foreground\n end", "def bg_dark_grey; use_code(100) end", "def color\n return @color\n end", "def color\n return @color\n end", "def assign_game_color count\n case count\n when 0\n return \"transparent\"\n when 6\n return $app_red\n else\n return $app_blue\n end\n end", "def normal_color\n #return Color.new(255,255,255)\n end", "def colored_prompt\n return (Readline::VERSION !~ /EditLine/) && Pry.color if @colored_prompt.nil?\n\n @colored_prompt\n end", "def crisis_color\n return Color.new(255, 255, 64)\n end", "def crisis_color\n return text_color(17)\n end", "def colors\n return\n end", "def color\n return @color\n end", "def disabled_color\n return Color.new(255, 255, 255, 128)\n end", "def kiosk_mode_allow_color_inversion_settings\n return @kiosk_mode_allow_color_inversion_settings\n end", "def back_color2\n Color.new(0, 0, 0, 0)\n end", "def back_color1\n Color.new(0, 0, 0, 192)\n end", "def back_color1\n Color.new(0, 0, 0, 192)\n end", "def colorNormal\n puts \"\\033[0m\"\n end", "def content_colors fg, bg\n @color = fg\n @bgcolor = bg\n @color_pair = get_color($datacolor, fg, bg)\n end", "def detect_mode\n if ENV['NO_COLOR'] # see https://no-color.org/\n 0\n elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # windows\n if ENV['ANSICON']\n 16\n elsif ENV['ConEmuANSI'] == 'ON'\n TRUE_COLOR\n else\n 0\n end\n elsif ENV['TERM_PROGRAM'] == 'Apple_Terminal'\n 256\n else\n case ENV['TERM']\n when /^rxvt-(?:.*)-256color$/\n 256\n when /-color$/, /^rxvt/\n 16\n else # optimistic default\n TRUE_COLOR\n end\n end\n end", "def bgcolor( *val )\n if val.empty?\n return @bgcolor if @bgcolor\n return @form.bgcolor if @form\n return $def_bg_color\n else\n @color_pair = nil\n return property_set :bgcolor, val\n end\n end", "def primary_button_focus_border_color\n darken_color(primary_button_border_color, 0.25)\n end", "def get_user_text_color(user)\n user_color = get_user_color(user).gsub(\"#\", \"\")\n\n # Get the hex color as red, green, blue\n r = user_color[0..1].hex\n g = user_color[2..3].hex\n b = user_color[4..5].hex\n\n if ((r * 0.299) + (g * 0.587) + (b * 0.114)) > 186\n \"#4a4a4a\"\n else\n \"#ffffff\"\n end\n end", "def color\n fetch('vehicle.colors')\n end", "def blue\n (hex_color & BLUE) / MAX_RGB_VALUE * 100\n end", "def color_scheme_helper(opts={})\n color_scheme = user_pref(:color_scheme)\n color_scheme = Settings.default_color_scheme if color_scheme.blank? && !opts[:allow_blank]\n color_scheme = 'red' if color_scheme == 'xmas' && !is_holiday_season?\n color_scheme\n end", "def yellow \n\t\tlight COLOR_KEY_YELLOW\n\tend", "def titleforeground(fg)\n @title_list.each{|label| label['foreground'] = fg}\n self\n end", "def blue = \"\\e[36m#{self}\\e[0m\"", "def to_s\n \"#{foreground}#{background}\"\n end", "def background_color=(value)\n @peer.background_color = value.to_s\n end", "def colour\n @colour ||= Colour.new(attributes[:colour])\n end", "def auxiliary_colour\n @cr[0xe] >> 4\n end" ]
[ "0.7220582", "0.6944194", "0.69083774", "0.68901694", "0.65666145", "0.63970095", "0.63934714", "0.629649", "0.6244703", "0.62362814", "0.62349343", "0.620977", "0.61222553", "0.60984665", "0.60984665", "0.6093749", "0.6068151", "0.60643", "0.6055229", "0.60005957", "0.59888226", "0.59601474", "0.5917605", "0.5898075", "0.5887199", "0.5887199", "0.5856519", "0.5803365", "0.5797769", "0.57942325", "0.5793478", "0.5790422", "0.57524586", "0.5751935", "0.57464767", "0.5738884", "0.56914115", "0.5681351", "0.5673972", "0.5660535", "0.5649046", "0.5636848", "0.56084585", "0.55962706", "0.55947345", "0.5572935", "0.5566392", "0.55644435", "0.55508417", "0.55505854", "0.55501294", "0.55112845", "0.5503114", "0.5486207", "0.5476384", "0.5452919", "0.5451905", "0.5446749", "0.5425771", "0.54149216", "0.54084957", "0.53907263", "0.53907263", "0.5389086", "0.53874296", "0.5376208", "0.5371327", "0.53674287", "0.5365063", "0.5343886", "0.53437346", "0.53437346", "0.533993", "0.5339476", "0.5328019", "0.5327147", "0.5325188", "0.5321552", "0.5320749", "0.5319929", "0.53182715", "0.5316534", "0.53102964", "0.53102964", "0.5308432", "0.53002137", "0.5288266", "0.52578104", "0.5250753", "0.52201813", "0.5214935", "0.521383", "0.52131224", "0.5207959", "0.52057534", "0.5204958", "0.5202349", "0.5198601", "0.5194347", "0.518919" ]
0.73054874
0
Returns the client defined height for the terminal.
def height instance.options[:height] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def height\n Terminal.height\n end", "def terminal_height\n terminal_size.last\n end", "def height\n `#{clientRect}.height`\n end", "def terminal_height; end", "def terminal_height; end", "def max_height\n FFI::NCurses.getmaxy FFI::NCurses.stdscr\n end", "def window_height\n base_height = (wb = current_window_builder)[5] + wb[-1]\n base_height + default_line_height * line_number\n end", "def height\n line_count = layout.line_count\n h = (line_count - 1) * layout.spacing\n line_count.times do |i|\n h += layout.get_line_bounds(i).height\n end\n h\n end", "def height\n lines.size\n end", "def height\n lines.size\n end", "def height\n return nil unless @height\n if @height < 0\n return ((FFI::NCurses.LINES + @height) - self.row) + 1\n #return (FFI::NCurses.LINES + @height) \n end\n @height\n end", "def line_height\n return @common.lineHeight\n end", "def browser_height\n @browser_height\n end", "def height\n @screenplay.line_height * @lines.size\n end", "def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end", "def terminal_size\n m_GetStdHandle = Win32API.new( 'kernel32',\n 'GetStdHandle',\n ['L'],\n 'L' )\n m_GetConsoleScreenBufferInfo = Win32API.new(\n 'kernel32', 'GetConsoleScreenBufferInfo', ['L', 'P'], 'L'\n )\n\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = m_GetStdHandle.call(0xFFFFFFF5)\n \n m_GetConsoleScreenBufferInfo.call(stdout_handle, buf)\n bufx, bufy, curx, cury, wattr,\n left, top, right, bottom, maxx, maxy = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end", "def height\n if clear_border?\n geometry.height\n\n else\n border.height\n\n end\n end", "def get_ScreenHeight\n System::get_property('screen_height')\n end", "def terminal_size\n size = [80, 40]\n FFI::NCurses.initscr\n begin\n size = FFI::NCurses.getmaxyx(FFI::NCurses.stdscr).reverse\n ensure\n FFI::NCurses.endwin\n end\n size\n end", "def height\n return @height\n end", "def cursor_height\n return Font.default_size\n end", "def terminal_size\n format = 'SSSSSssssSS'\n buf = ([0] * format.size).pack(format)\n stdout_handle = WinAPI.GetStdHandle(0xFFFFFFF5)\n\n WinAPI.GetConsoleScreenBufferInfo(stdout_handle, buf)\n _, _, _, _, _,\n left, top, right, bottom, _, _ = buf.unpack(format)\n return right - left + 1, bottom - top + 1\n end", "def height\n @dimensions.y\n end", "def window_height\n Graphics.height - under_help - @keys_window.height\n end", "def height\n memoized_info[:height]\n end", "def height\n @grpc.height\n end", "def height \n @height || text_area_height + 2*@vertical_padding\n end", "def get_space_height\n return get_keyword_value(\"SPACE-HEIGHT\").to_f\n end", "def height\n return data.height\n end", "def window_height\n return ACTOR_WINDOW_HEIGHT\n end", "def display_height\n (display_width.to_f / width.to_f) * height\n end", "def display_height\n (display_width.to_f / width.to_f) * height\n end", "def display_height\n (display_width.to_f / width.to_f) * height\n end", "def box_height\n return line_height + 104 + line_height * (@params.size + 1)\n end", "def height(lines=1)\n return @font.height * lines + 4 # Where's this magic '4' come from?\n end", "def height\n @height || 100\n end", "def contents_height\n h = height - standard_padding * 2\n h + (@item_max * line_height)\n end", "def get_height\n return get_keyword_value(\"FLOOR-HEIGHT\").to_f\n end", "def height\n\t\treturn @height\n\tend", "def height\n dimensions()[:y]\n end", "def height\n get_geometry if @height.nil?\n return @height\n end", "def height(path)\n io_for(path).height\n end", "def default_line_height\n return Fonts.line_height(current_layout.default_font)\n end", "def get_window_size\n Ncurses.refresh\n cols, rows = [], []\n Ncurses.stdscr.getmaxyx rows, cols\n [rows.first, cols.first]\n end", "def height\n @ole.Height\n end", "def height\n @ole.Height\n end", "def height\r\n assert_exists\r\n return @o.invoke(\"height\").to_s\r\n end", "def height\n top + bottom\n end", "def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end", "def height\n barcode.two_dimensional? ? (ydim * encoding.length) : (@height || 100)\n end", "def height\n options[:height] || Config.height\n end", "def height\n current_node = @root\n\n return height_helper(current_node)\n end", "def height\n return 0 if @root.nil?\n return hegiht_helper(@root)\n end", "def drb_height\n instance.options[:drb_height]\n end", "def drb_height\n instance.options[:drb_height]\n end", "def terminal_size\n if /solaris/ =~ RUBY_PLATFORM and\n `stty` =~ /\\brows = (\\d+).*\\bcolumns = (\\d+)/\n [$2, $1].map { |c| x.to_i }\n else\n `stty size`.split.map { |x| x.to_i }.reverse\n end\n end", "def height\n return height_helper(@root, 0)\n end", "def height\n return height_helper(@root, 0)\n end", "def height\n return 0 if @root == nil\n\n current = @root\n\n return height_helper(current, 1, 1)\n end", "def cursor_height\n if @segments.first.text.empty?\n # Heights are off for empty text layouts. Fake it to make it (it\n # being a real height).\n new_segment = TextSegment.new(@dsl, \"Hi\", 100)\n height_from_segment(new_segment)\n else\n height_from_segment(@segments.first)\n end\n end", "def visible_height\n @win.maxy - 2\n end", "def height\n bounds[:bottom] - bounds[:top]\n end", "def height\n bounds[:bottom] - bounds[:top]\n end", "def window_height\n end", "def height_calc\n lines = [@data.length, page_row_max].min rescue page_row_max\n return lines * line_height + standard_padding * 2\n end", "def height_calc\n lines = [@data.length, page_row_max].min rescue page_row_max\n return lines * line_height + standard_padding * 2\n end", "def height\n dimensions.last\n end", "def height\n return @window_height # outer height\nend", "def height\n content.size\n end", "def formatted_height\n '000'\n end", "def line_height\n TDD::ABF::SETTINGS::OVERRIDE_LINE_HEIGHT[name] || @info[:lineHeight]\n end", "def height\n (self.width.to_f * (9.to_f/16.to_f)).to_i\n end", "def height()\n 0\n end", "def window_height\n fitting_height(11)\n end", "def window_height\n fitting_height(11)\n end", "def window_height\n fitting_height(11)\n end", "def height\n size_a[1]\n end", "def height\n attr('height')\n end", "def height\n return height_helper(@root, 0, 1)\n end", "def height\n return height_helper(@root, 0, 1)\n end", "def height\n size.first\n end", "def height\n size.first\n end", "def scroll_height\n self.scroll_size[:y]\n end", "def height\n return height_helper(@root)\n end", "def get_terminal_size\n terminal_size ||= {}\n if ENV[\"LINES\"] && ENV[\"COLUMNS\"]\n terminal_size[\"lines\"] = ENV[\"LINES\"]\n terminal_size[\"columns\"] = ENV[\"COLUMNS\"]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && shell_command_exists?('tput')\n terminal_size[\"lines\"] = `tput lines`.strip.to_i\n terminal_size[\"columns\"] = `tput cols`.strip.to_i\n elsif STDIN.tty? && shell_command_exists?('stty')\n terminal_size[\"lines\"], terminal_size[\"columns\"] = `stty size`.strip.split(/\\s/).map(&:to_i)\n else\n terminal_size[\"lines\"], terminal_size[\"columns\"] = 40, 90\n end\n terminal_size\n end", "def height\n metadata[:height] if valid?\n end", "def height\n rows\n end", "def terminal_size\n if JRUBY_VERSION =~ /^1.7/\n [ @java_terminal.get_width, @java_terminal.get_height ]\n else\n [ @java_terminal.getTerminalWidth, @java_terminal.getTerminalHeight ]\n end\n end", "def cursor_height(viewport, _item_size)\n return viewport.rect.height\n end", "def pixel_height\n @sensor_height / @height_in_pixels\n end", "def default_line_height\n Fonts.line_height(current_layout.default_font)\n end", "def contents_height\n Graphics.height\n end", "def height\n height_helper(@root, 0)\n end", "def height()\n @view__.height\n end", "def ui_max_y\n\t\t\t\tCurses.rows\n\t\t\tend", "def height\n\t\tnode['height']\n\tend", "def get_win_decorator_height(id)\n (`xwininfo -id #{id}`).scan(/^.*Y:\\s*(\\d*)/).flatten.map{|n| n.to_i}.reduce(:-)\nend", "def height\n @bottom_edge - @top_edge\n end", "def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map { |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end", "def terminal_size\n if (ENV['COLUMNS'] =~ /^\\d+$/) && (ENV['LINES'] =~ /^\\d+$/)\n [ENV['COLUMNS'].to_i, ENV['LINES'].to_i]\n elsif (RUBY_PLATFORM =~ /java/ || (!STDIN.tty? && ENV['TERM'])) && command_exists?('tput')\n [`tput cols`.to_i, `tput lines`.to_i]\n elsif STDIN.tty? && command_exists?('stty')\n `stty size`.scan(/\\d+/).map{ |s| s.to_i }.reverse\n else\n nil\n end\n rescue\n nil\n end" ]
[ "0.80022955", "0.7961311", "0.7796024", "0.74394196", "0.74394196", "0.69349074", "0.66931736", "0.66673386", "0.66026163", "0.66026163", "0.6565395", "0.6558424", "0.654131", "0.65285957", "0.64757663", "0.64489186", "0.6439559", "0.6391138", "0.63764066", "0.6341309", "0.63273555", "0.6326366", "0.632012", "0.6315942", "0.62679255", "0.6254781", "0.6230764", "0.62081474", "0.61949366", "0.6192422", "0.61503386", "0.61503386", "0.61503386", "0.61410624", "0.6131093", "0.6130153", "0.61092645", "0.6101627", "0.61003333", "0.60992354", "0.6090875", "0.6066208", "0.60584325", "0.60424703", "0.60385925", "0.60385925", "0.603764", "0.6029916", "0.6026769", "0.6026769", "0.6025157", "0.6010165", "0.600812", "0.60020816", "0.60020816", "0.5984618", "0.59718925", "0.59718925", "0.5969332", "0.5969324", "0.59684134", "0.5964033", "0.5964033", "0.5961996", "0.59497064", "0.59497064", "0.59496427", "0.59496427", "0.5948787", "0.59461194", "0.59459525", "0.59455395", "0.5939775", "0.5939216", "0.5939216", "0.5939216", "0.5938655", "0.59379506", "0.59337264", "0.59337264", "0.59252787", "0.59252787", "0.5902948", "0.5894902", "0.5882861", "0.5878527", "0.58744967", "0.58655053", "0.5852855", "0.5841625", "0.58261836", "0.5817339", "0.58152556", "0.58123577", "0.5811848", "0.5808847", "0.5806608", "0.58056134", "0.5796723", "0.5793255" ]
0.5967757
61